Namespaces

"Friessen, Michelle" <[email protected]> Tue, 15 Jul 2014 15:37:31 -0500
Newsgroups gmane.text.xml.xmlbeans.user
Message-ID <CANm+gpEJQ4yVpaf00amXZ0U87Dc+vdB-jrP1HdNJeXCiD6Xa4g@mail.gmail.com>
--f46d044280b271f2c104fe41608a
Content-Type: text/plain; charset=UTF-8

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

--f46d044280b271f2c104fe41608a
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>We have 3 namespaces that need to be added when gener=
ating XML:</div><div><br></div><div><div>xmlns=3D&quot;<a href=3D"http://ww=
w.imsglobal.org/xsd/imsqti_v2p1">http://www.imsglobal.org/xsd/imsqti_v2p1</=
a>&quot;</div>
<div>xmlns:xsi=3D&quot;<a href=3D"http://www.w3.org/2001/XMLSchema-instance=
">http://www.w3.org/2001/XMLSchema-instance</a>&quot;</div><div>xsi:schemaL=
ocation=3D&quot;<a href=3D"http://www.imsglobal.org/xsd/imsqti_v2p1">http:/=
/www.imsglobal.org/xsd/imsqti_v2p1</a> <a href=3D"http://www.imsglobal.org/=
question/qtiv2p1pd2/xsd/imsqti_v2p1.xsd">http://www.imsglobal.org/question/=
qtiv2p1pd2/xsd/imsqti_v2p1.xsd</a>&quot;</div>
</div><div><br></div><div>Using XmlCursor, we were able to get the last 2 a=
dded using:</div><div><br></div><div><div>cursor.insertAttributeWithValue(&=
quot;schemaLocation&quot;, &quot;<a href=3D"http://www.w3.org/2001/XMLSchem=
a-instance">http://www.w3.org/2001/XMLSchema-instance</a>&quot;, &quot;<a h=
ref=3D"http://www.imsglobal.org/xsd/imsqti_v2p1">http://www.imsglobal.org/x=
sd/imsqti_v2p1</a> <a href=3D"http://www.imsglobal.org/question/qtiv2p1pd2/=
xsd/imsqti_v2p1.xsd">http://www.imsglobal.org/question/qtiv2p1pd2/xsd/imsqt=
i_v2p1.xsd</a>&quot;);</div>
</div><div><br></div><div>However, we cannot successfully get the first one=
 to print out. =C2=A0We&#39;ve tried variations of insertNamespace, insertA=
ttribute and insertAttributeWithValue. =C2=A0Does anyone have any suggestio=
ns on how to add a namespace without a prefix?</div>
<div><br></div><div>Thanks.</div><br clear=3D"all"><div><div dir=3D"ltr"><d=
iv><b style=3D"color:rgb(80,0,80)"><font color=3D"#008b5d" face=3D"Verdana"=
><span style=3D"font-size:10pt">Michelle Friessen</span></font></b><br></di=
v><div><font color=3D"navy" face=3D"Arial"><span style=3D"font-size:10pt">S=
ystems Product Support=C2=A0</span></font><font color=3D"navy" face=3D"Verd=
ana"><span style=3D"font-size:10pt">Analyst<br>
Assessment &amp; Instruction<br>Pearson</span></font><br></div><div><font c=
olor=3D"#073763">(319) 354-9200 x214687</font><br></div></div></div>
</div>

--f46d044280b271f2c104fe41608a--