adilfarid
05-03-2008, 12:51 PM
Hello Friends....
My name is Adil Farid... I am new to XML
I am trying to add element to xml , but i am not able to add its attribute.. as well..
Creting new element in xml and appending its siblings is simple but i am not getting any idea, how to set attributes to the xml element that has been created....
i am pasting my xml code,,,\\
<?xml version="1.0" encoding="utf-8"?>
<photos path="images/">
<photo name="Photo 1" url="1.jpg">This is the optional description for photo 1</photo>
<photo name="Photo 2" url="2.jpg">This is the optional description for photo 2</photo>
<photo name="Photo 3" url="3.jpg">This is the optional description for photo 3</photo>
<photo name="Photo 4" url="4.jpg">This is the optional description for photo 4</photo>
<photo name="Photo 5" url="5.jpg">This is the optional description for photo 5</photo>
</photos>
Well i am able to create element "Photos" and its sub node "Photo" but adding attributes ot "Photos" and "Photo " is very hard for me...\
hope to see the solution soon.......
Thanks in Advance....
Regards.
Adil Farid.
My name is Adil Farid... I am new to XML
I am trying to add element to xml , but i am not able to add its attribute.. as well..
Creting new element in xml and appending its siblings is simple but i am not getting any idea, how to set attributes to the xml element that has been created....
i am pasting my xml code,,,\\
<?xml version="1.0" encoding="utf-8"?>
<photos path="images/">
<photo name="Photo 1" url="1.jpg">This is the optional description for photo 1</photo>
<photo name="Photo 2" url="2.jpg">This is the optional description for photo 2</photo>
<photo name="Photo 3" url="3.jpg">This is the optional description for photo 3</photo>
<photo name="Photo 4" url="4.jpg">This is the optional description for photo 4</photo>
<photo name="Photo 5" url="5.jpg">This is the optional description for photo 5</photo>
</photos>
Well i am able to create element "Photos" and its sub node "Photo" but adding attributes ot "Photos" and "Photo " is very hard for me...\
hope to see the solution soon.......
Thanks in Advance....
Regards.
Adil Farid.