Hi,

I’m using XmlBeans 2.2 and have a problem regarding the namespace 
prefixes and declaration:

I have a substitution group in my schema, and replace the abstract element 
through a substitution group element. I rename the element using XmlCursor and 
the correct QNames with namespaces. 

The problem now is as follows: 

If I save the document into an output stream, I want the namespaces to be 
defined at the root element:

options.setSaveNamespacesFirst();
options.setSaveAggressiveNamespaces(); //should reduce the number of namespace 
prefix declarations

and set the prefix:

HashMap<String, String> suggestedPrefixes = new HashMap<String, String>();
suggestedPrefixes.put(OMConstants.NS_SWE,OMConstants.NS_SWE_PREFIX);
options.setSaveSuggestedPrefixes(suggestedPrefixes);

The namespace is defined in the root element as 

xmlns:swe=&#8221;http://www.opengis.net/swe/0.0&#8221;

and in elements, which are not part of a substitution group, correctly set:

<swe:DataBlockDefinition>

but, if the element is part of a substitution group, the namespace is defined 
again in the element with a different prefix:

<ns:CompositePhenomenon xmlns:ns=&#8220;http://www.opengis.net/swe/0.0&#8220;>

although the namespaces are completely the same and I don't know how to set the 
prefix, which should be used ("swe") for the substitution group element.

Did anybody have a similar problem?

In a former version of XmlBeans  (1.2) this worked fine. But now I am using 
other schemata with the actual XmlBeans version and I am not sure, whether this 
is a schema issue, a xmlbeans issue or an issue produced by myself.

Any help will be very appreciated!

Cheers,

Chris

_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to