geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jarek Gawor" <jga...@gmail.com>
Subject Re: Help needed on http methods and regular expressions
Date Fri, 05 Jan 2007 20:24:21 GMT
It looks to me like the regex in the schema file does not quite match
the HTTP spec. First, the regex in the schema file does not allow
numbers (the HTTP spec does), and second it also allows for
non-english characters (the HTTP spec does not). The regex basically
allows Unicode letters only (see all L* categories on
http://www.fileformat.info/info/unicode/category/index.htm).

I think that regex should be something like:

[\u0021-\u007E-[\(\)<>\{\}@,:;\[\]\?\\/]]+

Jarek

On 1/4/07, David Jencks <david_jencks@yahoo.com> wrote:
> Chris Cardona has been trying to test the jacc 1.1 extended http-
> method support by deploying slide (GERONIMO-1747) and I don't know
> enough about regular expressions to see where the problem is.
>
> The http 1.1 spec says:
>
> (5.1.1)       extension-method = token
>
> (2.2)
>
>         token          = 1*<any CHAR except CTLs or separators>
>         separators     = "(" | ")" | "<" | ">" | "@"
>                        | "," | ";" | ":" | "\" | <">
>                        | "/" | "[" | "]" | "?" | "="
>                        | "{" | "}" | SP | HT
>
>         CHAR           = <any US-ASCII character (octets 0 - 127)>
>
>         CTL            = <any US-ASCII control character
>                          (octets 0 - 31) and DEL (127)>
>
> I think this means a hyphen is allowed in an extension-method.
>
> The web-app 2.5 schema says:
>
>    <xsd:simpleType name="http-methodType">
>      <xsd:annotation>
>
>        <xsd:documentation>
>
>         A HTTP method type as defined in HTTP 1.1 section 2.2.
>
>        </xsd:documentation>
>      </xsd:annotation>
>
>       <xsd:restriction base="xsd:token">
>           <xsd:pattern value="[\p{L}-[\p{Cc}\p{Z}]]+"/>
>       </xsd:restriction>
>
>    </xsd:simpleType>
>
> I have roughly no clue what that means.
>
> Xmlbeans is complaining:
>
> cvc-datatype-valid.1.1: string value 'VERSION-CONTROL' does not match
> patter
> n for http-methodType in namespace http://java.sun.com/xml/ns/javaee,
> error: cvc
> -datatype-valid.1.1: string value 'BASELINE-CONTROL' does not match
> pattern for
> http-methodType in namespace http://java.sun.com/xml/ns/javaee]
>
> I see 3 possiblilites:
>
> 1. I'm wrong and http 1.1 spec does not allow hyphens in extension
> methods
> 2. sun is wrong and the regexp in http-methodType means something
> other than the definition in the http 1.1 spec
> 3. xmlbeans is wrong and is not interpreting the regexp in the schema
> correctly.
>
> Anyone have a clue?
> Help!
>
> thanks
> david jencks
>
>

Mime
View raw message