xpur
Extract a URI from an XML document
Index > Books > Declarative Development Guide > Reference Library > Accessor Listing > xpur

Rate this page:
Really useful
Satisfactory
Not helpful
Confusing
Incorrect
Unsure
Extra comments:


Module

urn:org:ten60:netkernel:ext:xml:ura

Definition

Active URI Base

active:xpur

Format

<instr>
  <type>xpur</type>
  <operand>foo.xml</operand>
  <operator>
    <xpath>/path/to/uri</xpath>
  </operator>
  <target>var:uri</target>
</instr>

Syntax

ArgumentRulesDescription
typeMandatory xpur
operandMandatory the resource containing a URI
operatorMandatory a canonical XPath document
targetMandatory Fragment OKthe target resource

The xpur accessor returns a canonical URI extracted from an XPath location in the operand document. The XPath location is supplied by the operator as a canonical XPath document.

Documents frequently contain URI's that are needed for subsequent processing. This accessor extracts the value at a given xpath location and casts it to a canonical URI.

Here's an example...

<instr>
  <type>xpur</type>
  <operand>
    <example>
      <someresource the_uri_to_my_resource="file:/some/resource.xml">
        <desc>My resource</desc>
      </someresource>
    </example>
  </operand>
  <operator>
    <xpath>/example/someresource/@the_uri_to_my_resource</xpath>
  </operator>
  <target>var:uri</target>
</instr>

Produces a value in var:uri...

<uri>file:/some/resource.xml</uri>

(C) 2003, 1060 Research Limited
© 2003-2005, 1060 Research Limited. 1060 registered trademark, NetKernel trademark of 1060 Research Limited.