[
https://issues.apache.org/jira/browse/XERCESJ-1674?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mukul Gandhi resolved XERCESJ-1674.
-----------------------------------
Assignee: Mukul Gandhi
Resolution: Fixed
The fix for this issue, has been committed with SVN revision 1868498.
> Namespace issue with xs:assert within xs:override
> -------------------------------------------------
>
> Key: XERCESJ-1674
> URL: https://issues.apache.org/jira/browse/XERCESJ-1674
> Project: Xerces2-J
> Issue Type: Bug
> Affects Versions: 2.11.0
> Reporter: Patrick Gratz
> Assignee: Mukul Gandhi
> Priority: Major
>
> When using xs:assert within an xs:override Xerces seems to have problems with
> resolving namespaces that are not defined in the base schema. Consequently,
> the following instance doesn't validate against the given schema because the
> mets prefix seems to be unknown.:
> {code:xml|title=example_instance.xml}
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <mets xmlns="http://www.loc.gov/METS/"
> xmlns:xlink="http://www.w3.org/1999/xlink" TYPE="delete"
> cellar-mets:version="3.0"
>
> PROFILE="http://publications.europa.eu/mdr/mets/cellar-mets-3_profile.xml"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:cellar-mets="http://publications.europa.eu/cellar-mets-extensions"
> xsi:schemaLocation="http://www.loc.gov/METS/
> http://www.loc.gov/standards/mets/version111/mets.xsd">
> <metsHdr CREATEDATE="2016-08-22T10:30:01.540+02:00">
>
> <metsDocumentID>celex_02009R1223-20150716_delete_item</metsDocumentID>
> </metsHdr>
>
> <structMap ID="structMap_1">
> <div TYPE="work" CONTENTIDS="celex:02009R1223-20150716">
> <div TYPE="expression"
> CONTENTIDS="celex:02009R1223-20150716.ENG">
> <div TYPE="manifestation"
> CONTENTIDS="celex:02009R1223-20150716.ENG.fmx4">
> <fptr
> CONTENTIDS="celex:02009R1223-20150716.ENG.fmx4.L_2009342EN.01020304.tif"/>
> </div>
> </div>
> </div>
> </structMap>
> </mets>
> {code}
> {code:xml|title=example_schema.xsd}
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
> xmlns="http://www.loc.gov/METS/"
> xmlns:mets="http://www.loc.gov/METS/"
> xmlns:xlink="http://www.w3.org/1999/xlink"
> targetNamespace="http://www.loc.gov/METS/"
> elementFormDefault="qualified" attributeFormDefault="unqualified"
> vc:minVersion="1.1"
> version="3.0">
> <xs:import namespace="http://www.w3.org/1999/xlink"
> schemaLocation="http://www.loc.gov/standards/xlink/xlink.xsd"/>
> <xs:override
> schemaLocation="http://www.loc.gov/standards/mets/version111/mets.xsd">
> <xs:complexType name="structMapType">
> <xs:sequence>
> <xs:element name="div" type="divType">
> <xs:annotation>
> <xs:documentation xml:lang="en"> The structural divisions
> of the hierarchical
> organization provided by a <structMap> are
> represented by division
> <div> elements, which can be nested to any depth.
> Each <div>
> element can represent either an intellectual (logical)
> division or a physical
> division. Every <div> node in the structural map
> hierarchy may be
> connected (via subsidiary <mptr> or <fptr>
> elements) to content
> files which represent that div's portion of the whole
> document.
> </xs:documentation>
> </xs:annotation>
> </xs:element>
> </xs:sequence>
> <xs:attribute name="ID" type="xsd:ID" use="optional"/>
> <xs:attribute name="TYPE" type="xsd:string" use="optional"/>
> <xs:attribute name="LABEL" type="xsd:string" use="optional"/>
> <xs:anyAttribute namespace="##other" processContents="lax"/>
> <xs:assert test="child::mets:div/@TYPE = ('work', 'dossier',
> 'agent', 'event')"
> xpathDefaultNamespace="##targetNamespace">
> <xs:annotation>
> <xs:documentation xml:lang="en">The root div within a
> structMap has to be either of
> type 'work', 'dossier' or 'agent'.</xs:documentation>
> <xs:appinfo>
> <metsSection>structMap</metsSection>
> </xs:appinfo>
> </xs:annotation>
> </xs:assert>
> </xs:complexType>
> </xs:override>
> </xs:schema>
> {code}
> Replacing the mets prefix with a wildcard or adding it to the base schema
> will cause a successful validation.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]