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

RE: regexs, grouping (?) and XSLT2?

Subject: RE: regexs, grouping (?) and XSLT2?
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Sun, 8 Aug 2004 23:45:14 +0100
RE:  regexs
> With respect to the other issue, below is an example doc; might be 
> easier to understand.
> 
> So, the para output would be something like:
> 
> <p>Some citations: (Doe, 1999a, 1999b; Doe and Jones, 1999)</p>

I think you're trying to solve several problems at the same time here. It
fails my 10-minute rule: I never spend more than ten minutes answering a
question on this list. Essentially both the para output and the list of
citations are grouping problems that can be tackled using
xsl:for-each-group, probably using group-adjacent. You may need to write a
function that calculates the grouping key. The suffix "a", "b" etc can be
obtained using xsl:number. It may be simplest to start by generating a copy
of the bibliography in which the list of authors (Doe and Jones) and the
year/serial (1999b) appear as additional computed child elements or
attributes, and then working with this copy.

Michael Kay




> And in the bib list:
> 
> Doe (1999a)
> ----. (1999b)
> Doe and Jones (1999)
> 
> ============
> 
> <?xml version="1.0" encoding="utf-8"?>
> <article xmlns="http://docbook.org/docbook-ng">
>    <info>
>      <title>Test</title>
>    </info>
>    <section>
>      <info>
>        <title>Introduction</title>
>      </info>
>      <para>Some citations: <citation><biblioref 
> linkend="one"/><biblioref
>      linkend="two"/><biblioref linkend="three"/></citation></para>
>    </section>
>    <bibliography>
>      <modsCollection xmlns="http://www.loc.gov/mods/v3">
>        <mods ID="one">
> 	<name type="personal">
> 	  <namePart type="given">John</namePart>
> 	  <namePart type="family">Doe</namePart>
> 	  <role>
> 	    <roleTerm type="text">author</roleTerm>
> 	  </role>
> 	</name>
> 	<titleInfo>
> 	  <title>Some Title</title>
> 	</titleInfo>
> 	<originInfo>
> 	  <dateIssued>1999</dateIssued>
> 	</originInfo>
>        </mods>
>        <mods ID="two">
> 	<name type="personal">
> 	  <namePart type="given">John</namePart>
> 	  <namePart type="family">Doe</namePart>
> 	  <role>
> 	    <roleTerm type="text">author</roleTerm>
> 	  </role>
> 	</name>
> 	<titleInfo>
> 	  <title>Another Title</title>
> 	</titleInfo>
> 	<originInfo>
> 	  <dateIssued>1999</dateIssued>
> 	</originInfo>
>        </mods>
>        <mods ID="three">
> 	<name type="personal">
> 	  <namePart type="given">John</namePart>
> 	  <namePart type="family">Doe</namePart>
> 	  <role>
> 	    <roleTerm type="text">author</roleTerm>
> 	  </role>
> 	</name>
> 	<name type="personal">
> 	  <namePart type="given">Jane</namePart>
> 	  <namePart type="family">Jones</namePart>
> 	  <role>
> 	    <roleTerm type="text">author</roleTerm>
> 	  </role>
> 	</name>
> 	<titleInfo>
> 	  <title>Some Title</title>
> 	</titleInfo>
> 	<originInfo>
> 	  <dateIssued>1999</dateIssued>
> 	</originInfo>
>        </mods>
>      </modsCollection>
>    </bibliography>
> </article>

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.