Greek beta code conversion zo utf-8

Oxygen general issues.
zlanczky
Posts: 2
Joined: Wed Jul 18, 2012 11:32 am

Greek beta code conversion zo utf-8

Post 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
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: Greek beta code conversion zo utf-8

Post 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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
zlanczky
Posts: 2
Joined: Wed Jul 18, 2012 11:32 am

Re: Greek beta code conversion zo utf-8

Post 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
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: Greek beta code conversion zo utf-8

Post 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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply