I don't know how the XSLT you're running fits into the rest of your process, but if it's possible for you, another solution is to change the output method on your XSLT. An output of text <xsl:output method="text"/> should avoid any XML parsing errors.
Alternatively, depending on the rest your process, you could also use ACL to read and update the file before you pass it to your XSLT. The open(), getline(), replace() and put() functions in Epic work very quickly in my experience - definitely faster than an XSLT for manipulating text the way you want.
Of course with either of these methods you lose the reassurance of always having well-formed output. Also, you'll want to watch for actual < and > tags in the data by screening for " < " and "> " and leaving them as they appear.
No XSLT expert myself and haven't been paying full attention to this thread(commercial rents are down, lease is up,we're moving uptown), but ifrunning a XSLT 2 processor you can useuse-character-maps="[name]" in your output declaration:
<xsl:output omit-xml-declaration="no" method="xml" encoding="utf-8" indent="no" use-character-maps="doc-entities"/">
<xsl:output-character character="§" string="§"/>
<xsl:output-character character="–" string="–"/>
<xsl:output-character character="—" string="—"/>
Only used it for numeric character entities so far --not general entities --but it does seem to guarantee output format for html and xml.
Continuing Education of the Bar - California
In Reply to Paul Nagai:
Support has said that datamerge is working as designed by returning
(as stored in the database) as and that it is up to me to convert
markup from < to < on output via the XSLT. That conversation is ongoing.
BUT if one of you XSL gurus knows how to do this, maybe I can leave support
I have tried swapping the overall output method to text (that was a hail
mary) and believe this is the "best" answer but it fails:
The following "works" in that it returns the string to Editor with a ! where
there should be a < so the select and the translate are working:
All attempts to use the < fail with the following:
javax.xml.transform. TransformerException: Error reported by XML parser.
Failed to update query: (my query name)
com.arbortext.epic.datamerge.DataMergeException: Failed to construct XSL
(FWIW: Michael Kay can be found responding to this question (more or less),
in his own inimitable way, "Fix the #$#% program generating the bad