With Xalan 1.5.0 & Xerces 2.2.0 this command
Xalan -o /tmp/search.out /tmp/search.xml /home/xdoc/xslt/index_search.xsl

Results:
XSLT error: Character data is not allowed at this position in the
stylesheet (/home/xdoc/xslt/index_search.xsl, line 549, column 1)

The line 549 is the place where the named template is beginning.

With Xalan 1.4.0 & Xerces 2.1.0 it outputs the resulttree correctly.
The XSLT is here below (it quite long and not so pretty):

So the question is: what is going on?

Cheers,
jarkko

<xsl:stylesheet version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<!-- Defining the Colors used in the layout -->
        <xsl:import href="colors.xsl" />
<!-- Images used -->
        <xsl:import href="images.xsl" />
<!-- profiler -->
        <xsl:import href="profiler.xsl" />
<!-- logwriter -->
        <xsl:import href="logwriter.xsl" />

<xsl:output method="html" encoding="ISO-8859-1" indent="yes" />
<xsl:param name="date"/>
<xsl:template match="/">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>Advanced Search</title>
   <!-- <script language="JavaScript" src="/js/scripts.js"></script> -->
  <link REL="stylesheet" TYPE="text/css" HREF="/css/notunsigned.css"/>

<!--
************************************************************************
SCRIPT: tests that every field in start date and end date is selected
************************************************************************
-->
<script LANGUAGE="JavaScript">

function concat()
        {
        document.search.from.value = document.search.start_year.value +
"-" + document.search.start_month.value + "-" +
document.search.start_day.value;
        document.search.to.value =  document.search.to_year.value + "-" +
document.search.to_month.value + "-" + document.search.to_date.value
        }

function checkFields() {
missinginfo = "";

if (document.search.start_day.value == "")
{
missinginfo += "\n     -  start day of the search";
}
if(document.search.start_month.value == "")
{
missinginfo += "\n     -  start month of the search";
}
if(document.search.start_year.value == "")
{
missinginfo += "\n     -  start year of the search";
}
if (document.search.to_date.value == "")
{
missinginfo += "\n     -  end day of the search";
}
if(document.search.to_month.value == "")
{
missinginfo += "\n     -  end month of the search";
}
if(document.search.to_year.value == "")
{
missinginfo += "\n     -  end year of the search";
}
if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in your:\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}
</script>

<script language="javascript">

        function validate()
        {
        concat();
        return checkFields();

        }
</script>


<script TYPE="text/javascript" LANGUAGE="JavaScript">

function show(divID) {
if (document.layers &amp;&amp; document.layers[divID] != null)
        document.layers[divID].visibility = 'visible';
else if (document.all)
        document.all[divID].style.visibility = 'visible';
else if (document.getElementByID)
        document.getElementById(''+divID+'').innerHTML=html
        document.getElementById(''+divID+'').style.visibility = 'visible';
}
function hide(divID) {
if (document.layers &amp;&amp; document.layers[divID] != null)
        document.layers[divID].visibility = 'hidden';
else if (document.all)
        document.all[divID].style.visibility = 'hidden';
else if (document.getElementById)
        document.getElementById(''+divID+'').style.visibility = 'hidden';
}
</script>

</meta>
</head>
<!--  DISABLED: NO write to log -->
        <xsl:value-of select="$UserData"/>
        <div style="position:absolute; z-index:1; top:14px; left:8px;">
                <table width="100%" height="35" border="0" cellspacing="0"
                 cellpadding="1" BACKGROUND="{$UpperBackGroundImg}">
                <tr>
                <td width="100%" valign="top"><img
src="/kuvat/xdoc.jpg"/></td>
                </tr>
                <tr>
                <td width="100%" valign="top" align="left">
                <p><font color="#FFFFFF" size="2">
                <b>XDoc
                <xsl:value-of
select="document($language_setting)/Language/ViewNavigation/AdvSearch" />
                </b></font></p></td>
                </tr>
                </table></div>

<div style="position:absolute; z-index:2; top:69px; left:8px;">
<form name="search" onSubmit="return validate();" method="GET"
action="/cbroker/XMLServ/XMLHan">
        <input type="hidden" name="status" value="{/XDoc/@status}"/>
        <input type="hidden" name="command" value="search"/>
        <input type="hidden" name="from" value=""/> <!-- value comes form
javascript concat() -->
        <input type="hidden" name="to" value=""/>   <!-- value comes form
javascript concat() -->
<!--    <input type="hidden" name="command" value="search"/> -->

<table width="700" border="0">
<tr>
<!-- time title -->
<td width="200">
<p><font size="2">Time frame from (dd.mm.yyyy):</font></p>
</td>
<td width="500">
<p><select name="start_day">

<xsl:if
test="/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@from!=''">
<option selected="selected"
value="{substring(/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@from,9,2)}">
        <xsl:value-of
select="substring(/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@from,9,2)"/>.
</option>
</xsl:if>


<option value="">day</option>
<option value="01">01.</option>
<option value="02">02.</option>
<option value="03">03.</option>
<option value="04">04.</option>
<option value="05">05.</option>
<option value="06">06.</option>
<option value="07">07</option>
<option value="08">08.</option>
<option value="09">09.</option>
<option value="10">10.</option>
<option value="11">11.</option>
<option value="12">12.</option>
<option value="13">13.</option>
<option value="14">14.</option>
<option value="15">15.</option>
<option value="16">16.</option>
<option value="17">17</option>
<option value="18">18.</option>
<option value="19">19.</option>
<option value="20">20.</option>
<option value="21">21.</option>
<option value="22">22.</option>
<option value="23">23.</option>
<option value="24">24.</option>
<option value="25">25.</option>
<option value="26">26.</option>
<option value="27">27.</option>
<option value="28">28.</option>
<option value="29">29.</option>
<option value="30">30.</option>
<option value="31">31.</option>
</select>

<select name="start_month">
<xsl:if
test="/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@from!=''">
<xsl:call-template name="month_number_to_text">
<xsl:with-param name="month"
select="substring(/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@from,6,2)"/>
</xsl:call-template>
</xsl:if>

<option value="">month.</option>
<option value="01">Jan.</option>
<option value="02">Feb.</option>
<option value="03">Mar.</option>
<option value="04">Apr.</option>
<option value="05">May.</option>
<option value="06">Jun.</option>
<option value="07">Jul.</option>
<option value="08">Aug.</option>
<option value="09">Sep.</option>
<option value="10">Oct.</option>
<option value="11">Nov.</option>
<option value="12">Dec.</option>
</select>

<select name="start_year">
<xsl:if
test="/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@from!=''">
<option selected="selected"
value="{substring(/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@from,1,4)}">
        <xsl:value-of
select="substring(/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@from,1,4)"/>
</option>
</xsl:if>

<option value="">year</option>
<option value="2000">2000</option>
<option value="2001">2001</option>
<option value="2002">2002</option>
<option value="2003">2003</option>
<option value="2004">2004</option>
<option value="2005">2005</option>
<option value="2006">2006</option>
</select>
<font size="2"><b><xsl:text> </xsl:text>to:<xsl:text> </xsl:text>
</b></font>

<select name="to_date">
<xsl:if test="/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@to!=''">
<option selected="selected"
value="{substring(/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@to,9,2)}">
        <xsl:value-of
select="substring(/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@to,9,2)"/>.
</option>
</xsl:if>
<option value="">day</option>
<option value="01">01.</option>
<option value="02">02.</option>
<option value="03">03.</option>
<option value="04">04.</option>
<option value="05">05.</option>
<option value="06">06.</option>
<option value="07">07</option>
<option value="08">08.</option>
<option value="09">09.</option>
<option value="10">10.</option>
<option value="11">11.</option>
<option value="12">12.</option>
<option value="13">13.</option>
<option value="14">14.</option>
<option value="15">15.</option>
<option value="16">16.</option>
<option value="17">17</option>
<option value="18">18.</option>
<option value="19">19.</option>
<option value="20">20.</option>
<option value="21">21.</option>
<option value="22">22.</option>
<option value="23">23.</option>
<option value="24">24.</option>
<option value="25">25.</option>
<option value="26">26.</option>
<option value="27">27.</option>
<option value="28">28.</option>
<option value="29">29.</option>
<option value="30">30.</option>
<option value="31">31.</option>
</select>
<select name="to_month">

<xsl:if test="/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@to!=''">
<xsl:call-template name="month_number_to_text">
<xsl:with-param name="month"
select="substring(/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@to,6,2)"/>
</xsl:call-template>
</xsl:if>

<!--
******************************************************************************************
        the first option value field must be empty. By so it does not
apply / save the value
-->
******************************************************************************************
<option value="">month.</option>
<option value="01">Jan.</option>
<option value="02">Feb.</option>
<option value="03">Mar.</option>
<option value="04">Apr.</option>
<option value="05">May.</option>
<option value="06">Jun.</option>
<option value="07">Jul.</option>
<option value="08">Aug.</option>
<option value="09">Sep.</option>
<option value="10">Oct.</option>
<option value="11">Nov.</option>
<option value="12">Dec.</option>
</select>
<select name="to_year">

<xsl:if test="/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@to!=''">
<option selected="selected"
value="{substring(/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@to,1,4)}">
        <xsl:value-of
select="substring(/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@to,1,4)"/>
</option>
</xsl:if>

<option value="">year</option>
<option value="2000">2000</option>
<option value="2001">2001</option>
<option value="2002">2002</option>
<option value="2003">2003</option>
<option value="2004">2004</option>
<option value="2005">2005</option>
<option value="2006">2006</option>
</select>

</p>
</td>
</tr>
<tr>

<!-- time Templates -->
<td width="180">
<p><font size="2">Among Templates:</font></p>
</td>
<td>
<p><select size="1" name="XDocForm" onFocus="show('template');"
onBlur="hide('template');show('index');">
<xsl:if
test="/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@templates!=''">
<option selected="selected"
value="{/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@templates}">
        <xsl:value-of
select="/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@templates"/>
</option>
</xsl:if>

<option value="">All Templates</option>
<xsl:for-each select="/XDoc/XDocList/ListItem">
<option value="{Name}"><xsl:value-of select="Name"/></option>
</xsl:for-each>
</select>
</p>

</td>
</tr>

<!-- Topic -->
<tr>
<td width="180">
<p><font size="2">Topic Contains:</font></p>
</td>
<td>


<p><input name="topic"
value="{/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@topic}"
type="text" size="26" onFocus="show('topic');"
onBlur="hide('topic');show('index');"/></p>
</td>
</tr>

<!-- Lastname -->
<tr>
<td width="180">
<p><font size="2">Authors' Last name:</font></p>
</td>
<td>
<p><input name="lastName"
value="{/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@lastName}"
type="text" size="26" onFocus="show('author');"
onBlur="hide('author');show('index');"/></p>
</td>
</tr>


<!-- NOT IMPL. !!!! -->
<!-- status
<tr>
<td width="180">
<p><font size="2">Status:</font></p>
</td>
<td>
<p><select size="1" name="">
<option value="unprocessed">unprocessed</option>
<option value="processed">processed</option>
<option value="signed">signed</option>
</select></p>
</td>
</tr>
-->

<!-- asc / desc -->
<tr>
<td width="180">
<p><font size="2">Order by:</font></p>
</td>
<td>
<p>
<font size="2">
<select size="1" name="order" onFocus="show('order');"
onBlur="hide('order');show('index');">

<xsl:if
test="/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@orderBy!=''">
<option selected="selected"
value="{/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@orderBy}">
        <xsl:value-of
select="/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@orderBy"/>
</option>
</xsl:if>

<option value="date">Date</option>
<option value="subject">Subject</option>
<option value="type">Type</option>
<option value="sender">Sender</option>
</select>

<select size="1" name="desc" onFocus="show('by');"
onBlur="hide('by');show('index');">
<xsl:if
test="/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@order!=''">
<option selected="selected"
value="{/XDoc/XDocCurUser/UserProfile/AdvSearch/Documents/@order}">
        descending
</option>
</xsl:if>
<option value="">ascending</option>
<option value="1">descending</option>
</select>
</font>
</p>
</td>
</tr>


<!-- asc / desc
<tr>
<td width="180">
<p>(un)processed:</p>
</td>
<td>
<p><font size="2">
<select size="1" name="desc">
<option value="">processed</option>
<option value="1">unprocessed</option>
</select>
</font>
</p>
</td>
</tr>
-->

<!-- Save Settings -->
<tr>
<td width="180">
<p><font size="2">Save Field Values:</font></p>
</td>
<td>
<p><font size="2">


<xsl:if
test="/XDoc/XDocCurUser/UserProfile/AdvSearch/@saveEnabled='false'">
        <input type="radio" checked="checked" name="saveEnabled" value=""
onFocus="show('saveno');"
onBlur="hide('saveno');show('index');">No</input>
        <input type="radio" name="saveEnabled" value="true"
onFocus="show('saveyes');"
onBlur="hide('saveyes');show('index');">Yes</input>
</xsl:if>

<xsl:if test="/XDoc/XDocCurUser/UserProfile/AdvSearch/@saveEnabled=''">
        <input type="radio" checked="checked" name="saveEnabled" value=""
onFocus="show('saveno');"
onBlur="hide('saveno');show('index');">No</input>
        <input type="radio" name="saveEnabled" value="true"
onFocus="show('saveyes');"
onBlur="hide('saveyes');show('index');">Yes</input>
</xsl:if>

<xsl:if test="/XDoc/XDocCurUser/UserProfile/AdvSearch/@saveEnabled='n'">
        <input type="radio" checked="checked" name="saveEnabled" value=""
onFocus="show('saveno');"
onBlur="hide('saveno');show('index');">No</input>
        <input type="radio" name="saveEnabled" value="true"
onFocus="show('saveyes');"
onBlur="hide('saveyes');show('index');">Yes</input>
</xsl:if>

<xsl:if test="/XDoc/XDocCurUser/UserProfile/AdvSearch/@saveEnabled='y'">
        <input type="radio" name="saveEnabled" value=""
onFocus="show('saveno');"
onBlur="hide('saveno');show('index');">No</input>
        <input type="radio" checked="checked" name="saveEnabled" value="y"
onFocus="show('saveyes');"
onBlur="hide('saveyes');show('index');">Yes</input>
</xsl:if>

</font></p>
</td>
</tr>

<!-- submit -->
<tr>
<td width="180">

</td>
<td>
<input type="SUBMIT" value="Find"/><xsl:text>   </xsl:text>
<input type="button" value="Back" onClick="javascript:window.self;
history.back(-1)"/>
</td>
</tr>

</table>
</form>
</div>

<!-- ************************************
        text of help -->
<div id="index"
style="position:absolute;visibility:hidden;z-index:100;top:20px;left:212px;border-width:thin
thin thin thin; border-color:green; border-style:solid;">
<table bgcolor="#FFFFFF">
<tr><td><p>Reminders about the input fields.</p></td></tr>
</table>
</div>

<!-- ************************************
        text of topic template -->
<div id="template"
style="position:absolute;visibility:hidden;z-index:100;top:20px;left:212px;border-width:thin
thin thin thin; border-color:green; border-style:solid;">
<table bgcolor="#FFFFFF">
<tr><td><p>Here you can restrict the search to specific template or all
templates.</p></td></tr>
</table>
</div>

<!-- ************************************
        text of topic help -->
<div id="topic"
style="position:absolute;visibility:hidden;z-index:100;top:20px;left:212px;border-width:thin
thin thin thin; border-color:green; border-style:solid;">
<table bgcolor="#FFFFFF">
<tr><td><p>Here you can restrict the search to documents where topic
contains this text.</p></td></tr>
</table>
</div>

<!-- ************************************
        text of Author's name help -->
<div id="author"
style="position:absolute;visibility:hidden;z-index:100;top:20px;left:212px;border-width:thin
thin thin thin; border-color:green; border-style:solid;">
<table bgcolor="#FFFFFF">
<tr><td><p>Here you limit the search to documents, whose author name
contains this text. Not case sensitive.</p></td></tr>
</table>
</div>

<!-- ************************************
        text of order -->
<div id="order"
style="position:absolute;visibility:hidden;z-index:100;top:20px;left:212px;border-width:thin
thin thin thin; border-color:green; border-style:solid;">
<table bgcolor="#FFFFFF">
<tr><td><p>The results are sorted by your selection.</p></td></tr>
</table>
</div>

<!-- ************************************
        text of by -->
<div id="by"
style="position:absolute;visibility:hidden;z-index:100;top:20px;left:212px;border-width:thin
thin thin thin; border-color:green; border-style:solid;">
<table bgcolor="#FFFFFF">
<tr><td><p>The results are sorted ascending or descending. Default is
ascending.</p></td></tr>
</table>
</div>

<!-- ************************************
        text of saveno -->
<div id="saveno"
style="position:absolute;visibility:hidden;z-index:100;top:20px;left:212px;border-width:thin
thin thin thin; border-color:green; border-style:solid;">
<table bgcolor="#FFFFFF">
<tr><td><p>The settings will not be saved to your profile.</p></td></tr>
</table>
</div>

<!-- ************************************
        text of saveyes -->
<div id="saveyes"
style="position:absolute;visibility:hidden;z-index:100;top:20px;left:212px;border-width:thin
thin thin thin; border-color:green; border-style:solid;">
<table bgcolor="#FFFFFF">
<tr><td><p>The settings will be saved to your profile.</p></td></tr>
</table>
</div>


</html>
</xsl:template>

<!-- *******************************************************************
        This template changes any number 1-12 to equal text value
        of the month. The number value is set to the parameter month.
-->  *******************************************************************

<xsl:template name="month_number_to_text">
<xsl:param name="month"/>
<xsl:choose>
        <xsl:when test="$month='01'">
                <option selected="selected" value="{$month}">
                Jan.
                </option>
        </xsl:when>
        <xsl:when test="$month='02'">
                <option selected="selected" value="{$month}">
                Feb.
                </option>
        </xsl:when>
        <xsl:when test="$month='03'">
                <option selected="selected" value="{$month}">
                Mar.
                </option>
        </xsl:when>
        <xsl:when test="$month='04'">
                <option selected="selected" value="{$month}">
                Apr.
                </option>
        </xsl:when>
        <xsl:when test="$month='05'">
                <option selected="selected" value="{$month}">
                May.
                </option>
        </xsl:when>
        <xsl:when test="$month='06'">
                <option selected="selected" value="{$month}">
                Jun.
                </option>
        </xsl:when>
        <xsl:when test="$month='07'">
                <option selected="selected" value="{$month}">
                Jul.
                </option>
        </xsl:when>
        <xsl:when test="$month='08'">
                <option selected="selected" value="{$month}">
                Aug.
                </option>
        </xsl:when>
        <xsl:when test="$month='09'">
                <option selected="selected" value="{$month}">
                Sep.
                </option>
        </xsl:when>
        <xsl:when test="$month='10'">
                <option selected="selected" value="{$month}">
                Oct.
                </option>
        </xsl:when>
        <xsl:when test="$month='11'">
                <option selected="selected" value="{$month}">
                Nov.
                </option>
        </xsl:when>
        <xsl:when test="$month='12'">
                <option selected="selected" value="{$month}">
                Dec.
                </option>
        </xsl:when>
</xsl:choose>
</xsl:template>

</xsl:stylesheet>




****************************************************************
Jarkko Moilanen          "The box said that is needs
Researcher                Windows 95 or better... So I
[EMAIL PROTECTED]            installed Linux."
www.uta.fi/~jm60697
GSM: +358 50 3766 927
****************************************************************
* ITCM | Information Technology and Crisis Management
* http://www.itcm.org
****************************************************************





Reply via email to