Re: Namespaces
"Friessen, Michelle" <[email protected]> Wed, 16 Jul 2014 09:25:34 -0500
| Newsgroups | gmane.text.xml.xmlbeans.user |
|---|---|
| Message-ID | <CANm+gpG-48DvPBoMfc8x4mkR=vWkYUQciV=+zXYwviRQtVQU4Q@mail.gmail.com> |
--e89a8f234b231ef82b04fe504ccc Content-Type: text/plain; charset=UTF-8 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 < [email protected]> 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:[email protected]] > *Sent:* Tuesday, July 15, 2014 4:38 PM > *To:* [email protected] > *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 > --e89a8f234b231ef82b04fe504ccc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Using an empty string for the prefix in insertNamespace re= sults in nothing be printed out for that namespace.<div><br></div><div>Any = other suggestions?</div><div><br></div><div>Thanks.</div></div><div class= =3D"gmail_extra"> <br clear=3D"all"><div><div dir=3D"ltr"><div><b style=3D"color:rgb(80,0,80)= "><font color=3D"#008b5d" face=3D"Verdana"><span style=3D"font-size:10pt">M= ichelle Friessen</span></font></b><br></div><div><font color=3D"navy" face= =3D"Arial"><span style=3D"font-size:10pt">Systems Product Support=C2=A0</sp= an></font><font color=3D"navy" face=3D"Verdana"><span style=3D"font-size:10= pt">Analyst<br> Assessment & Instruction<br>Pearson</span></font><br></div><div><font c= olor=3D"#073763">(319) 354-9200 x214687</font><br></div></div></div> <br><br><div class=3D"gmail_quote">On Wed, Jul 16, 2014 at 7:04 AM, Gagnon,= Joseph - 0558 - MITLL <span dir=3D"ltr"><<a href=3D"mailto:Joseph.Gagno= [email protected]" target=3D"_blank">[email protected]</a>></span> wro= te:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"><div lang=3D"EN-US" link=3D"blue" vlink=3D"p= urple"><div><p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-fam= ily:"Calibri","sans-serif";color:#1f497d">I was able to= achieve a prefix-less namespace attribute by passing an empty string for t= he prefix argument.<u></u><u></u></span></p> <p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:"Ca= libri","sans-serif";color:#1f497d"><u></u>=C2=A0<u></u></spa= n></p><p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:&q= uot;Calibri","sans-serif";color:#1f497d">E.g. =C2=A0cursor.i= nsertNamespace("", namespaceUri);<u></u><u></u></span></p> <p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:"Ca= libri","sans-serif";color:#1f497d"><u></u>=C2=A0<u></u></spa= n></p><div style=3D"border:none;border-top:solid #b5c4df 1.0pt;padding:3.0p= t 0in 0in 0in"> <p class=3D"MsoNormal"><b><span style=3D"font-size:10.0pt;font-family:"= ;Tahoma","sans-serif"">From:</span></b><span style=3D"font-s= ize:10.0pt;font-family:"Tahoma","sans-serif""> Friessen= , Michelle [mailto:<a href=3D"mailto:[email protected]" target= =3D"_blank">[email protected]</a>] <br> <b>Sent:</b> Tuesday, July 15, 2014 4:38 PM<br><b>To:</b> <a href=3D"mailto= :[email protected]" target=3D"_blank">[email protected]</a><b= r><b>Subject:</b> Namespaces<u></u><u></u></span></p></div><p class=3D"MsoN= ormal"> <u></u>=C2=A0<u></u></p><div><div><p class=3D"MsoNormal">We have 3 namespac= es that need to be added when generating XML:<u></u><u></u></p></div><div><= p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><div><div><p class=3D"M= soNormal">xmlns=3D"<a href=3D"http://www.imsglobal.org/xsd/imsqti_v2p1= " target=3D"_blank">http://www.imsglobal.org/xsd/imsqti_v2p1</a>"<u></= u><u></u></p> </div><div><p class=3D"MsoNormal">xmlns:xsi=3D"<a href=3D"http://www.w= 3.org/2001/XMLSchema-instance" target=3D"_blank">http://www.w3.org/2001/XML= Schema-instance</a>"<u></u><u></u></p></div><div><p class=3D"MsoNormal= ">xsi:schemaLocation=3D"<a href=3D"http://www.imsglobal.org/xsd/imsqti= _v2p1" target=3D"_blank">http://www.imsglobal.org/xsd/imsqti_v2p1</a> <a hr= ef=3D"http://www.imsglobal.org/question/qtiv2p1pd2/xsd/imsqti_v2p1.xsd" tar= get=3D"_blank">http://www.imsglobal.org/question/qtiv2p1pd2/xsd/imsqti_v2p1= .xsd</a>"<u></u><u></u></p> </div></div><div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><div>= <p class=3D"MsoNormal">Using XmlCursor, we were able to get the last 2 adde= d using:<u></u><u></u></p></div><div><p class=3D"MsoNormal"><u></u>=C2=A0<u= ></u></p></div> <div><div><p class=3D"MsoNormal">cursor.insertAttributeWithValue("sche= maLocation", "<a href=3D"http://www.w3.org/2001/XMLSchema-instanc= e" target=3D"_blank">http://www.w3.org/2001/XMLSchema-instance</a>", &= quot;<a href=3D"http://www.imsglobal.org/xsd/imsqti_v2p1" target=3D"_blank"= >http://www.imsglobal.org/xsd/imsqti_v2p1</a> <a href=3D"http://www.imsglob= al.org/question/qtiv2p1pd2/xsd/imsqti_v2p1.xsd" target=3D"_blank">http://ww= w.imsglobal.org/question/qtiv2p1pd2/xsd/imsqti_v2p1.xsd</a>");<u></u><= u></u></p> </div></div><div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><div>= <p class=3D"MsoNormal">However, we cannot successfully get the first one to= print out. =C2=A0We've tried variations of insertNamespace, insertAttr= ibute and insertAttributeWithValue. =C2=A0Does anyone have any suggestions = on how to add a namespace without a prefix?<u></u><u></u></p> </div><div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><div><p cla= ss=3D"MsoNormal">Thanks.<u></u><u></u></p></div><p class=3D"MsoNormal"><br = clear=3D"all"><u></u><u></u></p><div><div><div><p class=3D"MsoNormal"><b><s= pan style=3D"font-size:10.0pt;font-family:"Verdana","sans-se= rif";color:#008b5d">Michelle Friessen</span></b><u></u><u></u></p> </div><div><p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-fami= ly:"Arial","sans-serif";color:navy">Systems Product Sup= port=C2=A0</span><span style=3D"font-size:10.0pt;font-family:"Verdana&= quot;,"sans-serif";color:navy">Analyst<br> Assessment & Instruction<br>Pearson</span><u></u><u></u></p></div><div>= <p class=3D"MsoNormal"><span style=3D"color:#073763"><a href=3D"tel:%28319%= 29%20354-9200%20x214687" value=3D"+13193549200" target=3D"_blank">(319) 354= -9200 x214687</a></span><u></u><u></u></p> </div></div></div></div></div></div></blockquote></div><br></div> --e89a8f234b231ef82b04fe504ccc--