docbook v5 customization layer - german umlaute / oxygenxml

osprofi
Posts: 18

docbook v5 customization layer - german umlaute / oxygenxml

Thu Jun 13, 2013 7:29 am

Hello Docbook user

I am writing a customization layer and have 2 questions:

1) I wrote an xml testfile in UTF-8 encoding using german umlaute;
I specified in the customization file for html conversion

Code: Select all

<xsl:output method="html" encoding="UTF-8" indent="yes"/>

the related meta tag

Code: Select all

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

is displayed correctly, but the german umlaute, e.g. ä is written like this: &auml;

What do I need to adjust so that the correct UTF-8 code for the letter ä will be displayed ?

2) Before using a customization layer for the html transformation Oxygenxml generated an html file which was immediately displayed; Now, using a customization layer for the html transformation the html code is only displayed in the lower window.

What do I need to adjust that the generated html file is displayed straight on ?

Thanks for your help.

regards, peter
osprofi
Posts: 18

Re: docbook v5 customization layer - german umlaute / oxygen

Thu Jun 13, 2013 7:40 am

Hello docbook users
question #2 is solved using changing the output parameter in the transformation scenario
regards, peter
sorin_ristache
Posts: 4144

Re: docbook v5 customization layer - german umlaute / oxygen

Mon Jun 17, 2013 2:50 pm

Hello Peter,


osprofi wrote:1) I wrote an xml testfile in UTF-8 encoding using german umlaute;
I specified in the customization file for html conversion

Code: Select all

<xsl:output method="html" encoding="UTF-8" indent="yes"/>

the related meta tag

Code: Select all

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

is displayed correctly, but the german umlaute, e.g. ä is written like this: &auml;

What do I need to adjust so that the correct UTF-8 code for the letter ä will be displayed ?


This is caused by the attribute method="html" of the element xsl:output in the XSLT stylesheet. The HTML serializer is imposed by this output method declaration and for the non-ASCII characters it does not guarantee that the Unicode codepoint is used. In particular the German umlaute characters are always represented as entity references (e.g. &auml;). If you change the method to "xml" you get the ä character.

Anyway the browser displays the character correctly (i.e. ä) regardless of the representation in the HTML file, as the ä character or as the entity reference &auml;, because all browsers (I think) know how to represent the &auml; reference. So the exact representation in the HTML file does not really matter if the character is displayed correctly in the browser.


Regards,
Sorin

Return to “DocBook”

Who is online

Users browsing this forum: No registered users and 0 guests