Re: XPath on encoded SOAP documents

Hi Mike,

> XPath 2.0 as currently defined cannot process encoded SOAP
> documents. It's possible to add a new type of axis to remedy this.
> The implementation costs are non-zero but not prohibitive. The
> definition of this axis is straightforward, result in something
> subtly different from the other axes.

I wonder whether the "general steps" in XPath 2.0
(http://www.w3.org/TR/xpath20/#id-general-steps) meet some of your
needs.

As you've said, it's possible to define an extension function that
dereferences encoded references, with a signature of:

  element soap:dereference(element)

The element argument is the element with the href attribute or nested
information. The element returned is the referenced element, or the
argument element itself if it contains nested information.

Implemented in XSLT, it might look like:

<xsl:function name="soap:dereference">
  <xsl:param name="element" type="element" />
  <xsl:result select="if ($element/@href)
                      then id(substring($element/@href, 2))
                      else $element" />
</xsl:function>

You could then perhaps do something like:

  n:getOrderStatusResult
    /soap:dereference(Result)
    /soap:dereference(shipToInfo)

to get from the n:getOrderStatusResult to the shipTo information.

Would that meet your requirement?

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

Received on Saturday, 16 March 2002 08:03:16 UTC