Hello!
I can’t properly get result into my Nokia emulator version 3.0 browser from my xsl stylesheet by using tag name: <xsl:attribute name=“href”>. Data from TAMINO are correct display in pretty table but I can’t make href attribute in my XSL file in order to ASP page displayed in NOKIA will good transform.
Please help me!
Regards Dariusz Baumann POLAND
Muiris
(Muiris )
April 16, 2002, 3:23pm
2
Hi
How and where are you using the xsl:attribute tag ? You should have it immediately after the tag you are trying to add the attribute to.
e.g.
<xsl:attribute name=“href”> … etc.
Regards, Muiris.
Hello!
Thanks Muiris for reply. Before you answered I got a idea. I used
tag instead of tag, so that is why it was not worked.
NOW, it worked!
Regards Dariusz Baumann POLAND
Guest
(Guest)
April 17, 2002, 4:05pm
4
To find out what you’re doing wrong, I’ll need to see your code, and to know a little bit more about the input and desired output of your transformation. Michael Kay
Hello! My previous XSL was: -------------------------------- <?xml version="1.0" ?> <xsl:stylesheet xmlns:xsl=“XSLT Namespace ” version=“1.0”> <xsl:output omit-xml-declaration=“yes”/> <xsl:template match=“/”>
<xsl:for-each select=“//mydatabase”>
</xsl:for-each>
Nr Name Address <xsl:value-of select=“nr”/> <xsl:value-of select=“name”/>
<xsl:attribute name=“href”>find.asp?nr=<xsl:value-of select=“nr” />&address=<xsl:value-of select=“address” /> </xsl:attribute> <xsl:value-of select=“address” />
</xsl:template>
</xsl:stylesheet>
--------------------------------
My corrected XSL is:
--------------------------------
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl=“
XSLT Namespace ” version=“1.0”>
<xsl:output omit-xml-declaration=“yes”/>
<xsl:template match=“/”>
<xsl:for-each select=“//mydatabase”>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
--------------------------------
The one difference is tag
instead of tag Regards Dariusz Baumann POLAND
Guest
(Guest)
April 18, 2002, 3:53pm
6
Thanks, it’s nice when a problem turns out to be that easy. I’m surprised your XSLT processor a(or rather, your XML parser) allows you to write <xsl:attribute name=“href”>find.asp?nr=<xsl:value-of select=“nr” />&address=<xsl:value-of select=“address” /> </xsl:attribute><xsl:value-of select=“address” /> - the “&” should be escaped as “& a m p ;” (perhaps it was, but has been corrupted by the forum software?) I personally tend to write this kind of thing using attribute value templates: It’s just a bit shorter and easier to read (and therefore easier to spot mistakes). Michael Kay
Guest
(Guest)
April 18, 2002, 3:55pm
7
Yes, it appears that when you type “& a m p ;” into a forum message (without the spaces), it comes out as “&”. Michael Kay