This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: include ?


 Eduardo,

There are two ways to do acheive your goal.

1 - Use an external entity.

<!DOCTYPE TEST [
<!ENTITY yourfile SYSTEM "yourfile.xml">
<!--this file cannot have a DOCTYPE, but can have an XML declaration (maybe
its a restricted one ... I can't remember) -->
]>

<TEST>
&yourfile;
<BODY>
</BODY>
</TEST>

2. use the document function in XSLT.

In your DOC, you might have:

<IncludeLink url="yourfile.xml"/>

In your XSLT you might have:

<xsl:template match="IncludeLink">
  <xsl:apply-templates select="document(@url)"/>
</xsl:template>


Either of those should work well. It all depends on whether you want to use
validate the fragment on its own (difficult with first method) and which
language you want to use to process your document. I prefer the XSLT method,
but either will work.

HTH,

Rich

-----Original Message-----
From: Eduardo Dominguez [mailto:edmz@emonterrey.com]
Sent: Friday, September 08, 2000 12:03 PM
To: xsl-list@mulberrytech.com
Subject: xml:include ?


Is there something like this ? Havent found a refernce
for it. 

I want to be able to include a fixed xml file in
every other file, so that that I only have to
edit in one place and every file that includes
it reflects this change.

is this possible ?

thanks in advance.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]