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

splitting the content at each and every element

Subject: splitting the content at each and every element
From: Ganesh Babu N <nbabuganesh@xxxxxxxxx>
Date: Wed, 27 May 2009 18:36:37 +0530
 splitting the content at each and every element
Dear All,

My input :

<article>
  <para>Countering misinformation <bold>about</bold> vaccines has
become an urgent priority to assure the continued success of
immunization programs. Fortunately, parents continue to seek
information as well as the means to validate what they find. They also
are seeking to identify trusted health providers to give them more
information and guidance.</para>
</article>

Required output:

<text>
  <parastyle>
     <characterstyle style="para">
          <content>Countering misinformation</content>
     </characterstyle>
     <characterstyle type="bold">
          <content>about</content>
      </characterstyle>
      <characterstyle type="para">
           <content> vaccines has become an urgent priority to assure
the continued success of immunization programs. Fortunately, parents
continue to seek information as well as the means to validate what
they find. They also are seeking to identify trusted health providers
to give them more information and guidance</content>
      </characterstyle>
    </parastyle>
 </text>

My XSL:

<xsl:template match="/">
  <text>
    <xsl:apply-templates/>
  </text>
</xsl:template>

<xsl:template match="para">
    <parastyle>
      <characterstyle type="{name()}">
          <content>
            <xsl:apply-templates/>
           </content>
      </characterstyle>
     </parastyle>
</xsl:template>

<xsl:template match="bold">
      <characterstyle type="{name()}">
          <content>
            <xsl:apply-templates/>
           </content>
      </characterstyle>
</xsl:template>

XSL Output:

<text>
  <parastyle>
     <characterstyle style="para">
          <content>Countering misinformation
          <characterstyle type="bold">
          <content>about</content>
      </characterstyle>
           <content> vaccines has become an urgent priority to assure
the continued success of immunization programs. Fortunately, parents
continue to seek information as well as the means to validate what
they find. They also are seeking to identify trusted health providers
to give them more information and guidance</content>
      </characterstyle>
    </parastyle>
 </text>


My problem is how to split the file at each element it encountered. it
may not be single bold, any number of tags may come inside the para
element.

Please suggest how to split the content at each element.

Regards,
Ganesh

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.