[Archivesspace_Users_Group] Changes to PDF export in 2.8?

Chris Mayo mayoc at bc.edu
Wed Aug 19 09:26:36 EDT 2020


Lora, Mark,

Thank you both! Moving the variable did fix the issue, and now I feel a bit
sheepish for focusing on the './ead' segment of the error report, not the
'fn:substring' part. I may make more of the refinements Mark suggested
later on, but it's working for now, which is the important part. Thanks for
the help tracking that down.

Best,
Chris

On Tue, Aug 18, 2020 at 6:12 PM Custer, Mark <mark.custer at yale.edu> wrote:

> Chris, Lora:
>
> Okay, so I just did a bit more digging (but not enough yet), and I'd say
> that there must either be a bug in the gem or in the way that it's invoked
> (I'm leaning toward the latter, but I haven't looked at the ASpace code
> yet).  Whatever the issue is, it's not what I speculated the first time
> around.
>
> Chris, like you, I have no problems when running this stylesheet with any
> version of saxon outside of ArchiveSpace, and most everything looks fine
> with how you have things set up.  I say "most everything looks fine" only
> because that $repo variable could select multiple values if you had, say,
> a  "num" element hand-encoded in the primary finding aid title, and if you
> did, you'd get an error when trying to run the substring function anyway,
> since that function will always require a single string and never multiple
> items in a sequence.  I'd probably change that same Xpath expression to
> look for the call number in the archdesc/did/unitid[1] area instead, just
> to play it safe.  Also because I think it's strange that ASpace serializes
> the unitid to the finding aid title, but that might just be me 🙂.
>
> The issue here, I think, is that you cannot set a global variable in the
> XSLT stylesheets in ASpace 2.8.  Luckily the default ones don't do that
> (although I'm surprised, since I do that all the time 🙂), but you should
> definitely have the option to do that, as you did before. Actually, it
> looks like the EAC-to-HTML one does declare at least one global variable,
> but that transformation is not used anywhere in ASpace I don't think, so no
> worries.
>
> But in the meantime, you can get things working again as Lora just
> mentioned, by moving your repo variable inside of the "publicationstmt"
> template instead.  That's the important part right now; good find, Lora!
>
> Mark
>
>
>
>
>
> ------------------------------
> *From:* archivesspace_users_group-bounces at lyralists.lyrasis.org <
> archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of
> Lora Woodford <Lora.Woodford at lyrasis.org>
> *Sent:* Tuesday, August 18, 2020 5:07 PM
> *To:* Archivesspace Users Group <
> archivesspace_users_group at lyralists.lyrasis.org>
> *Subject:* Re: [Archivesspace_Users_Group] Changes to PDF export in 2.8?
>
>
> And, as soon as I sent this, I found where that repo variable is being set
> up at line 126 of your xsl.  If you move that down into the publicationstmt
> template starting on ln 358 you should be golden.
>
>
>
> Lora
>
>
>
> *From: *<archivesspace_users_group-bounces at lyralists.lyrasis.org> on
> behalf of Lora Woodford <Lora.Woodford at lyrasis.org>
> *Reply-To: *Archivesspace Users Group <
> archivesspace_users_group at lyralists.lyrasis.org>
> *Date: *Tuesday, August 18, 2020 at 4:39 PM
> *To: *Archivesspace Users Group <
> archivesspace_users_group at lyralists.lyrasis.org>
> *Subject: *Re: [Archivesspace_Users_Group] Changes to PDF export in 2.8?
>
>
>
> Hi Chris,
>
> I took a quick look at this, and I do think Mark’s instinct is correct.
> It seems an existing (custom to you folks) function in your xsl isn’t
> working with the recent updates/transition to saxon-rb.
>
> My XSL is pretty rusty these days, but the following lines (ln 364-371) in
> your as-ead-pdf.xsl are the culprits:
>
>
> <xsl:choose>
>
>     <xsl:when test="substring($repo,1,2)='IM'">
>
>         <fo:block>Irish Music Archives</fo:block>
>
>     </xsl:when>
>
>     <xsl:otherwise>
>
>         <xsl:apply-templates select="ead:publisher"/>
>
>     </xsl:otherwise>
>
> </xsl:choose>
>
>
>
> The error “The context item for axis step ./ead is absent. Found while
> atomizing the first argument of fn:substring()” points to the fact that the
> transformation no longer knows how to handle the $repo provided as the
> first argument in that substring function.  For what it’s worth, removing
> this customization from your stylesheet (only this customization) results
> in being able to successfully export/print pdfs over here.
>
> I’ll keep poking, but wanted to give you this partial update sooner rather
> than later.
>
>
>
> Lora
>
>
>
> *From: *<archivesspace_users_group-bounces at lyralists.lyrasis.org> on
> behalf of Chris Mayo <mayoc at bc.edu>
> *Reply-To: *Archivesspace Users Group <
> archivesspace_users_group at lyralists.lyrasis.org>
> *Date: *Monday, August 17, 2020 at 3:04 PM
> *To: *Archivesspace Users Group <
> archivesspace_users_group at lyralists.lyrasis.org>
> *Subject: *Re: [Archivesspace_Users_Group] Changes to PDF export in 2.8?
>
>
>
> Hi Mark,
>
>
>
> Thanks for the suggestion - I hadn't tried yet, but I can successfully run
> the transform outside of Aspace using Oxygen (I don't know how to run XSL
> from the command line). I'm not sure whether that obviates the question
> about the files, but I've attached a sample EAD and the stylesheet (plus a
> couple of sidecar files) here. It sounds like what's going on is that the
> version of saxon bundled into Aspace has gotten stricter, and I'm not sure
> what to do about that. It's fairly important for us to be able to output
> PDFs directly from the application.
>
>
>
> Best,
>
> Chris
>
>
>
> On Mon, Aug 17, 2020 at 1:49 PM Custer, Mark <mark.custer at yale.edu> wrote:
>
> Chris,
>
>
>
> No clue if it's related or not, but it looks like a gem that's utilized
> for XSLT transformations in ASpace was switched out recently (saxon-xslt ->
> saxon-rb).  I wonder if the new gem (and/or new version of saxon) is more
> strict, and only now throwing an error because of that?
>
>
>
> In any event, have you tried running the transformations outside of
> ASpace?  Either way, if you can share a sample EAD file that throws the
> error and a copy of the in-house ead-to-pdf stylesheet, I'd be curious to
> take a look. Not that I'm sure I can help, of course :)
>
>
>
> Mark
>
>
>
>
> ------------------------------
>
> *From:* archivesspace_users_group-bounces at lyralists.lyrasis.org <
> archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of
> Chris Mayo <mayoc at bc.edu>
> *Sent:* Monday, August 17, 2020 1:31 PM
> *To:* Archivesspace Users Group <
> archivesspace_users_group at lyralists.lyrasis.org>
> *Subject:* [Archivesspace_Users_Group] Changes to PDF export in 2.8?
>
>
>
> Hi all,
>
>
>
> We keep a modified in-house version of the ead-to-pdf stylesheet so that
> we can put out Finding Aids with our own branding and a few other changes.
> When we recently installed 2.8 on our test server, we discovered that the
> export to PDF job was failing with the following error info:
>
>
>
> "The context item for axis step ./ead is absent. Found while atomizing the
> first argument of fn:subst"
>
>
>
> Our production server is currently running on 2.6, and we had previously
> updated the test server to 2.7 without that upgrade breaking our
> stylesheet, so the issue appears to have been introduced between 2.7 and
> 2.8. As far as I can tell, the base code for the stylesheet didn't change
> between those versions, and while the error message looks like an Xpath
> problem, the EAD structure doesn't appear to have changed either.
>
>
>
> Has anyone else encountered problems with modified finding aid stylesheets
> in 2.8, or have any thoughts on what could be causing this error?
>
>
>
> Chris
>
>
>
> Chris Mayo
>
> Digital Production Librarian
>
> Boston College
>
> chris.mayo at bc.edu
>
> pronouns: they/them/theirs
>
> _______________________________________________
> Archivesspace_Users_Group mailing list
> Archivesspace_Users_Group at lyralists.lyrasis.org
> http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group
> <https://nam05.safelinks.protection.outlook.com/?url=http%3A%2F%2Flyralists.lyrasis.org%2Fmailman%2Flistinfo%2Farchivesspace_users_group&data=02%7C01%7Cmark.custer%40yale.edu%7Cf4811802275944f45fc908d843bace2b%7Cdd8cbebb21394df8b4114e3e87abeb5c%7C0%7C0%7C637333816887727146&sdata=HBhoNRwGOmxaMWmIggYWvQ5haSxxrI0CbEBLPocnA4g%3D&reserved=0>
>
>
>
> --
>
> Chris Mayo
>
> Digital Production Librarian
>
> Boston College
>
> chris.mayo at bc.edu
>
> pronouns: they/them/theirs
> _______________________________________________
> Archivesspace_Users_Group mailing list
> Archivesspace_Users_Group at lyralists.lyrasis.org
> http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group
>


-- 
Chris Mayo
Digital Production Librarian
Boston College
chris.mayo at bc.edu
pronouns: they/them/theirs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20200819/63e8222d/attachment.html>


More information about the Archivesspace_Users_Group mailing list