Page 1 of 1
Greek beta code conversion zo utf-8
Posted: Wed Jul 18, 2012 11:40 am
by zlanczky
My xml doc contains greek beta coding (
http://en.wikipedia.org/wiki/Beta_code).
I need to create html doc (it is simple with Oxygen) but I need the texts to be converted to UTF-8 coding (
http://en.wikipedia.org/wiki/Utf-8).
Is it any chance to do it with Oxygen?
thankx
Re: Greek beta code conversion zo utf-8
Posted: Wed Jul 18, 2012 12:38 pm
by adrian
Hi,
Do you generate the HTML with an XSLT transformation?
Do you want to convert the beta code characters to their Unicode equivalent (e.g. G -> γ , *G -> Γ) or is it something else that I'm missing?
For the beta code to Unicode conversion, there was a PDF linked as reference in that wiki article:
http://www.tlg.uci.edu/encoding/quickbeta.pdf
Regards,
Adrian
Re: Greek beta code conversion zo utf-8
Posted: Wed Jul 18, 2012 10:34 pm
by zlanczky
Hi Adrian,
yes, I want to generate HTML doc.
Yes, in between I want to convert the texts to unicode greek chars, as you understood.
Thanks for the reference of the conversion but my problem is differerent.
How can I convert the text within oXigen or with other tools to convert only the text part of the html, but not the tags. I have the conversion routine in VB, in python, this is not a problem. Is it possible to embed e.g such java script in oXigen?
regards, Zoltán
Re: Greek beta code conversion zo utf-8
Posted: Thu Jul 19, 2012 3:22 pm
by adrian
Hello,
Oxygen cannot by itself run scripts, VB, JavaScript or python on parts of the document. If you want to do this from Oxygen and perform the conversion only on text, you will have to process the XML source (not the HTML) with the help of XSLT and an appropriate transformer.
If you have VBScript or JavaScript code that does this text conversion, you could use an XSLT with the MSXSL extension (can embed JavaScript, VisualBasic, or C#) and run it in Oxygen with the .NET 1.0/2.0 transformer (Windows only):
MSDN XSLT Stylesheet Scripting using <msxsl:script>
e.g. JavaScript
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:js="urn:custom-javascript"
exclude-result-prefixes="msxsl js">
<xsl:template match="text()">
<xsl:value-of select="js:convertText(string(.))"/>
</xsl:template>
<msxsl:script language="JavaScript" implements-prefix="js">
<![CDATA[
function convertText(strText)
{
// Do the conversion
// ...
return convertedText;
}
]]>
</msxsl:script>
<!-- Add other templates that correctly process the XML elements -->
</xsl:stylesheet>
Regards,
Adrian