functx:name-test

Whether a name matches a list of names or name wildcards

Description

The functx:name-test function tests a name against a list of names or name wildcards. Valid name wildcards are:

*, which matches all names

*:x, where x is a local name, which matches all names with that local name, in any namespace

p:*, where p is a prefix, which matches all names in the namespace associated with that prefix.

Parameters

Description

testname:string()

the name to test

names:string()

the list of names or name wildcards

Examples

XPath

Results

functx:name-test(name($in-xml),(‘*’))

true

functx:name-test(name($in-xml),(‘pre:*’))

true

functx:name-test(name($in-xml),(’*:a’))

true

functx:name-test(name($in-xml),(‘pre:a’,’pre:b’))

true

functx:name-test(name($in-xml),(‘a’,’b’,’c’))

false

Depends On