This week's book giveaways are in the iOS and Features new in Java 8 forums.
We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient and have the authors on-line!
See this thread and this one for details.
The moose likes XML and Related Technologies and the fly likes XML within XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML within XML" Watch "XML within XML" New topic

XML within XML

Gitanjali Magani

Joined: Oct 21, 2005
Posts: 3

How can I include an XML [Having same dtd] into another XML.

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8920

Not sure about youre question. Are you asking how to refer to DTD in a XML document or how to include an external XML file in a XML file.

For first one

For 2nd one use XInclude.

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42954
If you don't need to mix elements (i.e., the included XML is just a text blob to the including XML), use a CDATA section.

If you need to access elements of both at the same time, give each a namespace. As suggested, XInclude can help as well.
I agree. Here's the link:
subject: XML within XML