functx:id-untyped
Gets XML element(s) that have an attribute with a particular value
Description
The functx:id-untyped function simulates the built-in fn:id function except that the value specified can be the value of any attribute, not just one declared to be of type xs:ID. This is useful for getting elements based on ID when a schema is not present. It returns all elements that have any attribute, regardless of name, whose value is the specified value.
Parameters |
Description |
---|---|
node:node() |
the root node(s) to start from |
id:string() |
the “id” to find |
Examples
XPath |
Results |
---|---|
functx:id-untyped($in-xml,’B001’) |
<c id=”B001”>ghi</c> |
functx:id-untyped($in-xml,’A001’) |
<a id=”A001”>abc</a> <b foo=”A001”>def</b> |
functx:id-untyped($in-xml,’C001’) |
() |