[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: position and grouping?

Subject: Re: position and grouping?
From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx>
Date: Fri, 15 Oct 2004 17:46:58 -0400
henri lefebre
I need to send this again, as I am no closer to understanding why this
is not working.  Name order is correct, until I have more than one
mods:mods element with the same mods:name content.  Example output is
now like:

Amin, A.  (1994) Post-Fordism: Models, Fantasies and Phantoms of
Transition, In A. Amin Ed., Post-Fordism: A Reader (Oxford:Blackwell
Publishers)   pp. 2345.

Arendt, H. (1959) The Human Condition, New York:Doubleday.

N. Brenner (1999) Globalisation as Reterritorialisation: The Re-scaling
of Urban Governance in the European Union, Globalisation as
ReterritorialisationUrban Studies, March , 36(3) pp. 43151.

N. Brenner (2000) The Urban Question as a Scale Question: Reflections
on Henri Lefebre, Urban Theory and the Politics of Scale, International
Journal of Urban and Regional Research,  24(2) pp. 36178.

On Oct 14, 2004, at 6:29 PM, David Carlisle wrote:

position() _never_ relates to the location of a node in a source
tree. It always refers to a position in a current node list
(or sequence in 2.0). That is if you select a node with self:: it
always
has position() =1 even if it's the 1001 child of some parent.

But I don't see why the test I have correctly handles the first mods:name in a mods:mods element, except if the same names are repeated in another mods:mods element.

In other words, I want the when test to be satisfied for all
first-authors.  So what am I doing wrong?

<xsl:template match="mods:name" mode="full">
    ...
    <xsl:when test="$sort-order='first-author' and position() = 1 and
not(parent::mods:relatedItem)">
      <xsl:apply-templates select="mods:namePart[@type='family'] |
mods:namePart[not(@type)]"/>
      <xsl:text>, </xsl:text>
      <xsl:apply-templates select="mods:namePart[@type='given']"/>
    </xsl:when>
    ...
</xsl:template>

The (abbreviated) source looks like:

<mods>
  <name type="personal">
    <namePart type="given">Jane</namePart>
    <namePart type="family">Doe</namePart>
  </name>
  <name type="personal">
    <namePart type="given">Steve</namePart>
    <namePart type="family">Smith</namePart>
  </name>
<mods>

Bruce

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.