Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I remove the duplicate attributes reported by the xerces SAX2 parser?

0
Posted

How do I remove the duplicate attributes reported by the xerces SAX2 parser?

0

Very strange. For example, when I run “SAX2Print” (one of the example programs for using the SAX2 parser provided by Xerces), I get the following output: The first “visibleTo” attribute is the one I actually put on the element inside my .XML file. The second one is the default value specified for the element in the .XSD (W3C schema defition) file. As far as I can tell, these duplicate attributes happen in the following situation: 1. Using the Xerces SAX2 parser 2. Validation is ON 3. Your schema has attributes with default values specified 4. Hour XML file specifies a non-default value 5. You are using a W3C schema file (it works with just an ordinary DTD). What happens is that xerces reports the value set on the attribute, AND the default from the schema. I think this is a bug in the Xerces parser. I dont know how to fix it, except to check for the duplicate in your own code. Sorry.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123