- From: Pete Cordell <petexmldev@codalogic.com>
- Date: Fri, 2 Mar 2012 09:47:28 -0000
- To: <bugzilla@jessica.w3.org>, <www-xml-schema-comments@w3.org>
I agree that change helps make sure the ##local(s) etc bind with the proper
part of the simpleType, but I don't think it prevents ##all being valid in
the test.
Maybe:
<xs:union>
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="##targetNamespace"/>
<xs:enumeration value="##local"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="xs:anyURI">
<xs:pattern value=""/>
<xs:pattern value="[^#].*"/>
<xs:pattern value="#"/>
<xs:pattern value="#[^#].*"/>
</xs:restriction>
</xs:union>
Would that work?
That allows things that don't start with two #s.
I made a little Perl script to test it:
#!/usr/bin/perl
pass( '' );
pass( 'foo' );
pass( '#all' );
pass( '#' );
fail( '##' );
fail( '##all' );
sub pass()
{
check( shift, 1 );
}
sub fail()
{
check( shift, 0 );
}
sub check()
{
my $in = shift;
my $want = shift;
$is_match = '0';
$is_match = '1' if( $in =~ /^(?:|[^#].*|#|#[^#].*)$/ );
# print "is_match: $is_match\n";
$res = 'fail';
$res = 'pass' if $ is_match == $want;
print "Reject " if $want == 0;
print "$in : $res\n";
}
HTH,
Pete Cordell
Codalogic Ltd
Interface XML to C++ the easy way using C++ XML
data binding to convert XSD schemas to C++ classes.
Visit http://codalogic.com/lmx/ or http://www.xml2cpp.com
for more info
----- Original Message -----
From: <bugzilla@jessica.w3.org>
To: <www-xml-schema-comments@w3.org>
Sent: Friday, March 02, 2012 8:57 AM
Subject: [Bug 16182] wildC035 and wildC036 valid for XSD 1.1?
> https://www.w3.org/Bugs/Public/show_bug.cgi?id=16182
>
> Michael Kay <mike@saxonica.com> changed:
>
> What |Removed |Added
> ----------------------------------------------------------------------------
> CC| |cmsmcq@blackmesatech.com,
> | |mike@saxonica.com
> Component|Microsoft tests |Structures: XSD Part 1
> Version|2006-11-06 |1.1 only
> AssignedTo|cmsmcq@blackmesatech.com |David_E3@VERIFONE.com
> Product|XML Schema Test Suite |XML Schema
> QAContact|public-xml-schema-testsuite
> |www-xml-schema-comments@w3.
> |@w3.org |org
>
> --- Comment #3 from Michael Kay <mike@saxonica.com> 2012-03-02 08:57:37
> UTC ---
> The relevant types (basicNamespaceList and specialNamespaceList) are
> defined
> like this:
>
> <xs:union memberTypes="xs:anyURI">
> <xs:simpleType>
> <xs:restriction base="xs:token">
> <xs:enumeration value="##targetNamespace"/>
> <xs:enumeration value="##local"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:union>
>
> I think what is needed is for the order of the union to be reversed, so
> the
> token comes before the anyURI.
>
> I'm reclassifying this as a spec bug.
>
> --
> 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 Friday, 2 March 2012 09:47:30 UTC