[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] fileoutput
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 _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|