|
Posted by Johnny on 10/11/06 20:54
"uidzer0" <ben.lemasurier@gmail.com> wrote in message
news:1160576257.854798.324500@m7g2000cwm.googlegroups.com...
> Hey everyone,
>
> I am trying to figure out how to import an external xml file into a
> current document at a certain location within the document ie:
>
> Here is my main xml:
>
> <books>
> <book>
> <title>1</title>
> <author>a</author>
> </book>
> <book>
> <title>2</title>
> <author>b</author>
> </book>
> <book>
> <title>3</title>
> <author>c</author>
> </book>
> </book>
>
>
> And here is the xml to be imported:
>
> <book>
> <title>new</title>
> <author>new author</author>
> </book>
>
> I would like to import this right after the first book entry (after 1,
> before 2), can anyone point me in the right direction here?
>
> Thanks!
>
> Ben
>
since you are asing in a php group, and it's such a basic question (I must
be reading what you want wrong or something), how about:
# file import.xml
<book>
<title>new</title>
<author>new author</author>
</book>
# file base_xml.php
<books>
<book>
<title>1</title>
<author>a</author>
</book>
<?php include ("import.xml"); ?>
<book>
<title>2</title>
<author>b</author>
</book>
<book>
<title>3</title>
<author>c</author>
</book>
</book>
Navigation:
[Reply to this message]
|