Open sadiqkhoja opened 3 months ago
I've inferred that "the spec" above refers to XPath 1.0 (id
, 5.2.1 Unique IDs).
A few notes:
I can confirm that we're out of [XPath 1.0] spec as reported
We're also out of [XPath 1.0] spec according to the last NOTE in the quoted language, by treating the id
attribute as a unique identifier even in the absence of a DTD
This function is not included in the ODK XForms Specification (and according to my reading, this is explicit); but since we provide the functionality, I do consider it a bug
Both aspects of out-of-XPath-1.0-spec behavior are consistent with the native evaluators of each major browser (I checked in Chrome, Firefox, Safari); I would like to find a compliant implementation before we decide to address this
Q. If no DTD is defined then is
id
attribute implicitly considered as unique ID of the element node?
This is the current behavior, and as mentioned it is consistent with all of the major browsers. I believe the behavior is expected for HTML documents, and any non-HTML consideration is just unaddressed (I'd expect it never will be).
we are not handling DTD at this moment, right?
Correct.
I was curious if there is any precedent for DTD support or interest in it. Not that it's an exhaustive search, but this issue is the first to mention DTD across all of the getodk org.
As per the spec,
id
function selects elements by their unique ID and attribute for unique ID is declared using DTD.Q. If no DTD is defined then is
id
attribute implicitly considered as unique ID of the element node?Following test fails, because we are not handling DTD at this moment, right?
This issue probably just needs documentation.