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 Shashank <sh...@icmg.nu> on 2001/10/22 13:50:40 UTC

adding value to Node

Hi !

I am able to create a new Elment and add it to parent Node i want.

I am also able set its atributes. but when I call setNodeValue,  doesnt
work, I mean doesn' sets the value of this Node.

how to do this

take care,
Shashank


--

-----------------------------------------------------------
Shashank
iCMG
India Development Center
Millennium Towers
Queens Road, Bangalore - 51
Ph:91-80-286 5620 Fax:91-80-286 5623
-------------------------------------------------------------
Architecting Software Components for EAI
        http://www.iCMGworld.com/
-------------------------------------------------------------
The information transmitted is intended only for the person or entity to

which it is addressed and may contain confidential and/or privileged
material.  Any review, retransmission, dissemination or other use of, or

taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you are not

the intended recipient, please contact the sender by reply e-mail and
destroy all copies of the original message.



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


Re: adding value to Node

Posted by Sudeendra Kumar <su...@wipro.com>.
hi all,
we are unable to get XML parsers(we r using apache parser)
i mean parser is not validating against
xmlschema even after setting
all properties ,could anybody help to
sort out this problem

thanks in advance.
sudhi


Re: adding value to Node

Posted by Christian Geuer-Pollmann <ge...@nue.et-inf.uni-siegen.de>.
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 <sh...@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


Re: adding value to Node

Posted by Shashank <sh...@icmg.nu>.
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:

> Hi
>
> try to element.appendChild(doc.createTextNode("Whatever you need"));
>
> --On Montag, 22. Oktober 2001 17:20 +0530 Shashank <sh...@icmg.nu> wrote:
>
> > Hi !
> >
> > I am able to create a new Elment and add it to parent Node i want.
> >
> > I am also able set its atributes. but when I call setNodeValue,  doesnt
> > work, I mean doesn' sets the value of this Node.
> >
> > how to do this
> >
> > take care,
> > Shashank
> >
> >
> > --
> >




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


Re: adding value to Node

Posted by Christian Geuer-Pollmann <ma...@nue.et-inf.uni-siegen.de>.
Hi

try to element.appendChild(doc.createTextNode("Whatever you need"));

--On Montag, 22. Oktober 2001 17:20 +0530 Shashank <sh...@icmg.nu> wrote:

> Hi !
>
> I am able to create a new Elment and add it to parent Node i want.
>
> I am also able set its atributes. but when I call setNodeValue,  doesnt
> work, I mean doesn' sets the value of this Node.
>
> how to do this
>
> take care,
> Shashank
>
>
> --
>


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