Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic System Architect (steve huntington)
Decrease font size
Increase font size
Topic Title: Invalid XML from Report Generator
Topic Summary: Is there an option I can set to generate valid XML?
Created On: 22-Mar-2007 19:38
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 22-Mar-2007 19:38
User is offline View Users Profile Print this message


Steve Ireland

Posts: 1
Joined: 14-Feb-2006

When I use the Report Generator (selecting HTML and Raw data) the resulting SAPrpValue attribute in the intermediate XML contains the x0A x0D character strings for carriage return and line feed. This isn't valid XML and when picked up by an XSLT transformation tool it transforms these into spaces. This destroys the formatting of the text for descriptions - so I was wondering if anyone knows of a patch or a configuration option that can be set so that the carriage return and line feed character stream is converted to something that is valid XML such as & #xA;



We're at SA version 10.4



Thanks.


Steve Ireland

Edited: 23-Mar-2007 at 15:30 by Steve Ireland
Report this to a Moderator Report this to a Moderator
 24-Mar-2007 20:07
User is offline View Users Profile Print this message


John Crouchley

Posts: 4
Joined: 6-Sep-2005

These ARE valid XML characters - from the XML specification:

2.2 Characters
[Definition: A parsed entity contains text, a sequence of characters, which may represent markup or character data.] [Definition: A character is an atomic unit of text as specified by ISO/IEC 10646:2000 [ISO/IEC 10646]. Legal characters are tab, carriage return, line feed, and the legal characters of Unicode and ISO/IEC 10646. The versions of these standards cited in A.1 Normative References were current at the time this document was prepared. New characters may be added to these standards by amendments or new editions. Consequently, XML processors MUST accept any character in the range specified for Char. ]

Character Range
[2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] /* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. */


Edited: 24-Mar-2007 at 20:13 by John Crouchley
Report this to a Moderator Report this to a Moderator
 24-Mar-2007 20:11
User is offline View Users Profile Print this message


John Crouchley

Posts: 4
Joined: 6-Sep-2005

My guess is that your XSLT is generating HTML - the characters x0A and x0D in HTML are interpreted as white space and so appear as spaces.
We use a template such as the following to deal with this. 


<xsl:template name="lf2br">

<!-- import $StringToTransform -->

<xslaram name="StringToTransform"/>

<xsl:choose>

<!-- string contains linefeed -->

<xsl:when test="contains($StringToTransform,' ')">

<!-- output substring that comes before the first linefeed -->

<!-- note: use of substring-before() function means -->

<!-- $StringToTransform will be treated as a string, -->

<!-- even if it is a node-set or result tree fragment. -->

<!-- So hopefully $StringToTransform is really a string! -->

<xsl:value-of select="substring-before($StringToTransform,' ')"/>

<xsl:text disable-output-escaping="yes"><br/></xsl:text><!-- DEV_STRING -->

<!-- repeat for the remainder of the original string -->

<xsl:call-template name="lf2br">

<xsl:with-param name="StringToTransform">

<xsl:value-of select="substring-after($StringToTransform,' ')"/>

</xsl:with-param>

</xsl:call-template>

</xsl:when>

<!-- string does not contain newline, so just output it -->

<xsltherwise>

<xsl:value-of select="$StringToTransform"/>

</xsltherwise>

</xsl:choose>

</xsl:template>



Edited: 24-Mar-2007 at 20:18 by John Crouchley
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic System Architect forum.
There are currently 1 users logged in.
The most users ever online was 16 on 30-Oct-2008 at 14:46.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.