[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: [xmldev] Including XMLs in XML


varun mehta
Please don't SHOUT.

Varun Mehta <varun@v...> writes:

> Is there anyways where I can include one XML file in another
>
> eg:
>
> XML 1
> ===========
>
> <father>
> 	<child1>HERE INCLUDE FILE 1</child1>
> 	<child2>HERE INCLUDE FILE 2</child2>
> 	<child3>HERE INCLUDE FILE 3</child3>
> 	<child4>HERE INCLUDE FILE 4</child4>
> </father>
>
>
> XML 2
> ===========
>
> <child>
> 	<data1></data1>
> 	<data2></data2>
> </child>
>
> WITHOUT USING PARSERS OF ANY KIND, 

I don't understand what you're getting at here --- what do you read the XML
with, if not a parser?

> CAN I LINK THE TWO FILES SUCH THAT
> THE FINAL XML LOOKS THIS WAY.
> 	
> FINAL XML
> ============
>
> <father>
> 	<child1>
> <!-- THE FILE TWO GET's INCLUDED OVER HERE -->
> 		<child>
> 			<data1></data1>
> 			<data2></data2>
> 		</child>
> 	</child1>
> </father>

You can declare an external entity in the DTD:

<!ENTITY child1Data SYSTEM "path/to/child1.xml">

and then use it in the XML:

<father><child1>&child1;</child1></father>

But that requires a parser to expand the entity.

Anthony
-- 
Anthony Williams
Senior Software Engineer, Beran Instruments Ltd.


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.