[Xml-compile] Re: Missing space in response
Allan Wind
allan at insurancedesk.com
Fri Aug 22 22:49:39 BST 2008
The mailing list did not response my submission, so there was no easy
way to follow on my initial question.
On Fri, Aug 22, 2008 at 1:03 PM, Allan Wind <allan at insurancedesk.com> wrote:
> I am getting a response from a service:
>
> ...
> <responseMessage xmlns="...>REJECTED - Duplicate
> Lead</responseMessage></env:Body></env:Envelope>
The element is defined as:
<xs:element name="responseMessage" type="xs:token">
but if I read the spec correctly tokens can contain embedded single
spaces. Schema/BuiltInTypes.pm does:
$builtin_types{token} =
$builtin_types{NMTOKEN} =
{ parse => \&_collapse
, example => 'token'
};
where
sub _collapse { $_[0] =~ s/\s+//g; $_[0]}
Should that be something like this instead?
sub _collapse { $_ = $_[0]; s/^\s+//; s/\s+$//; s/(\s)$1+/$1/g; $_ };
/Allan
--
Allan Wind
Software Engineering Manager
InsuranceDesk.com
Tel. (781) 932 4700 ext. 190
http://www.InsuranceDesk.com
More information about the Xml-compile
mailing list