<xsl:template match="..."> </xsl:template>
converts the entity in the xsl document and so inserts a space in the
output. What I want is to insert the characters "& n b s p ;" to get
inserted in the output.
putting the   in a CDATA results in the ampersand being quoted as &
In perusing some of the non-microsoft XML/XSL discussions, I see mention of
an xsl command called xsl:entity-ref which looks like it is exactly what I
want. But it is not mentioned in the Microsoft documentation.
But then I happened to notice that Microsoft itself uses that command in
defaultSS.xsl, the stylesheet used to expand XML documents in IE5. How nice
of them.
So I tried it - e.g. <xsl:entity-ref name="nbsp"/>. Even more interesting.
If I use .transformNode, it works fine! just what I want. But if I use
.transformNodeToObject, then I get a parsing error on the output DOM,
reporting "Reference to undefined entity 'nbsp'". This makes sense, because
I haven't, in fact, defined it.
So how do I define it? I thought entities can only be defined in a DTD, and
I'm not using one. Even if I did, then what do I define the output to be? Do
I have to define each special character? or is there some way I can refer to
the HTML spec?
I also tried variations on the theme of <xsl:entity-ref name="#160"/>, since
that's the numeric equivalent (in a MS browser anyway), and you don't have
to define numeric character entity refs (I believe), but they all resulted
in an error during the transform operation.
...Mike
<!DOCTYPE foo [
<!ENTITY nbsp " ">
]>
<foo> </foo>
You will also probably want to turn of validateOnParse in the target
document object.
"Mike Kraley" <mi...@kraley.com> wrote in message
news:s0pfo8...@corp.supernews.com...
But how do I get XSL to insert a doctype node in the output. I previously
corresponded with you about the difficulty of inserting a DOCTYPE via the
DOM; it seems that it is no easier via XSL, unless I am missing something.
I tried pre-loading the output document with a simple document (as you
describe) before executing the transformNodeToObject, but that seems to get
blown away when the transform takes place.
I tried turning off validateOnParse, but I still get the error.
And, am I correct that if I use any part of a DOCTYPE, then I need a
complete DTD? iow, is there any way to define an entity, but still say that
I don't care about the structure of the document (as if I had not specified
a DOCTYPE)?
thanks
...Mike
Microsoft <anon...@microsoft.com> wrote in message
news:erR2fHnG$GA.249@cppssbbsa05...