Page 1 of 1

include xml file in another xml file

Posted: Wed Feb 24, 2010 4:20 am
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