This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 14909 - Is method-type pattern in the serialization schema not well defined?
Summary: Is method-type pattern in the serialization schema not well defined?
Status: RESOLVED INVALID
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Serialization 3.0 (show other bugs)
Version: Working drafts
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Henry Zongaro
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-23 14:20 UTC by Gabriel Petrovay
Modified: 2011-11-23 16:48 UTC (History)
1 user (show)

See Also:


Attachments

Description Gabriel Petrovay 2011-11-23 14:20:48 UTC
http://www.w3.org/2010/xslt-xquery-serialization/schema-for-parameters-for-xslt-xquery-serialization.xsd defines

<xs:simpleType name="method-type">
  <xs:union>
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:enumeration value="html"/>
        <xs:enumeration value="text"/>
        <xs:enumeration value="xml"/>
        <xs:enumeration value="xhtml"/>
      </xs:restriction>
    </xs:simpleType>
    <xs:simpleType>
      <xs:restriction base="xs:QName">
        <xs:pattern value=".*:.*"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:union>
</xs:simpleType>

Does this make the following values valid method parameter values:
":"
":my-method"
"my-method:"

?

Why not having the pattern being:
<xs:pattern value=".+:.+"/>
?

".*:.*" is anyway a super-group of the valid QNames. What is actually wanted is: ".+:.+".
Comment 1 Gabriel Petrovay 2011-11-23 14:32:02 UTC
I know the final valid type is an intersection of the base type and the pattern in the restriction. Still, ".+:.+" would make the expected value explicit.
Comment 2 Michael Kay 2011-11-23 15:09:24 UTC
I think the pattern as given is actually OK. There are two conditions: it must be a valid QName, and it must contain a colon. The type as defined achieves this. It would be possible to specify a more restrictive pattern such as ".+:.+", but this is unnecessary as this would only exclude strings such as ":" which are not valid QNames in the first place.
Comment 3 Gabriel Petrovay 2011-11-23 15:27:27 UTC
(In reply to comment #2)
> I think the pattern as given is actually OK. There are two conditions: it must
> be a valid QName, and it must contain a colon. The type as defined achieves
> this. It would be possible to specify a more restrictive pattern such as
> ".+:.+", but this is unnecessary as this would only exclude strings such as ":"
> which are not valid QNames in the first place.

Yes, I understand that ".*:.*" is the minimum pattern that still enforces the validity of the method-type. If this is the reasoning behind, than this i not an issue anymore.

Thanks!