logo       

Prefix problem: msg#00128

text.xml.xmlbeans.user

Subject: Prefix problem

Hi,


I am trying to create xml document using XmlBeans 1.0.3 for a
project. I would like to add a "x" prefix to only root node. Here is
a simple xml example that i want

<x:product id="123" xmlns:x="urn:productContent">
<quantity>4</quantity>
<price>100</price>
</x:product>

If i use the following code

HashMap suggestedPrefixes = new HashMap();
suggestedPrefixes.put( "urn:productContent", "x" );
XmlOptions xmlOptions = new XmlOptions();
xmlOptions.setSaveSuggestedPrefixes( suggestedPrefixes );

then i have got

<x:product id="123" xmlns:x="urn:productContent">
<x:quantity>4</x:quantity>
<x:price>100</x:price>
</x:product>


Is there any way to put "x" prefix to only root node, in this case
"product" node ?

Thanks in your advance.
Erol,


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise