RE: [xsl] Writing a stylesheet to create another XML Document

Subject: RE: [xsl] Writing a stylesheet to create another XML Document
From: "Kunal H. Parikh" <kunal@xxxxxxxxxx>
Date: Mon, 8 Apr 2002 09:13:05 +1000
G'Day Jeni !

Thanks a million for all the help that you have provided ! I have
managed to get the merging of my XML files working.

Now, another question along the same lines.

What I am trying to do is access Author.xml/AuthorList/Author/Name by
using the following:
TutorialWithAuthorName.xsl
**************************
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">
	<xsl:import href="Identity.xsl"/>

	<xsl:output method="xml" indent="yes" />

	<xsl:variable name="authors" select="document('Author.xml')" />

	<xsl:key name="authors" match="Author" use="@id" />

	<xsl:template match="Author">
		<xsl:variable name="id" select="@id" />
		<xsl:for-each select="$authors">
			<xsl:copy-of select="key('authors', $id)" />
		</xsl:for-each>
	</xsl:template>

	<!-- Beginning of EXTRA STUFF -->

	<xsl:template match="/">
		<xsl:for-each select="Tutorial/AuthorList/Author" >
			<xsl:value-of select="Name" />
		</xsl:for-each>
	</xsl:template>

	<!-- End of EXTRA STUFF -->
</xsl:stylesheet>
**************************

However, in VS.NET which uses MSXML 3.0, there is no output at all if
the "EXTRA STUFF" is there in the stylesheet, else all works out well.


As always, TAM...IA (Thanx a million .... in advance)


Kunal

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Jeni
Tennison
Sent: Sunday, 7 April 2002 03:26
To: Kunal H. Parikh
Cc: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] Writing a stylesheet to create another XML Document

Hi Kunal,

> According to your email, I have modified the files (Included)
>
> However, I don't get any output .... in IE 6.
>
> Do I need to use another XML Parser instead of MSXML ?

Sorry, I accidentlly missed off a $ -- in the template, you need to
access the value of the $authors global variable:

<xsl:template match="Author">
  <xsl:variable name="id" select="@id" />
  <xsl:copy-of select="$authors[@id = $id]" />
</xsl:template>

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


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



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


Current Thread