OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help




[ Lists Home | Date Index | Thread Index ]
  • From: "Michael O' Dell" <maod@hotmail.com>
  • To: xml-dev@xml.org
  • Date: Thu, 15 Jun 2000 10:19:25 GMT

Hello all,

Apologies for this 'newbie' question, yet again.

The following, when parsed through XSL transformations, works, but I don't 
know why. To me, it appears, (if I were to draw this in a graphical form) 
that this shouldn't work, but it does... Why?

Your answers / help / suggestions are appreciated.




Here is the XML document:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="Links.xsl"?>

   <division id="North">
      <description>This is a test <link url="localhost">link                 
       stuff</link> embedded.
   <division id="South">
      <description>...And in this test, the link is embedded really          
really deep in the text <link url="localhost">link 2
         stuff</link> embedded. No worries, it seems.
   <division id="West">
      <description><link url="localhost">How about starting with a          
link</link>, cool heh! </description>


Here is the XSL:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" 

<xsl:template match="/">
<html xsl:version="1.0"    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
      <title>Sales Results By Division</title>
      <table border="1">

         <xsl:for-each select="sales/division">
         <!-- order the result by revenue -->
            <xsl:sort select="revenue" data-type="number"                 

                     <em><xsl:value-of select="@id"/></em>
                     <xsl:value-of select="revenue"/>

                    <!-- highlight negative growth in red -->
                    <xsl:if test="growth &lt; 0">
                       <xsl:attribute name="style"> 								                 
                   <xsl:value-of select="growth"/>
                   <xsl:value-of select="bonus"/>
                   <xsl:apply-templates select="description"/>

<xsl:template match="description">
	<xsl:apply-templates />

<xsl:template match="link">
	<a href="{@url}">
		<xsl:value-of select="." />

Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@xml.org&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS