[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Sorting a TEI bibliography by

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 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"/>


<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!




A. Charles Muller

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

Office: 03-5841-3735


Web Site: Resources for East Asian Language and Thought

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

Current Thread