PDA

View Full Version : Need schema help


jorge_msf
03-01-2005, 03:39 PM
Hi, everyone
I'm new to XML and schemas and i have the following question. It's possible to make a schema ignore elements that exists in the xml file but are not defined in the schema?

Example:

<root>
<element1>...</element1>
<element2>...</element2>
</root>

element2 is not defined in schema and i want im to ignore this when validating the xml file instead of give a "element not defined in schema" type of error.

Is possible to do this?

Thanks . :)

jorge_msf
03-01-2005, 05:40 PM
Ok, i find the solution in another forum. Ill post the solution here in hope that it help someone else.

<xs:element name="Content">
<xs:complexType mixed="true">
<xs:sequence>
<xs:any processContents="skip" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>

You can put any element inside node "Conten" and dont need to define them in the schema.

Bye.