Hi;
I have a XSL file which works with Xalan processor from the command-line
without any problem, but when I try with Cocoon 1.8.2 , i receive
errors. I need help to figure out what am i doing wrong? I'm attaching
my XSL and XML file.
I also need help to figure out how can I make this process automatic
rather than changing the xsl params each time. If you look at the xml
file there are several Task tags, I want to be able to output seperate
page for each <Task> </Task> pair. Is it possible to do this with one
xsl script? If yes, would you please show me how to do it, or send me an
example.
Error Message: org.apache.xalan.xslt.XSLProcessorException: Warning:
can't output text before document element! Ignoring...
main3.xsl
------------------
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:processing-instruction
name="cocoon-format">type="text/html"</xsl:processing-instruction>
<xsl:param name='SectionNum' select='020' />
<xsl:param name='TaskNo' select='2' />
<html>
<head><b><xsl:value-of
select='Module/Task[$TaskNo][@SectionNum]/Title' /></b></head>
<body>
<p><xsl:value-of
select='Module/Task[$TaskNo][@SectionNum]/Intro/para' /></p>
<xsl:choose>
<xsl:when
test="count(Module/Task[$TaskNo][@SectionNum]/Step)>0">
<ol>
<xsl:for-each select='Module/Task[$TaskNo][@SectionNum]/Step'
>
<li>
<xsl:apply-templates />
</li>
</xsl:for-each>
</ol>
</xsl:when>
<xsl:when
test="count(Module/Task[$TaskNo][@SectionNum]/SubTask)>0" >
<xsl:for-each
select='Module/Task[$TaskNo][@SectionNum]/SubTask' >
<p><b><xsl:text> </xsl:text><xsl:value-of
select='./title' /></b></p>
<p><xsl:value-of select='./Intro' /></p>
<ol>
<xsl:for-each select='./Step' >
<li>
<xsl:apply-templates />
</li>
</xsl:for-each>
</ol>
</xsl:for-each>
</xsl:when>
</xsl:choose>
</body>
</html>
</xsl:template>
<xsl:template match='guilabel'>
<b><xsl:text>[</xsl:text><xsl:value-of
select='.'/><xsl:text>]</xsl:text></b>
</xsl:template>
<xsl:template match='emphasis'>
<b><xsl:value-of select='.'/></b>
</xsl:template>
</xsl:stylesheet>
---------------------
xml file
----------------------
<?xml version="1.0"?>
<Module ModuleNum="004">
<title>
<para>Daily Maintenance</para>
</title>
<Intro>
<para>These procedures provide the step-by-step instructions
for performing
the daily maintenance tasks of warming-up the tube and
performing air (fast)
calibrations. </para>
</Intro>
<Competency>Perform daily maintenance procedures.</Competency>
<Task SectionNum="010"><Title>Tube Warm-Up</Title>
<Intro>
<para>For optimum performance and consistent image
quality, perform a
tube warm-up if your system has been inactive for two
or more hours. The system
will notify you at the two hour time limit with a
warning dialog box. It is
desirable to perform a tube warm-up procedure along
with fast calibrations once
per 24 hours.</para>
</Intro>
<Objective> Tube warm-up.</Objective>
<Step>
<QuickStep>
<para>From the scan monitor, click <guilabel>[Daily
Prep]</guilabel>.</para>
</QuickStep>
</Step>
<Step>
<QuickStep>
<para>Click <guilabel>[Tube
Warm-Up]</guilabel>.</para>
</QuickStep>
</Step>
<Step>
<QuickStep>
<para> Click <guilabel>[Accept & Run Tube
Warm-up]</guilabel> to
proceed.</para>
</QuickStep>
</Step>
<Step>
<QuickStep>
<para> Press <emphasis>Start Scan</emphasis>.</para>
</QuickStep>
</Step>
<Step>
<QuickStep>
<para> Select <guilabel>Quit</guilabel> or proceed to
Fast
Calibrations.</para>
</QuickStep>
</Step>
</Task>
<Task SectionNum="020"><Title>Air Calibrations</Title>
<Intro>
<para>Air calibrations, also called Fast Cals, must be
performed
following a tube warm-up procedure. These calibrations
ensure consistent image
quality and radiation exposure.</para>
</Intro>
<Objective>Perform Air Calibrations.</Objective>
<Step>
<QuickStep>
<para>After completing the tube warm-up, click
<guilabel>[Fast
Cals]</guilabel>.</para>
</QuickStep>
</Step>
<Step>
<QuickStep>
<para>Press <emphasis>Start Scan</emphasis>.</para>
</QuickStep>
</Step>
<Step>
<QuickStep>
<para>Click <guilabel>[Quit]</guilabel>.</para>
</QuickStep>
</Step>
</Task>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>