David Carlisle wrote:
(no tabs) <xsl:value-of select="somenode" separator="{&tab;}" />
That one's an error: the &tab; is expanded before xslt starts so it is an
AVT where the expression in {} is just a tab character which isn't a
legal xpath expression.
Ouch, that hurts! Cut 'n' paste typo and I thought to have checked them
all. Well, I meant "{'&tab;'}" ;-)
<!DOCTYPE x [
<!ENTITY tab "	" >
<!ENTITY tab2 "&#x09;" >
]>
This is where I fell asleep during the lesson last year ;-)
I'm sure I saw this before. Thanks! Now it works as I expect it to. I
can even use the character map, so as to prevent the tabs to be
re-interpreted when I micro-pipeline some data, or use a normalize-space
somewhere too often.
isn't white space fun??
Haha. Nightmarish fun, yes. Some day in ancient history, I thought I had
it all figured out. But recently we started redesigning some of the xslt
libraries and we messed up big time in these corner areas of whitespace
handling.
I am sure this issue also has to do with the way I am mistreating
newline characters.
One more question that I still don't get. If XML parses these entities
before it gets to XSLT, and if XML has predefined entities & <
> ' and " why can't I use the following to the same success?
<!DOCTYPE x [
<!ENTITY tab "	" >
<!ENTITY tab2 "&#x09;" >
]>
It will produce '	' where you previously got ' ' (tab).
Hmm, thinking out loud here: if I get rid of that character map, and I
stick to the lovely &tab; (defined as your &tab2;), do I risk loosing
the tab characters in the output stream when I tossle and hossle them
hence and forth through my templates during a single pass? Meaning, can
normalize-space, strip-space, xsl:value-of, xsl:variable + pipelining,
xsl:function etc be a spoil-sport for me? (if so, character maps are
safer, if not, I can as well get rid of them)
Cheers and thanks!
-- Abel Braaksma
http://www.nuntia.com
--~------------------------------------------------------------------
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>
--~--