For a Schema question, ask for help.

Source: Internet
Author: User

For a Schema question, ask for help.
(Store the home page at pm and move it to the question area. Thank you !)

Now you need to define such a node:

<Nodes>
<Node> this is a node </Node>
<Node>
<Text> this is another node </Text>
<Node> nest other subnodes. </Node>
</Node>
</Nodes>

Now, the key question is, how can such nodes be defined using Schema? My current solution is as follows:

<Xs: complexType name = "Node">
<Xs: sequence>
<Xs: choice>
<Xs: element name = "SimpleNode" type = "SimpleNode"/>
<Xs: element name = "NestNode" type = "NestNode"/>
</Xs: choice>
</Xs: sequence>
</Xs: complexType>

<Xs: complexType name = "NestNode">
<Xs: sequence>
<Xs: element name = "Text" type = "xs: string" minOccurs = "0" maxOccurs = "unbounded"/>
<Xs: element name = "Node" type = "Node" minOccurs = "1" maxOccurs = "unbounded"/>
</Xs: sequence>
</Xs: complexType>

<Xs: complexType name = "SimpleNode">
<Xs: simpleContent>
<Xs: extension base = "xs: string">
</Xs: extension>
</Xs: simpleContent>
</Xs: complexType>

The problem is that the definition of the first Node type is incorrect. That is to say, I cannot use Node as both SimpleNode and NestNode.

What are the comments of prawns?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.