You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by "Friessen, Michelle" <mi...@pearson.com> on 2014/07/15 22:37:31 UTC

Namespaces

We have 3 namespaces that need to be added when generating XML:

xmlns="http://www.imsglobal.org/xsd/imsqti_v2p1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p1
http://www.imsglobal.org/question/qtiv2p1pd2/xsd/imsqti_v2p1.xsd"

Using XmlCursor, we were able to get the last 2 added using:

cursor.insertAttributeWithValue("schemaLocation", "
http://www.w3.org/2001/XMLSchema-instance", "
http://www.imsglobal.org/xsd/imsqti_v2p1
http://www.imsglobal.org/question/qtiv2p1pd2/xsd/imsqti_v2p1.xsd");

However, we cannot successfully get the first one to print out.  We've
tried variations of insertNamespace, insertAttribute and
insertAttributeWithValue.  Does anyone have any suggestions on how to add a
namespace without a prefix?

Thanks.

*Michelle Friessen*
Systems Product Support Analyst
Assessment & Instruction
Pearson
(319) 354-9200 x214687

Re: Namespaces

Posted by "Friessen, Michelle" <mi...@pearson.com>.
Using an empty string for the prefix in insertNamespace results in nothing
be printed out for that namespace.

Any other suggestions?

Thanks.

*Michelle Friessen*
Systems Product Support Analyst
Assessment & Instruction
Pearson
(319) 354-9200 x214687


On Wed, Jul 16, 2014 at 7:04 AM, Gagnon, Joseph - 0558 - MITLL <
Joseph.Gagnon@ll.mit.edu> wrote:

> I was able to achieve a prefix-less namespace attribute by passing an
> empty string for the prefix argument.
>
>
>
> E.g.  cursor.insertNamespace("", namespaceUri);
>
>
>
> *From:* Friessen, Michelle [mailto:michelle.friessen@pearson.com]
> *Sent:* Tuesday, July 15, 2014 4:38 PM
> *To:* user@xmlbeans.apache.org
> *Subject:* Namespaces
>
>
>
> We have 3 namespaces that need to be added when generating XML:
>
>
>
> xmlns="http://www.imsglobal.org/xsd/imsqti_v2p1"
>
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
> xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p1
> http://www.imsglobal.org/question/qtiv2p1pd2/xsd/imsqti_v2p1.xsd"
>
>
>
> Using XmlCursor, we were able to get the last 2 added using:
>
>
>
> cursor.insertAttributeWithValue("schemaLocation", "
> http://www.w3.org/2001/XMLSchema-instance", "
> http://www.imsglobal.org/xsd/imsqti_v2p1
> http://www.imsglobal.org/question/qtiv2p1pd2/xsd/imsqti_v2p1.xsd");
>
>
>
> However, we cannot successfully get the first one to print out.  We've
> tried variations of insertNamespace, insertAttribute and
> insertAttributeWithValue.  Does anyone have any suggestions on how to add a
> namespace without a prefix?
>
>
>
> Thanks.
>
>
> *Michelle Friessen*
>
> Systems Product Support Analyst
> Assessment & Instruction
> Pearson
>
> (319) 354-9200 x214687
>

RE: Namespaces

Posted by "Gagnon, Joseph - 0558 - MITLL" <Jo...@ll.mit.edu>.
I was able to achieve a prefix-less namespace attribute by passing an empty 
string for the prefix argument.



E.g.  cursor.insertNamespace("", namespaceUri);



From: Friessen, Michelle [mailto:michelle.friessen@pearson.com]
Sent: Tuesday, July 15, 2014 4:38 PM
To: user@xmlbeans.apache.org
Subject: Namespaces



We have 3 namespaces that need to be added when generating XML:



xmlns="http://www.imsglobal.org/xsd/imsqti_v2p1"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p1 
http://www.imsglobal.org/question/qtiv2p1pd2/xsd/imsqti_v2p1.xsd"



Using XmlCursor, we were able to get the last 2 added using:



cursor.insertAttributeWithValue("schemaLocation", 
"http://www.w3.org/2001/XMLSchema-instance", 
"http://www.imsglobal.org/xsd/imsqti_v2p1 
http://www.imsglobal.org/question/qtiv2p1pd2/xsd/imsqti_v2p1.xsd");



However, we cannot successfully get the first one to print out.  We've tried 
variations of insertNamespace, insertAttribute and insertAttributeWithValue. 
Does anyone have any suggestions on how to add a namespace without a prefix?



Thanks.




Michelle Friessen

Systems Product Support Analyst
Assessment & Instruction
Pearson

(319) 354-9200 x214687