This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27369 - [XDM 3.1] Multiple entity declarations
Summary: [XDM 3.1] Multiple entity declarations
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Data Model 3.1 (show other bugs)
Version: Last Call drafts
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Norman Walsh
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-19 16:14 UTC by Michael Kay
Modified: 2015-11-09 19:35 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2014-11-19 16:14:42 UTC
XDM 3.1 section 5.15 (and similarly 5.16) says

"The dm:unparsed-entity-public-id accessor returns the public identifier of an unparsed external entity declared in the specified document. If no entity with the name specified in $entityname exists, or if the entity is not an external unparsed entity, or if the entity has no public identifier, the empty sequence is returned."

It doesn't say what happens if there is more than one declaration with the specified entity name. 

The Infoset (section 2.9) exposes all the entities: "There is an unparsed entity information item for each unparsed general entity declared in the DTD."

We should adopt the answer given in the XML recommendation, section 4.2:

"If the same entity is declared more than once, the first declaration encountered is binding."

Technically I guess this depends on the order of unparsed entity information items in the Infoset respecting the order of entity declarations in the source document.

I am adding an XSLT 3.0 test that assumes this resolution. (Saxon currently takes the last one encountered).
Comment 1 Michael Kay 2014-11-19 16:17:58 UTC
The incident (and requirement) that triggers this is described here:

https://saxonica.plan.io/issues/2187
Comment 2 Norman Walsh 2014-12-01 22:48:49 UTC
Per the discussion at the telcon of 25 November, 2014, I have made the following changes to the XDM 3.1 spec.

1. I added the following paragraph to the end of section 3.2:

Furthermore, construction of an instance of the data model from an Infoset is only gauranteed to be well-defined for Infosets that could have been derived from a conforming XML document.

2. I added the following prose to the last paragraph of section 6.1.1:

There can be at most one unparsed entity associated with any given name. Conforming XML documents may include more than one unparsed entity declaration for the same name, but XML mandates that only the first such declaration is significant.
Comment 3 Michael Kay 2015-11-09 19:35:42 UTC
In addition, a note was added to the function specifications in XSLT 3.0