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

What is wrong with this xsl ?

Subject: What is wrong with this xsl ?
From: "Latha V. M." <latha_vm@xxxxxxxxx>
Date: Mon, 20 Jan 2003 18:37:08 -0800 (PST)
split xsl
Hi,
I have the following xsl code:
<?xml version="1.0" encoding="UTF-8"?>

[lsunkara@ateserver ateserver2003]$ cat
XSLSource/SectionForm/split.xsl 
<xsl:stylesheet version="1.1"
       
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
       
xmlns:xhtml="http://www.w3.org/1999/TR/xhtml1/strict">
<xsl:output method="xml" version="4.0"
encoding="UTF-8" indent="yes"/>

<xsl:template match = "/" >
        <xsl:apply-templates select = "survey" />
</xsl:template>

<xsl:template name="survey" match = "xsl:survey" >
        <survey>
                <xsl:copy-of select =
"/survey/surveyInfo"/>
                <xsl:call-template name = "section"/>
        </survey>
</xsl:template>

<xsl:template match = "/xsl:survey/xsl:section" name =
"section" >
        <xsl:variable name = "file" select = "@id" />
        <section sname = "{$file}" number =
"{position()}" href = "{$file}" />
        <xsl:document href = "{$file}" >
                <xsl:copy-of select =
"/survey/section" />
        </xsl:document>
</xsl:template>

<xsl:template match = "*" >
</xsl:template>

</xsl:stylesheet> 
When I run this code as under it does not execute the
template for survey, it only executes the "/"
template.
#!/usr/bin/ksh
#This script uses the Xalan tool to translate a survey
section
#----------------------------------------------------------------------------------------
#LOCALCLASSPATH=/home/lsunkara/xmlold/xalan-j_1_2_2/xalan.jar:/home/lsunkara/xmlold/xalan-j_1_2_2/xerces.jar
LOCALCLASSPATH=/usr/java/xalan-j_2_4_0/bin/xalan.jar:/usr/java/xalan-j_2_4_0/bin/xercesImpl.jar:/usr/java/xalan-j_2_4_0/bin/xml-apis.jar
#----------------------------------------------------------------------------------------
XSL=XSLSource/SectionForm/split.xsl

INPUT=XMLSource/demo-survey.xml
OUTPUT=split1.xml

java -classpath $LOCALCLASSPATH
org.apache.xalan.xslt.Process -IN $INPUT -OUT $OUTPUT
-XSL $XSL -INDENT 2 -TT 

The xml looks like:
<survey>
<surveyInfo>
</surveyInfo>
<intro>
</intro>
<section id="test">
<question></question>
</section>
</survey>

=====
"Great minds have purposes, others have wishes."

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

 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.