This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Problem
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: Re: [xsl] Problem
- From: "Robert Koberg" <rob at koberg dot com>
- Date: Sat, 19 May 2001 18:50:13 -0700
- References: <CNEFJPPGLIEMKJECEAKHIEOECAAA.adc@adcworks.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
If it is always the same file then it is very easy. You use the document
function to call in the XML to your stylesheet and apply-templates to it.
For example:
<xsl:variable name="news" select="document('../newsfolder/news1')"/>
<xsl:apply-templates select="$news" mode="news"/>
If you have varying "floating" content then you need to (the way I do it...)
associate it with the main content piece in a "site-config" XML file. I use
a gui and have editors/admin types pick which floating content they want to
associate with a particular page.
Then when the page is getting rendered it calls (document function) the
site-config XML file to find the floating pieces (could be more than one)
and pulls them in using another document funcation call. For example:
<!-- find the correct section to pull the floating content ...example...-->
<xsl:variable name="floaters"
select="document('../xml/site-config.xml)//section[@id='$id')]/floaters"/>
<xsl:apply-templates select="$floaters"/>
then as you read the floaters nodeset, call the document function on each
floater node and apply-templates on it.
----- Original Message -----
From: "Allistair Crossley" <adc@adcworks.com>
To: <XSL-List@lists.mulberrytech.com>
Sent: Saturday, May 19, 2001 12:47 PM
Subject: [xsl] Problem
> Hello,
>
> I am developing a website using XML and XSL. I have come up against a
> problem...on each webpage I want to have a news table. But I do not want
to
> have to add this news cotnent into every XML page because that defeats the
> object. Ideally I would like to have my normal XML pages and then 1 XML
page
> with the news content in.
>
> I am using XSL to format this all out. Does anyone have any clue as to how
I
> can centralise the news content so that the XSL can read it into the
result
> document?
>
> Many thanks.
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list