unwanted escaping of with XML::DOM

2008-02-09 Thread Alois Heuboeck
Hi I'm trying to feed text into an existing XML tree - the problem I'm encountering is that the text may contain entity references (including the 'forbidden' ''), in which case the is escaped by 'amp;'. I'm using the module XML::DOM for this. Here's an example of an empty tree (the file

Re: unwanted escaping of with XML::DOM

2008-02-09 Thread Alois Heuboeck
Gunnar Hjalmarsson wrote: Alois Heuboeck wrote: I'm trying to feed text into an existing XML tree - the problem I'm encountering is that the text may contain entity references (including the 'forbidden' ''), in which case the is escaped by 'amp;'. I'm using the module XML::DOM

Re: Replace only once.

2005-12-02 Thread Alois Heuboeck
On Fri, Dec 02, 2005 at 10:22:47AM +, Mads N. Vestergaard wrote: I have a script where I need to replace 45 in the beginning, with nothing in a variable It looks like this: #!/usr/bin/perl $modtager = 45247; $modtager =~s/45//; Then $modtager is 247, but if forinstance the

Re: Skipping blank lines while reading a flat file.

2005-10-07 Thread Alois Heuboeck
Dave, (this is one I know :-) ) I want to skip the blank lines and just print the lines with text, like this this is myfile This is my test case code. #!/usr/bin/perl -w use strict; my $opt_testfile=test-text.txt; open (TS, $opt_testfile) or die can't open file; while (TS) { chomp;

encoding - utf-8

2005-09-19 Thread Alois Heuboeck
= $dom_parser-parsefile($infile); open OUT, file3.xml or die could not open log file; print OUT $TREE-toString(); close OUT; Thanks for any comments! Alois Heuboeck -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http

keep entity references while parsing with XML::Parser

2005-09-15 Thread Alois Heuboeck
Hi Perlers, I'm trying to do the following: 1- take an XML file 2- in one script, replace everything above Unicode #x7F (end of ASCII) with entity references (which can either have special names, like auml; or be based on the Unicode nb. like #x00AE;) 3- then in another script, do some