Can an XSD schema contain other XSD content?

To clarify the title of this question, I have a basic schema that defines the structure of my XML. However, the XML files are used as shown below:

<!DOCTYPE root [ <!ENTITY node1 SYSTEM "C:\node1.xml"> <!ENTITY node2 SYSTEM "C:\node2.xml"> ]> <root> &node1; &node2; </root> 

For this reason, I want to be able to define a circuit that represents these individual β€œnodes”. This will allow me to have intellisense for both the top-level root xml and for each of the sub-level node xml files.

Is it possible to define an XSD schema that references other XSD content as its own? I want to avoid duplicating the same schema definitions that are in node.xsd inside root.xsd by providing intellisense for someone creating root.xml or node.xml.

Please let me know if I need to clarify. Thank you for your help.

+4
source share
1 answer

Yes, you can include a different schema and definition structure in your schema.

You can use <xsd:import> or <xsd:include> to include other schemes in yours.

Depending on the namespace, how restrictive other schemes are, etc., some problems may arise.

+3
source

Source: https://habr.com/ru/post/1338310/


All Articles