Altova Mailing List Archives


RE: How dynamic is XSL?

From: S&oslash;ren Neigaard <neigaard@-------------->
To:
Date: 8/10/2000 6:40:00 PM
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@xxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxx]On Behalf Of Thorbj&oslash;rn Ravn
Andersen
Sent: 10. august 2000 14:50
To: 'xsl-list@xxxxxxxxxxxxxxxx'
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&oslash;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

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.