Mahmoud (archive)
Usenet Archive
- Joined
- Feb 2, 2006
- Messages
- 3
- Reaction score
- 0
Hi all,
I have a problem with xml that output from application I need to validate one of the values by using XSD schema The xml output like this
<?xml version="1.0" encoding="UTF-8"?>
<csv:csv xmlns:csv="http://xmlns.myapplication.com/2007/message- format/ csv" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.myapplication.com/2007/ message-format/csv right.xsd" > <csv:line> <csv:field>I</csv:field> <csv:field>3871</csv:field> <csv:field>0</csv:field> "i want to check this value" <csv:field>25042008</csv:field> <csv:field>0</csv:field> <csv:field>4233</csv:field> </csv:line> <csv:line> <csv:field>I</csv:field> <csv:field>3871</csv:field> <csv:field>29042008</csv:field> <csv:field>25042008</csv:field> <csv:field>6600183376</csv:field> <csv:field>4233</csv:field> <csv:field/> </csv:line> <csv:line> <csv:field>I</csv:field> <csv:field>3871</csv:field> <csv:field>29042008</csv:field> <csv:field>25042008</csv:field> </csv:line> </csv:csv>
I get the XSD schema like this
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:csv="http://xmlns.myapplication.com/2007/message- format/csv" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http:// xmlns.myapplication.com/2007/message-format/csv" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="csv">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="line">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="field" type="xs:string" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
But the problem that I want to check the value of the third tag <csv:field> to know if it contain 0 or 1 Can anyone help me to write this XSD
I have a problem with xml that output from application I need to validate one of the values by using XSD schema The xml output like this
<?xml version="1.0" encoding="UTF-8"?>
<csv:csv xmlns:csv="http://xmlns.myapplication.com/2007/message- format/ csv" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.myapplication.com/2007/ message-format/csv right.xsd" > <csv:line> <csv:field>I</csv:field> <csv:field>3871</csv:field> <csv:field>0</csv:field> "i want to check this value" <csv:field>25042008</csv:field> <csv:field>0</csv:field> <csv:field>4233</csv:field> </csv:line> <csv:line> <csv:field>I</csv:field> <csv:field>3871</csv:field> <csv:field>29042008</csv:field> <csv:field>25042008</csv:field> <csv:field>6600183376</csv:field> <csv:field>4233</csv:field> <csv:field/> </csv:line> <csv:line> <csv:field>I</csv:field> <csv:field>3871</csv:field> <csv:field>29042008</csv:field> <csv:field>25042008</csv:field> </csv:line> </csv:csv>
I get the XSD schema like this
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:csv="http://xmlns.myapplication.com/2007/message- format/csv" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http:// xmlns.myapplication.com/2007/message-format/csv" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="csv">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="line">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="field" type="xs:string" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
But the problem that I want to check the value of the third tag <csv:field> to know if it contain 0 or 1 Can anyone help me to write this XSD