Re: [xsl] new to XML/XSL - having problems with broswer compatibility and functions

Subject: Re: [xsl] new to XML/XSL - having problems with broswer compatibility and functions
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Wed, 05 Jun 2002 23:15:09 +0200
Hello Michael,

you change your stylesheets from a MS-proprietary implementation of the working draft to the XSLT standard - that's great ;-)

Look at the archives for help, tutorials, references on XSLT or the spec itself.

Examples:
http://www.zvon.org/xxl/XSLTreference/Output/index.html
http://www.dpawson.co.uk/
http://www.w3.org/TR/xslt
http://www.topxml.com/

Your problem with <xsl:value-of/> can easily be solved with <xsl:value-of select="."/>.

Regards,

Joerg

Michael Leahy wrote:
Hello list,

I'm just getting started developing an XSL stylesheet for displaying metadata from XML files for various datasets, and I need some help with the programming. Here is my situation:

I have a stylesheet that works in IE5.5 and up, but no versions of Netscape. The original header/namespace for this XSL document that was used is "<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"; TYPE="text/javascript">".

When I changed this to "<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">" the stylesheet would work in Netscape 6.2, and sort-of load in IE5.5 (but not IE6). Now my problem is that some of the code that was previously used no longer works.

First of all, I am no longer able to specify the <BODY> properties - as soon as I do this, all the XSL commands become invalid expressions.

Next, and more importantly, I need to be able to list the characteristics of multiple attributes (i.e. many "attr" tags in the XML file) in a table.

This is how it was previously done:

The following line was used to check if any "attrlabl" elements were used for any of the "attr" tags within the "context" path.

<xsl:if test="context()[attr/attrlabl[. != '']]">

This command was repeated to determine if any other elements within the "attr" tags were used, and if so, an appropriate column would be added to a table. The problem here is that "context()" is apparently no longer a valid function (as IE6 indicated)

In the following loop, the contents of each "attr" tag was added to the table as a row:

<xsl:for-each select="attr[attrlabl != '']">
<tr bgcolor="#ffffff">
<!-- Write out the name of the attribute -->
<xsl:for-each select="attrlabl">
<td>
<DIV CLASS="attribute"><font color="#000000" face="Arial, Helvetica, sans-serif" size="2"><xsl:value-of /></font></DIV>
</td>
</xsl:for-each>
.....
</tr>
</xsl:for-each>


The problem with this part of the code is that IE6 does not like the <xsl:value of /> being used without a select="" statement in it. I don't know if this is a result of some other error, or if I should be doing this some other way.

Also, I don't seem to be able to add any javascript to the document.

I would greatly appreciate if anyone could offer some suggestions, or perhaps point me to a helpful source.

Kind regards,
Michael Leahy


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


Current Thread