Been spending a bit of time with Unidata 7.1 and XDOM support and I have to
say that I'm disappointed, frustrated, and really quite concerned.

With a simple hand-constructed XML document, everything seems to work pretty
well.  Throw any xmlns namespaces into the mix and, well, things get
butt-ugly.  In the test example, we are receiving a SOAP response with a
normal XML response.  The program holds the XML string in a variable
XML.DATA and then issues this:

STATUS = XDOMOpen(XML.DATA, XML.FROM.STRING, DOM.HANDLE)

...and everything seems to be okay.  This is then followed by:

  STATUS = XDOMLocate(DOM.HANDLE,START.NODE,'',NODE.HANDLE)

...where START.NODE is a variable containing the starting node.  This is
where things get ugly.  First, the starting node value needs a "//" prefix,
which I see is an XPath syntax thing but the Unidata documentation say
nothing about it.  Second, for a node to be found - for whatever reason -
there must be xmlns="" in the node.  There can be nothing between the
quotes, that doesn't work, but without the xmlns="" it's apparently looking
to some parent name space and ... well, things don't work.  So this xml frag
works:

<Handle xmlns="">

But this does not:

<Handle xmlns="http://....";>
...or...
<Handle>

I've tried using XDOMLocate with a full XDOM path to the node, no love.
I've tried extracting the first node in the XML document, no love.  There
are only two situations that seem to work, the first being sending in
START.NODE = "" in which case the entire document is parsed, or with //name
in which case it'll work if the XML has been manually munged to either
remove all namespacing or to add the xmlns="" on the nodes to be extracted.
Seems kinda wonky to have to replace something in order to allow it to be
extracted, don't it?

I've tried different settings for the namespace variable on XDOMLocate
(which is the '' above) and nothing seems to work.  Could it be because the
xmlns= refers to a dead URL?  Seems every time I'm in into this kind of
thing the namespace urls are dead, so it seems to be something of a common
thing.  Could this be stopping Unidata from being able to find a specific
node?

Clearly either I'm doing some stuff incorrectly; otherwise this is a feature
that isn't quite fully baked.  What say ye, my genius cyberdwellers?

-Kevin
http://www.PrecisOnline.com
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to