You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by SingleShot <mi...@gmail.com> on 2006/06/28 17:23:45 UTC

XMLBeans Inserting Unwanted Namespace

I'm trying to save a document with a default namespace, but XMLBeans keeps
inserting a named namespace ("xb") into nested elements.

What I want:

    <Example xmlns="http://example.com"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <BaseType xsi:type="DerivedType"/>
    </Example >

What I get from XMLBeans:

    <Example xmlns="http://example.com"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <BaseType xsi:type="xb:DerivedType" xmlns:xb="http://example.com"/>
    </Example >

I've tried various combinations of XMLOptions when saving to no avail, such
as:

    Map namespaces = new HashMap();
    namespaces.put("http://example.com", "");
    
    XmlOptions options = new XmlOptions();
    options.setSaveSuggestedPrefixes(namespaces);
    options.setSaveAggressiveNamespaces();
    options.setUseDefaultNamespace();

Any suggestions would be appreciated. Thanks,

Mike
-- 
View this message in context: http://www.nabble.com/XMLBeans-Inserting-Unwanted-Namespace-tf1862224.html#a5086582
Sent from the Xml Beans - User forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org