W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2000

is this addressing?

From: Ivan Leong <ivanl@pacific.net.sg>
Date: Mon, 15 May 2000 14:56:13 -0400 (EDT)
To: <www-dom@w3.org>
Message-ID: <ECENKJDIBCIHECEFMMEPOEBICBAA.ivanl@pacific.net.sg>
OK, I'm a newbie. I'm playing with Perl XML::Parser, XML::DOM. I've a need
to write two pieces of code and I could use a pointer or two. pls reply me
direct.

code #1
=======
Assume input xml:
<a>
  <b>
    <c>
      <d>text2</d>
    </c>
  </b>
  <b>
    <e>text5</e>
    <c>text4</e>
    <d>text3</e>
  </b>
</a>

Assume parameter input: text3

Output needed:
1:2:3
(this means text3 appear in 3rd node of the 2nd node within the 1st node of
the document)


code #2
=======
Assume input xml:
<a>
  <b>
    <c>
      <d>text2</d>
    </c>
  </b>
  <b>
    <e>text5</e>
    <c>text4</e>
    <d>text3</e>
  </b>
</a>

Assume parameter input: 1:1:1:1

Output needed:
text2
(this means 1st node, 4 levels down contains "text2")

OR

Assume parameter input: 1:2:2

Output needed:
text4
(this means 2nd node of 2nd node of 1st node: "text4")
Received on Sunday, 21 May 2000 11:01:56 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:47 GMT