Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


XSV fails on negative regexp (eg mimetype of MPEG7)

From: Heiko Studt <studt@---.----------.-->
To: xmlschema-dev@--.---
Date: 9/11/2007 2:04:00 PM
Hi,

XSV seems to fail on xsd-allowed 'negated' regular expressions in
patterns. This breaks the support of MPEG7:mimetype. (urn:mpeg:mpeg7:schema:2004)
Allthough XSV documents lacks functionality in some parts of RegExp, 
this lack is not documented on its project page.


The failing pattern follows (copied out of MPEG7 V2):
---
<simpleType name="mimeType">
  <restriction base="string">
    <whiteSpace value="collapse"/>
<pattern 
value='[&#x21;-&#x7f;-[\(\)&lt;&gt;@,;:\\"/\[\]\?=]]+/[&#x21;-&#x7f;-[\(\)&lt;&gt;@,;:\\"/\[\]\?=]]+'/>
  </restriction>
</simpleType>
---


Changed to the following, the pattern seems to work right again, but
after a slept night I am not 100% sure wether it is the same
semantically; MIME is defined in RFC 2045 (5.1 - MIME), but I don't 
see the special handling of &#x21; ("!").
---
<simpleType name="mimeType">
  <restriction base="string">
    <whiteSpace value="collapse"/>
<pattern 
value='(&#x21;|[^&#x7f;\(\)&lt;&gt;@,;:\\"/\[\]\?=])+/(&#x21;|[^&#x7f;\(\)&lt;&gt;@,;:\\"/\[\]\?=])+'/>
  </restriction>
</simpleType>
---


RFC 2045 MIME (Part 1):
---
5.1.  Syntax of the Content-Type Header Field

   In the Augmented BNF notation of RFC 822, a Content-Type header field
   value is defined as follows:

     content := "Content-Type" ":" type "/" subtype
                *(";" parameter)
                ; Matching of media type and subtype
                ; is ALWAYS case-insensitive.

     type := discrete-type / composite-type

     discrete-type := "text" / "image" / "audio" / "video" /
                      "application" / extension-token

     composite-type := "message" / "multipart" / extension-token

     extension-token := ietf-token / x-token

     ietf-token := <An extension token defined by a
                    standards-track RFC and registered
                    with IANA.>

     x-token := <The two characters "X-" or "x-" followed, with
                 no intervening white space, by any token>

     subtype := extension-token / iana-token

     iana-token := <A publicly-defined extension token. Tokens
                    of this form must be registered with IANA
                    as specified in RFC 2048.>

     parameter := attribute "=" value

     attribute := token
                  ; Matching of attributes
                  ; is ALWAYS case-insensitive.

     value := token / quoted-string

     token := 1*<any (US-ASCII) CHAR except SPACE, CTLs,
                 or tspecials>

     tspecials :=  "(" / ")" / "<" / ">" / "@" /
                   "," / ";" / ":" / "\" / <">
                   "/" / "[" / "]" / "?" / "="
                   ; Must be in quoted-string,
                   ; to use within parameter values
---


According to the example of http://www.w3.org/TR/xmlschema-2/#rf-pattern
the "-"-Syntax may work as negating (allthough it is unlikly following 
http://www.w3.org/TR/xmlschema-2/#charcter-classes).
---
<simpleType name='better-us-zipcode'>
  <restriction base='string'>
    <pattern value='[0-9]{5}(-[0-9]{4})?'/>
  </restriction>
</simpleType>
---


A simple fix for this part (while I don't see wether the charClassSub
will work afterwards), may be to replace every -[ into [^ if it is
preceed by [ or (. This will not solve the issue with MPEG7 completly.


Are those things true, known or perhaps even solved somewhere?


-- 
MFG
Hopefully I have written down clearly everything needed.
Heiko Studt <studt@f...>



From ht@i... Thu Sep 13 10:20:49 2007
Received: from lisa.w3.org ([128.30.52.41])
	by frink.w3.org with esmtp (Exim 4.50)
	id 1IVloX-0008Tc-8J
	for xmls


transparent
Print
Mail
Like It
Disclaimer
.

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.

.
.

transparent

transparent