[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Data from DB in xsl
You need to establish '\n' as a string: Note the single quotes around \n\n: <xsl:value-of select="substring-before($sText,'\n\n')"/> not <xsl:value-of select="substring-before($sText,\n\n)"/> Cheers, Charles White The Tumeric Partnership http://www.tumeric.net chuck@xxxxxxxxxxx http://www.javertising.com ________________________________________ Author, Mastering XSLT, Sybex Books Co-Author, Mastering XML, Premium Edition, Sybex Books ----- Original Message ----- From: "Stevenson Ngila" <Stevenson@xxxxxxxxxxxxxxxxxxxxxx> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Sent: Wednesday, August 28, 2002 7:25 AM Subject: RE: Data from DB in xsl > on writing the code you gave me, i get the error below: > > "Unexpected character in query string. contains($sText,-->\<--n\n)" > > here is my code: > > <xsl:template name="paragrapher"> > <xsl:param name="sText"/> > <xsl:if test="contains($sText,\n\n)"> > <p> > <xsl:value-of select="substring-before($sText,\n\n)"/> > </p> > </xsl:if> > </xsl:template> > > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of > Jarno.Elovirta@xxxxxxxxx > Sent: 28 August 2002 15:18 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: RE: Data from DB in xsl > > > Hi, > > template name=paragrapher > param text > if contains($text, \n\n) > <p> > substring-before($, \n\n) > </p> > call-template name=paragrapher > with-param name=text select=substring-after($text, \n\n) > else > <p> > $text > </p> > > i.e. recursion is your friend. You should make sure the template handles > whitespace characters between the two LINE FEEDs, but that shouldn't be too > hard to implement. > > Jarno > > > -----Original Message----- > > From: ext Stevenson Ngila [mailto:Stevenson@xxxxxxxxxxxxxxxxxxxxxx] > > Sent: 28. August 2002 14:51 > > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > > Subject: RE: Data from DB in xsl > > > > > > if the user input the following text using the form: > > > > "This new status will be used by the DQA team when performing defect > > analysis.The status should be called "Defect Analysis" and is > > neither under > > Development or Support. > > > > To assist managers when tracking call progress, we need an > > option on the > > filter whereby the last update is displayed instead of the > > call description. > > Please see attached screen designs." > > > > This statement contains two paragraphs. If it's saved in the > > database, how > > can i make it to be formatted(xslt) exactly the way it(2 > > paragraphs) is > > instead of it giving me one paragraph. > > > > -----Original Message----- > > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Khan, Amir > > Sent: 28 August 2002 13:48 > > To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx' > > Subject: RE: Data from DB in xsl > > > > > > sounds like you want to use <pre>whatevertext</pre> > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|