Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » XSD with a variable subtree definition(Define an XSD to validate an XMLs with a subtree which you cannot predict in advance its structure)
XSD with a variable subtree definition [message #1819654] Mon, 20 January 2020 13:35 Go to next message
Alessandro Corti is currently offline Alessandro CortiFriend
Messages: 1
Registered: January 2020
Junior Member
I'm trying to define an XSD to validate the XMLs with a "variable" subtree <DOR_DATA> which you cannot predict in advance its structure.

For example. The <DOR_DATA> subtree could be:


The following XSD is wrong and I cannot find the solution:
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns:xsd="...XMLSchema....">
<xsd:element name="DATA">
<xsd:sequence minOccurs="1" maxOccurs="1">
<xsd:element name="DOCUMENTS" minOccurs="1" maxOccurs="1">
<xsd:sequence minOccurs="1" maxOccurs="1">
<xsd:element name="DOCUMENT" minOccurs="1" maxOccurs="unbounded">
<xsd:sequence minOccurs="1" maxOccurs="1">
<xsd:element name="DOR_ID" minOccurs="1" maxOccurs="1" type="xsd:integer" />
<xsd:element name="DOR_DATA">
<xsd:complexType >
<xsd:any />
Re: XSD with a variable subtree definition [message #1819676 is a reply to message #1819654] Tue, 21 January 2020 06:45 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31253
Registered: July 2009
Senior Member
This forum is for asking questions about the use of Eclipse's XML Schema Definition model, not for general "help me author a schema" questions. Using wildcards seems the right general approach to what you state you are trying to achieve, but you haven't actually asked any question at all.
Previous Topic:XML
Next Topic:XSD file - Restriction from imported namespace
Goto Forum:

Current Time: Sun Jul 12 14:12:53 GMT 2020

Powered by FUDForum. Page generated in 0.01947 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top