[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Writing a stylesheet to create another XML Documen

Subject: RE: Writing a stylesheet to create another XML Document
From: "Kunal H. Parikh" <kunal@xxxxxxxxxx>
Date: Mon, 8 Apr 2002 09:13:05 +1000
create another xml with current
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:  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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.