Re: [xsl] fileoutput

Subject: Re: [xsl] fileoutput
From: "Joerg Heinicke" <joerg.heinicke@xxxxxx>
Date: Mon, 18 Mar 2002 20:08:11 +0100
As far as I know the classes changed. On this page
http://xml.apache.org/xalan-j/extensionslib.html#redirect you can see an old
example, at the end of the paragraph there is a link to the Redirect class
http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/lib/Redirect.html,
the example there should work.

Joerg

----- Original Message -----
From: "Laura Jenkins" <xsl_list@xxxxxxxxxxx>

> hi here is a problem i have :
>
> i have an xml file schools.xml
> --file schools.xml ---
> <Schools>
> <school>cal</school>
> <school>london</school>
> <school>delhi</school>
> </schools>
>
> --------------------------------------
> my objective is to output each of the  school names is a a different file
> called 'schoolname'-school.txt ( example delhi-school.txt)
> and xsl file goes..
>
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>                 xmlns:xalan="http://xml.apache.org/xslt";
>                 xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
>                 extension-element-prefixes="redirect"
>                 version="1.0">
> <xsl:variable name = "schools" select ="document('schools.xml')"/>
> <xsl:template match="/">
> <xsl:for-each select="$schools">
> <xsl:variable name="sc" select="."/>
> <xsl:variable name="file" select="concat($sc,'-school','.txt')"/>
>
> <redirect:write select="$file">
> <!--
> i want to output each time to a file called schoolname-school.txt (example
> delhi-school.txt)
> -->
> <xsl:value-of select="$sc"/>
> </redirect:write>
> </xsl:for-each>
> </xsl:template>
> </xsl:stylesheet>
>
>
> and there is another XML file against which i run this xsl.
>
> The above code doesnt work!! obviously because of some problem which i am
> unable to understand. My questions:
>
> 1.can someone please tell me where i am going wrong ??
> 2.Id i have a secondary document imported to my XSL file,
> can i get to their children by expression $DocumentName/child??
> laura


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


Current Thread