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

Re: preceding-sibling:: while keeping xml well formed

Subject: Re: preceding-sibling:: while keeping xml well formed
From: Spencer Tickner <spencertickner@xxxxxxxxx>
Date: Tue, 31 May 2005 10:36:41 -0700
xsl preceding sibiling
Hi guys,

Thank you very much, I can modify each easily to fit my needs. Once
again apreciate the help.

Spencer

On 5/31/05, Aron Bock <aronbock@xxxxxxxxxxx> wrote:
> With this input:
>
> <i>This<b>is</b>valid</i>
>
> This XSL:
>
> <?xml version="1.0" encoding="iso8859-1"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>     <xsl:output method="xml" indent="yes"/>
>
>     <xsl:template match="/">
>         <data>
>             <xsl:apply-templates/>
>         </data>
>     </xsl:template>
>
>     <xsl:template match="text()[ancestor::i and not(ancestor::b)]">
>         <italic>
>             <xsl:copy-of select="."/>
>         </italic>
>     </xsl:template>
>
>     <xsl:template match="text()[ancestor::b[ancestor::i]]">
>         <bolditalic>
>             <xsl:copy-of select="."/>
>         </bolditalic>
>     </xsl:template>
>
> </xsl:stylesheet>
>
> Produces:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <data>
>   <italic>This</italic>
>   <bolditalic>is</bolditalic>
>   <italic>valid</italic>
> </data>
>
> It looks only for text() nodes ... something you may need to augment.
>
> --A
>
> >I am using xslt to convert one xml to another importable xml.
> >Everything is going fine except for the fact that the program I am
> >importing into supports <italic>, and <bold>, but needs a <bolditalic>
> >when the both are together.
> >
> >My original xml file is used on the web so of course
> >
> ><i>This<b>is</b>valid</i>.
> >
> >I assume this can be done using the preceding-sibiling axis to achive
> >something along the lines of
> >
> ><italic>This</italic><bolditalic>is</boldItalic><italic>valid</italic>
>
> _________________________________________________________________
> On the road to retirement? Check out MSN Life Events for advice on how to
> get there! http://lifeevents.msn.com/category.aspx?cid=Retirement

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.