On Thursday, February 27, 2003, at 03:22 AM, Tom Howe wrote:


hmm, thanks for that. Im going to have to try some of these examples and
see where it gets me.


Im also wary of the document() call since this means that the stylesheet
is requesting for a component to be built and I am used to building the
components first and then applying the stylesheets afterwards. This
allows all my components access to the same perl objects available at
XSP runtime. But maybe there are ways around that too.


In fact, use of the document() call for specific tasks *may* mean that
the individual components get cached separately. Which would be a good
thing.

I hope that it does!! That's one of the main reasons I started to use it. In fact, I think it might be possible to optimize non-cacheable XSP pipelines by using axkit: URIs to pull in the other elements at the end of the pipeline, thus minimizing the amount of non-cacheable content to just the XSP.


simon


Cheers, Tom


-----Original Message-----
From: S Woodside [mailto:[EMAIL PROTECTED]
Sent: 27 February 2003 07:57
To: Tom Howe
Subject: Re: Building Component driven sites using XSLT?


Yeap, it's pretty easy to do this, especially with axkit 1.6.1 that has the axkit: URI scheme (thanks matt!)

In your site XSLT insert a document() call, such as <xsl:copy-of
select="document('axkit:/components/menu.xml')"/>

use PIs or .htaccess directives to assign whatever XSLT to
/components/menu.xml you want... they will be applied and the result
will be inserted into your site XSLT's output at that point. Or if you
want to do further processing, you can use <xsl:apply-templates
select="document(...)"/> and so on. It's very flexible.

A more advanced trick, you can define the components to include in the
XML input to the site XSLT by doing something like this:

           <xsl:if test="localmenu">
             <hr />
             <xsl:copy-of
select="document(concat('axkit:',string(localmenu)))"/>
           </xsl:if>

That' says, if there's a localmenu node (e.g.,
<localmenu>/components/foo/localmenu.xml</localmenu>) child in the
context node, then it constructs an appropriate axkit URI (in this
example, it would be axkit:/components/foo/localmenu.xml ). and then
copy the (processed by axkit) result into the output.

I like XSLT :-)

HTH,

simon

On Wednesday, February 26, 2003, at 11:04 AM, Tom Howe wrote:

Essentially we have a component driven site. Each part of a page is
described by a separate XML file plus there are XML files that relate
to the url that is being accessed, we call these the primary page.

eg
 we have xml files for primary pages: /home/index.xml,
/home/signin.xml etc

and
 we have xml files for components: /components/menu.xml,
/components/header.xml etc

Any primary page xml or component xml file can "require" (by means of
<include/> tags  that another component is loaded. The various
component xml files are then combined to form one long XML file that
is first processed by XSP and then by XPathScript.

--
www.simonwoodside.com -- 99% Devil, 1% Angel


--
     anti-spam: do not post this address publicly
www.simonwoodside.com -- 99% Devil, 1% Angel


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to