Oh right -- I don't have to test for content, I just test for existence of the element.  Duh.  Thanks :)

Are you switching to 2.0 for your production version, or just for your own edification and jollification?  According to what I could find out 2.0 isn't widely supported yet (e.g. by browsers), so I'm not sure we want to switch just yet.


-----Original Message-----
From: Encoded Archival Description List [mailto:[log in to unmask]] On Behalf Of Custer, Mark
Sent: Friday, June 03, 2011 9:37 AM
To: [log in to unmask]
Subject: Re: XSLT 1.0 => 2.0

Hi Michele,

I just took a quick glance, and I think that your conditional would be valid if you just remove all of those "string" functions.

As an aside, I just recently worked on some of my first XSLT 2.0 style sheets, and it was very nice to shorten some code that took up way too many lines in 1.0.  Have fun! 


-----Original Message-----
From: Encoded Archival Description List [mailto:[log in to unmask]] On Behalf Of Michele R Combs
Sent: Friday, June 03, 2011 9:13 AM
To: [log in to unmask]
Subject: XSLT 1.0 => 2.0

Just for fun, I took a quick run at converting our style sheets from XSLT1.0 to XSLT2.0 this week and got the following error:

Error on line 451 of eadcbs6-su1.xsl:
  XPTY0004: A sequence of more than one item is not allowed as the first argument of
  string() (<head/>, <p/>)
  at xsl:call-template name="toc" (file:/G:/LIB/Special%20Collections/Digital%20Projects/EAD/saxon/../styles/eadcbs6-su1.xsl#230)
  in built-in template rule
Transformation failed: Run-time errors were reported

Line 451, in context, looks like this:

      <xsl:if test="string(archdesc/acqinfo/*)
      or string(archdesc/processinfo/*)
      or string(archdesc/prefercite/*)
      or string(archdesc/custodialhist/*)
      or string(archdesc/processinfo/*)
      or string(archdesc/appraisal/*)
      or string(archdesc/accruals/*)
      or string(archdesc/*/acqinfo/*)
      or string(archdesc/*/processinfo/*)
      or string(archdesc/*/prefercite/*)
      or string(archdesc/*/custodialhist/*)
      or string(archdesc/*/processinfo/*)
      or string(archdesc/*/appraisal/*)
      or string(archdesc/*/accruals/*)">     <= line 451
         <p class="toclink">
            <a class="toc" href="#adminlink">
               <xsl:text>Administrative Information</xsl:text>

I've checked the W3C document at (which, while not impenetrable, is not exactly crystal clear either) and am not sure what the problem is.  Surely I can test multiple conditions, so is it a syntax thing?


Michele Combs
Librarian for Manuscripts and Archives Processing Special Collections Research Center Syracuse University
[log in to unmask]