Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Omitting a field in XML
Message
From
28/09/2007 15:19:08
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
 
 
To
All
General information
Forum:
Internet
Category:
XML
Title:
Omitting a field in XML
Miscellaneous
Thread ID:
01257516
Message ID:
01257516
Views:
58
I have the following schema:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:element name="PRSDIE">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="D_NUMBER"/>
				<xs:element ref="D_SIZE"/>
				<xs:element ref="D_NUM_PORTS"/>
				<xs:element ref="D_PORT_TYPE"/>
				<xs:element ref="D_DESC"/>
				<xs:element ref="D_LOCATION"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="D_SIZE" type="xs:string"/>
	<xs:element name="D_PORT_TYPE" type="xs:string"/>
	<xs:element name="D_NUM_PORTS" type="xs:integer"/>
	<xs:element name="D_NUMBER" type="xs:string"/>
	<xs:element name="D_LOCATION" type="xs:string"/>
	<xs:element name="D_DESC" type="xs:string"/>
	<xs:element name="CAPCO1">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="PRSDIE" maxOccurs="unbounded"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>
I need to change it so all fields are optional, and the tags don't even need to exist in the file. Now if I omit the tags themselves I get an error when I import into a .NET dataset. Any advice out there?
Very fitting: http://xkcd.com/386/
Next
Reply
Map
View

Click here to load this message in the networking platform