include xml file in another xml file

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
devendra-m
Forum Contributor
Posts: 111
Joined: Wed Sep 12, 2007 3:16 am

include xml file in another xml file

Post by devendra-m »

I have an xml file book.xml as

Code: Select all

<book>
    testbook
</book>
 
I want to include book.xml in test.xml so I used following method.

test.xml

Code: Select all

<?xml version="1.0"?>
<!DOCTYPE novel  [
<!ENTITY book SYSTEM "book.xml">
]>
<test>
     &book;
</test>


and i got the output as

Code: Select all

<test>
      <book>
              <book>
                        testbook
             </book>
      </book>
</test>
>

there is extra tag included in test.xml

but the desired output is

Code: Select all

<test>
             <book>
                        testbook
             </book>
</test>
can anybody help to achieve this
Post Reply