You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ws.apache.org by Rachna Jotwani <rj...@dag.com> on 2013/07/17 18:37:55 UTC
INVALID_CHARACTER_ERR
Hi
I am using the Apache XMLSchema apis to read XSDs. Using the below code.
I have over 100 xsds.
I get the following error, but it doesn't tell me which file has the invalid
character.
schemaCol.read method reads all dependent xsds as well, so it is difficult
to guess which xsd it could be.
Can someone give me some ideas to debug this?
Thanks
Rachna
java.lang.RuntimeException: org.w3c.dom.DOMException: INVALID_CHARACTER_ERR:
An invalid or illegal XML character is specified.
at
org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.ja
va:1898)
at
org.apache.ws.commons.schema.SchemaBuilder.handleInclude(SchemaBuilder.java:
1644)
at
org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuil
der.java:219)
at
org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:121)
at
org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.ja
va:512)
at
org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.ja
va:496)
File file = new File(fileName);
DocumentBuilderFactory documentBuilderFactory =
DocumentBuilderFactory.newInstance();
documentBuilderFactory.setNamespaceAware(true);
Document doc = documentBuilderFactory.newDocumentBuilder().
parse(fileName);
XmlSchemaCollection schemaCol = new XmlSchemaCollection();
schemaCol.setBaseUri(doc.getBaseURI());
XmlSchema schema = schemaCol.read(doc, fileName, null);