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

RE: Omit TEIForm and capture attributes of current nod

Subject: RE: Omit TEIForm and capture attributes of current node
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 25 Sep 2008 16:53:56 +0100
RE:  Omit TEIForm and capture attributes of current nod
The first thing that's wrong with it is that this

group-adjacent="self::list self::figure[@id]"

is not a valid XPath expression. So it's hard to see why you get any output
at all, other that a compile-time error message.

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: J. S. Rawat [mailto:jrawat@xxxxxxxxxxxxxx] 
> Sent: 25 September 2008 06:32
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx; xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Omit TEIForm and capture attributes of current node
> 
> Hi
> I want to omit TEIForm by xslt and want to capture attribute of <p>. 
> Please let me know what is wrong in below xsl.
> 
> XSL
> <xsl:template match="p">
> <xsl:for-each-group select="node()" 
> group-adjacent="self::list self::figure[@id]"> <xsl:choose>
> <xsl:when test="current-grouping-key()">			
> <xsl:apply-templates select="self::*"/>
> </xsl:when>
> <xsl:otherwise>
> <xsl:if test="@rend">
> <p class="{@rend}">
> <xsl:copy-of select="current-group()"/>
> </p>
> </xsl:if>
> <xsl:if test="not(@rend)">
> <p><xsl:copy-of select="current-group()"/></p> </xsl:if> 
> </xsl:otherwise> </xsl:choose> </xsl:for-each-group> </xsl:template>
> 
> INPUT
> <p rend="right">Existing evidence <abbr 
> type="acronym">WM</abbr> was the most... First <name>Federal 
> Congress</name>. With the exception of his work.
> <figure entity="F001" id="fig1"><figDesc>...</figDesc></figure>
> He may have written others as well.</p>
> <p align="left">dkdkdk</p>
> <p>dkdk</p>
> 
> XSLT OUTPUT
> <p>Existing evidence <abbr type="acronym" 
> TEIform="abbr">WM</abbr> was the most... First <name 
> TEIform="name">Federal Congress</name>. 
> With the exception of his work. </p>
> <div class="figure" id="F001">
>    <a href="/images/fig1.jpg">
>   <img src="/images/fig1.jpg" alt=""/>
> </a>
> <div class="caption">
> <p>...</p>
> </div>
> </div>
> <p>He may have written others as well.</p> <p>dkdkdk</p> <p>dkdk</p>
> 
> REQUIRED OUTPUT
> <p class="right">Existing evidence <abbr type="acronym" 
> TEIform="abbr">WM</abbr> was the most... First <name 
> TEIform="name">Federal Congress</name>. With the exception of 
> his work. </p> <div class="figure" id="F001">
>    <a href="/images/fig1.jpg">
>   <img src="/images/fig1.jpg" alt=""/>
> </a>
> <div class="caption">
> <p>...</p>
> </div>
> </div>
> <p class="right">He may have written others as well.</p> <p 
> align="left">dkdkdk</p> <p>dkdk</p>

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.