Subject: Re: matching positional nodes
From: Mukul Gandhi <mukul_gandhi@xxxxxxxxx>
Date: Thu, 7 Jul 2005 10:18:38 -0700 (PDT)
|
Hi Spencer,
There are some grouping solutions listed at the web
page http://gandhimukul.tripod.com/grouping.html,
which is located on my web site. There is a section on
grouping similar to the problem you have posted (I
feel so). I hope that would help? Not to mention
Jeni's web site on grouping.. Hope Jeni does'nt mind
myself speaking her name in public.
Regards,
Mukul
XSLT & XML pages
http://gandhimukul.tripod.com
--- Spencer Tickner <spencertickner@xxxxxxxxx> wrote:
> 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
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
|