OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xmldev] [xml-dev] Including XMLs in XML

[ Lists Home | Date Index | Thread Index ]

Please don't SHOUT.

Varun Mehta <varun@verchaska.com> 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.





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS