use the cursor api. it will give you all the namespaces in scope in a Map object.
        XmlObject xobj = XmlObject.Factory.parse(xml);
        XmlCursor curs = xobj.newCursor();
        HashMap map = new HashMap();

On 5/1/2014 7:31 AM, jgagnon wrote:
I'm trying to figure out how to get the namespace information (the
namespace(s) itself and the namespace prefix(es) that are applied to
elements within the document) contained within an XML file after I have
parsed it in XMLBeans.  For example, consider the following XML snippet:

<?xml version="1.0" encoding="UTF-8"?>
<pfx:DoorCommand xsi:schemaLocation=" ../schema.xsd"
       <pfx:DescriptiveLabel>This document is

In the case, the namespace I'm concerned with is ""; and
the prefix "pfx" that's applied to the document elements.

I have not been able to figure out how to do this via the XMLBeans API.

View this message in context:
Sent from the XMLBeans User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to