axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Davis" <>
Subject Re: GetAsDOM
Date Fri, 10 Aug 2001 19:52:32 GMT
One very time-consuming option is to write our own sax->dom converter that
returns our own DOM classes (extending the real ones) for just
the portion wanted and those classes/utils can manage the namespaces under

Glen Daniels <> on 08/10/2001 12:16:38 PM

Please respond to

To:   "''" <>
Subject:  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
                                Building cool stuff for web developers

View raw message