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
xml parsing problem using xerces
Nischal Tanna
Ranch Hand
Posts: 182
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi All
I am using jdk 1.5 and latest version of xerces
the code below :
String W3C_XML_SCHEMA = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; URL fullUrl = new URL("<some url which shall return an xml as a text output>"); HttpURLConnection conn = (HttpURLConnection)fullUrl.openConnection(); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(true); factory.setAttribute(W3C_XML_SCHEMA, "http://www.w3.org/2001/XMLSchema"); factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource",new File("my_schema.xsd")); factory.setValidating(true); DocumentBuilder builder = factory.newDocumentBuilder(); Document doc = builder.parse(conn.getInputStream());
gives the below exception:
java.lang.IllegalArgumentException: <a href="http://java.sun.com/xml/jaxp/properties/schemaLanguage" target="_blank" rel="nofollow">http://java.sun.com/xml/jaxp/properties/schemaLanguage</a> at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.setAttribute(DocumentBuilderFactoryImpl.java:118) at ValidateXMLTest.main(ValidateXMLTest.java:140)
Any solution ?
Thnx
Paul Sturrock
Bartender
Posts: 10336
I like...
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Moving to our XML forum...
JavaRanch FAQ
HowToAskQuestionsOnJavaRanch
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Validation with JAXP and XML Schema
How to validate XML against DTD
Help for warning: src-import.0: Failed to read imported schema document
Validation with JAXP and XML Schema
Throws IllegalArguementException when validating XML with schema
More...