Paramter passing in Xalan

Subject: Paramter passing in Xalan
From: "Peter B. West" <pbwest@xxxxxxxxxxxx>
Date: Sat, 17 Jun 2000 23:28:25 +1000
I am experiencing a problem with parameter passing in Xalan.

I have an N-en.xml file containing a structure in English, and another
file with translations of parts of en.xml in latin - N-la.xml.  The
structure of N-en.xml is complex, but N-la.xml is simple, e.g.,

    <text en="Ps90-15">
      Invocábit me, et ego exáudiam eum; erípiam eum, et glorificábo
      eum; longitúdine diérum adimplébo eum.
    <text en="Ps90-1">
      Qui hábitat in adjutório Altíssimi in protectióne Dei c&oelig;li

Elements in N-en.xml which may have translations have an `id' attribute
of type ID.  The contents of this attribute are not constrained, except
by the type.  In N-la.xml, each translated element is a `text' element
with an `en' attribute whose contents match the contents of the `id'
attribute in N-en.xml.  E.g.

    <ofseason massname="First-Sunday-of-Lent" station="St. John
	      Lateran" class="First" sunday="true" colour="Violet">
      <introit id="Invocábit-me">
	  <psalmref psalmnum="90" verselist="15-16"/>
	  <versestext id="Ps90-15">
	    He shall call upon Me, and I will hear him; I will deliver
	    him, and glorify him; I will fill him with length of days.

Here the `versestext' element has an id whose contents `Ps90-15' match
one of the `en' tags in N-la.xml.

My problems is to present both the English and the Latin text of these
elements.  I am attempting to access N-la.xml using document() in the
following way.

To access the Latin text, I have this (note the debugging output).  I
have a parameter, with a default value of `default'.

  <xsl:template match="latin/text">
    <xsl:param name="iden" select="'default'"/>
	Found latin/text
	  Where am I?
    <xsl:value-of select="name()"/>:
    <xsl:value-of select="@en"/>:
    <xsl:value-of select="$iden"/>:
    <xsl:value-of select="text[@en=$iden]"/>

I am attempting to access this template using:
		Where am I?
		<xsl:value-of select="name()"/>
		id is:
		<xsl:value-of select="firstverse/versestext/@id"/>
		<xsl:variable name="fvid"
		Just set fvid
		<xsl:value-of select="$fvid"/>
		<xsl:apply-templates select="document($massfile-la)">
		  <xsl:with-param name="iden" select="$fvid"/>

My output looks like:

                Where am I?
                id is:
                Just set fvid
        Found latin/text
          Where am I?
        Found latin/text
          Where am I?
My parameter is not being set - it stays as `default', even though the
required value `Ps90-15' is being set in the variable $fvid.  What am I
missing here?

 __ /__   Peter B. West  pbwest@xxxxxxxxxxxx
  /     "Lord, to whom shall we go?"

 XSL-List info and archive:

Current Thread