You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by David Jencks <da...@yahoo.com> on 2007/01/04 22:27:24 UTC

Help needed on http methods and regular expressions

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


Re: Help needed on http methods and regular expressions

Posted by David Blevins <da...@visi.com>.
On Jan 4, 2007, at 7:35 PM, David Jencks wrote:

>
> On Jan 4, 2007, at 6:12 PM, David Blevins wrote:
>
>>
>> On Jan 4, 2007, at 1:27 PM, David Jencks 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.
>>
>> It means hypen is not allowed.  I.e. ascii 0-127 is allowed except  
>> 0-31,32,34,40,41,44,47,58,59,60,61,62,63,64,91,92,93,123,125
>
> I'm kinda confused here.  According to http://www.asciitable.com/  
> hyphen is 45 which is not in your list of exclusions, not a control  
> character, and I might be blind but I don't see it in the http spec  
> list of separators.  Why exactly is hyphen not allowed?

Whoop. My bad. Now I'm just as confused as you.

-David


>
> thanks
> david jencks
>
>>
>> -David
>>
>>> 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
>>>
>>
>


Re: Help needed on http methods and regular expressions

Posted by David Jencks <da...@yahoo.com>.
On Jan 4, 2007, at 6:12 PM, David Blevins wrote:

>
> On Jan 4, 2007, at 1:27 PM, David Jencks 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.
>
> It means hypen is not allowed.  I.e. ascii 0-127 is allowed except  
> 0-31,32,34,40,41,44,47,58,59,60,61,62,63,64,91,92,93,123,125

I'm kinda confused here.  According to http://www.asciitable.com/  
hyphen is 45 which is not in your list of exclusions, not a control  
character, and I might be blind but I don't see it in the http spec  
list of separators.  Why exactly is hyphen not allowed?

thanks
david jencks

>
> -David
>
>> 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
>>
>


Re: Help needed on http methods and regular expressions

Posted by David Blevins <da...@visi.com>.
On Jan 4, 2007, at 1:27 PM, David Jencks 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.

It means hypen is not allowed.  I.e. ascii 0-127 is allowed except  
0-31,32,34,40,41,44,47,58,59,60,61,62,63,64,91,92,93,123,125

-David

> 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
>


Re: Help needed on http methods and regular expressions

Posted by David Jencks <da...@yahoo.com>.
I talked with Greg Wilkins a bit and this issue is apparently going  
to be fixed "soon":

http://jcp.org/aboutJava/communityprocess/maintenance/jsr154/ 
servlet-2.5_MR6.html

after checking that the last batch of xsd changes didn't break  
anything I'm going to patch the web-app schema and re-push the  
xmlbeans schema jar.

thanks
david jencks

On Jan 5, 2007, at 12:24 PM, Jarek Gawor wrote:

> 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 <da...@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
>>
>>


Re: Help needed on http methods and regular expressions

Posted by Jarek Gawor <jg...@gmail.com>.
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 <da...@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
>
>