Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Omitting a field in XML
Message
From
02/10/2007 05:00:02
 
 
To
01/10/2007 23:27:13
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
Internet
Category:
XML
Miscellaneous
Thread ID:
01257516
Message ID:
01257829
Views:
14
This message has been marked as the solution to the initial question of the thread.
Hi,

The minOccurs attribute should be in the sequence declaration. Try:
><xs:element ref="O_DEPT" minOccurs="0"/>
etc. (Remove the existing minOccurs)
HTH,
Viv

>Here is my new schema:
>
><?xml version="1.0" encoding="UTF-8"?>
><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
>	<xs:element name="PRSORDER">
>		<xs:complexType>
>			<xs:sequence>
>				<xs:element ref="O_DEPT"/>
>				<xs:element ref="O_PART"/>
>				<xs:element ref="O_DESC"/>
>				<xs:element ref="O_PRODNO"/>
>				<xs:element ref="O_RESP"/>
>				<xs:element ref="O_OPER"/>
>				<xs:element ref="O_MACH"/>
>				<xs:element ref="O_WRK_CTR"/>
>				<xs:element ref="O_PREV_WRK_CTR"/>
>				<xs:element ref="O_NEXT_WRK_CTR"/>
>				<xs:element ref="O_TOOL_NO"/>
>				<xs:element ref="O_QTY_ORD"/>
>				<xs:element ref="O_BAL"/>
>				<xs:element ref="O_ACT"/>
>				<xs:element ref="O_DUE_YMD"/>
>				<xs:element ref="O_START_YMD"/>
>				<xs:element ref="O_COMP_YMD"/>
>				<xs:element ref="O_CUT_IN_DATE_YMD"/>
>				<xs:element ref="O_START_TIME"/>
>				<xs:element ref="O_START_FLAG"/>
>				<xs:element ref="O_COMP_FLAG"/>
>				<xs:element ref="O_CUR_OP_FLAG"/>
>				<xs:element ref="O_DDATE_CHG_FLAG"/>
>				<xs:element ref="O_START_TIME_MSG"/>
>				<xs:element ref="O_ALLOY"/>
>				<xs:element ref="O_HEAT_TREAT_CODE"/>
>			</xs:sequence>
>		</xs:complexType>
>	</xs:element>
>	<xs:element name="O_DEPT" type="xs:string" minOccurs="0"/>
>	<xs:element name="O_PART" type="xs:string" minOccurs="0"/>
>	<xs:element name="O_DESC" type="xs:string" minOccurs="0"/>
>	<xs:element name="O_PRODNO" type="xs:string" minOccurs="0"/>
>	<xs:element name="O_RESP" type="xs:string" minOccurs="0"/>
>	<xs:element name="O_OPER" type="xs:string" minOccurs="0"/>
>	<xs:element name="O_MACH" type="xs:string" minOccurs="0"/>
>	<xs:element name="O_WRK_CTR" type="xs:string" minOccurs="0"/>
>	<xs:element name="O_PREV_WRK_CTR" type="xs:string" minOccurs="0"/>
>	<xs:element name="O_NEXT_WRK_CTR" type="xs:string" minOccurs="0"/>
>	<xs:element name="O_TOOL_NO" type="xs:string" minOccurs="0"/>
>	<xs:element name="O_QTY_ORD" type="xs:integer" minOccurs="0"/>
>	<xs:element name="O_BAL" type="xs:integer" minOccurs="0"/>
>	<xs:element name="O_ACT" type="xs:float" minOccurs="0"/>
>	<xs:element name="O_DUE_YMD" type="xs:string" minOccurs="0"/>
>	<xs:element name="O_START_YMD" type="xs:string" minOccurs="0"/>
>	<xs:element name="O_COMP_YMD" type="xs:string" minOccurs="0"/>
>	<xs:element name="O_CUT_IN_DATE_YMD" type="xs:string" minOccurs="0"/>
>	<xs:element name="O_START_TIME" type="xs:int" minOccurs="0"/>
>	<xs:element name="O_START_FLAG" type="xs:string" minOccurs="0"/>
>	<xs:element name="O_COMP_FLAG" type="xs:string" minOccurs="0"/>
>	<xs:element name="O_CUR_OP_FLAG" type="xs:string" minOccurs="0"/>
>	<xs:element name="O_DDATE_CHG_FLAG" type="xs:string" minOccurs="0"/>
>	<xs:element name="O_START_TIME_MSG" type="xs:string" minOccurs="0"/>
>	<xs:element name="O_ALLOY" type="xs:string" minOccurs="0"/>
>	<xs:element name="O_HEAT_TREAT_CODE" type="xs:string" minOccurs="0"/>
>	<xs:element name="CAPCO1">
>		<xs:complexType>
>			<xs:sequence>
>				<xs:element ref="PRSORDER" maxOccurs="unbounded"/>
>			</xs:sequence>
>		</xs:complexType>
>	</xs:element>
></xs:schema>
>
>Here is the error I am getting:
>"The 'minOccurs' attribute cannot be present. An error occurred at file:///c:/vfp/ka/runtime/dn196201.xsd, (35, 3)."
>
>
>
>>minOccurs=0 ?
>>
>>>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?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform