From thomas.scheffler at uni-jena.de Mon Oct 5 06:31:57 2015 From: thomas.scheffler at uni-jena.de (Thomas Scheffler) Date: Mon, 5 Oct 2015 15:31:57 +0200 Subject: [jdom-interest] Schema aware parsing bug Message-ID: <56127BCD.7000402@uni-jena.de> Hi, I try to parse a document schema aware. There is an attribute defined as fixed="yes". Even if the attribute is not present in the source, it will be present in the JDOM Element. This should be the behavior of default="yes" if the attribute is not present. Semantically the fixed='yes' means the default is 'no' if the attribute is not present. This has currently a huge impact we have @invalid='yes' fixed by a 3rd party schema. I use Oracle JAVA 1.8.0_51 and put a simple test to show the error in the attachment. Hope that it can be fixed soon... regards, Thomas -------------- next part -------------- A non-text attachment was scrubbed... Name: SchemaBug.java Type: text/x-java Size: 535 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: schemabug.xml Type: text/xml Size: 153 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: schemabug.xsd Type: text/xml Size: 479 bytes Desc: not available URL: From mike at saxonica.com Mon Oct 5 07:00:50 2015 From: mike at saxonica.com (Michael Kay) Date: Mon, 5 Oct 2015 15:00:50 +0100 Subject: [jdom-interest] Schema aware parsing bug In-Reply-To: <56127BCD.7000402@uni-jena.de> References: <56127BCD.7000402@uni-jena.de> Message-ID: <1A244C0F-F74E-43C2-BCFA-C9C09737030E@saxonica.com> I don?t think your interpretation of ?fixed? is correct. XML Schema part 1, section 3.2.1: "fixed indicates that the attribute value if present must equal the supplied constraint value, and if absent receives the supplied value as for default.? Michael Kay Saxonica > On 5 Oct 2015, at 14:31, Thomas Scheffler wrote: > > Hi, > > I try to parse a document schema aware. There is an attribute defined as fixed="yes". Even if the attribute is not present in the source, it will be present in the JDOM Element. This should be the behavior of default="yes" if the attribute is not present. > Semantically the fixed='yes' means the default is 'no' if the attribute is not present. > This has currently a huge impact we have @invalid='yes' fixed by a 3rd party schema. > > I use Oracle JAVA 1.8.0_51 and put a simple test to show the error in the attachment. Hope that it can be fixed soon... > > regards, > > Thomas > _______________________________________________ > To control your jdom-interest membership: > http://www.jdom.org/mailman/options/jdom-interest/youraddr at yourhost.com