Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within XML
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Tim Cooke
Campbell Ritchie
paul wheaton
Ron McLeod
Devaka Cooray
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Paul Clapham
Saloon Keepers:
Tim Holloway
Carey Brown
Piet Souris
Bartenders:
Forum:
XML and Related Technologies
unble to validate xml against schema
Jigar Naik
Ranch Hand
Posts: 763
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi
I have below xml xsd file.
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="message-packet"> <xs:complexType> <xs:sequence> <xs:element name="message" minOccurs="1" maxOccurs="1"> <xs:complexType> <xs:sequence> <xs:element name="message-text" minOccurs="1" maxOccurs="1" nillable="false"> <xs:simpleType> <xs:restriction base="xs:string"> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="message-code" type="xs:string" minOccurs="1" maxOccurs="1" nillable="true"> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="timestamp" minOccurs="1" maxOccurs="1" nillable="false"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:minLength value="6"></xs:minLength> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="sender" type="senderType" minOccurs="1" maxOccurs="1" nillable="false" /> <xs:element name="recipient" type="recipientType" minOccurs="1" maxOccurs="1" nillable="false" /> </xs:sequence> <xs:attribute name="type" use="required"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="individual"></xs:enumeration> <xs:enumeration value="bulk"></xs:enumeration> <xs:enumeration value="Individual"></xs:enumeration> <xs:enumeration value="Bulk"></xs:enumeration> <xs:enumeration value="INDIVIDUAL"></xs:enumeration> <xs:enumeration value="BULK"></xs:enumeration> </xs:restriction> </xs:simpleType> </xs:attribute> <xs:attribute name="priority" use="required"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:minLength value="0"></xs:minLength> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:complexType> </xs:element> <xs:complexType name="recipientType"> <xs:sequence> <xs:element name="contact" minOccurs="1" maxOccurs="50"> <xs:complexType> <xs:all> <xs:element name="message-type" type="xs:string" minOccurs="1" maxOccurs="1"> </xs:element> <xs:element name="mobile-number" minOccurs="1" maxOccurs="1" nillable="false"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:minLength value="5"></xs:minLength> <xs:maxLength value="20"></xs:maxLength> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="id" maxOccurs="1" minOccurs="0" type="xs:string"> </xs:element> </xs:all> <xs:attribute name="type" type="xs:string" use="required"> </xs:attribute> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> <xs:complexType name="senderType"> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="dnis"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:minLength value="0"></xs:minLength> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:schema>
and below is my xml file which i am trying to validate it.
ERROR Message
parse cvc-elt.1: Cannot find the declaration of element 'message-packet'.
XML File
<message-packet priority="normal" type="individual"> <message> <message-text>test message</message-text> <message-code>001</message-code> </message> <timestamp>2009-01-01 10:20:35</timestamp> <sender dnis="7575">JIGAR</sender> <recipient> <contact type="SMS"> <message-type>IVR</message-type> <mobile-number>9619388664</mobile-number> <id>IVR2009010100004</id> </contact> </recipient> </message-packet>
Can anybody help me out solving this issue ???
Jigar Naik
Paul Clapham
Sheriff
Posts: 28400
100
I like...
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
That means the parser couldn't find the schema file.
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
MS Exchange web service: If the 'nillable' attribute is false in the schema, the 'xsi:nil' attribute
Axis 1.4 throwing org.xml.sax.SAXException: Invalid element
dynamic attribute definition in xsd
schema generation
XML valiadation using schema
More...