You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Glen Daniels <gd...@macromedia.com> on 2001/08/10 18:16:38 UTC

GetAsDOM

So getAsDOM works by serializing the element out to a string, then parsing
that as a mini-document.  There's a problem with this, though - it doesn't
work if there are are namespaced attributes... If we originally had the
"xsi" prefix declared at the top level (i.e. <Envelope>), and then ask for
this header as DOM:

<someHeader xsi:type="fooType"/>

The parser will complain because we're trying to parse exactly that string,
which doesn't contain a namespace declaration for the xsi:type element, and
thus this is bad XML.

If we change the serializer to add the namespace declaration, we alter the
structure of the document and, although the parse will work then, we lose
the correctness of the DOM representation.

Any suggestions?  All I can think of at the moment is to serialize the
entire envelope, parse it as DOM, and then find the element we're looking
for in the tree.... (keeping a cached copy of the DOM around, probably)

Glen Daniels
Macromedia
http://www.macromedia.com/
                                Building cool stuff for web developers