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

conversion from xslt2.0 to xslt1.0

Subject: conversion from xslt2.0 to xslt1.0
From: "TDarksword" <tdarksword@xxxxxxxxxxxx>
Date: Tue, 22 Jun 2004 16:30:18 +0100
xslt2.0
I was given a piece of XSLT that uses Saxon to work. Unfortunately my
webhost doesnt support Java, but it does support PHP so I can use sablotron
but not saxon. What I thus need to do is convert the following piece of
XSLT2.0 to XSLT1.0.

<?xml version="1.0"?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
<xsl:output method="xml" indent='yes' encoding="utf-8"/>

<xsl:template match="server">
<xsl:variable name="servername" select="substring(@name,1,4)"/>
<xsl:variable name="filename"
select="concat('file:///','h:/inetpub/wwwroot/','serverdump_',$servername,'.
xml')"/>
<xsl:result-document href="{$filename}">
<resources>
<xsl:for-each
select=".//resource[not(@swgcraft_id=preceding::*/@swgcraft_id)]">
<xsl:sort select="."/>
<resource>
<xsl:attribute name="swgcraft_id" select="./@swgcraft_id"/>
<xsl:copy-of select="name"/>
<xsl:copy-of select="type"/>
<xsl:copy-of select="er"/>
<xsl:copy-of select="cr"/>
<xsl:copy-of select="cd"/>
<xsl:copy-of select="dr"/>
<xsl:copy-of select="fl"/>
<xsl:copy-of select="hr"/>
<xsl:copy-of select="ma"/>
<xsl:copy-of select="oq"/>
<xsl:copy-of select="sr"/>
<xsl:copy-of select="ut"/>
<xsl:copy-of select="pe"/>
<xsl:copy-of select="verified"/>
<xsl:copy-of select="available_timestamp"/>
<planets_on>
<xsl:variable name="resource" select="./@swgcraft_id" />
<xsl:for-each select="../../..//resource[@swgcraft_id=$resource]">
<xsl:value-of select="../../@name"/>
<xsl:if test="position()!=last()">
</xsl:if>
</xsl:for-each>
</planets_on>
</resource>
</xsl:for-each>
</resources>
</xsl:result-document>
</xsl:template>

</xsl:transform>

I'm guessing that as I can't use result-document, I'll need to do each
server 1 at a time, with parameters passed through from PHP to Sablotron,
unless anyone has any better ideas..


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.