W3C home > Mailing lists > Public > public-qt-comments@w3.org > June 2007

[Bug 4600] [XSLT 2.0] validating duplicated attributes

From: <bugzilla@wiggum.w3.org>
Date: Wed, 06 Jun 2007 18:52:28 +0000
To: public-qt-comments@w3.org
Message-Id: <E1Hw0cO-0007Lb-VQ@wiggum.w3.org>


           Summary: [XSLT 2.0] validating duplicated attributes
           Product: XPath / XQuery / XSLT
           Version: Recommendation
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLT 2.0
        AssignedTo: mike@saxonica.com
        ReportedBy: mike@saxonica.com
         QAContact: public-qt-comments@w3.org

We say in 5.7.1 Constructing Complex Content, rule 9: 

If an attribute A in the result sequence has the same name as another attribute
B that appears later in the result sequence, then attribute A is discarded from
the result sequence.

A strict reading suggests that the processor is not allowed to perform any
schema-based validation on attribute A until it is confident that it will not
be discarded under this rule. This also suggests that in such circumstances the
processor should not attempt any static validation of the attribute. For
example, it appears to be incorrect to report an error for:

  <xsl:attribute name="a" xsl:type="xs:integer">abcd</xsl:attribute>
  <xsl:copy-of select="@*"/>

until you have established that @* does not contain an attribute named "a".

This seems an unreasonable constraint on the implementation which gives no user
benefit. It's very unlikely that any users would wish such behaviour or rely on
it. I propose that we should add to rule 9. "Before discarding attribute A, the
processor MAY perform validation on the value of the attribute and report any
validity errors that would arise if attribute B were not present."
Received on Wednesday, 6 June 2007 18:52:34 UTC

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