Processing XML Validation Output Programmatically in Java

billmink

New Member
The problem I have to solve is the following:Given an XML file that "almost validates" using an XSD (or ideally NVDL) schema, how can I "fix" the file programmatically?("Almost validates" means that some elements will have attributes that they are not allowed to have. It is guaranteed that there will be no other validation errors. "Fixing" simply means deleting the offending attribute.)I tried using Woodstox's validating writer but for some reason it wouldn't accept my XSD as valid (granted, it's quite complicated with multiple imports and abstract types but it is valid).An alternative is an XML validation library that produces an output I can then parse/process and use to identify the attributes that need to be removed.Any other approach that produces the same end product is also welcome.
 
Back
Top