users@jaxb.java.net

marshal to dom

From: zhidong zhao <zzhao_at_CS.UNO.EDU>
Date: Tue, 28 Jan 2003 03:33:06 -0700

Marshaller.marshal(object, node) invocation builds a w3c dom tree in memory that reflects the content tree of object instance. The dom tree can be correctly serialized back into original xml text using XMLWriter and tree climbing methods such as getFirstChild, getPreviousSibling, getNextSibling work, but node.getElementsByTagName(tagname) method returns null. I suspect XPathAPI methods such as selectNodes won't work either.
The problem might be related to namespace prefix-jaxb adds a namespace xmlns:ns1 when namespace is not specified in schema. Don't know if node.getNamespace() work. How to call selectNodes and getElementsByTagName with an unknown namespace?