W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2000

Creating XML::DOM Tags

From: Guru Prasad <pnguruji@yahoo.com>
Date: Mon, 20 Nov 2000 16:50:34 +0530 (IST)
To: www-dom@w3.org
Message-ID: <Pine.LNX.4.20.0011201624180.12046-100000@Larry.bk>

I am a newbie to XML-DOM. I have a peculiar problem in appending XML tags.
I am using Perl to work with XML. The Contents of the XML file is as

<Name>Mr. XYZ</Name>
<Address>Actual Address#1</Address>

<Name>Mr. ABC</Name>
<Address>Actual Address#2</Address>

I keyed in the above data in a file. Now how to actually create such tags
with values using perl scripts. I tried with
$Node = $Doc->getElementsbyTagName("XML_File")->item(0);
$DataNode = $Doc->createElement("Data")

Now the above code is working and it created a instance of <Data></Data>.
But how to actually create tags under <Data>. I mean if i say 
getElementsbyTagName("Data"), Then i will get an multiple instance of
<Data>.I don't want to say getElementsbyTagName("Data")->item(0) b'coz
it would be very static. I want the DOM Parser to identify the last <Data>
instance that is created and it should return me so that i can do 
createElements under it.

Any suggestions/help would be great.


Received on Monday, 20 November 2000 06:26:37 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:07 UTC