Re: [xsl] Using value-of to extract non-escaped characters

Subject: Re: [xsl] Using value-of to extract non-escaped characters
From: Ralph Holz <Ralph.Holz@xxxxxxxxxx>
Date: Sun, 31 Mar 2002 16:03:15 +0100

In general, XSLT processors can handle these caracters.
I guess you tried to build an element node and assigned
one of the suspect values to its name. Can you post the
relevant XSLT snippets where the errors occur?

Sure, but I'll post all the code and the XML file. I hope that it is readable on your e-mail clients.


I don't get a line where the error occurs, sorry.

========= xsl ==================================================================================

<xsl:template match="flash">
<html>
<head>
<title><xsl:value-of select="title" /></title>
</head>
<body>
<object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,0,0,0"; id="gravity4" width="430" height="330">
<xsl:apply-templates select="startfile" />
<xsl:for-each select="parameter">
<xsl:copy-of select="." />
<xsl:element name="param">
<xsl:attribute name="name"><xsl:value-of select="name" /></xsl:attribute>
<xsl:attribute name="value"><xsl:value-of select="value" /></xsl:attribute>
</xsl:element>
</xsl:for-each>
</object>
</body>
</html>
</xsl:template>


<xsl:template match="startfile">
<xsl:element name="embed">
<xsl:attribute name="src"><xsl:value-of select="startfile" /></xsl:attribute>
<xsl:for-each select="parameter">
<xsl:variable name="name"><xsl:value-of select="name" /></xsl:variable>
<xsl:variable name="value"><xsl:value-of select="value" /></xsl:variable>
<xsl:attribute name="{$name}"><xsl:value-of select="name" /></xsl:attribute>
<xsl:attribute name="{$value}"><xsl:value-of select="value" /></xsl:attribute>
</xsl:for-each>
</xsl:element>
</xsl:template>


========= xml ==================================================================================

<flash xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="C:\Ralph\XML Schemas\game\flash.xsd">
<title>TopCat</title>
<startfile>topcatlaundry.dcr
<parameter>
<name>bgColor</name>
<value>#333366</value>
</parameter>
<parameter>
<name>width</name>
<value>430</value>
</parameter>
<parameter>
<name>height</name>
<value>330</value>
</parameter>
<parameter>
<name>swRemote</name>
<value>swSaveEnabled='true' swVolume='true' swRestart='true' swPausePlay='true' swFastForward='true' swContextMenu='true'</value>
</parameter>
<parameter>
<name>swStretchStyle</name>
<value>fill</value>
</parameter>
<parameter>
<name>type</name>
<value>application/x-director</value>
</parameter>
<parameter>
<name>pluginspage</name>
<value>http://www.macromedia.com/shockwave/download/</value>
</parameter>
</startfile>
<parameter>
<name>swRemote</name>
<value>swSaveEnabled='true' swVolume='true' swRestart='true' swPausePlay='true' swFastForward='true' swContextMenu='true'</value>
</parameter>
<parameter>
<name>swStretchStyle</name>
<value>fill</value>
</parameter>
<parameter>
<name>bgColor</name>
<value>#333366</value>
</parameter>
</flash>


========= end =================================================================================

Thanks,
Ralph


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



Current Thread