***********************************************************
<?xml version="1.0" encoding="ISO-8859-1"?>
<testXML xmlns:xsi = " xsi:noNamespaceSchemaLocation = "testXSD.xsd">
<proc>
<nameOf> testName </nameOf>
<param>2005</param>
<param>test</param>
</proc>
</testXML>
*******************************************************
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xs:schema xmlns:xs="
<xs:element name="testXML">
<xs:complexType>
<xs:sequence>
<xs:element name="proc">
<xs:complexType>
<xs:sequence>
<xs:element name="nameOf" type="xs:string"/>
<xs:choice>
<xs:element name="param" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
<xs:element name="param" type="xs:double" minOccurs="1" maxOccurs="unbounded"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element></xs:schema>
Above is an xml file and the corresponding xsd file except for the fact that the param element in the xsd is defined twice. Basically what I want to do is create an array type structure where is the value between <param> in the xml is a string it will be detected as a string by the xsd and if its an int detected as an int and so on if i included floats or doubles etc. I saw this choice method on the web but it does not work because you cannot declare the param element twice in the same code.
Here is my dilema, I would like to be able to validate the following:
<param>2005</param>
<param>test</param>
<param>2.4</param>
where param can be any type of datatype so if its a string is goes to the string xsd or the int and so on.
Hopefully that made sense, I'll continue to probe anyway,cheers - Ace333.
<?xml version="1.0" encoding="ISO-8859-1"?>
<testXML xmlns:xsi = " xsi:noNamespaceSchemaLocation = "testXSD.xsd">
<proc>
<nameOf> testName </nameOf>
<param>2005</param>
<param>test</param>
</proc>
</testXML>
*******************************************************
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xs:schema xmlns:xs="
<xs:element name="testXML">
<xs:complexType>
<xs:sequence>
<xs:element name="proc">
<xs:complexType>
<xs:sequence>
<xs:element name="nameOf" type="xs:string"/>
<xs:choice>
<xs:element name="param" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
<xs:element name="param" type="xs:double" minOccurs="1" maxOccurs="unbounded"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element></xs:schema>
Above is an xml file and the corresponding xsd file except for the fact that the param element in the xsd is defined twice. Basically what I want to do is create an array type structure where is the value between <param> in the xml is a string it will be detected as a string by the xsd and if its an int detected as an int and so on if i included floats or doubles etc. I saw this choice method on the web but it does not work because you cannot declare the param element twice in the same code.
Here is my dilema, I would like to be able to validate the following:
<param>2005</param>
<param>test</param>
<param>2.4</param>
where param can be any type of datatype so if its a string is goes to the string xsd or the int and so on.
Hopefully that made sense, I'll continue to probe anyway,cheers - Ace333.