If you have a reference to a SchemaLocalElement/Attribute, then .getName().getNamespaceURI() should do the trick. This is if you want to get them "from the Schema". If you have an instance, then XmlObject.newCursor().getName().getNamespaceURI() gets the element/attribute uri.
As far as "setting" namespace declarations, you don't need to do that. XMLBeans will insert namespace declarations as needed when you save your document. You can then use XmlOptions to set some namespace/prefix mappings that you'd prefer etc. Radu On Sun, 2008-07-20 at 22:53 -0700, Eric Murphy wrote: > Is there any way to query a schema element to find out its declaring > namespace? Also how do you set your namespace declarations when > creating a new XmlDocument? While the declarations are in the schema > they don’t seem to be available through any of the XmlBeans objects. I > would like to set my namespaces by getting them out of the schema > rather than hard coding them into the code. > > > > Eric Murphy > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

