cancel
Showing results for 
Search instead for 
Did you mean: 

xmlparsing::Setting the values inside xml file

Former Member
0 Kudos

Hi,

Iu2019ve an xml file without containing any values inside the tags. I need to get the values from the text file and set the values inside the xml file. When I try to set the string variable inside the setValueNode() using DOM parser, itu2019s not setting any values inside the xml file.

Please help me on this..

Regards

Vineela

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

I am doing conversion from EDIFACT format to xml format.

I am writing this code using core java. So I am using xmlparsing to convert my data. Iu2019ve one Hash table with me. I need to get the values from there and populate those values into xml file.

Regards

Vineela

Former Member
0 Kudos

Hi,

I am using core java here.

refIS:reference xml file.

Document doc = parserXML(refIS);

Node root=doc.getDocumentElement();

writeDocumentToOutput(root, 0);

Here for this root node Iu2019ll have to set string value.

Regards,

vineela

Former Member
0 Kudos

Hi,

Use the Text http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/Text.html

Ex:

Document document = // handle to the document

Element lbl = document.createElement("Label");

Text text=null;

text= document.createCDATASection("Test");

lbl.appendChild(text);

Regards

Ayyapparaj