cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Kuhnle <li...@kuhnle.net>
Subject Re: Why does XSPMarkupLanguage wrap text in xsp:text?
Date Wed, 08 Jun 2005 17:03:48 GMT
Vadim Gritsenko <vadim@reverycodes.com> wrote on 07.06.2005 14:34:36:

> > 
> >>I guess original idea was that text() nodes can be safely ignored, 
while 
> >>xsp:text nodes are meaningful. It might be still true, haven't 
> >>digged deeper...

Hope I'm not too annoying on this issue, but on further work on logic 
sheets, I believe the auto-wrapping is not only complicating things a bit, 
it is actually introducing problems.

ContentHandler.characters specification [1] says that the character data 
can be fed in chunks, so autowrapping text ".a..b..c..d." ('.' stands for 
space) might not rsult in <xsp:text>.a..b..c..d.</xsp:text>, but in 
<xsp:text>.a..b..c</xsp:text><xsp:text>..d</xsp:text> or some other

"partitioning". It actually gets chunked in the current implementation if 
there are newlines in the text.

Now consider e.g. the python xsp.xsl, which has a "space='strip'" option, 
where the template for xsp:text does a normalize-space(). So partitioning 
<xsp:text>.a..b..c..d.</xsp:text> results in "a.b.c.d", while partitioning 
<xsl:text>.a..b</xsl:text><xsl:text>..</xsl:text><xsl:text>c..d.</xsl:text>

results in "a.bc.d". 

I would think there are some more side effects like this somewhere, so I 
would suggest either fixing the PreProcessFilter, so it fixes chunking, or 
remove it alltogether.

Regards,
Jochen

[1] 
http://xml.apache.org/xerces2-j/javadocs/api/org/xml/sax/ContentHandler.html#characters(char[],%20int,%20int)

[2] 
http://svn.apache.org/viewcvs.cgi/cocoon/branches/BRANCH_2_1_X/src/blocks/python/java/org/apache/cocoon/components/language/markup/xsp/python/xsp.xsl?view=markup

Mime
View raw message