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

RE: binary base64 definition

  • From: Ian Graham <igraham@i...>
  • To: Jerry Johns <Jjohns@c...>
  • Date: Sat, 06 Jan 2001 17:38:25 -0500 (EST)

binary base64

I don't believe the DOM is really the issue here -- XML (and, by
implication, the DOM) talk about the structual and semantic (notations,
PIs, etc.) content of a 'document,' and don't care about the actual text
content of an element, provided it is 'acceptable' text (that is, not
binary or data otherwise containing illegal bytes).

I would thus hazard that, regardless of the tool you use (DOM, JDOM,
SAX) to process the XML, you will need to add something to handle 
element text content that is specially encoded according to some non-XML
standard (such as base64, uuencode, zip, etc.).

Similarly, with external entities referenced by some combination of an
entity declaration and a notation, you would have to provide code to
handle the special data type indicated by the notation.

Of course, java has (somewhere, I hope!) methods for encoding/decoding
base64 (if the jdk doesn't, then I'm sure there is a package somewhere
that does this), so it shouldn't be too hard to add this. There's probably
a javascript package thta does this also.

Ian

On Sat, 6 Jan 2001, Jerry Johns wrote:

> What if I ditched DOM and used another tool for managing the XML file; could
> I then insert the base64 content and still be within the XML standards? Is
> this a limitate of DOM? Thanks. Jerry
> 
> -----Original Message-----
> From: Ian Graham [mailto:igraham@i...]
> Sent: Saturday, January 06, 2001 10:50 AM
> To: Dan Vint
> Cc: Jerry Johns; 'xml-dev@l...'
> Subject: Re: binary base64 definition
> 
> 
> 
> The DOM supports access to notation nodes, but can enforce no statement
> aobut the proper encoding of a referenced external entity (which makes
> sense, as it is external to the document).
> 
> Base64 encoding of content inside a document would require custom code for
> doing the encoding/decoding, and some attribute-based mechanism for
> labeling the 'type' content of the node containing the data. That is
> certainly possible, but as far as I can see is outside the scope of the
> DOM. 
> 
> Ian
> 
> 
> On Fri, 5 Jan 2001, Dan Vint wrote:
> 
> > You can't use elements this way, but an alternative would be to create a 
> > NOTATION type and then an external entity of this type - you would copy
> all
> > the contents of whatever should be base 64 into this external file, it
> > would be part of the XML document but it would be outside. Not sure if
> > DOM has been setup to understand NOTATIONS, but in an SGML world you would
> > be able to associcate a "processor" with that notation and have it called 
> > whenever you needed to read or write that format. 
> > 
> > Your DTD might look like the following:
> > 
> > <!DOCTYPE .... [
> > 
> > <!NOTATION base64 SYSTEM "binary base64">
> > <!ENTITY extfile1 SYSTEM "extfile.b64" NOTATION "base64" >
> > 
> > ]>
> > ....
> > &extfile1;
> > ...
> > 
> > The syntax is probably not exact but you can look up the details.
> > 
> > ..dan
> > 
> > > 
> > > In the DTD, can I specify a type of "binary base64" for an element so
> that
> > > when I write to the XML file using DOM, DOM will automatically encode
> the
> > > binary data for me without parsing for control characters? If so, I
> assume
> > > it will do the reverse when I read that element.
> > > 
> > > Can anyone validate my assumption about the DTD data type? Has anyone
> seen
> > > an example DTD definition with this in it?
> > > 
> > > Thanks much.
> > > Jerry
> > > 
> > 
> > 
> 


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.