Re: [xsl] Sorting a TEI <biblStruct> bibliography by <surname>

Subject: Re: [xsl] Sorting a TEI <biblStruct> bibliography by <surname>
From: "Charles Muller acmuller@xxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 21 Jul 2014 03:24:03 -0000
Syd Bauman wrote:

Your code works for me, Charles. (I'm running it as XSLT 2.0 using
Saxon-HE 9.5.1.3J on the commandline.)

HOWEVER, the select= attribute of your <xsl:sort> will try to select *all*
of the <surname> descendants of each child of each <biblStruct>. If
there is more than one, you will get "max 1 item allowed on
xsl:sort/@select" or some such. E.g.

Thanks, Syd. You have identified the problem for me.


Yes, there are some <biblStruct> entries in my data that contain more than one <surname>. If I test this against entries that contain only one <surname>, it works.

So I need to adjust my code such that it applies only to the *first* surname encountered.

Thus, I changed

<xsl:sort select="*//surname"/>

to

<xsl:sort select="*//surname[1]"/>

but this generates the same error message.

I need to find a way to select only the first occurrence of this descendant. I am trying to figure this out now, but if anyone can point me in the right direction, I'd be delighted!

Regards,

Chuck

-------------------

A. Charles Muller

University of Tokyo
Graduate School of Humanities and Sociology, Faculty of Letters
Center for Evolving Humanities
7-3-1 HongE
, BunkyE
-ku
Tokyo 113-8654, Japan

Office: 03-5841-3735

<acmuller@xxxxxxxxxxxxxxx>

Web Site: Resources for East Asian Language and Thought
http://www.acmuller.net

H-Buddhism Zotero Bibliography: https://www.zotero.org/groups/h-buddhism_bibliography_project/items/collectionKey

Current Thread