ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-xml
perl-xml
XML::Parser & "invalid character"
by Jenda Krynicky other posts by this author
Mar 29 2002 6:41PM messages near this date
view in the new Beta List Site
Re: XML::Parser & "invalid character" | Re: XML::Parser & "invalid character"
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.

Thanks a lot, Jenda


=========== Jenda@[...].cz == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain
I can't find it.
					--- me
_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Jenda Krynicky
Chris Strom

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved