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

RE: dynamic grouping of tabular data; one or two trans

Subject: RE: dynamic grouping of tabular data; one or two transformations?
From: "Chris Bayes" <chris@xxxxxxxxxxx>
Date: Sat, 24 Nov 2001 21:23:36 -0000
stylesheet grouping
Dan,
I'm confused too. I think you need to step back a bit and do

<?xml version="1.0" encoding="UTF-16" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method = "html" encoding="Windows-1252" />
	<xsl:template match="/">
		<!-- don't do anything here but set up the script -->	
		<html>
			<head>
				<script type="text/javascript">
					function doIt(){
						// grab the original xml
						var xml =
document.XMLDocument;
						// and the first
transform
						var xsl = new
ActiveXObject("msxml2.domdocument");
						xsl.async = false;
	
xsl.load("stylesheet1.xsl");
						// transform xml/xsl to
result1
						var result1 = new
ActiveXObject("msxml2.domdocument");
	
xml.transformNodeToObject(xsl, result1);
						// now get the second
stylesheet
	
xsl.load("stylesheet2.xsl");
						// now use it on the
result of the first transform
						var html =
result1.transformNode(xsl);
						// and replace this
stuff with the result
						var newDoc =
document.open("text/html", "replace");
						newDoc.write(html);
						newDoc.close();
					}
				</script>
			</head>
			<body onload="doIt()"></body>
		</html>
	</xsl:template>
</xsl:stylesheet>

Which means that you have 3 stylesheets. You could do it with 2 but it
would be a bit more long winded.

Ciao Chris

XML/XSL Portal
http://www.bayes.co.uk/xml


> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Dan Diebolt
> Sent: 24 November 2001 20:30
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  dynamic grouping of tabular data; one or 
> two transformations?
> 
> 
> > >   xsl2 = xml.transformNode(xsl1);
> > >   html = xml.tranformNode(xsl2);
> > 
> > But I think that using a two-step transformation where the first 
> > transformation generates the keys that you use for the second 
> > transformation is probably more straight-forward in the long run.
> 
> Okay I have my two transfomations working properly from a 
> command line but I am having some difficulty packaging it. 
> Basically I am stuck with 
> an XML file with a stylesheet reference in it:
> 
> <?xml version="1.0"?>
> <?xml-stylesheet type="text/xsl" href="Group.xsl"?>
> <root>
>  <row> <A>0</A> <B>0</B> <C>0</C> <D>0</D> </row>
>  ...
>  <row> <A>1</A> <B>1</B> <C>1</C> <D>1</D> </row>
> </root>
> 
> In the stylesheet Group.xsl I am attempting to do the two 
> transformations within msxml script:
> 
>   <msxsl:script language="javascript" implements-prefix="user">
>   <![CDATA[
>    function DoIt(xml,xsl1) {
>     xsl2 = xml.transformNode(xsl1.documentElement);
>     html = xml.transformNode(xsl2.documentElement);
>     return html;
>    }
>   ]]> 
>  </msxsl:script>
> 
> <xsl:variable name="result" 
>      select="user:DoIt(document(''),document('Group1.xsl'))"/>
> 
> Group1.xsl is the styleshet that will generate the stylesheet with 
> key definitions in it. I am a little confused if I can proceed like 
> this and exactly what type of object the XSLT function document() 
> passes to the JavaScript DoIt function. I have never had to 
> do a transform within JavaScript called from within a 
> stylesheet before. Can anyone clear this up? Thanks.
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! GeoCities - quick and easy web site hosting, just 
> $8.95/month. http://geocities.yahoo.com/ps/info1
> 
>  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.