[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Include with XML?

Subject: Re: Include with XML?
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Mon, 10 Dec 2001 18:24:48 +0000
include stylesheet in xml
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:

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

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"
            xmlns="http://www.w3.org/1999/Transform"
            xmlns:xsl="http://www.w3.org/1999/TransformAlias">

<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 ...
  </xsl:stylesheet>
</template>
            
</stylesheet>

Running this stylesheet over the XML document will generate the XSLT
stylesheet:

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

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

Which you can then use as usual.

I hope that helps,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.