RE: [xsl] Include with XML?

Subject: RE: [xsl] Include with XML?
From: Roberto Arévalo <roberto.arevalo@xxxxxx>
Date: Tue, 11 Dec 2001 12:03:19 +0100
Gracias Jeni.


Hi Roberto,

> How I can write an include with a value taken of a XML?

You can't. What you can do is to write a stylesheet that takes your
XML document:

>         <LAYER1>layer1.xsl</LAYER1>
>         ............

and generates from it an XSLT stylesheet that has the relevant value
in the href attribute of an xsl:include element in it. Something like:

<stylesheet version="1.0"

<namespace-alias stylesheet-prefix="xsl" result-prefix="#default" />

<template match="/">
  <xsl:stylesheet version="1.0">
    <!-- href attribute comes from source XML -->
    <xsl:include href="{PRINCIPAL/LAYER1}" />
    ... rest of the stylesheet content ...

Running this stylesheet over the XML document will generate the XSLT

<xsl:stylesheet version="1.0"

<xsl:include href="layer1.xsl" />

Which you can then use as usual.

I hope that helps,


Jeni Tennison

 XSL-List info and archive:

 XSL-List info and archive:

Current Thread