0

I am transforming an XML into another XML using dom4j. Now I need to validate the transformed XML with an external XSD file which I m doing through SAXParserFactory.

When I run the program, there is an exception with message

violation of Unique Particle Attribution

How can I disable this Unique Particle Attribution in my program?

Petru Gardea
  • 21,373
  • 2
  • 50
  • 62
user968813
  • 314
  • 1
  • 4
  • 14

1 Answers1

1

Most likely this should address your problem:

http://xerces.apache.org/xerces2-j/features.html#validation.schema-full-checking

Petru Gardea
  • 21,373
  • 2
  • 50
  • 62
  • Seeking help from the suggested page, I am writing now: SAXParserFactory valfactory = SAXParserFactory.newInstance(); SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); valfactory.setFeature("http://apache.org/xml/features/validation/schema-full-checking", false); valfactory.setSchema(schemaFactory.newSchema(new File("XSD/myXSD.xsd")); But still it is giving: org.xml.sax.SAXParseException with message "violate "Unique Particle Attribution" Please advice where I am going wrong. Thanks !!! – user968813 Jan 24 '12 at 11:59
  • I was working applying it on incorrect object. Now I am applying it on schemaFactory, & it is workign fine. Thanks !!! – user968813 Jan 25 '12 at 10:01