#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Location
    India
    Posts
    0
    Rep Power
    0

    Question


    HI
    iam using sun parser to create a xml dom
    if iam using element method iam getting in the following format
    <sravan sravan1='1000'/>
    but i need the xml structure like this
    <root>
    <sravan sravan1='1000'/>
    </root>
    any sample code will help me
    thanx in advance
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Location
    Colorado
    Posts
    46
    Rep Power
    14
    Well, I'm not exactly sure if this is what you mean, but here goes. I think you would want to call the appendChild(Node newNode) method on your root element. EG - (pseudocode)

    Node root;
    Node firstChild;

    root.appendChild(firstChild);

    This should add a child node to the root element. If that's not what you were looking for, post some more details and I'll try to help you out some more.
    - MW

IMN logo majestic logo threadwatch logo seochat tools logo