You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Daniel Pfuhl <da...@web.de> on 2001/05/14 18:09:26 UTC

How to access a Node by Name ??

Hi

Is it possible to access a DOMNode by name
for cloning it afterwards? How can I 
accomplish doing this?

I tried it using
NodeList newnodelist = doc.getElementsByTagName(search);

But NodeList seems to be flat without any
structure, or am I wrong?

I would like to get a Node with its Child-
Elements like this:

<language>
  <choice type="string">
    <value>french</value>
    <value>english</value>
    <value>german</value>
  </choice>
</language> 

If I search for language and put it in my NodeList
it is not possible to access "value/#text".

It would be nice if somebody can point me the right
direction...

thanx 

daniel
------------------------------------------
Daniel Pfuhl
mailto:daniel@dphome.de
______________________________________________________________________________
Ferienklick.de - 225 Reisekataloge auf einen Blick!
Direkt zu Ihrem Traumurlaub: http://ferienklick.de/?PP=2-0-100-105-0


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: How to access a Node by Name ??

Posted by Zhaohua Meng <me...@hotlens.com>.
Look at the api of NodeList. You should be able to get the length of 
the NodeList(getLength()) and a specific Node, if there is any(item
(index));

Zhaohua Meng

Hotlens.com Inc.
http://www.hotlens.com

350 Fifth AVE
Suite 3113
New York, NY 10118
Phone: 212-465-1700
Fax:   212-465-1710
email: mengzh@hotlens.com


-----Original Message-----
From: "Daniel Pfuhl" <da...@web.de>
To: "BUW.XML" <bu...@listbot.com>, "Xerces-List" <xerces-j-
user@xml.apache.org>
Date: Mon, 14 May 2001 18:09:26 +0200
Subject: How to access a Node by Name ??

> 
> Hi
> 
> Is it possible to access a DOMNode by name
> for cloning it afterwards? How can I 
> accomplish doing this?
> 
> I tried it using
> NodeList newnodelist = doc.getElementsByTagName(search);
> 
> But NodeList seems to be flat without any
> structure, or am I wrong?
> 
> I would like to get a Node with its Child-
> Elements like this:
> 
> <language>
>   <choice type="string">
>     <value>french</value>
>     <value>english</value>
>     <value>german</value>
>   </choice>
> </language> 
> 
> If I search for language and put it in my NodeList
> it is not possible to access "value/#text".
> 
> It would be nice if somebody can point me the right
> direction...
> 
> thanx 
> 
> daniel
> ------------------------------------------
> Daniel Pfuhl
> mailto:daniel@dphome.de
> _____________________________________________________________________
> _________
> Ferienklick.de - 225 Reisekataloge auf einen Blick!
> Direkt zu Ihrem Traumurla"CENhttp://ferienklick.de/?PP=2-0-100-105-0
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org