473,396 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Putting encoded text into an attribute with XSLT

I'm trying to figure out how to HTML encode shift_jis text and put it into
an attribute.

Starting with this XML-file with characters encoded in shift_jis


<?xml version="1.0" encoding="shift_jis"?>

<test>

<label>??</label>

</test>

and applying this stylesheet

<?xml version="1.0" encoding="utf-8"?>

<!DOCTYPE xsl:stylesheet>

<xsl:stylesheet

version="1.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="html"/>

<xsl:template match="test">

<html>

<body>

<xsl:value-of select="label"/>

</body>

</html>

</xsl:template>

</xsl:stylesheet>

creates output that looks like this:

<html>

<body>数学</body>

</html>

Notice how the shift_jis characters have been HTML escaped (or encoded?) and
display fine in the browser. So far so good. But now I want to put these
escaped characters into an attribute. Here is the HTML I'd really like to
make:

<html>

<body><a href="matlab:disp('数学')">foo</a></body>

</html>

Notice that the same two encoded Japanese characters are now within an
attribute and surrounded by some other text. I've tried every trick I know
and searched all over the Internet, but haven't been able to figure this one
out.

Can someone please point me in the right direction? Thanks for your help!
Jul 20 '05 #1
0 1300

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike Kamermans | last post by:
I'm having difficulty XSL tranforming some XML of the form <some_element> <jis>1234</jis></some_element> into the xhtml form <img src="jis/1234.gif"/> My initial idea was to use the following...
35
by: .:mmac:. | last post by:
I have a bunch of files (Playlist files for media player) and I am trying to create an automatically generated web page that includes the last 20 or 30 of these files. The files are created every...
2
by: js | last post by:
I have a table rendered with XSLT. The first column has a radio button controls for user to make a selection for a particular row. All the values in the remaining columns are all concated with a...
2
by: Keith Chadwick | last post by:
Is there a way to append to an attribute in XSLT. For example: <input name="emailaddress" style="width:200px"> <xsl:apply-templates select="//object"/> </input> <xsl:template...
6
by: Chris Fink | last post by:
I have an xml document that contains some elements encoded as Base64. How do I dynamically scan the XML Document and pull out the sections that are Base64... My overall goal is to display the...
5
by: Steven Berkovitz | last post by:
Hi there, I am having a problem where if i add an attribute to a control at runtime the rendered attribute is HTML encoded. For example, on a textbox: textBox.Attributes = "if(x && y)...
10
by: Jon Noring | last post by:
Out of curiosity, may a CDATA section appear within an attribute value with datatype CDATA? And if so, how about other attribute value datatypes which accept the XML markup characters? To me,...
1
by: arnold | last post by:
Hi, I've been knocking my head against the wall trying to create an XSL transform to perform "normalizations" of a set of XML files that have a common structure. % XML file before transform
1
by: daldridge | last post by:
I have a unique-elements/sorting question (who doesn't?), but haven't yet been able to get appropriate template/select/for-each processing working. I don't fully grok the Muenchian technique yet...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.