4.7 XPath 1.0 Expressions

The arguments to some conditions, actions, and tokens use XPath 1.0 expressions. XPath is a language created to provide a common syntax and semantics for the functionality shared between XSLT and XPointer. XPath is used primarily for addressing parts of an XML document, but also provides basic facilities for manipulation of strings, numbers, and Booleans.

The XPath specification requires that the embedding application provide a context with several application-defined pieces of information. In DirXML Script (see Section 4.1, DirXML Script), XPath is evaluated with the following context:

The W3 Web site contains more information about XPath.

XPath Examples

Here are some simple XPath examples commonly used in Identity Manager:

Add Event

<input>
<add cached-time="20130423053016.248Z" class-name="User" event-id="rj-idmdt-122&#35;20130423053016#1#1:71e2b5fd-cf71-4ebc-06a1-fdb5e27171cf" qualified-src-dn="O=data\OU=users\CN=sfpuserz" src-dn="\Rose-Mayflower-2\data\users\sfpuserz" src-entry-id="39025" timestamp="1366695016#45"> 
      <add-attr attr-name="Postal Code"> 
        <value timestamp="1366695016#24" type="string">Sacramento</value> 
      </add-attr> 
      <add-attr attr-name="OU"> 
        <value timestamp="1366695016#22" type="string">DCM</value> 
      </add-attr> 
      <add-attr attr-name="Title"> 
        <value timestamp="1366695016#16" type="string">senior manager</value> 
      </add-attr> 
      <add-attr attr-name="co"> 
        <value timestamp="1366695016#18" type="string">USA</value> 
      </add-attr> 
      <add-attr attr-name="Telephone Number"> 
        <value timestamp="1366695016#12" type="teleNumber">+1 818 936-6205</value> 
      </add-attr> 
      <add-attr attr-name="S"> 
        <value timestamp="1366695016#19" type="string">California</value> 
      </add-attr> 
      <add-attr attr-name="Given Name"> 
        <value timestamp="1366695016#11" type="string">sfpuserz</value> 
      </add-attr> 
      <add-attr attr-name="company"> 
        <value timestamp="1366695016#23" type="string">Francos</value> 
      </add-attr> 
      <add-attr attr-name="Surname"> 
        <value timestamp="1366695016#26" type="string">joe</value> 
      </add-attr> 
      <add-attr attr-name="workforceID"> 
        <value timestamp="1366695016#15" type="string">800001</value> 
      </add-attr> 
      <add-attr attr-name="CN"> 
        <value timestamp="1366695016#45" type="string">sfpuserz</value> 
      </add-attr> 
    </add>
</input> 

Element

Description

add-attr[@attr-name="Surname"]/value

Returns the value of the add-value node for the Surname attribute.

add-attr[@attr-name=" Facsimile Telephone Number" /value/component[@name="faxNumber"]

Returns the value of the fax number from the Facsimile Telephone Number structured attribute.

Modify Event

<input>
    <modify class name="User" event id="656B0450E1A3BC5C6525780D003E7F4D   1294053788689" from merge="true" qualified src dn="O=data\OU=users\CN=username" src dn="data\users\username" src entry id="33045">
      <association>656B0450E1A3BC5C6525780D003E7F4D</association>
      <modify attr attr name="DirXML EntitlementRef">
        <remove all values/>
      </modify attr>
      <modify attr attr name="CN">
        <add value>
          <value naming="true" timestamp="1294053459#23" type="string">username</value>
        </add value>
      </modify attr>
    </modify>
</input>

Element

Description

@src-dn

Returns the value of the src-dn attribute inside the event node.

@event-id

Returns the value of the event-id attribute.

modify-attr[@attr-name="CN"]/add-value/value

Returns the value of the add-value node for the Surname attribute.