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

RE: matching positional nodes

Subject: RE: matching positional nodes
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sat, 9 Jul 2005 00:18:35 +0100
RE:  matching positional nodes
I would do something like

<xsl:template match="bold[1]">
<sectionnumber><xsl:value-of select="."/></sectionnumber>
</xsl:template>

<xsl:template match="bold">
<xsl:copy-of select="."/>
</xsl:template>

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

> -----Original Message-----
> From: Spencer Tickner [mailto:spencertickner@xxxxxxxxx] 
> Sent: 07 July 2005 17:49
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  matching positional nodes
> 
> Hi Everyone, thanks in advance for the help.
> 
> I am translating from xml to xml.
> 
> Original (just a snippet)
> 
> <section><bold>1</bold>This is a section with 
> <bold>text</bold></section>
> 
> What I need
> 
> <section>
>   <sectionnumber>1</sectionnumber>
>   <sectiontext>This is a section with <bold>text</bold></sectiontext>
> </section>
> 
> What I've tried
> 
> <xsl:template match="section">
>    <section>
>     <sectionnumber><xsl:apply-templates 
> select="BOLD[1]"/></sectionnumber>
>     <sectiontext><xsl:apply-templates 
> select="*[not(BOLD[1])]"/></sectiontext>
>   </section>
> </xsl:template>
> 
> So far what I'm getting as output is
> 
> <section>
> <sectionnumber>1</sectionnumber>
> <sectiontext>1text</sectiontext>
> </section>
> 
> Pretty close but not quite there. Anyone have any ideas on that
> apply-template select?
> 
> Thanks a lot,
> 
> Spencer

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.