Subject: [xsl] Re: Adding structure to text nodes From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx> Date: Wed, 19 Mar 2003 21:03:15 +0100 |
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="', 	 '"/> </xsl:call-template> </xsl:variable> <xsl:for-each select="vendor:node-set($vWords)/*"> <xsl:value-of select="concat(., '
')"/> </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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Adding structure to text , Simon Kelly | Thread | RE: [xsl] Adding structure to text , Conal Tuohy |
RE: [xsl] Answers to review questio, Lars Huttar | Date | [xsl] Answers to review questions i, Lars Huttar |
Month |