Re: [xsl] Whitespace between character entities deleted

Subject: Re: [xsl] Whitespace between character entities deleted
From: David Carlisle <davidc@xxxxxxxxx>
Date: Sat, 10 Nov 2001 17:00:20 GMT
This is a "feature" of msxml (which makes it really quite dificult
sometimes to get acceptible XML browsing in IE)

MSXML treats the entity references as nodes this is OK as far as the DOM
goes, but it is supposd to hide this fact from the XPath model.

Worse is the fact that it removes any white space text nodes as it
builds the DOM. This is normally fairly inconvenient but it is
particularly bad here as the space between the two character entities is
not supposed to be a white space text node at all, according to the
Xpath model, the accented letters and the space should all be part of
the same text node.

If you are calling the parser from script then you need to set the
preseverWhiteSpace property to true _before_ parsing teh document.
If however you are using the xml-stylesheet processing instruction, the
document has already been parsed before you get control so there is
nothing you can do,

> However, the source text contains varieties of capital A with tilde plus
> something else.

That is what utf-8 encoded characters look like if you look at them in a
window using latin-1 encoding.

> I would be grateful for advice.

It is a bug in IE. Please report it to them, if enough people complain,
they may do something about it.

But if you are in an environment where you have control over the parser
something like the following (which I just cut out the msxml
documentation) should do trick.

xmldoc= new ActiveXObject("Msxml2.DOMDocument");
xmldoc.preserveWhiteSpace = true;

This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit or alternatively call
Star Internet for details on the Virus Scanning Service.

 XSL-List info and archive:

Current Thread