-
writing to xml using php
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.
-
-
How are you outputting the above? We'll need to see the PHP script that you're using to accomplish what you've done so far. It's hard to know how to help without knowing what's going on first.
So, please post the relevant PHP and someone might be able to help
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks