xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lawrence Jones" <ljo...@bea.com>
Subject RE: parsing a document with no namespace
Date Wed, 28 Sep 2005 19:14:30 GMT
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:news@sea.gmane.org] On Behalf Of Dan Durkin
> Sent: Wednesday, September 28, 2005 11:24 AM
> To: user@xmlbeans.apache.org
> 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
> progress-unit@http://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: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org



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


Mime
View raw message