I'm receiving an xml message with unknown variable name elements... that is, they are not predefined...
I only know there can be 0 or more of those elements, allong with some other that are mandatory...
for example
<root>
<service>my service</service>
<resource>my resource</resource>
<action>update</action>
<parameters>
<field1>value1</field1>
<field2>value2</field2>
<field3>value3</field3>
</parameters>
</root>
that is, I don't know what will be passed as "parameters", I only know there will be 0 or more elements with a value, no deeper tag nesting allowed....
I was thinking about something like
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="root">
<xs:complexType>
<xs:sequence>
<xs:element name="service" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/>
<xs:element name="resource" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/>
<xs:element name="action" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/>
<xs:element name="parameters">
<xs:complexType>
<xs:element name="*" maxOccurs="unbounded">
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
of course, the hard part is
<xs:element name="*" maxOccurs="unbounded">
is it possible to do sucha a thing?
how can I define an xsd file that validates such a message?
--
I checked the w3c reference at
http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/datatypes.html#NCName
and it says:
"The ·lexical space· of NCName is the set of all strings which ·match· the NCName production of [Namespaces in XML]."
so what does it mean?
besides... could you recomend me some easy way to test compliance with an xsd definition?