[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Copying all comments [xsltproc 1.0]
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|