[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

Subject: Re: AW: AW: Detecting carriage return and newline feed in XML Data
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Mon, 1 Nov 2004 13:43:49 +0000
svg text carriage return
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/

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.