[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Binary characters in XML

Subject: Binary characters in XML
From: Neil Smith <neil@xxxxxxxxxxxxxxx>
Date: Mon, 30 Jun 2003 11:15:55 +0100
binary characters
You will need to encode the binary data as Base-64 data, and un-encode it for use. Base 64 is guaranteed to produce only text characters.


XML does not support inline binary data, as it can contain illegal (for XML) characters which break the parser. The parser is *required* not to parse the document if it contains such charcters, and there is no way you can do it the way you are trying.


HTH
Neil Smith.


Date: Sat, 28 Jun 2003 23:38:17 -0500
From: "Michael Leung" <mmhleung@xxxxxxxxxxxxx>
Subject:  Binary characters in XML

Hi,

I am trying to transform an XML document:

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="bin.xsl"?>
<doc>
<binary>
&#x01;&#x02;&#x03;&#x04;&#x05;&#x06;&#x07;&#x08;&#x00;
</binary>
</doc>

into a binary file with the contents being the value of
the binary element in the above using the following
XSLT stylesheet:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output encoding="utf-8" />


<xsl:template match="binary">
<xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>

I tried using MSXSL from Microsoft and I got an "Invalid unicode character" error.

I also tried using Saxon and I got an "illegal XML character &#x1;" error.
In IE, those characters are displayed as rectangles ().

I wonder why the XSLT processors are complaining about these
characters and I wonder if it is possible to carry out such a
transformation.

Many thanks,
Michael.
- --
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.