You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Erol Ozcan <er...@gmail.com> on 2005/01/21 01:57:50 UTC
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,
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org