473,326 Members | 2,113 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,326 software developers and data experts.

How to output numerical entity encodings with XslTransform?

I am using the XslTransform class in C#.net to output XML files that include
non-ascii Unicode characters such as the Greek capital letter theta U+0398.
I can easily outout the data as serialized UTF-8 by using the default
encoding of UTF-8; however, my customer wants any non-ascii characters
output as numerically-entity encoded characters, e.g. Θ (where 920 is
the decimal equivalent for hexadecimal 398). If I use the Saxon processor
or MSXSL, and the xsl transform has the output type set to us-ascii as
follows:

<xsl:output method="xml" encoding="us-ascii" indent="no" />

then all non-ascii characters are automatically output as numerically-entity
encoded characters. However, if I use the XsltTransform class outputting to
a streamwriter with an encoding type of ASCII, then no entity encoding takes
place - in fact the character is replaced with a question mark. Can anyone
tell me how to configure the properties of the transform to output
numerically-entity encoded characters for all non-ascii characters?

Thank you,

Tim

Nov 16 '05 #1
0 1109

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

Similar topics

81
by: Jonas Smithson | last post by:
I recently read the claim somewhere that numerical entities (such as —) have a speed advantage over the equivalent named entities (such as &mdash;) because the numerical entity requires just a...
1
by: KwiKiwi | last post by:
Hey, I'm doing a series of XSL Transformations from a C#.NET Console app. I've designed a .xsl file (to output to "text" not "xml") to generate a text file with entries that look like: ...
2
by: John Meyer | last post by:
I have an application where I create an xml fragment using an XslTransform object. However, if I use the following output method, <xsl:output method="xml" version="1.0" encoding="UTF-8"...
1
by: Tim Menninger | last post by:
When I use the XslTransform.Transform method to write to the HttpRequest.OutputStream The first byte of the output is always an invalid character, looks like an ascii zero or some other...
2
by: Tim Meagher | last post by:
I am using the XslTransform class in C#.net to output XML files that include non-ascii Unicode characters such as the Greek capital letter theta U+0398. I can easily outout the data as serialized...
3
by: Joseph A Romeo | last post by:
I have written an XSLT transformation on an ASP.NET page. The resulting HTML is primarily a table of links. I have found that when the resulting HTML is less than or equal to 16040 bytes, the...
2
by: Lionel Fourquaux | last post by:
In .Net 1.1, System.Xml.Xsl.XslTransform cannot output directly a document in an encoding that cannot represent all the characters used (e.g. write in us-ascii for compatibility, and convert all...
3
by: Fredy Muñoz [MCP] | last post by:
Hello there! I have a couple of questions about generating HTML using an XSLT Stylesheet. I use the System.Xml and System.Xml.Xsl namespaces and a XslTransform object to make the...
18
by: Terry Holland | last post by:
I have an asp.net (1.1) application that connects to a SQL server 2000 db. I have a stored procedure in my db that out puts data in xml format. What I need to be able to do is display that xml...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...

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.