Hi, I just recognized that I used the SubGroupElementTypes, not the SubGroupElementDocuments as elements to be set in the substitution group element. An example:
//former was : SubGroupElementType sbElementType= SubGroupElementType.Factory.newInstance(); SubGroupElementDocument sbElementDoc = SubGroupElementDocument.Factory.newInstance(); AbstractElement element = doc.addNewAbstractElement(); element.set(sbElementDoc); That works fine. So it was an issue caused by myself. Sorry for posting this email to your list! Regards, Chris > -----Ursprüngliche Nachricht----- > Von: [email protected] > Gesendet: 21.02.07 12:36:49 > An: [email protected] > Betreff: Namespace problem with renamed substitution group elements > 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=”http://www.opengis.net/swe/0.0” > > 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=“http://www.opengis.net/swe/0.0“> > > 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] > > _____________________________________________________________________ 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]

