xsl-list
[Top] [All Lists]

RE: Whitespace between nodes

2004-05-12 17:50:05
I think Charles Knell would have quickly responded back(if the proper
code was provided) and told you that you can use the <xsl:strip-space
elements="*"/> as a child node of xsl:stylesheet before your first
xsl:template to strip all of the extra spaces from your elements and
then use the normalize-space() function when you output your element
value to ensure that any leading and trailing white space contained in
the element is strip out as well.  Setting indent to "no" will ensure
that your output stream consists of one long string of properly spaced
characters.

So yes, there is a tag (and function) that do what you need but theyre
not really magic they just take out the extra spaces as directed and
there not obscure in that they are published and readily accessible in
every XSLT 1.0 compliant reference.  And last time I checked there were
about 34 elements available for use in XSLT 1.0 and about 40 functions
between XPath and XSLT.  Even if you added the 17 or so Axis values
you're still not talking about a huge number of total aspects of
XSLT/XPath 1.0 to memorize.  And a quick scan of an online reference and
something like <strip-space> jumps right out at you.

Im telling you these things because as I read through your email thread
I was seeing a lot of frustration and contention with those trying to
help.  And a quick trip to Michaels Kay's reference or Dave Pawson's FAQ
would have presented a dozen examples using an element and function that
pretty much state in plain English just what it is they do.

I've found that when there feels like there should be a simple solution
there usually is and it just takes a bit of research to find the answer.
And if after doing the research you still cant find the answer your
going to find a lot of people in here who will help you with exactly the
things you need but who will also avoid you if they feel like your not
doing anything to research it yourself and your getting frustrated with
people because theyre not giving you exactly what you want when you want
it.

Anyway, I hope these two aspects of XSLT will help get you where you
want and you can move on to a less frustrating part of your day.  I know
how frustrating it can be sometimes so I can empathize with your
frustration.

Best of luck!

<M:D/>

-----Original Message-----
From: Nicholas Shanks [mailto:contact(_at_)nickshanks(_dot_)com]
Sent: Wednesday, May 12, 2004 5:12 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Whitespace between nodes

On 12 May 2004, at 23:10, Andreas L. Delmelle wrote:

Would you agree that, in this case, it should be:
<q>
  <a href="...">...</a>
</q>

Yep, sure - I was never saying ti wasn't. I was just asking if there
was some magic, obscure <xsl:output-span
indent="no">...</xsl:output-span> tag I could use to force the
processor to always output text without whitespace. Maybe it was just
wishful thinking :-)

Suppose a processor performs the indentation of the result tree in a
final
step, how is it supposed to distinguish between the results of your
code and
those of the rewrite above?

That wouldn't be necessary.

- Nick.


--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--



<Prev in Thread] Current Thread [Next in Thread>