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

Re: Adding structure to text nodes

Subject: Re: Adding structure to text nodes
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Wed, 19 Mar 2003 21:03:15 +0100
.so structure
The wanted re-formatting of the text is achieved easily using the
"str-split-to-words" template from FXSL:

<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:vendor="urn:schemas-microsoft-com:xslt"
>

   <xsl:import href="strSplit-to-Words.xsl"/>

   <!-- to be applied on words.xml -->

   <xsl:output indent="yes" omit-xml-declaration="yes"/>

    <xsl:template match="/">
      <xsl:variable name="vWords">
        <xsl:call-template name="str-split-to-words">
          <xsl:with-param name="pStr" select="/*"/>
          <xsl:with-param name="pDelimiters" select="', &#9;&#10;&#13;'"/>
        </xsl:call-template>
      </xsl:variable>

      <xsl:for-each select="vendor:node-set($vWords)/*">
        <xsl:value-of select="concat(., '&#xA;')"/>
      </xsl:for-each>
    </xsl:template>

</xsl:stylesheet>

When applied on the provided source.xml:

<long>blabla
blabla
blabla
</long>


The desired result is produced:

blabla
blabla
blabla


It seems to me, though, that the problem is not formulated very well -- e.g.
what is exactly the "structure" that the result must have?


=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL


"Cams Ismael" <Ismael.Cams@xxxxxxxxxxx> wrote in message
news:57FD2C3A246F76438CA6FDAD8FE9F1957ABC54@xxxxxxxxxxxxxxxxxxx
>And the formate with in that long tag will not be altered.

The problem is that it's my wish that the format is altered. If I have

<long>blabla
blabla
blabla
</long>

the output should not be:

blabla
blabla
      blabla

but instead:

blabla
blabla
blabla

So the content must be altered, but in a structured way. So it's actually
like reading the thoughts of the author of the xml file. I know I never can
accomplish this for 100%. But some hints and tricks can lead me maybe to an
acceptable solution.

Ismaël

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list





 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.