DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9041>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9041 schema validation with substitutionGroup from another namespace Summary: schema validation with substitutionGroup from another namespace Product: Xerces2-J Version: 2.0.0 Platform: All OS/Version: Other Status: NEW Severity: Normal Priority: Other Component: XML Schema Structures AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] Hi, I think there might be a bug in schema validation when a substitution group references an element in another namespace. As an example I get an error when validating the following document: <?xml version="1.0" encoding="UTF-8"?> <nc:netcdf xmlns:nc="http://nebbia.scd.ucar.edu/xml/test/netcdf" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cf="http://nebbia.scd.ucar.edu/xml/test/netcdf-cf" xsi:schemaLocation="http://nebbia.scd.ucar.edu/xml/test/netcdf http://nebbia.scd.ucar.edu/xml/test/netcdf.xsd http://nebbia.scd.ucar.edu/xml/test/netcdf-cf http://nebbia.scd.ucar.edu/xml/test/netcdf-cf.xsd"> <nc:variable name="P0" /> <nc:latitude name="lat" /> <cf:latitude name="lat" /> </nc:netcdf> where the two schema defintions are as follows: <?xml version="1.0" encoding="UTF-8" ?> <xsd:schema targetNamespace="http://nebbia.scd.ucar.edu/xml/test/netcdf" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:nc="http://nebbia.scd.ucar.edu/xml/test/netcdf" elementFormDefault="qualified"> <xsd:element name="netcdf" type="nc:NetcdfType" /> <xsd:complexType name="NetcdfType"> <xsd:sequence> <xsd:element ref="nc:variable" minOccurs="0" maxOccurs="unbounded" /> </xsd:sequence> </xsd:complexType> <xsd:element name="variable" type="nc:VariableType" /> <xsd:complexType name="VariableType"> <xsd:attribute name="name" type="xsd:string" use="optional" /> </xsd:complexType> <xsd:element name="latitude" type="nc:VariableType" substitutionGroup="nc:variable" /> </xsd:schema> and: <?xml version="1.0" encoding="UTF-8" ?> <xsd:schema targetNamespace="http://nebbia.scd.ucar.edu/xml/test/netcdf-cf" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:nc="http://nebbia.scd.ucar.edu/xml/test/netcdf" xmlns:cf="http://nebbia.scd.ucar.edu/xml/test/netcdf-cf" elementFormDefault="qualified"> <xsd:import namespace="http://nebbia.scd.ucar.edu/xml/test/netcdf" schemaLocation="http://nebbia.scd.ucar.edu/xml/test/netcdf-cf.xsd" /> <xsd:element name="latitude" type="nc:VariableType" substitutionGroup="nc:variable" /> </xsd:schema> the error I get when trying to validate with an instance of org.apache.xerces.parsers.SAXParser is: [Error] example.ncx:8:29: cvc-complex-type.2.4.a: Invalid content starting with element 'cf:latitude'. The content must match '("http://nebbia.scd.ucar.edu/xml/test/netcdf":variable){0-UNBOUNDED}'. (I have set the followinf=g features on: parser.setFeature( "http://xml.org/sax/features/validation", true); parser.setFeature( "http://xml.org/sax/features/namespaces",true); parser.setFeature( "http://apache.org/xml/features/validation/schema",true); ) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
