Given the following schema
<?xml version="1.0" encoding="UTF-8"?>
<?xdmp-annotations all?> <!-- Preserve documentation annotations -->
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
targetNamespace="http://my-namespace/graphql"
xmlns:gql="http://my-namespace/graphql">
<xs:complexType name="Person">
<xs:choice maxOccurs="unbounded">
<xs:element name="name" type="xs:string" minOccurs="1"/>
<xs:element name="height" type="xs:string" minOccurs="0"/>
<xs:element name="appearsIn" type="xs:string" minOccurs="0"/>
<xs:element name="friends">
<xs:complexType>
<xs:sequence>
<xs:element name="person" type="gql:Person" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:element name='person' type='gql:Person'>
<xs:annotation>
<xs:documentation>
Person interface
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:schema>
how would I access the "person" element documentation?
The following code returns nothing:
xquery version "1.0-ml";
import schema namespace gql ="http://my-namespace/graphql" at "/graphql/person.xsd";
let $element := element {xs:QName('gql:person')} {}
return
<xml>
{sc:element-decl($element) => sc:annotations()}
</xml>
According to the documentation, the processing instruction "<?xdmp-annotations all?>
" should be enough to ensure documentation is returned in addition to the appinfo, no?
Two things:
anyType
.xs:schema
element so that the schema parsing code sees it.Fix those two things and your query works fine.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다