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

Re: issue with cross referencing

Subject: Re: issue with cross referencing
From: George Cristian Bina <george@xxxxxxxxxxxxx>
Date: Wed, 11 Oct 2006 21:26:12 +0200
all cristian crosses
Hi,

A stylesheet like the one below

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:key name="steps" match="*[@id]" use="@id"/>


    <xsl:template match="xref">
        <xsl:variable name="step" select="key('steps',@xrefid)"/>
        <xsl:value-of select="substring-after(name($step), 'step')"/>
        <xsl:for-each select="$step">
            <xsl:number format="A"/>
        </xsl:for-each>
    </xsl:template>
</xsl:stylesheet>

will give you as output

First line here
Second line
Third line Cross ref thru 1A 1B

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

meenakshi n wrote:
Hi all:

Have an issue with cross referencing.

I have some text:

1. First line
   A. second line
   B. thrisd line
2. Cross ref to 1 A.

The xml would be

<step1 id="s1">
   <text>First line here</text>

<step2 id="s2">
   <text>Second line</text>
  <step3 id="s3">
    <text>Third line</text>
  </step3>
</step2>

</step1>
<step1 id="s4">
<text>Cross ref thru <xref xrefid="s1"/> <xref
xrefid="s2"/><xref

Now, on my style sheet I have used keys to resolve it
like this:

<xsl:key name="steps" match="*[@id]" use="@id"/>

<xsl:template match="xref">
	<xsl:for-each select="key('steps',@xrefid)">
        <xsl:number count="step1" format="1"/>
       </xsl:for-each>
</xsl:template>

While I would expect Cross ref to 1 A, I am getting Cross ref to 1 1

How do I make the number formatting to point to and
say A, B or whtever the level is?


Thank you in advance for all your help.




__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

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.