Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old June 8th, 2011, 01: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
Send a message via Skype™ to ROCXY
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.
Reply With Quote
  #2 (permalink)  
Old June 8th, 2011, 02:43 PM
Friend of Wrox
Points: 6,525, Level: 34
Points: 6,525, Level: 34 Points: 6,525, Level: 34 Points: 6,525, Level: 34
Activity: 50%
Activity: 50% Activity: 50% Activity: 50%
 
Join Date: Nov 2007
Location: Germany
Posts: 1,221
Thanks: 0
Thanked 238 Times in 237 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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 11: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 02:22 AM
Add a CheckBox DataColumn to my DataGridView, Null format: "" or "True" but Error: F ismailc C# 2005 0 September 25th, 2009 05: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 04:09 PM



All times are GMT -4. The time now is 09:21 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.