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

RE: XML DTD help for binary data (repost)

  • From: "Rick Jelliffe" <ricko@a...>
  • To: <xml-dev@i...>
  • Date: Wed, 17 Jun 1998 15:29:12 +1000

dtd binary data


> From:  Gang He

> I am working on writing a XML DTD to describe a data file. The file will
> contain some binary data. I understand that I can use Entity and
> Notation to do the job. But for some reason I have to make the file
> containing the binary data a XML document file. Could someone please
> tell me whether I can use PCDATA for the binary data directly or I
> should make all binary characters into character references and then put
> them in PCDATA? And if I need make all binary characters into character
> references first, is there any way to convert the binary character into
> character reference automatically?

An XML text document can only contain characters allowed by the XML spec.

So there are many characters you cannot use: the "function" characters below
&#x20; for example. So even if with numeric character references, XML is not
a format that can be used for direct transmission of binary data. You cannot
put &#x0000; in a document, for example.

You have to encode the binary data in some other notation, and put this
encoded data in the element. (You can mark up which encoding you are using
in an attribute. This may help you if you decide to change notation at some
future time.)

The most common notation to use is Base64. You can find base 64 specified in
an RFC.

You can make a more efficient encoding by using all the available
characters. There are sevearal thousand, so you might want to invent your
own Base4K  encoding, for example, if it was really a big problem.

XML is not a compound document archiving or transmission format.

Rick Jelliffe


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.