MarkLogic Server 11.0 Product Documentation
sc:schemasc:schema(
[$arg as item()]
) as schema-root()?
Summary
Returns the root schema of the item.
The context item is used if no argument is given.
- If the item is a document node, the result is the schema of its
root element.
- If the item is an element node, the result is the schema of its
element declaration.
- If the item is an attribute node, the result is the schema of its
attribute declaration.
- If the item is a schema component, the result is the containing
schema.
- If the item is an atomic value, the result is the schema containing the
type of that atomic value.
- In other cases, the result is the empty sequence.
Parameters |
arg |
The item whose associated schema is to be returned.
|
Example
declare namespace th="http://marklogic.com/xdmp/thesaurus";
xdmp:describe(
<th:thesaurus>
<th:entry><th:term>dog</th:term>
<th:synonym><th:term>canine</th:term></th:synonym>
</th:entry>
</th:thesaurus>//th:entry/sc:schema()!sc:component-property("schema-location")
)
=>
"thesaurus.xsd"
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.