Skip Menu |

This queue is for tickets about the XML-Compile CPAN distribution.

Report information
The Basics
Id: 39215
Status: resolved
Priority: 0/
Queue: XML-Compile

People
Owner: Nobody in particular
Requestors: tom@eborcom.com (no email address)
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.94
Fixed in: (no value)



Hi, I have encountered trouble using XML::Compile's schema parsing with null values in certain fields. I am using an XML schema that defines its own simple type as follows: <simpleType name="ID"> <restriction base="xsd:string"> <length value="18"/> <pattern value="[a-zA-Z0-9]{18}"/> </restriction> </simpleType> Various fields use this type, for example: <element name="roleId" type="tns:ID" nillable="true"/> However, XML::Compile does not cope with the following: <roleId xsi:nil="true"/> It throws the following error: error: string `' does not match pattern (?-xism:^(?:[a-zA-Z0-9]{18})$) at {urn:enterprise.soap.sforce.com}loginResponse/result/userInfo/roleId#facet It looks like XML::Compile applies the pattern even for nill values, despite the schema specifying it tolerates them. I lack a detailed understanding of WSDL and SOAP, though, so I apologise if I have misunderstood something. Thanks, Tom Hukins
Subject: Re: [rt.cpan.org #39215]
Date: Fri, 12 Sep 2008 14:41:52 +0200
To: "tom [...] eborcom.com via RT" <bug-XML-Compile [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* tom@eborcom.com via RT (bug-XML-Compile@rt.cpan.org) [080912 12:08]: Show quoted text
> <roleId xsi:nil="true"/> > error: string `' does not match pattern (?-xism:^(?:[a-zA-Z0-9]{18})$) at > {urn:enterprise.soap.sforce.com}loginResponse/result/userInfo/roleId#facet
This is probably a bug. I am able to reproduce it. Now, I need to find time to fix it ;-) Is your schema one of those which abuse nillable for optional? You may try option interpret_nillable_as_optional -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #39215]
Date: Fri, 12 Sep 2008 22:06:50 +0200
To: "tom [...] eborcom.com via RT" <bug-XML-Compile [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* tom@eborcom.com via RT (bug-XML-Compile@rt.cpan.org) [080912 12:08]: Show quoted text
> Fri Sep 12 08:08:13 2008: Request 39215 was acted upon. > Transaction: Ticket created by tom@eborcom.com > > I am using an XML schema that defines its own simple type as follows: > <simpleType name="ID"> > <restriction base="xsd:string"> > <length value="18"/> > <pattern value="[a-zA-Z0-9]{18}"/> > </restriction> > </simpleType> > > Various fields use this type, for example: > <element name="roleId" type="tns:ID" nillable="true"/> > > However, XML::Compile does not cope with the following: > <roleId xsi:nil="true"/>
The first investigation shows that nillable does not work on top-level elements, only on nested elements. Trying to fix that. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions drs Mark A.C.J. Overmeer MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Probably solved in 0.95, which will be released later today