|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: AW: AW: Detecting carriage return and newline feed
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/
|
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
|

Cart








