Re: [xsl] Format text within a XML tag...

Subject: Re: [xsl] Format text within a XML tag...
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 18 Jun 2002 12:08:05 +0100
> Yes, I want to use the standard XSLT language, I added the script as a 
> "quick and dirty" solution to be able to demo it for some customers...

but if you are using XSLT then xsl:script is a syntax error not
a solution (not even of the quick and dirty kind).

Here's what I got:

<xsl:template match="/">
  <xsl:for-each select="./Output">
    <tr>
      <td>... some tags ...</td>
    </tr>
    <xsl:for-each select="./MapRule">


so far so good, although ./Output could more simply be wrriten as Output
as could ./MapRule


     <!-- Here I want to "mark" the comments -->
          <xsl:value-of select="./objectrule" />
        </td>

so replace that value-of by 
<xsl:call-template to a named template that does the
replacement. Someone just posted some code that looked about right so I
won't repeat here.


> When trying to add another template within the <td> tag 

> "Keyword xsl:template may not be used here."


You can't put xsl:templates inside anything. yhey are all at teh top
level, children of xsl:template.
A template specifies what code to execute if you ever apply templates to
a matching node. the order of the xsl:template instructions is imeterial
(except for error recovery) and as teh definitions of this matching
behaviour is essentially global it wouldn't make sense to nest them 9and
it's not allowed).

Note that changing from the-language-known-as-xsl-in-ie5 to XSL isn't
just a matter of changing the namespace it is essentially a completely
different language.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

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


Current Thread