Here is my code to make elelment in name space   "http://www.starstandards.org/STAR " using no prefix while
elements in name space "http://www.openapplications.org/oagis"  with a prefix "O".
 
It worked for me for both  for xmlbeans verion 1.0.4
 
        XmlOptions opts = new XmlOptions();
        Map<String, String> map = new HashMap<String, String>();
        map.put("http://www.starstandards.org/STAR", "");//  map.put("http://www.starstandards.org/STAR", "S") will force prefix to be "S".
        map.put("http://www.openapplications.org/oagis
", "O");
        opts.setSaveSuggestedPrefixes(map);

 

From: Rob Eger [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 29, 2006 2:33 PM
To: [email protected]
Subject: RE: elementFormDefault='qualified" and xmlText

I sort of have the opposite problem:  I don't want xmlText() to give me any prefixes or namespace declarations (I just want the raw xml for the element).  Anyone know how to accomplish this?  I've tried a few things with XmlOptions, but no luck so far.

Thanks,
Rob.

On Wed, 2006-03-29 at 09:35 -0800, Jinyuan Zhou wrote:
I dont' have this problem. but I passed an XmlOptions with a call to opts.setSaveSuggestedPrefixes(map) to specify my choices of prefix names.
I wonder if this will give you back the prefixes.



From: Martin Wegner [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 29, 2006 9:25 AM
To: [email protected]
Subject: elementFormDefault='qualified" and xmlText



Greetings.

I have elementFormDefault="qualfied" in my schema.  I am using XMLBeans 2.0.  When I use the xmlText() method to serialize my XMLBeans object, the elements are not prefixed.  XMLBeans correctly spits out the default namespace declaration, so it semanticaly valid XML.  But I really need the elements to be prefixed directly (downstream clients are brain dead, what can you do?).

What am I missing?  Thanks in advance.


--Marty

Rob Eger
Senior Software Engineer
Local Matters, Inc.
 
1221 Auraria Parkway
Denver, CO  80204
[EMAIL PROTECTED]
www.localmatters.com
O 303-572-1122 x203
F 303-572-1123


Reply via email to