Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old June 8th, 2011, 12:03 PM
Authorized User
Points: 345, Level: 6
Points: 345, Level: 6 Points: 345, Level: 6 Points: 345, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: , , .
Posts: 71
Thanks: 10
Thanked 0 Times in 0 Posts
Default Converting normal text to UTF values using "character map"

Dear All,

I have two questions to be discussed

Question 1.

I am writing an XSLT to convert the following UTF characters:

Input: Following is a Greek input
μακάριος


XSLT used:

<xsl:import href="iso8879map.xsl"/>

<xsl:output method="html" use-character-maps="iso8879" omit-xml-declaration="no" indent="no" />

<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>


Output:
&mgr;&agr;&kgr;&aacgr;&rgr;&igr;&ogr;&sfgr;


But, following is my required output - hope i need to make few modification in the above XSLT.

Required Output:
μακάÏιος


Any help would be great full.

Also, the original text that show above in the"Input" Greek characters was original converted from following normal text

<greek>mak&alphaacute;piow</greek>

My second question follows
Question 2

Is there any way in XSLT to directly convert as follows:

Input:
<greek>mak&alphaacute;piow</greek>

Output:
μακάÏιος
__________________
Thanks,
Rocxy.
  #2 (permalink)  
Old June 8th, 2011, 01:43 PM
Friend of Wrox
Points: 6,676, Level: 34
Points: 6,676, Level: 34 Points: 6,676, Level: 34 Points: 6,676, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2007
Location: Germany
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

What you posted as the "required output" looks like the gibberish you get when an UTF-8 or maybe UTF-16 encoded document is decoded with an 8bit encoding like ISO-8859-1 or Windows-1252. So I am not sure I understand what you want to achieve.
If you want to convert a string of characters to a sequence of integers with the Unicode codepoints of the characters then XSLT/XPath 2.0 offers http://www.w3.org/TR/xpath-functions...-to-codepoints.
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog


Similar Threads
Thread Thread Starter Forum Replies Last Post
MSXSL gives error message for "for" inside "select" ilyaz XSLT 1 December 9th, 2010 05:02 PM
Difficulties with "web.config" and "ASPNETDB" CFRham BOOK: ASP.NET MVC Website Programming Problem Design Solution ISBN: 9780470410950 2 July 3rd, 2010 10:19 AM
How to theme the "Browse" button of "FileUpload" control? varunbwj BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 October 14th, 2009 01:22 AM
Add a CheckBox DataColumn to my DataGridView, Null format: "" or "True" but Error: F ismailc C# 2005 0 September 25th, 2009 04:56 AM
Code not going as planned: "icicle" vs "savedinstancestate" joopthecat BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 3 May 3rd, 2009 03:09 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.