XML and escape characters

I’ve got a problem with escape characters being translated in the NotesDOMParser instead of being left alone.

I load the Parser object with some previously generate XML and use the Process method to parse it. I then perform a small edit which adds another node. Finally I call Serialize to emit the resulting XML to a NotesStream.

The “"” escape characters in the original XML pass through this procedure unscathed, as they should. However the “'” characters are converted to apostrophes and break the “well-formedness” nature of the XML.

I am I missing something here or is this a bug in the NoteDOMParser?

Any ideas greatfully received.

Tim.

Subject: XML and escape characters

More on this,

what’s happening is that when you run some XML through the NotesDOMParser.Serialize method, all attributes that are encapsulated in double quotes (e.g. name=“wilson”) are changed to being encapsulated in single quotes (e.g. name=‘wilson’).

The single quotes doen’t work if you want an apostrophe there, e.g. (name=“l’avigne”)

This breaks the wellformed-ness of the XML and prevents, in my case, a subsequent XSL transformation from succeeding, no matter if the apostrophe is escaped with ' or not.

Help!

Subject: XML and escape characters PLEASE HELP!

I got this problem too but I’m trying to parse an XSL file to another XSL file. All of my XSL functions are getting corrupted because domParser.serialize is matching the quotes.

I tried

<xsl:if test=“@name=‘fred’”>

It yielded the following

<xsl:if test=‘@name=‘fred’’>

Which of course doesn’t work. So I tried the following

<xsl:if test=‘@name=“fred”’>

And would you believe I got the following!!!

<xsl:if test=“@name=“fred””>

Ahhhh! Someone HELP!!!