It all depends on how you constructed the
XMLBean document. This is how XMLBeans deals with prefixes:
Only when saved to text, the saver will synthesize
prefixes and namespace declarations to generate a syntactically correct XML
document. If you are in case 2. and ask for the getDomNode
you will get a live Dom Node which, depending how your Dom saver works, might
marshal it in a different text representation. On the other hand newDomNode()
will engage the saver. If you want prefixes and namespace
declarations in the live DOM representation, they have to exist in the XmlBean’s
store. Ways to do that are:
Cezar From: Vinh Nguyen
(vinguye2) [mailto:[EMAIL PROTECTED] Anyone know if this is a bug or
expected behavior? I should mention that I'm using XmlBeans 2.2.0. From: Vinh
Nguyen (vinguye2) Hi all, There seems to be an issue with the getDomNode() method in
the generated beans in that it fails to preserve the namespace
prefix. I would expect the method to preserve all xml artifacts of the
existing object, but it doesn't seem to be. On the other hand, the
newDomNode() method does preserve the prefix. What is the proper way for
getting the original xml node representation of the object, without having to
create a new node? For example, my BoxDocument and BoxType classes were
generated from an xsd. Here's the various xml test outputs: **XML from boxDoc.xmlText(): **XML from boxDoc.getDomNode(): **XML from boxDoc.newDomNode(): Any help is appreciated, thanks! -Vinh _______________________________________________________________________ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. |
- XmlObject getDomNode fails to preserve namespace pr... Vinh Nguyen (vinguye2)
- RE: XmlObject getDomNode fails to preserve nam... Vinh Nguyen (vinguye2)
- RE: XmlObject getDomNode fails to preserve... Cezar Andrei