W3C home > Mailing lists > Public > public-qt-comments@w3.org > September 2012

[Bug 18973] New: We need a way to write XPath expressions within elements

From: <bugzilla@jessica.w3.org>
Date: Sat, 22 Sep 2012 12:32:17 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-18973-523@http.www.w3.org/Bugs/Public/>

           Summary: We need a way to write XPath expressions within
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLT 3.0
        AssignedTo: mike@saxonica.com
        ReportedBy: vdv@dyomedea.com
         QAContact: public-qt-comments@w3.org

XPath is becoming more powerful with each new version and as syntax is getting
more complex attributes become less and less adequate to write complex XPath

 * it is not possible to use CDATA sections to avoid escaping common characters
such as "<".
 * many tools do not preserve white spaces (and indentation) within attributes.
 * XML comments cannot be embedded in attributes.

Being able to write XPath expressions within elements content would then be
really handy for complex XPath expressions.

I can think of two options to achieve this.

The first one would be to generalize AVTs so that XPath expressions can be
embedded within text nodes using curly brackets. Florent Georges mentioned
something along these lines yesterday at the XML Summer School but I don't find
the feature in the latest working draft and it seemed to be restricted to a
very specific kind of usage anyway. 

The second option would be to define and xsl:select element that could be use
anywhere where @select attributes are allowed in a transformation and would
have exactly the same meaning and content (any @select attribute could be
replaced by an xsl:select element with the exact same content and any
xsl:select element could be replaced by a @select attribute (after having
removed comments and PIs)):

<xsl:variable select="... long XPath expression..."/>

would be equivalent to

  <xsl:select>... long XPath expression...</xsl:select>

Being only syntactic sugar, this should be a rather minor modification but it
would make our life much easier!

Would that make sense?



Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Saturday, 22 September 2012 12:32:22 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:49 UTC