xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] ID Generation for XML Element


Subject: Re: [xsl] ID Generation for XML Element
From: "Ramkumar.V" <ramkumar.v@xxxxxxxxx>
Date: Fri, 29 Oct 2010 16:51:08 +0530

Hi, List

If the sect element comes in nesting, the id is not generating correctly. Could you please anyone correct me?

XSLT:
=====
<xsl:template match="sec">
<xsl:variable name="pos"><xsl:number/></xsl:variable>
<xsl:choose>
<xsl:when test="ancestor-or-self::body/sec"><sec1 id="sec{$pos}"><xsl:apply-templates/></sec1></xsl:when>
<xsl:when test="ancestor-or-self::body/sec/sec"><sec2 id="sec{$pos}"><xsl:apply-templates/></sec2></xsl:when>
<xsl:when test="ancestor-or-self::body/sec/sec/sec"><sec3 id="sec{$pos}"><xsl:apply-templates/></sec3></xsl:when>
<xsl:when test="ancestor-or-self::body/sec/sec/sec/sec"><sec4 id="sec{$pos}"><xsl:apply-templates/></sec4></xsl:when>
</xsl:choose> </xsl:template>


Regards,
Ramkumar


=========================================================== ***Disclaimer***


This email, and any attachments ("this email"), is confidential. If you are not the addressee please tell the sender immediately, and destroy this email without using, sending or storing it. Any opinions, express or implied, in this email, are those of the sender, and are not necessarily approved by the company. Except as expressly stated, this e-mail should not be regarded as an offer, solicitation, recommendation or agreement to buy or sell products or services, or to enter into any contract. E-mail transmissions are not secure and may suffer errors, viruses, delay, interception and amendment. The company does not accept liability for damage caused by any of the foregoing.


ALL INCOMING AND OUTGOING MAILS MAY BE MONITORED BY THE COMPANY.
============================================================


Current Thread
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor