Re: XML::Parser & "invalid character"
by Chris Strom other posts by this author
Mar 29 2002 7:00PM messages near this date
view in the new Beta List Site
XML::Parser & "invalid character"
|
[RFC] XML::SAX::Consumer::XMLRPC
Sounds like you want to use CDATA declarations:
<![CDATA[chr(2)]]>
Might be a good idea to put entire code sections inside CDATA:
<![CDATA[
IF substring(PostingParameters.UserName,1,1) = char(2)
-- then it's an ID of a field and I will use value of that field
-- to log in
ELSE
-- its a constant
]]>
On Fri, Mar 29, 2002 at 07:41:44PM +0100, Jenda Krynicky wrote:
> I'm using XML files to replicate some settings and other stuff
> between several servers (thanks for your previous help!). Everything
> is cool except one thing.
>
> I use character with code 2 as a separator or marker on several
> places in the database. Things like
> IF substring(PostingParameters.UserName,1,1) = char(2)
> -- then it's an ID of a field and I will use value of that field
> -- to log in
> ELSE
> -- its a constant
>
> or
> (from ASP) ... conn.SetPostingParameters(..., _
> CSVSeparator & chr(2) & CSVQuote _
> & chr(2) & CSVEscape, ...
>
> the problem is that if I write a string containing a chr(2) into an XML
> file, XMP::Parser (used via XML::Simple) will refuse to parse the file
> with
>
> not well-formed at line ...
>
> error message. So I've replaced the char(2)s with  in the
> generated XML. Still no success, it gives
>
> reference to invalid character number at line ...
>
> error message.
>
> Is there any way to "properly" escape such a character so that it
> would be accepted by XML::Parser?
>
> And if not what character would you recomend to be used
> (escaped if necessary) to make XML::Parser happy, but still being
> reasonably safe that it will not be mistaken for "normal" data.
_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Jenda Krynicky
Chris Strom
|