The Altova extension functions listed below return schema information. Given below are descriptions of the functions, together with (i) examples and (ii) a listing of schema components and their respective properties.
Schema information from schema documents
The function altova:schema has two arguments: one with zero arguments and the other with two arguments. The zero-argument function returns the whole schema. You can then, from this starting point, navigate into the schema to locate the schema components you want. The two-argument function returns a specific component kind that is identified by its QName. In both cases, the return value is a function. To navigate into the returned component, you must select a property of that specific component. If the property is a non-atomic item (that is, if it is a component), then you can navigate further by selecting a property of this component. If the selected property is an atomic item, then the value of the item is returned and you cannot navigate any further.
Note: In XPath expressions, the schema must be imported into the processing environment (for example, into XSLT) with the xslt:import-schema instruction. In XQuery expressions, the schema must be explicitly imported using a schema import.
Schema information from XML nodes
The function altova:type submits the node of an XML document and returns the node's type information from the PSVI.
Note about naming of functions and language applicability
Altova extension functions can be used in XPath/XQuery expressions. They provide additional functionality to the functionality that is available in the standard library of XPath, XQuery, and XSLT functions. •In order to distinguish Altova extension functions from functions in the standard library, Altova extension functions are named in this documentation with a suffix of [altova:]. For example: add-years-to-date [altova:]. •When using Altova extension functions in your XPath/XQuery expressions, however, you must use the function without any prefix or suffix, just as you would use any standard XPath/XQuery function. Use an Altova extension like this: add-years-to-date(xs:date("2014-01-15"), 10). XPath functions (used in XPath expressions in XSLT): | XP1 XP2 XP3.1 | XSLT functions (used in XPath expressions in XSLT): | XSLT1 XSLT2 XSLT3 | XQuery functions (used in XQuery expressions in XQuery): | XQ1 XQ3.1 |
|
altova:schema() as (function(xs:string) as item()*)? XP3.1 XQ3.1 Returns the schema component as a whole. You can navigate further into the schema component by selecting one of the schema component's properties. •If this property is a component, you can navigate another step deeper by selecting one of this component's properties. This step can be repeated to navigate further into the schema. •If the component is an atomic value, the atomic value is returned and you cannot navigate any deeper. The properties of the schema component are: "type definitions" "attribute declarations" "element declarations" "attribute group definitions" "model group definitions" "notation declarations" "identity-constraint definitions" The properties of all other component kinds (besides schema) are listed below. Note: In XQuery expressions, the schema must be explicitly imported. In XPath expressions, the schema must have been imported into the processing environment, for example, into XSLT with the xslt:import instruction. •import schema "" at "C:\Test\ExpReport.xsd"; for $typedef in altova:schema() ("type definitions") return $typedef ("name") returns the names of all simple types or complex types in the schema •import schema "" at "C:\Test\ExpReport.xsd"; altova:schema() ("type definitions")[1]("name") returns the name of the first of all simple types or complex types in the schema |
Components and their properties Property name | Property type | Property value | kind | string | "Assertion" | test | XPath Property Record |
|
|
Property name | Property type | Property value | kind | string | "Attribute Declaration" | name | string | Local name of the attribute | target namespace | string | Namespace URI of the attribute | type definition | Simple Type or Complex Type |
| scope | A function with properties ("class":"Scope", "variety": "global" or "local", "parent": the containing Complex Type or Attribute Group) |
| value constraint | If present, a function with properties ("class": "Value Constraint", "variety": "fixed" or "default", "value": atomic value, "lexical form": string. Note that the "value" property is not available for namespace-sensitive types |
| inheritable | boolean |
|
|
Property name | Property type | Property value | kind | string | "Attribute Group Definition" | name | string | Local name of the attribute group | target namespace | string | Namespace URI of the attribute group | attribute uses | Sequence of (Attribute Use) |
| attribute wildcard | Optional Attribute Wildcard |
|
|
Property name | Property type | Property value | kind | string | "Attribute Use" | required | boolean | true if the attribute is required, false if optional | value constraint | See Attribute Declaration |
| inheritable | boolean |
|
|
Property name | Property type | Property value | kind | string | "Wildcard" | namespace constraint | function with properties ("class": "Namespace Constraint", "variety": "any"|"enumeration"|"not", "namespaces": sequence of xs:anyURI, "disallowed names": list containing QNames and/or the strings "defined" and "definedSiblings" |
| process contents | string ("strict"|"lax"|"skip") |
|
|
Property name | Property type | Property value | kind | string | "Complex Type" | name | string | Local name of the type (empty if anonymous) | target namespace | string | Namespace URI of the type (empty if anonymous) | base type definition | Complex Type Definition |
| final | Sequence of strings ("restriction"|"extension") |
| context | Empty sequence (not implemented) |
| derivation method | string ("restriction"|"extension") |
| abstract | boolean |
| attribute uses | Sequence of Attribute Use |
| attribute wildcard | Optional Attribute Wildcard |
| content type | function with properties: ("class":"Content Type", "variety":string ("element-only"|"empty"|"mixed"|"simple"), particle: optional Particle, "open content": function with properties ("class":"Open Content", "mode": string ("interleave"|"suffix"), "wildcard": Wildcard), "simple type definition": Simple Type) |
| prohibited substitutions | Sequence of strings ("restriction"|"extension") |
| assertions | Sequence of Assertion |
|
|
Property name | Property type | Property value | kind | string | "Complex Type" | name | string | Local name of the type (empty if anonymous) | target namespace | string | Namespace URI of the type (empty if anonymous) | type definition | Simple Type or Complex Type |
| type table | function with properties ("class":"Type Table", "alternatives": sequence of Type Alternative, "default type definition": Simple Type or Complex Type) |
| scope | function with properties ("class":"Scope", "variety": ("global"|"local"), "parent": optional Complex Type) |
| value constraint | see Attribute Declaration |
| nillable | boolean |
| identity-constraint definitions | Sequence of Identity Constraint |
| substitution group affiliations | Sequence of Element Declaration |
| substitution group exclusions | Sequence of strings ("restriction"|"extension") |
| disallowed substitutions | Sequence of strings ("restriction"|"extension"|"substitution") |
| abstract | boolean |
|
|
Property name | Property type | Property value | kind | string | "Wildcard" | namespace constraint | function with properties ("class": "Namespace Constraint", "variety": "any"|"enumeration"|"not", "namespaces": sequence of xs:anyURI, "disallowed names": list containing QNames and/or the strings "defined" and "definedSiblings" |
| process contents | string ("strict"|"lax"|"skip") |
|
|
Property name | Property type | Property value | kind | string | The name of the facet, for example "minLength" or "enumeration" | value | depends on facet | The value of the facet | fixed | boolean |
| typed-value | For the enumeration facet only, array(xs:anyAtomicType*) | An array containing the enumeration values, each of which may in general be a sequence of atomic values. (Note: for the enumeration facet, the "value" property is a sequence of strings, regardless of the actual type) |
|
Property name | Property type | Property value | kind | string | "Identity-Constraint Definition" | name | string | Local name of the constraint | target namespace | string | Namespace URI of the constraint | identity-constraint category | string ("key"|"unique"|"keyRef") |
| selector | XPath Property Record |
| fields | Sequence of XPath Property Record |
| referenced key | (For keyRef only): Identity Constraint | The corresponding key constraint |
|
Property name | Property type | Property value | kind | string | "Model Group" | compositor | string ("sequence"|"choice"|"all") |
| particles | Sequence of Particle |
|
|
Property name | Property type | Property value | kind | string | "Model Group Definition" | name | string | Local name of the model group | target namespace | string | Namespace URI of the model group | model group | Model Group |
|
|
Property name | Property type | Property value | kind | string | "Notation Declaration" | name | string | Local name of the notation | target namespace | string | Namespace URI of the notation | system identifier | anyURI |
| public identifier | string |
|
|
Property name | Property type | Property value | kind | string | "Particle" | min occurs | integer |
| max occurs | integer, or string("unbounded") |
| term | Element Declaration, Element Wildcard, or ModelGroup |
|
|
Property name | Property type | Property value | kind | string | "Simple Type Definition" | name | string | Local name of the type (empty if anonymous) | target namespace | string | Namespace URI of the type (empty if anonymous) | final | Sequence of string("restriction"|"extension"|"list"|"union") |
| context | containing component |
| base type definition | Simple Type |
| facets | Sequence of Facet |
| fundamental facets | Empty sequence (not implemented) |
| variety | string ("atomic"|"list"|"union") |
| primitive type definition | Simple Type |
| item type definition | (for list types only) Simple Type |
| member type definitions | (for union types only) Sequence of Simple Type |
|
|
Property name | Property type | Property value | kind | string | "Type Alternative" | test | XPath Property Record |
| type definition | Simple Type or Complex Type |
|
|
Property name | Property type | Property value | namespace bindings | Sequence of functions with properties ("prefix": string, "namespace": anyURI) |
| default namespace | anyURI |
| base URI | anyURI | The static base URI of the XPath expression | expression | string | The XPath expression as a string |
|
|
altova:schema(ComponentKind as xs:string, Name as xs:QName) as (function(xs:string) as item()*)? XP3.1 XQ3.1 Returns the component kind that is specified in the first argument which has a name that is the same as the name supplied in the second argument. You can navigate further by selecting one of the component's properties. •If this property is a component, you can navigate another step deeper by selecting one of this component's properties. This step can be repeated to navigate further into the schema. •If the component is an atomic value, the atomic value is returned and you cannot navigate any deeper. Note: In XQuery expressions, the schema must be explicitly imported. In XPath expressions, the schema must have been imported into the processing environment, for example, into XSLT with the xslt:import instruction. •import schema "" at "C:\Test\ExpReport.xsd"; altova:schema("element declaration", xs:QName("OrgChart"))("type definition")("content type")("particles")[3]!.("term")("kind") returns the kind property of the term of the third particles component. This particles component is a descendant of the element declaration having a QName of OrgChart •import schema "" at "C:\Test\ExpReport.xsd"; let $typedef := altova:schema("type definition", xs:QName("emailType")) for $facet in $typedef ("facets") return [$facet ("kind"), $facet("value")] returns, for each facet of each emailType component, an array containing that facet's kind and value |
Components and their properties Property name | Property type | Property value | kind | string | "Assertion" | test | XPath Property Record |
|
|
Property name | Property type | Property value | kind | string | "Attribute Declaration" | name | string | Local name of the attribute | target namespace | string | Namespace URI of the attribute | type definition | Simple Type or Complex Type |
| scope | A function with properties ("class":"Scope", "variety": "global" or "local", "parent": the containing Complex Type or Attribute Group) |
| value constraint | If present, a function with properties ("class": "Value Constraint", "variety": "fixed" or "default", "value": atomic value, "lexical form": string. Note that the "value" property is not available for namespace-sensitive types |
| inheritable | boolean |
|
|
Property name | Property type | Property value | kind | string | "Attribute Group Definition" | name | string | Local name of the attribute group | target namespace | string | Namespace URI of the attribute group | attribute uses | Sequence of (Attribute Use) |
| attribute wildcard | Optional Attribute Wildcard |
|
|
Property name | Property type | Property value | kind | string | "Attribute Use" | required | boolean | true if the attribute is required, false if optional | value constraint | See Attribute Declaration |
| inheritable | boolean |
|
|
Property name | Property type | Property value | kind | string | "Wildcard" | namespace constraint | function with properties ("class": "Namespace Constraint", "variety": "any"|"enumeration"|"not", "namespaces": sequence of xs:anyURI, "disallowed names": list containing QNames and/or the strings "defined" and "definedSiblings" |
| process contents | string ("strict"|"lax"|"skip") |
|
|
Property name | Property type | Property value | kind | string | "Complex Type" | name | string | Local name of the type (empty if anonymous) | target namespace | string | Namespace URI of the type (empty if anonymous) | base type definition | Complex Type Definition |
| final | Sequence of strings ("restriction"|"extension") |
| context | Empty sequence (not implemented) |
| derivation method | string ("restriction"|"extension") |
| abstract | boolean |
| attribute uses | Sequence of Attribute Use |
| attribute wildcard | Optional Attribute Wildcard |
| content type | function with properties: ("class":"Content Type", "variety":string ("element-only"|"empty"|"mixed"|"simple"), particle: optional Particle, "open content": function with properties ("class":"Open Content", "mode": string ("interleave"|"suffix"), "wildcard": Wildcard), "simple type definition": Simple Type) |
| prohibited substitutions | Sequence of strings ("restriction"|"extension") |
| assertions | Sequence of Assertion |
|
|
Property name | Property type | Property value | kind | string | "Complex Type" | name | string | Local name of the type (empty if anonymous) | target namespace | string | Namespace URI of the type (empty if anonymous) | type definition | Simple Type or Complex Type |
| type table | function with properties ("class":"Type Table", "alternatives": sequence of Type Alternative, "default type definition": Simple Type or Complex Type) |
| scope | function with properties ("class":"Scope", "variety": ("global"|"local"), "parent": optional Complex Type) |
| value constraint | see Attribute Declaration |
| nillable | boolean |
| identity-constraint definitions | Sequence of Identity Constraint |
| substitution group affiliations | Sequence of Element Declaration |
| substitution group exclusions | Sequence of strings ("restriction"|"extension") |
| disallowed substitutions | Sequence of strings ("restriction"|"extension"|"substitution") |
| abstract | boolean |
|
|
Property name | Property type | Property value | kind | string | "Wildcard" | namespace constraint | function with properties ("class": "Namespace Constraint", "variety": "any"|"enumeration"|"not", "namespaces": sequence of xs:anyURI, "disallowed names": list containing QNames and/or the strings "defined" and "definedSiblings" |
| process contents | string ("strict"|"lax"|"skip") |
|
|
Property name | Property type | Property value | kind | string | The name of the facet, for example "minLength" or "enumeration" | value | depends on facet | The value of the facet | fixed | boolean |
| typed-value | For the enumeration facet only, array(xs:anyAtomicType*) | An array containing the enumeration values, each of which may in general be a sequence of atomic values. (Note: for the enumeration facet, the "value" property is a sequence of strings, regardless of the actual type) |
|
Property name | Property type | Property value | kind | string | "Identity-Constraint Definition" | name | string | Local name of the constraint | target namespace | string | Namespace URI of the constraint | identity-constraint category | string ("key"|"unique"|"keyRef") |
| selector | XPath Property Record |
| fields | Sequence of XPath Property Record |
| referenced key | (For keyRef only): Identity Constraint | The corresponding key constraint |
|
Property name | Property type | Property value | kind | string | "Model Group" | compositor | string ("sequence"|"choice"|"all") |
| particles | Sequence of Particle |
|
|
Property name | Property type | Property value | kind | string | "Model Group Definition" | name | string | Local name of the model group | target namespace | string | Namespace URI of the model group | model group | Model Group |
|
|
Property name | Property type | Property value | kind | string | "Notation Declaration" | name | string | Local name of the notation | target namespace | string | Namespace URI of the notation | system identifier | anyURI |
| public identifier | string |
|
|
Property name | Property type | Property value | kind | string | "Particle" | min occurs | integer |
| max occurs | integer, or string("unbounded") |
| term | Element Declaration, Element Wildcard, or ModelGroup |
|
|
Property name | Property type | Property value | kind | string | "Simple Type Definition" | name | string | Local name of the type (empty if anonymous) | target namespace | string | Namespace URI of the type (empty if anonymous) | final | Sequence of string("restriction"|"extension"|"list"|"union") |
| context | containing component |
| base type definition | Simple Type |
| facets | Sequence of Facet |
| fundamental facets | Empty sequence (not implemented) |
| variety | string ("atomic"|"list"|"union") |
| primitive type definition | Simple Type |
| item type definition | (for list types only) Simple Type |
| member type definitions | (for union types only) Sequence of Simple Type |
|
|
Property name | Property type | Property value | kind | string | "Type Alternative" | test | XPath Property Record |
| type definition | Simple Type or Complex Type |
|
|
Property name | Property type | Property value | namespace bindings | Sequence of functions with properties ("prefix": string, "namespace": anyURI) |
| default namespace | anyURI |
| base URI | anyURI | The static base URI of the XPath expression | expression | string | The XPath expression as a string |
|
|
altova:type(Node as item?) as (function(xs:string) as item()*)? XP3.1 XQ3.1 The function altova:type submits an element or attribute node of an XML document and returns the node's type information from the PSVI. Note: The XML document must have a schema declaration so that the schema can be referenced. •for $element in //Email let $type := altova:type($element) return $type returns a function that contains the Email node's type information •for $element in //Email let $type := altova:type($element) return $type ("kind") takes the Email node's type component (Simple Type or Complex Type) and returns the value of the component's kind property The "_props" parameter returns the properties of the selected component. For example: •for $element in //Email let $type := altova:type($element) return ($type ("kind"), $type ("_props")) takes the Email node's type component (Simple Type or Complex Type) and returns (i) the value of the component's kind property, and then (ii) the properties of that component. |
Components and their properties Property name | Property type | Property value | kind | string | "Assertion" | test | XPath Property Record |
|
|
Property name | Property type | Property value | kind | string | "Attribute Declaration" | name | string | Local name of the attribute | target namespace | string | Namespace URI of the attribute | type definition | Simple Type or Complex Type |
| scope | A function with properties ("class":"Scope", "variety": "global" or "local", "parent": the containing Complex Type or Attribute Group) |
| value constraint | If present, a function with properties ("class": "Value Constraint", "variety": "fixed" or "default", "value": atomic value, "lexical form": string. Note that the "value" property is not available for namespace-sensitive types |
| inheritable | boolean |
|
|
Property name | Property type | Property value | kind | string | "Attribute Group Definition" | name | string | Local name of the attribute group | target namespace | string | Namespace URI of the attribute group | attribute uses | Sequence of (Attribute Use) |
| attribute wildcard | Optional Attribute Wildcard |
|
|
Property name | Property type | Property value | kind | string | "Attribute Use" | required | boolean | true if the attribute is required, false if optional | value constraint | See Attribute Declaration |
| inheritable | boolean |
|
|
Property name | Property type | Property value | kind | string | "Wildcard" | namespace constraint | function with properties ("class": "Namespace Constraint", "variety": "any"|"enumeration"|"not", "namespaces": sequence of xs:anyURI, "disallowed names": list containing QNames and/or the strings "defined" and "definedSiblings" |
| process contents | string ("strict"|"lax"|"skip") |
|
|
Property name | Property type | Property value | kind | string | "Complex Type" | name | string | Local name of the type (empty if anonymous) | target namespace | string | Namespace URI of the type (empty if anonymous) | base type definition | Complex Type Definition |
| final | Sequence of strings ("restriction"|"extension") |
| context | Empty sequence (not implemented) |
| derivation method | string ("restriction"|"extension") |
| abstract | boolean |
| attribute uses | Sequence of Attribute Use |
| attribute wildcard | Optional Attribute Wildcard |
| content type | function with properties: ("class":"Content Type", "variety":string ("element-only"|"empty"|"mixed"|"simple"), particle: optional Particle, "open content": function with properties ("class":"Open Content", "mode": string ("interleave"|"suffix"), "wildcard": Wildcard), "simple type definition": Simple Type) |
| prohibited substitutions | Sequence of strings ("restriction"|"extension") |
| assertions | Sequence of Assertion |
|
|
Property name | Property type | Property value | kind | string | "Complex Type" | name | string | Local name of the type (empty if anonymous) | target namespace | string | Namespace URI of the type (empty if anonymous) | type definition | Simple Type or Complex Type |
| type table | function with properties ("class":"Type Table", "alternatives": sequence of Type Alternative, "default type definition": Simple Type or Complex Type) |
| scope | function with properties ("class":"Scope", "variety": ("global"|"local"), "parent": optional Complex Type) |
| value constraint | see Attribute Declaration |
| nillable | boolean |
| identity-constraint definitions | Sequence of Identity Constraint |
| substitution group affiliations | Sequence of Element Declaration |
| substitution group exclusions | Sequence of strings ("restriction"|"extension") |
| disallowed substitutions | Sequence of strings ("restriction"|"extension"|"substitution") |
| abstract | boolean |
|
|
Property name | Property type | Property value | kind | string | "Wildcard" | namespace constraint | function with properties ("class": "Namespace Constraint", "variety": "any"|"enumeration"|"not", "namespaces": sequence of xs:anyURI, "disallowed names": list containing QNames and/or the strings "defined" and "definedSiblings" |
| process contents | string ("strict"|"lax"|"skip") |
|
|
Property name | Property type | Property value | kind | string | The name of the facet, for example "minLength" or "enumeration" | value | depends on facet | The value of the facet | fixed | boolean |
| typed-value | For the enumeration facet only, array(xs:anyAtomicType*) | An array containing the enumeration values, each of which may in general be a sequence of atomic values. (Note: for the enumeration facet, the "value" property is a sequence of strings, regardless of the actual type) |
|
Property name | Property type | Property value | kind | string | "Identity-Constraint Definition" | name | string | Local name of the constraint | target namespace | string | Namespace URI of the constraint | identity-constraint category | string ("key"|"unique"|"keyRef") |
| selector | XPath Property Record |
| fields | Sequence of XPath Property Record |
| referenced key | (For keyRef only): Identity Constraint | The corresponding key constraint |
|
Property name | Property type | Property value | kind | string | "Model Group" | compositor | string ("sequence"|"choice"|"all") |
| particles | Sequence of Particle |
|
|
Property name | Property type | Property value | kind | string | "Model Group Definition" | name | string | Local name of the model group | target namespace | string | Namespace URI of the model group | model group | Model Group |
|
|
Property name | Property type | Property value | kind | string | "Notation Declaration" | name | string | Local name of the notation | target namespace | string | Namespace URI of the notation | system identifier | anyURI |
| public identifier | string |
|
|
Property name | Property type | Property value | kind | string | "Particle" | min occurs | integer |
| max occurs | integer, or string("unbounded") |
| term | Element Declaration, Element Wildcard, or ModelGroup |
|
|
Property name | Property type | Property value | kind | string | "Simple Type Definition" | name | string | Local name of the type (empty if anonymous) | target namespace | string | Namespace URI of the type (empty if anonymous) | final | Sequence of string("restriction"|"extension"|"list"|"union") |
| context | containing component |
| base type definition | Simple Type |
| facets | Sequence of Facet |
| fundamental facets | Empty sequence (not implemented) |
| variety | string ("atomic"|"list"|"union") |
| primitive type definition | Simple Type |
| item type definition | (for list types only) Simple Type |
| member type definitions | (for union types only) Sequence of Simple Type |
|
|
Property name | Property type | Property value | kind | string | "Type Alternative" | test | XPath Property Record |
| type definition | Simple Type or Complex Type |
|
|
Property name | Property type | Property value | namespace bindings | Sequence of functions with properties ("prefix": string, "namespace": anyURI) |
| default namespace | anyURI |
| base URI | anyURI | The static base URI of the XPath expression | expression | string | The XPath expression as a string |
|
|