Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: AW: AW: [xsl] Detecting carriage return and newline feed in XML Data

From: Jeni Tennison <jeni@---------------->
To:
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/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent