Altova Mailing List Archives>Archive Index >xsl-list Archive Home >Recent entries >Thread Prev - AW: AW: [xsl] Detecting carriage return and newline feed in XML Data [Thread Next] Re: AW: AW: [xsl] Detecting carriage return and newline feed in XML DataTo: Date: 11/1/2004 1:44:00 PM Hi Lawrence, > 4. The System Architect cleverly export all structured diagrams and > their properties into one single XML. The text field described > before is as well stored as an attribut of an XML element. As others have pointed out, you can't see the CR/LF characters in the attribute using XSLT, since they're normalised away during XML parsing. The best thing to do is go to Popkin Software, complain that the XML that System Architect is generating isn't structured at all helpfully, and insist that they change it. In the meantime, though, perhaps you can use the fact that the paragraphs end in a full stop (period to our American friends) and indented using two-or-more spaces to access them. Try something like: <xsl:template match="SAProperty[@SAPrpName = 'Description']"> <xsl:param name="desc" select="@SAPrpValue" /> <xsl:choose> <xsl:when test="contains($desc, '. ')"> <para> <xsl:value-of select="normalize-space(substring-before($desc, '. '))" /> <xsl:text>.</xsl:text> </para> <xsl:apply-templates select="."> <xsl:with-param name="desc" select="substring-after($desc, '. ')" /> </xsl:apply-templates> </xsl:when> <xsl:otherwise> <para> <xsl:value-of select="normalize-space($desc)" /> </para> </xsl:otherwise> </xsl:choose> </xsl:template> Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
