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

RE: Can one stylesheet handle two different xml files

Subject: RE: Can one stylesheet handle two different xml files with different nodes?
From: kakridge@xxxxxxxxxxxxx
Date: Wed, 14 Jan 2004 14:56:17 -0500
xsl on two xml files
Michael, I see a trivial example in your book(p. 255, 2ed) using the
namespace-alias tag.  I assume this is the procedure that I need to
follow.  Is there a more in depth detail or a resource on the web that
explains this in depth?

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Michael Kay
Sent: Wednesday, January 14, 2004 2:33 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  Can one stylesheet handle two different xml files
with different nodes?

This might be a case for using a "meta-stylesheet", i.e. a stylesheet
that transforms the stylesheet.

Michael Kay

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> kakridge@xxxxxxxxxxxxx
> Sent: 14 January 2004 17:17
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Can one stylesheet handle two different xml 
> files with different nodes?
> 
> 
> If I have two xml files with identical structure, but with 
> different node names, I know I can write one Stylesheet to 
> handle both files. However, is there a more efficient way 
> then the following?  This seems pretty simple, but what if 
> the file is 3 or 4 megabytes?
> 
> For instance:
> 
> <ArrayOfBooks>
> 	<Book>
> 		<Title>FOO</Title>
> 	</Book>
> </ArrayOfBooks>
> 
> and 
> 
> <ArrayOfMagazines>
> 	<Magazine>
> 		<Title>FOOTOO</Title>
> 	</Magazine>
> </ArrayOfMagazines>
> 
> With this Stylesheet:
> 
> <xsl:template match="/">
> 	<xsl:apply-templates/>
> </xsl:template>
> 
> <xsl:template match="ArrayOfBooks | ArrayOfMagazines">
> 	<table>
> 		<xsl:apply-templates/>
> 	</table>
> </xsl:template>
> 
> <xsl:template match="Book | Magazine">
> 	<tr>
> 		<td>
> 			<xsl:value-of select="Title"/>
> 		</td>
> 	</tr>
> </xsl:template>
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 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.