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:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
XML and Related Technologies
how to validate XML with reference to particular XML Shcema
vamshidhar nimbagiri
Ranch Hand
Posts: 61
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi
I have order.xml and order.xsd
i need to check whether order.xml is valid as per order.xsd
Could any body please tell me how to do that.
Thanks
Vamshi
Thanks,
Vamshidhar Nimbagiri
SCJP 5.0
Aryan Khan
Ranch Hand
Posts: 290
I like...
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); StringBufferInputStream f = new StringBufferInputStream(std); Document document = parser.parse(f); SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Source schemaFile = new StreamSource(new File("c:/xSugar/bcard.xsd")); Schema schema = factory.newSchema(schemaFile); // create a Validator instance, which can be used to validate an instance document Validator validator = schema.newValidator(); return true;
OCP/MCP/SCJP/SCWCD/IBM XML/SCMAD/SCEA-1
vamshidhar nimbagiri
Ranch Hand
Posts: 61
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks Ahmad
Thanks,
Vamshidhar Nimbagiri
SCJP 5.0
Don't get me started about those stupid
light bulbs
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
problem while passing file name as parameter
validation of XML w/ XSD... almost there...
How to create an XML using JDOM from a javabean and XSD
URI syntax in namespace
Why namespace information is not in attributes list
More...