Feedback

  • Contents
 

XML Set Document Property

This XML tool modifies the value of a document property. The following properties are supported:

 

Name:

Description:

SelectionLanguage

Specifies the selection language for the ‘XML Select xxx’ operations.

XPath Use XPath as selection language. Default

XSLPattern Use Microsoft XSL Patterns as selection language

NOTE: The default is different from the default of the MSXML parser, as XPath is the way of the future!

SelectionNamespaces

Specifies the selection namespaces used for XPath queries. Please see the extended description following this table.

 

The SelectionNamespaces property allows you to specify a white-space separated list of namespace declarations of the form xmlns:<prefix>="<namespace-uri>". These namespaces define the prefixes for XPath selection operations, such as XML Select Nodes. In XPath queries, namespace prefixes are NOT the same as the ones appearing in the document. For example, given the document:

<a:A xmlns:a="urn:test-a">
<b:B xmlns:b= "urn:test-b">Foo</b:B>
</a:A>

Neither the XPath pattern /A/B nor /a:A/b:B will select element B. This might appear counter-intuitive, but has a good reason: the namespace prefix is not necessarily unique, as elements in the same scope can have the same prefix for different namespace URIs, such as in the following document:

<n:A xmlns:n="urn:test-a">
<n:B xmlns:n="urn:test-b">Foo</n:B>
<n:B xmlns:n="urn:test-c">Bar</n:B>
</n:A>

There would be no way to specifically select the second B element based on its namespace. Thus, the namespace prefixes for XPath selections have to be defined separately. The document property SelectionNamespaces provides a way to specify the namespace prefixes to be used in the XPath operations. Thus, specifying the string
xmlns:x=‘urn:test-a’ xmlns:y=‘urn:test-b’ xmlns:z=‘urn:test-c’
as selection namespaces allows to use the XPath query /x:A/y:B to retrieve the first B element and /x:A/z:B to retrieve the second B element in the above document.

NOTE: The XML Create Document, XML Create Document From String and XML Load Document have a parameter to pass a selection namespace declaration. This basically provides the same functionality as loading the document and then calling ‘XML Set Document Property’ for the SelectionNamespaces property (but it also allows setting the selection namespaces for read-only documents).

Inputs

Document

Node from whose owner document to query a property.

Property Name

String containing the name of the property to retrieve. Property names are case sensitive.

Property Value

String containing the value of the property.

Exit Paths

Success

This path is taken if the document properties were successfully set.

Failure

This path is taken if the operation fails.