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

Re: several questions on XML to HTML processing with XSL

Subject: Re: several questions on XML to HTML processing with XSL
From: Warren Hedley <w.hedley@xxxxxxxxxxxxxx>
Date: Fri, 09 Jun 2000 11:26:50 -0400
xsl how to use img
H.vanderLinden@xxxxxxxxxxxxx wrote:
> 
> This is similar to what I have except for the <xsl:apply-templates /> part.
> This is more detailed with <xsl:call-template...> statements.
> I want to get rid of this structure since it involves copying the actual
> content of the DIV/LAYER part and
> modifications to that part should be carried out twice.

Michael Kay's answer was actually much better than mine.
Use <xsl:element name="{$PageSection}"> ...

> > turns <img src="img.jpg" /> into <img src="img.jpg">
> > and <br /> into <br>.
> 
> Ah well, I didn't know about that (thanks for the info) but at the moment
> it's not relevant to my problem.

Actually - it's completely relevant.

> <maintext>
> <table cellspacing='0' border='0'>
> <tr><td><img src='myimage.jpg'></td><td>some text</td></tr>
> </table>
> <!-- some more HTML formatted text -->
> </maintext>

You should combine <xsl:copy-of /> with the HTML output method.

<xsl:template match="maintext">
  <xsl:copy-of select="child::node()" />
</xsl:template>

Use well-formed XML, and it will magically be transformed to
abbreviated HTML - ie. you should use <img /> in your XML.

> 4. How do I declare a variable parametername?
> 
> I'd like to do the following, but Saxon returns an errormessage on the
> <xsl:with-param> line (invalid $ character).
> 
> <xsl:variable name="ParamName">someXMLtag/@someAttribute</xsl:variable>
> 
> <xsl:call-template name="SomeTemplateName">
>    <xsl:with-param name="$ParamName">whateverValue</xsl:with-param>
> </xsl:call-template>

I don't quite understand what you're trying to do - do you mean to
say that you don't know the name of a parameter in a named template?

The name attribute on <xsl:with-param> must be a QName, so you
can't set this dynamically in any case.

-- 
Warren Hedley


 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.