473,324 Members | 2,254 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

How to handle the < and > sign to add into addText

Am trying to create a node.

Expand|Select|Wrap|Line Numbers
  1.  
  2. my $doc = $parser->parsefile ($file);
  3.    my $newnode = $doc->createElement("item");
  4.    $newnode->setAttribute('name','city_name');
  5.     $newnode->addText($addString);
  6.  
  7.     $addString="";
  8.     my $change_node = $doc->getElementsByTagName("record")->item(0);
  9.     $change_node->appendChild($newnode);
  10.  
The problem I have is addText is considering the tags to be text.
and the output I am getting is
Expand|Select|Wrap|Line Numbers
  1.  
  2. <item name="city_name">&lt;value&gt;Anchorage, Alaska&lt;/value&gt;</item>
  3.  
even though the $addString is <value>Anchorage, Alaska</value>

Any help in how I can handle the < and > sign to add into addText or should I be using any other method.

Thanks for help.
Feb 9 '11 #1
1 1686
Dormilich
8,658 Expert Mod 8TB
you have to add it as new element. the innerHTML property from JavaScript is not part of the DOM. btw. addText() is not supposed to create tags, therefore < and > are escaped.
Feb 9 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Eshrath | last post by:
Hi, What I am trying to do: ======================= I need to form a table in html using the xsl but the table that is formed is quite long and cannot be viewed in our application. So we are...
2
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script...
16
by: ^_^ | last post by:
conversion from: a="a"; to a=0x????; If there are many unicode strings to convert, how can I do batch-conversion?
3
by: Philippe Lang | last post by:
Hello, Does anyone have experience in interfacing a Postgresql database (tables? plpgsql functions? perl functions?) with the outside world through webservices? (XML-RPC, SOAP, UDDI, WSDL...) ...
3
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt,...
14
by: Michael | last post by:
Since the include function is called from within a PHP script, why does the included file have to identify itself as a PHP again by enclosing its code in <?php... <?> One would assume that the...
1
by: RSecor | last post by:
# sysctl -a | grep somaxconn kern.ipc.somaxconn: 1024 # perl -MSocket -e'print SOMAXCONN; print "\n";' 128 Anyone have any ideas why one would be 1024 and the other only 128?
36
by: kwitters | last post by:
I don't know if this is the right place to discuss the death of <in Python 3.0, or if there have been any meaningful discussions posted before (hard to search google with '<>' keyword), but why...
0
by: sarabonn | last post by:
Hallo everyone, I have a text(paragraph) which is exported as word document. The problem is i add this to the text for formatting "<w:p wsp:rsidR='006A77CB' wsp:rsidRDefault='0071725D'...
0
by: friendofgod | last post by:
Server is Win 2003, with IIS 6, patched up to date with Windows Update, and using perl version 5.008008. Re: Page with STDIN hangs, and does a continuous load, when called in browser. Page...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.