Advise wanted

T

The Owner

Hi,

I'm looking for a way to define a schema for an XML file with the
following content:

<root_record>
<record>
...
</record>
<record>
...
</record>
</root_record>

A schema definition along the following lines does not work:

<xs:element name="root_record">
<xs:complexType>
<xs:sequence>
<xs:element name="record" maxOccurs="unbounded">
<xs:complexType>
...
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>

with an xml file containing:

<root_record>
<record>The first</record>
<record>The second</record>
...
</root_record>

The online xml/xsd validators tell me <record> (of <record>The
second</record>) may not follow </record> (of <record>The first</record>).

So is there a good way to get what I want (an xml file containing (as
xml elements the values of) the contents of a selection of columns of
records from a database table and a correct accompanying schema file)?

Thanks once again for any usable answer!
 
M

Martin Honnen

The said:
I'm looking for a way to define a schema for an XML file with the
following content:

<root_record>
<record>
...
</record>
<record>
...
</record>
</root_record>

A schema definition along the following lines does not work:

<xs:element name="root_record">
<xs:complexType>
<xs:sequence>
<xs:element name="record" maxOccurs="unbounded">
<xs:complexType>
...
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>

That schema looks fine, as far as allowing a sequence of one or more
'record' elements as the contents of the 'root_record' element.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,147
Latest member
CarenSchni
Top