Can we import an XML file into another XML file?
I mean is there any import tag in XML that takes XML path as parameter and imports XML (for which path is provided).
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could use an external (parsed) general entity.
You declare the entity like this:
Then you reference it like this:
A complete example:
When the XML parser reads the file, it will expand the entity reference and include the referenced XML file as part of the content.
If the “otherFile.xml” contained:
<baz>this is my content</baz>Then the XML would be evaluated and “seen” by an XML parser as:
A few references that might be helpful: