- From: <bugzilla@jessica.w3.org>
- Date: Tue, 04 Jun 2013 08:32:45 +0000
- To: public-qt-comments@w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=22258
Bug ID: 22258
Summary: Provide function for easy matching of HTML and DITA
class attributes
Classification: Unclassified
Product: XPath / XQuery / XSLT
Version: Working drafts
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P2
Component: Functions and Operators 3.1
Assignee: mike@saxonica.com
Reporter: jirka@kosek.cz
QA Contact: public-qt-comments@w3.org
Several markup languages rely heavily on using values inside particular
attribute (usually named class) for specifying nature of element. It is typical
in HTML when you can have markup such <div class="main"> and you need matching
on @class here. But class attribute can have several values, some values are
needed for additional CSS styling, e.g. <div class="main ui-scrollable-pane
ui-border">.
In order to match such values you need to resort to patterns like
*[contains(concat(' ', @class, ' '), ' main ')]
Moreover matching should be case-insensitive. The similar approach is used in
DITA where specialized elements are by default processed by template for more
generic element which name is stored inside class attribute. DITA stylesheets
are full of patterns like:
*[contains(@class,' topic/related-links ')]
It would be very useful if there will be standard function which can test if
some token is present inside list of whitespace separated values, ideally this
match should be done case-insensitively.
It's very easy to write custom function for this, but this is so common
operation that native function that can be further optimized would be real
plus.
Something like:
class-matches(value as xs:string, text as xs:string) as xs:boolean
Jirka
--
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Tuesday, 4 June 2013 08:33:30 UTC