xerces-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Geuer-Pollmann <geuer-pollm...@nue.et-inf.uni-siegen.de>
Subject Re: adding value to Node
Date Wed, 24 Oct 2001 08:06:50 GMT
Element new_elem = document_object.createElement ("elem_name");

new_elem.appendChild(document_object.createText("asaass"));

new_elem.setAttribute ("name", "Computer Just Selected");
parent_node.appendChild (new_elem);


--On Dienstag, 23. Oktober 2001 10:25 +0530 Shashank <shashank@icmg.nu> 
wrote:

> Hi !
>
> I have create and insert new Nodes in a an XML file.
> But the type of Node depends on element defined in DTD file.
>
> How to read the element type from a DTD file. and create a Node object of
> specified type.
>
>
>
> I am doing something similar.
>
>
>  Element new_elem = document_object.createElement ("elem_name");
>  new_elem.setNodeValue ("asaass");
>  new_elem.setAttribute ("name", "Computer Just Selected");
>  parent_node.appendChild (new_elem);
>
>
> resulting XML file I get contains the Elment as following
>     <elem_name name="Computer Just Selected"/>
>
>
>
> where is the Value of this Node.
>         <elem_name name="Computer Just Selected"/>asaass</elem_name>
>
> Christian Geuer-Pollmann wrote:
>> try to element.appendChild(doc.createTextNode("Whatever you need"));


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


Mime
View raw message