You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by ajay bhadauria <ab...@yahoo.com> on 2010/09/07 15:22:15 UTC

xsd:anyURI Validation

Hi All,

When we used anyURI in the schema then any character is allowed in the xml messgage for URI validation ?

We are currently useing xalan-java2.7.1 with xerces-java 2.9.0. Earlier we were using Tibco validator which uses crimson parser which failed for the 
same.

Please help me to understand this since we are new user of xalan.2.7.1.

Thanks a lot
Ajay 

--- On Fri, 9/3/10, ajay bhadauria <ab...@yahoo.com> wrote:

> From: ajay bhadauria <ab...@yahoo.com>
> Subject: xsd:anyURI puzzle
> To: j-users@xerces.apache.org
> Date: Friday, September 3, 2010, 11:23 PM
> Hi,
> 
> I am using xalan 2.7.1 for xml schema validation
> and I have schema with below grammer
> 
>     <xsd:simpleContent>
>       <xsd:extension base="Scheme">
>         <xsd:attribute
> name="messageIdScheme" type="xsd:anyURI"
> use="required"/>
>       </xsd:extension>
>     </xsd:simpleContent>
> 
> and my xml message is below
> 
> <fpml:header>
>    <fpml:messageId 
> messageIdScheme="www|somesite.com">stringString</fpml:messageId>
>    <fpml:sentBy>stringString</fpml:sentBy>
>    <fpml:creationTimestamp>2007-01-01T01:01:01</fpml:creationTimestamp>
> </fpml:header>
> 
> Apache xerces parser is validating successfully though "|"
> is not valid character in URI.
> 
> Please help me in this why Apache parser is behaving like
> this
> 
> Thanks
> Ajay 
> 
> 
>       
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org
> 
> 


      

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


Re: xsd:anyURI Validation

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Hi Ajay,

The lexical space of xs:anyURI [1] is much larger than the RFC 2396
definition for URIs. Characters not normally allowed in URIs are to be
treated as if they were escaped with %nn sequences and that includes '|'.
Both Xerces and the other validator you were using have the correct
behaviour.

Thanks.

[1] http://www.w3.org/TR/xmlschema-2/#anyURI

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com.
E-mail: mrglavas@apache.org

ajay bhadauria <ab...@yahoo.com> wrote on 09/07/2010 09:22:15 AM:

> Hi All,
>
> When we used anyURI in the schema then any character is allowed in
> the xml messgage for URI validation ?
>
> We are currently useing xalan-java2.7.1 with xerces-java 2.9.0.
> Earlier we were using Tibco validator which uses crimson parser
> which failed for the
> same.
>
> Please help me to understand this since we are new user of xalan.2.7.1.
>
> Thanks a lot
> Ajay
>
> --- On Fri, 9/3/10, ajay bhadauria <ab...@yahoo.com> wrote:
>
> > From: ajay bhadauria <ab...@yahoo.com>
> > Subject: xsd:anyURI puzzle
> > To: j-users@xerces.apache.org
> > Date: Friday, September 3, 2010, 11:23 PM
> > Hi,
> >
> > I am using xalan 2.7.1 for xml schema validation
> > and I have schema with below grammer
> >
> >     <xsd:simpleContent>
> >       <xsd:extension base="Scheme">
> >         <xsd:attribute
> > name="messageIdScheme" type="xsd:anyURI"
> > use="required"/>
> >       </xsd:extension>
> >     </xsd:simpleContent>
> >
> > and my xml message is below
> >
> > <fpml:header>
> >    <fpml:messageId
> > messageIdScheme="www|somesite.com">stringString</fpml:messageId>
> >    <fpml:sentBy>stringString</fpml:sentBy>
> >    <fpml:creationTimestamp>2007-01-01T01:01:01</fpml:creationTimestamp>
> > </fpml:header>
> >
> > Apache xerces parser is validating successfully though "|"
> > is not valid character in URI.
> >
> > Please help me in this why Apache parser is behaving like
> > this
> >
> > Thanks
> > Ajay
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> > For additional commands, e-mail: j-users-help@xerces.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org