 |
 |
 |
Hi Bill,
Watkins, Bill <bill.watkins@b...> writes:
> <QuotedStringList>
> "your dog.my_dog" "my_cat$your_cat"
> "their_rat"
> </QuotedStringList>
>
> [...]
>
> <xs:simpleType name="QUOTEDNAME_TYPE">
> <xs:restriction base="xs:string">
> <xs:pattern value='\s*"\S([^"]|\s)+\S"\s*'/>
> </xs:restriction>
> </xs:simpleType>
>
> <xs:simpleType name="QUOTEDNAMELIST_TYPE">
> <xs:list itemType="QUOTEDNAME_TYPE"/>
> </xs:simpleType>
The list-based approach won't works since you can have whitespaces inside
list values. In the example above your list will be chopped up as follows:
'"your' 'dog.my_dog"' '"my_cat$your_cat"' '"their_rat"'.
> <xs:simpleType name="listOfQuotedStrings">
> <xs:restriction base="xs:string">
> <xs:pattern value='(("[^"]*")\s+)*'/>
> </xs:restriction>
> </xs:simpleType>
This one won't work since it expects at least one whitespace after a
quoted string, even the last one.
> <xs:simpleType name="listOfQuotedStrings">
> <xs:restriction base="xs:string">
> <xs:pattern value='("[^"]*"(\s+"[^"]*")*)?'/>
> </xs:restriction>
> </xs:simpleType>
This one is almost there. The only thing you need to add is optional
whitespaces before the first quoted string and after the last (note
the newlines after <QuotedStringList> and before "your dog.my_dog"
as well as after "their_rat" and before </QuotedStringList> -- they
are part of the value):
<xs:pattern value='(\s*"[^"]*"(\s+"[^"]*")*\s*)?'/>
hth,
-boris
--
Boris Kolpackov
Code Synthesis Tools CC
http://www.codesynthesis.com
Open-Source, Cross-Platform C++ XML Data Binding
From mike@s... Fri Jan 05 12:49:15 2007
Received: from maggie.w3.org ([193.51.208.68])
by frink
|
 | 

|  |
These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.
|  |
| |
 |
 |
 |