RE: [xsl] XML apparently cannot be used for general text markup: whitespace gripe

Subject: RE: [xsl] XML apparently cannot be used for general text markup: whitespace gripe
From: "Hunsberger, Peter" <Peter.Hunsberger@xxxxxxxxxx>
Date: Tue, 19 Mar 2002 08:50:20 -0600
Andrew,

Thanks for raising the issue, it's helped me formulate what will be my
generalized architectural approach to the issue:

> 1- Is there a concensus on this issue?  Is it really a problem?
> 

I don't know about any consensus on the issue, but personally, I do not
think it is a problem:  If you're doing client side XSLT then you know
you've also got CSS support and it's much better to use CSS for precise
control of element placement than any dependency on spacing.  If you have to
do generic HTML on the server side it's more of a pain, since you can't
really depend on CSS.  However, you're then in a position to pipeline the
content or use other techniques to get some kind of sensible XML structure
that can in turn be rendered in whatever form you really need.  For me this
usually means lots of (sometimes tricky) table structures, alternatively I
sometimes resort to pumping out variable numbers of &#160;  In either case,
you can control what shows up on the client side.

> 2- From an xsl processing perspective, is text node processing (such as
> text()[1]) equivalent to normal element processing?

One would hope that you don't normally have such badly formed XML that
you've got to resort to this on a regular basis?  If you do, a two pass
approach would seem recommended...

> 3 - Should this problem be dealt with at xml level, or should it not
matter
> to the xsl developer?

If you're doing HTML with CSS then it need not matter to the XSL developer.
If you're doing generic HTML and you don't want it to matter to *every* XML
developer then, again, do a two pass transformation: first to generic XHTML,
then to precisely formatted HTML.  Unfortunately, in the latter case,
someone at the XML level still has to worry about it...

As I've watched this forum I've noticed a lot of questions on how to get
precise HTML output (e.g.. &nbsp; ad nauseam).  I think somehow the
community needs more emphasis on how to do XML to HTML with CSS and on how
to do XML --> XHTML --> HTML.  It's probably something that should be
emphasized in the books and FAQs?  

 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread