This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: How dynamic is XSL?
- To: <xsl-list at mulberrytech dot com>
- Subject: RE: How dynamic is XSL?
- From: Søren Neigaard <neigaard at mobilethink dot dk>
- Date: Thu, 10 Aug 2000 16:40:09 +0200
- Reply-To: xsl-list at mulberrytech dot com
Ok - I now belive (thanks to Linda van...) that I have to use templates
instead. I'm working on it. There's still one thing that puzzels me. How do
I take values from the XML, and place them as values in the result via XSL:
<?xml version="1.0"?>
<?xml-stylesheet href="example.xsl" type="text/xsl" media="explorer"?>
<?cocoon-process type="xslt"?>
<card>
<cardid>index</cardid>
<cardtitle>WAP XML Test</cardtitle>
<imgsrc>Graphics/header.wbmp</imgsrc>
<imgalt>Header</imgalt>
</card>
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/"> <!-- root of XML document -->
<xsl:processing-instruction
name="cocoon-format">type="text/html"</xsl:processing-instruction>
<wml>
<template>
<do type="prev" label="Back">
<prev/>
</do>
</template>
<xsl:variable name="v1"><xsl:value-of select="cardid"/></xsl:variable>
<xsl:variable name="v2"><xsl:value-of
select="cardtitle"/></xsl:variable>
<card id="{$v1}" title"{$v2}"> <!-- dosent work -->
<p align="center">
<img src="<xsl:value-of select="imgsrc"/>" alt="<xsl:value-of
select="imgalt"/>"/> <!-- dosent work -->
</p>
</card>
</wml>
</xsl:template>
</xsl:stylesheet>
-----Original Message-----
From: owner-xsl-list@mulberrytech.com
[mailto:owner-xsl-list@mulberrytech.com]On Behalf Of Thorbjørn Ravn
Andersen
Sent: 10. august 2000 14:50
To: 'xsl-list@mulberrytech.com'
Subject: RE: How dynamic is XSL?
> If I have a XML document with an abitrary mix of text and
> links, can I then
> make only one XSL that always can be used to transform that
> XML document?
>
> For instance the XML could at one time, start with some text,
> then have some
> links, and end with some text. And at another time the XML
> could start with
> some links, then text, and then maybe some links again. I
> think what I'm
> askin, is is the <xsl:for-each> takes care of this problem,
> or if the first
> "for-each" takes care of links, then all the links are
> handled first, and
> there after the text (if any comes after the links)?
>
> Was this question clear?
No. Please show a sample XML file.
Are you working with XHTML documents?
--
Thorbjørn Ravn Andersen "...and...Tubular Bells!"
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list