Input:
====
<!--<query id="Q26">ED: È stata cambiata valutazione in
accertamento perché in altri capitoli viene citato
l’accertamento come prima fase del processo di assistenza
infermiersitica. Ok?</query>-->
Output
====
<query id="Q26">ED: &#x00C8; stata cambiata valutazione in
accertamento perch&#x00E9; in altri capitoli viene citato
l&#x2019;accertamento come prima fase del processo di assistenza
infermiersitica. Ok?</query>
Desired output:
========
<query id="Q26">ED: È stata cambiata valutazione in accertamento
perché in altri capitoli viene citato l’accertamento come
prima fase del processo di assistenza infermiersitica. Ok?</query>
Tried XSLT:
=======
<xsl:for-each select="//comment()">
<xsl:choose>
<xsl:when test="substring(.,2,8)='query id'">
<xsl:text>
</xsl:text>
<xsl:value-of select="."/>
</xsl:when>
</xsl:choose>
</xsl:for-each>
I even tried different manipulation (substring(), substring-after() etc)to
get this done, for instance below one.
<xsl:for-each select="//comment()">
<xsl:choose>
<xsl:when test="substring(.,2,8)='query id'">
<xsl:text>
</xsl:text>
<xsl:element name="query">
<xsl:value-of select="."/>
</xsl:element>
<xsl:value-of select="."/>
</xsl:when>
</xsl:choose>
</xsl:for-each>
Just to add, notice È changing to &#x00C8; and similarly >
< (thats what xsl:value-of does. :-( ). Would have been much easier
with 2.0 with the use of
<xsl:sequence
select="replace(codepoints-to-string(string-to-codepoints($arg)),
'\[#x([0-9A-Za-z]+)\]', '#x$1;')"/> and replace() function.
and so on,
but alas I am using 1.0. Is there a way to get this done in 1.0?
Thanks for hints.
Pankaj
--~------------------------------------------------------------------
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>
--~--