You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Gary L Peskin <ga...@firstech.com> on 2000/11/17 20:12:56 UTC

Whitespace handling proposal

Scott --

I wanted to run this by you before making the change.

I'm making the changes necessary in TemplateList to properly implement
the import hierarchy now that you've made the get/setUid() change
(Thanks!).  As I see you already discovered, there is a problem in
handling the whitespace preserving and stripping top-level elements.  I
think the problem can be corrected as follows.

The m_whitespaceStrippingElements and m_whitespacePreserviingElements
vectors in Stylesheet currently hold the XPath expressions that make up
the value of the "elements" attribute on the xsl:strip-space and
xsl:preserve-space elements.  The problem here is that the XPath
expression does not retain the Uid from the element that originated it.

StylesheetComposed later takes these vectors of XPath expressions and
attempts to chain them on to the WhitespaceList.  Unfortunately, we
don't know the Uid of the containing element at this point because it
was not added to the vector.

I think I can solve this problem by adding WhitespaceInfo elements onto
the vectors directly.  I'd add an argument to the constructor to pass
through the Uid of the xsl:strip-space or xsl:preserve-space template
element.  This would allow us to polymorphically process the whitespace
stuff much cleaner and correctly.

Any thoughts?

Gary

Re: Whitespace handling proposal

Posted by Gary L Peskin <ga...@firstech.com>.
Gary L Peskin wrote:
> 
> Scott --
> 
> I wanted to run this by you before making the change.
> 

Well, everything seemed to be working and the change kinda grew on me so
I just promoted it.  Please let me know if there's a problem and I'll
back it off.

I still think we might have a problem with xsl:preserve-space and
xsl:strip-space in imported (not included) sheets but we'll save that
for another day.

Gary