[Petal] Stripping XML declaration

William McKee william at knowmad.com
Wed Jan 12 15:46:00 GMT 2005


Hi Josh,

Please reply to the list in the future.

> It would be 
>  $processed =~ s#^ \s* <\?xml version="1.0"\?> \s* ##xs;
>  #s to treat as single string
>  #x to allow readability whitespace in the left hand side

Thanks for the regex. Did that work for you?


> I would definitely not recommend any sort of XML parser for this single
> change, esp. since is defined as occuring at the beginning of the document.

I'd agree. I was just making suggestions. I prefer to look at all
possible solutions and avoid premature optimization.


Regards,
William

-- 
Knowmad Services Inc.
http://www.knowmad.com


More information about the Petal mailing list