Hi Dan

I think XmlOptions.setLoadSubstituteNamespaces() is what you want. The
comments on that method indicate that passing in the same map that
you're currently using should work.

Cheers,

Lawrence

> -----Original Message-----
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Dan Durkin
> Sent: Wednesday, September 28, 2005 11:24 AM
> To: [email protected]
> Subject: parsing a document with no namespace
> 
> 
> I'm trying to parse a document with no namespace.
> 
> In the javadocs for XmlOptions.setLoadAdditionalNamespaces(), it seems
> to indicate that you can map no namespace to a namespace, however,
when
> I try to do this I get an exception:
> 
> org.apache.xmlbeans.XmlException: error: The document is not a
> [EMAIL PROTECTED]://scilearn.com/exercise/lrmh/rem: document element
> namespace mismatch expected "http://scilearn.com/exercise/lrmh/rem";
got ""
> 
> Here's a code snippet setting up the XmlOptions and calling the parse
> method:
> 
> 
> 
> HashMap namespaceMap = new HashMap();
>       namespaceMap.put("", "http://scilearn.com/exercise/lrmh/rem";);
> XmlOptions opts = new XmlOptions();
> opts.setLoadAdditionalNamespaces(namespaceMap);
> 
> ProgressUnitDocument pud = ProgressUnitDocument.Factory.parse(new
> java.io.File("test/test.xml"), opts);
> 
> 
> Has anyone use this or have any suggestions?
> 
> 
> Thanks,
> 
> Dan
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



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

Reply via email to