473,379 Members | 1,302 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,379 software developers and data experts.

character reference encoding confusion, please help.

(* note the escaped ampersand and the character reference have extra spaces
to avoid being converted when viewed)

I have a job that requires the following

<ThisElement>Here is some text & a m p ; here is a & # x E 2 ;
character</ThisElement>

to end up as

<ThisElement>Here is some text & a m p ; here is a & # x E 2 ;
character</ThisElement>

after it has been transformed using MSXSL3.0. There will be other parts of
the source XML that get changed but the heart of my problem is I want to
keep the escaped ampersand and the character reference as they are.

currently the escaped ampersand remains as is and the character reference
changes to
& a m p ; # E 2 ; with the single the first character getting escaped. If I
disable output escaping it remains intact but then the &amp; character gets
converted to a single ampersand and create bad resulting XML.

I need some XSL code that will keep any currently escaped characters but not
escape any character references.

Any help would be great, I have read through the spec but not found the any
answers.

Thanks
Jul 20 '05 #1
1 1997
"news.hunterlink.net.au" wrote:
I need some XSL code that will keep any currently escaped characters but not
escape any character references.


There is no way in XSLT to distinguish between &#E2; and the actual character in
the input, so the only solution would be parsing the string and replacing any
characters which you need expressed as numeric entities with output-escaped
text.

Note that this will also convert occurances of the character with codepoint E2,
not just the numeric entities.

PS. No need to escape entities with extra spaces when posting to the newsgroup,
since the content type is text/plain the entities will not be resolved (at least
not by any reasonably standards compliant newsreader).

--
Klaus Johannes Rusch
Kl********@atmedia.net
http://www.atmedia.net/KlausRusch/
Jul 20 '05 #2

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

Similar topics

38
by: Haines Brown | last post by:
I'm having trouble finding the character entity for the French abbreviation for "number" (capital N followed by a small supercript o, period). My references are not listing it. Where would I...
7
by: Harlan Messinger | last post by:
How far back in their version history did Netscape and Internet Explorer support — and – codes for em and en dashes in text? In ALT attributes? In TITLE tags? I notice that Netscape 4.7 and 6...
19
by: Ian | last post by:
I'm using the following meta tag with my documents: <meta http-equiv="Content-Type" content= "text/html; charset=us-ascii" /> and yet using character entities like &rsquo; and &mdash; It...
9
by: jmev7 | last post by:
I'm in the US, and have to constantly take data input from other countries. Some of this data has characters which I can't understand, since it's input from other language keyboards. This prevents...
18
by: james | last post by:
Hi, I am loading a CSV file ( Comma Seperated Value) into a Richtext box. I have a routine that splits the data up when it hits the "," and then copies the results into a listbox. The data also...
40
by: Shmuel (Seymour J.) Metz | last post by:
I'd like to include some Hebrew names in a web page. HTML 4 doesn't appear to include character attributes for ISO-8859-8. I'd prefer avoiding numeric references, e.g.,...
8
by: Brand Bogard | last post by:
Does the C standard include a library function to convert an 8 bit character string to a 16 bit character string?
44
by: Kulgan | last post by:
Hi I am struggling to find definitive information on how IE 5.5, 6 and 7 handle character input (I am happy with the display of text). I have two main questions: 1. Does IE automaticall...
10
by: Paul W | last post by:
Hi all, I have an application that reads data in from a text file and stores it in a database. My problem is that there are some characters in the file that aren't being handled properly. For...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.