On Fri, 2005-08-05 at 10:31 -0700, Bob Foster wrote:

> Maybe it would be more clear if you read:
>
> http://www.w3.org/TR/xmlschema-2/#rf-whiteSpace
>
> anyURI is an atomic datatype that is not derived from string. The
> whitespace processing is collapse. Therefore, leading or trailing
> whitespace is not part of the value.

OK. That's what I'm trying to work around.
I can't get James' regex to work, but
<element name="test">
<oneOrMore>
<element name="uri">
<ref name="anyuri"/>
</element>
</oneOrMore>
</element>

<define name="anyuri">
<data type="string">
<param name="pattern">(([a-zA-Z][0-9a-zA-Z
+\-\.]*:)?/{0,2}[0-9a-zA-Z;/?:@&amp;=+$\.\-_!
~*'()%]+)?(#[0-9a-zA-Z;/?:@&amp;=+$\.\-_!~*'()%]+)?</param>
      </data>
</define>

Seems to work with

<test>
<uri>http://example.com</uri>
<uri>file://www.example.com</uri>
<uri>../www.example.com</uri>
<uri>ftp://www.example.com/</uri>
<uri></uri>


<uri>http://www.exam ple.com</uri>
<uri> http://www.example.com</uri>
<uri>http://www.example.com </uri>


</test>


catches spaces mid, start and end.
I somehow doubt my test cases are broad enough.

Anyone know of a suite of RFC2396 test cases :-)

regards DaveP



YAHOO! GROUPS LINKS




Reply via email to