Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Help in XSL - better example

Manish,

A better example -

<xsl:stylesheet name="Test2"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method = "html"/>
<xsl:variable name="root" select="/mydata/questionire"/>
<xsl:template match="/mydata">
<table>
<xsl:apply-templates select="question-id"/>
</table>
</xsl:template>
<xsl:template match="question-id">
<tr>
<xsl:for-each select="id">
<td><xsl:value-of select="."/></td>
<td><xsl:value-of
select="$root/question[qid=current()]/desc"/></td>
</xsl:for-each>
</tr>
</xsl:template>
</xsl:stylesheet>

Normally, using "//" is not a good idea becuase it searches every node.
By using an xsl variable as a 'position locator' for the second
xsl:value-of operation, it restricts the search to just matching nodes.

Greg
[1007 byte] By [Greg Longtin] at [2007-11-9 14:55:24]
# 1 Re: Help in XSL - better example
Greg,
I have observed that you are referring to
"http://www.w3.org/1999/XSL/Transform" namespace in your xsl
files.IE 5.0 does not accept the Transform namespace.Are you a different
browser coz most of the methods r not acceptable in IE5 when u use Transform.In
the example below <xsl:variable> is not accepted in IE 5.0.
Any idea as to how to resolve this problem?

Many Thanks

"Greg Longtin" <longtin@att.net> wrote:
>Manish,
>
>A better example -
>
><xsl:stylesheet name="Test2"
>xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
><xsl:output method = "html"/>
><xsl:variable name="root" select="/mydata/questionire"/>
><xsl:template match="/mydata">
> <table>
> <xsl:apply-templates select="question-id"/>
> </table>
></xsl:template>
><xsl:template match="question-id">
> <tr>
> <xsl:for-each select="id">
> <td><xsl:value-of select="."/></td>
> <td><xsl:value-of
>select="$root/question[qid=current()]/desc"/></td>
> </xsl:for-each>
> </tr>
></xsl:template>
></xsl:stylesheet>
>
>Normally, using "//" is not a good idea becuase it searches every node.
>By using an xsl variable as a 'position locator' for the second
>xsl:value-of operation, it restricts the search to just matching nodes.
>
>Greg
>
TO GREG at 2007-11-11 23:33:54 >
# 2 Re: Help in XSL - better example
choclatecake,

I'm using the MSXML 3 March preview. It does support this namespace. If
you read the release notes, it doesn't replace MSXML in IE5 unless you run
an exe that changes the GUID's, etc

See the MSDN site for the downloads...

Greg

"TO GREG" <choclatecake@hotmail.com> wrote in message
news:39201f72$1@news.dev-archive.com...
>
> Greg,
> I have observed that you are referring to
> "http://www.w3.org/1999/XSL/Transform" namespace in your xsl
> files.IE 5.0 does not accept the Transform namespace.Are you a different
> browser coz most of the methods r not acceptable in IE5 when u use
Transform.In
> the example below <xsl:variable> is not accepted in IE 5.0.
> Any idea as to how to resolve this problem?
>
> Many Thanks
Greg Longtin at 2007-11-11 23:34:49 >
# 3 Re: Help in XSL - better example
How to change the GUID and make MSXML3 work with IE5?
Yuenan Yang at 2007-11-11 23:35:59 >
# 4 Re: Help in XSL - better example
Yuenan,

From the xmlsdk30.chm help file (which is part of the MSXML SDK download),
search on "replace mode", topic "Running Msxml3 in Replace Mode" --

When you install Msxml3.dll, the Xmlinst.exe installer tool is added to your
system directory. You can use Xmlinst.exe to run Msxml3.dll in Replace mode.

In Replace mode, the tool modifies the registry entry to appear as if the
entry was created by Msxml.dll, and overwrites the InprocServer32, TypeLib
and Default Icon values. This modification allows applications that are
coded to the previous ClassIDs and ProgIDs to take advantage of the new
functionality in Msxml3 without changing your code.

HTH,

Greg

"Yuenan Yang" <yuenan@idcglobal.com> wrote in message
news:39240c68$1@news.dev-archive.com...
>
> How to change the GUID and make MSXML3 work with IE5?
Greg Longtin at 2007-11-11 23:36:57 >