xml-xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeffrey Crump" <jcr...@sonicsoftware.com>
Subject Problem with XmlBeans.loadXsd
Date Thu, 22 Jul 2004 19:00:41 GMT

I'm trying to load some a schema definition and I'm having problems
getting XML Beans to recognize my namespaces.

First of all, I have a parsed XML document (it's WSDL) and I've located
the schema element, i.e.,

XmlObject[] = new XmlObject[size];
Element elem = ... 
XmlObject schemaObj = XmlObject.Factory.parse(elem);
schemaArray[count++] = schemaObj;

Then I try to load the schema:

XmlOptions options = new XmlOptions();
options.setLoadAdditionalNamespaces(nsMap); //java.util.Map from prefix
to uri, obtained from the original document that elem came from
SchemaTypeLoader loader = XmlBeans.loadXsd(schemaArray, options);

But I get this exception:

org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException: Can't
resolve prefix: xsd

The map I set into the options maps "xsd" to the appropriate URI. 

Am I missing something?  How can I get this to work, short of re-parsing
the entire document?


- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/

View raw message