Skip to content

296 Allow default-namespace=##any#1181

Merged
ndw merged 2 commits intoqt4cg:masterfrom
michaelhkay:296-default-namespace-auto
Jun 11, 2024
Merged

296 Allow default-namespace=##any#1181
ndw merged 2 commits intoqt4cg:masterfrom
michaelhkay:296-default-namespace-auto

Conversation

@michaelhkay
Copy link
Contributor

Allows the default namespace for elements and types to have the special value "##any", which causes unprefixed QNames to match elements in any namespace. Use cases include:

  • Casual ad-hoc XPath queries, where over-retrieval isn't a problem
  • Use with HTML, where it can be unpredictable whether elements will be in a namespace, and where users are accustomed to browser behaviour with its "wilful violation" of the XPath 1.0 specification
  • Any environment where multiple namespaces are in use for variants of what is essentially the same vocabulary of element names (for example, where the XML designer has made the mistake of versioning the namespace URI)

@michaelhkay
Copy link
Contributor Author

Fix #296

@michaelhkay michaelhkay force-pushed the 296-default-namespace-auto branch from 7788d3a to ad0388c Compare April 30, 2024 22:47
@michaelhkay michaelhkay added XPath An issue related to XPath XQuery An issue related to XQuery XSLT An issue related to XSLT Feature A change that introduces a new feature Tests Needed Tests need to be written or merged labels Apr 30, 2024
Copy link
Contributor

@ChristianGruen ChristianGruen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it’s unlikely that ##any is already widely used in our solar system, a note would be helpful that explains the rationale behind this particular string.

At least for XQuery, explicit syntax feels safer to me (to avoid typos such as #any):

(: which, I assume, will return the element :)
declare default element namespace any;
<xml:x/>/self::x

In proprietary interfaces, null, undefined or anything else could be supplied to indicate this special case.

@michaelhkay
Copy link
Contributor Author

Fix #379

@ndw
Copy link
Contributor

ndw commented Jun 5, 2024

The CG agreed to merge this PR at the Prague f2f.

@ndw ndw added the Propose Merge without Discussion Change is editorial or minor label Jun 5, 2024
@ndw
Copy link
Contributor

ndw commented Jun 11, 2024

The CG agreed to merge this PR without further discussion at meeting 81.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature A change that introduces a new feature Tests Needed Tests need to be written or merged XPath An issue related to XPath XQuery An issue related to XQuery XSLT An issue related to XSLT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants