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

Re: That's a wrap!

Subject: Re: That's a wrap!
From: "Charles O'Connor coconnor@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 4 Jan 2018 19:19:30 -0000
Re:  That's a wrap!
Thanks. This gets me where I need to be, and introduces me to ways of doing
things I did not know about. I'm looking at the grouping examples on W3C now.

The only issue is that the grouping of adjacent nodes captures the leading and
trailing text as well as the text between. I don't need to solve the problem
for my current uses, however. (I'm making test files for a DTD.)

Thanks again to this community!

-----Original Message-----
From: Martin Honnen martin.honnen@xxxxxx
[mailto:xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx]
Sent: Thursday, January 4, 2018 1:26 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  That's a wrap!

On 04.01.2018 19:16, Charles O'Connor coconnor@xxxxxxxxxxxx wrote:
> Thanks to you and Christophe.
>
>
>
> For the below, I would want the second group of <string-name> elements to be
in a different <person-group>, actually, but I hadn't gotten that far.

To me it looks as if

   <xsl:template match="mixed-citation">
       <xsl:copy>
           <xsl:for-each-group select="node()"
group-adjacent="boolean(self::string-name | self::etal | self::collab |
self::text())">
               <xsl:choose>
                   <xsl:when test="current-grouping-key() and
current-group()[self::*] ">
                       <person-group>
                           <xsl:apply-templates select="current-group()"/>
                       </person-group>
                   </xsl:when>
                   <xsl:otherwise>
                       <xsl:apply-templates select="current-group()"/>
                   </xsl:otherwise>
               </xsl:choose>
           </xsl:for-each-group>
       </xsl:copy>
   </xsl:template>

might do the job.

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.