[ https://issues.apache.org/jira/browse/XERCESJ-1599?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mukul Gandhi updated XERCESJ-1599: ---------------------------------- Fix Version/s: 2.12.0 > Prefix not resolved corectly when overriding an element > ------------------------------------------------------- > > Key: XERCESJ-1599 > URL: https://issues.apache.org/jira/browse/XERCESJ-1599 > Project: Xerces2-J > Issue Type: Bug > Components: XML Schema 1.1 Structures > Affects Versions: 2.11.0 > Reporter: Octavian Nadolu > Assignee: Mukul Gandhi > Fix For: 2.12.0 > > > If I validate the following schema "schema.xsd" I get an error: > "s4s-att-invalid-value: Invalid attribute value for 'ref' in element > 'element'. Recorded reason: UndeclaredPrefix: Cannot resolve 'ns:link' as a > QName: the prefix 'ns' is not declared." > The prefix "ns" is declared correctly in the "schema.xsd" schema, so there > should be no error reported. It seems that the validation context is not set > correctly, it uses the namespace declaration from the "override.xsd" schema > instead of "schema.xsd". If I declare the "ns" prefix in the "override.xsd" > schema there is no error. > You can reproduce the issue on the xml-schema-1.1-dev branch. > ----------- schema.xsd----------------------- > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > targetNamespace="schemaNS" xmlns:ns="schemaNS"> > <xs:override schemaLocation="override.xsd"> > <xs:element name="person"> > <xs:complexType> > <xs:sequence> > <xs:element name="name"/> > <xs:element name="email"/> > <xs:element ref="ns:link"/> > </xs:sequence> > </xs:complexType> > </xs:element> > </xs:override> > > <xs:element name="link"/> > </xs:schema> > ------------------------------------------- > ----------------override.xsd----------- > <?xml version="1.0" encoding="UTF-8"?> > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > targetNamespace="schemaNS"> > <xs:element name="person"> > <xs:complexType> > <xs:sequence> > <xs:element name="name"/> > <xs:element name="email"/> > </xs:sequence> > </xs:complexType> > </xs:element> > </xs:schema> > --------------------------------------------- -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: j-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: j-dev-h...@xerces.apache.org