could a line break be lost during parsing? 2003-01-17 - By Christopher Ebert
Hi, Oh, yes - sorry, the subject of the message made me think you were looking for a problem in the parser. :) So, really you have an XSL issue, yes? This isn't really the list for XSL issues. Xalan is the Apache XSL processor -- the xalan list would likely be more helpful. That said, I'm guessing the line breaks are not appearing as 0xA. Is that what's in your input file? Have you looked at the DOM element you get for the text you're trying to process? You might find 0xD instead, (any change more likely due to Java than Xerces). If I recall my ASCII, 0xA is line feed and 0xD is carriage return. I don't remember off hand which one Java uses for a line break ('\n'). HTH Cheers, Chris
-----Original Message----- From: dongjiang tang [mailto:dtang@(protected)] Sent: Friday, January 17, 2003 11:15 AM To: xerces-j-user@(protected) Subject: Re: could a line break be lost during parsing?
Hi, thank you for the reply. I was trying to add the <br> by a template as showed in the previous mail, but did not get it. I know the HTML will not show the line break, but I did look at the source of that HTML page generated by my xsl template, I did not see the line break either. dongjiang <xsl:template name="add-line-breaks"> <xsl:param name="string" select="." /> <xsl:choose> <xsl:when test="contains($string, '
')"> <xsl:value-of select="substring-before($string, '
')" /> <br /> <xsl:call-template name="add-line-breaks"> <xsl:with-param name="string" select="substring-after($string, '
')" /> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$string" /> </xsl:otherwise> </xsl:choose> </xsl:template> a
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1126" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=#ffffff> <DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV> <DIV><SPAN class=208501820-17012003><FONT face=Arial color=#0000ff size=2> Hi,</FONT></SPAN></DIV> <DIV><SPAN class=208501820-17012003><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=208501820-17012003> <FONT face=Arial color=#0000ff size=2>Oh, yes - sorry, the subject of the message made me think you were looking for a problem in the parser. :)</FONT></SPAN></DIV> <DIV><SPAN class=208501820-17012003><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=208501820-17012003> <FONT face=Arial color=#0000ff size=2>So, really you have an XSL issue, yes? This isn't really the list for XSL issues. Xalan is the Apache XSL processor -- the xalan list would likely be more helpful.</FONT></SPAN></DIV> <DIV><SPAN class=208501820-17012003><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=208501820-17012003> <FONT face=Arial color=#0000ff size=2>That said, I'm guessing the line breaks are not appearing as 0xA. Is that what's in your input file? Have you looked at the DOM element you get for the text you're trying to process? You might find 0xD instead, (any change more likely due to Java than Xerces). If I recall my ASCII, 0xA is line feed and 0xD is carriage return. I don't remember off hand which one Java uses for a line break ('\n').</FONT></SPAN></DIV> <DIV><SPAN class=208501820-17012003><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=208501820-17012003> <FONT face=Arial color=#0000ff size=2>HTH</FONT></SPAN></DIV> <DIV><SPAN class=208501820-17012003><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=208501820-17012003><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=208501820-17012003> <FONT face=Arial color=#0000ff size=2>Cheers,</FONT></SPAN></DIV> <DIV><SPAN class=208501820-17012003><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=208501820-17012003><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=208501820-17012003> <FONT face=Arial color=#0000ff size=2>Chris</FONT></SPAN></DIV> <DIV><SPAN class=208501820-17012003></SPAN> </DIV> <BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"> <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> dongjiang tang [mailto:dtang@(protected)]<BR><B>Sent:</B> Friday, January 17, 2003 11:15 AM<BR><B>To:</B> xerces-j-user@(protected)<BR><B>Subject:</B> Re: could a line break be lost during parsing?<BR><BR></FONT></DIV> <DIV><FONT face=Arial size=2>Hi, thank you for the reply. </FONT></DIV> <DIV><FONT face=Arial size=2>I was trying to add the <br> by a template as showed in the previous mail, but did not get it. </FONT></DIV> <DIV><FONT face=Arial size=2>I know the HTML will not show the line break, but I did look at the source of that HTML page generated by my xsl template, I did not see the line break either.</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>dongjiang</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><xsl:template name="add-line-breaks"><BR> <xsl :param name="string" select="." /><BR> <xsl:choose><BR> <xsl:when test="contains($string, '&#xA;')"><BR> <xsl:value-of select="substring-before($string, '&#xA;')" /><BR> <br /><BR> <xsl:call-template name="add-line-breaks"><BR>   ; <xsl:with-param name="string"<BR> select="substring-after($string, '&#xA;')" /><BR> </xsl:call-template><BR> </xsl:when><BR> <xsl:otherwise><BR> <xsl:value-of select="$string" /><BR> </xsl:otherwise><BR> </xsl:choose><BR></xsl:template><BR><FONT face=Arial size=2>a</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <BLOCKQUOTE dir=ltr style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"> <DIV style="FONT: 10pt arial"><FONT face=Arial size=2> </DIV></FONT></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>
|
|