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

Re: Separating documents in a stream

  • From: "John Tigue" <john.tigue@t...>
  • To: "xml-dev" <xml-dev@i...>
  • Date: Sat, 13 Nov 1999 23:32:08 -0800

multipart related boundary
Richard Anderson (rja@a...) wrote:
> Provided the xml pi is _always_ used that can be used 
> as the separator and seems the cleanest approach to me.
> 
> ----- Original Message -----
> From: David Megginson <david@m...>
> > kragen@p... (Kragen Sitaker) writes:
> >
> > > One protocol I remember reading about uses ]]>]]> to 
> > > separate XML documents, since that's a sequence that 
> > > can't occur inside a legal XML document.
> >
> > True, but ^L (formfeed) is not allowed within an XML 
> > document either -- it's still my favourite as a separator.

I'd consider using multipart MIME to solve the problem 
of seperating documents in a stream.

Here's the spec:
IETF RFC 1341
Borenstein, N. and Freed, N., 
"MIME (Multipurpose Internet Mail Extensions): Mechanisms for
Specifying and Describing the Format of Internet Message Bodies"
http://www.ietf.org/rfc/rfc1341.txt

Multiparting is well defined, well tested, and there exists free 
compliant software. Also by using technology which is orthogonal 
to XML, implementation code can be re-used.

Here's an example of what multipart looks like:

MIME-Version: 1.0
Content-Type: multipart/digest; boundary="---- next message ----"

------ next message ----

...document 1 goes here ...

------ next message ----

...document 2 goes here...

------ next message ------



There's even a sub-type 'multipart/related' which works well for 
aggregate documents with interlinked parts and a defined root
entity (for example, for HTML email the root is the HTML document 
and it links to the non-root images). multipart/related maintains
the internal links during transfer. XML document are a good
candidate for multipart/related.

Here's the multipart/related spec:
IETF RFC 2112
Levinson, E.,
"The MIME Multipart/Related Content-type"
http://www.ietf.org/rfc/rfc2112.txt

Here's a modified example from the spec. In this example there
are 3 parts: 1 HTML-like doc and 2 JPEGs.

Content-Type: Multipart/Related; 
     boundary=example-2; 
     start="950118.AEBH@X..."
     type="text/xml"

--example-2
Content-Type: text/xml; charset=iso-8859-1;
     declaration="950118.AEB0@X..."
Content-ID: 950118.AEBH@X...
Content-Description: Document

<doc>
This picture was taken by an automatic camera mounted ...
<image file="cid:950118.AECB@X..." />
<para>
 Now this is an enlargement of the area ...
<image file="cid:950118:AFDH@X..." />
</doc>
--example-2
Content-Type: image/jpeg
Content-ID: 950118.AFDH@X...
Content-Transfer-Encoding: BASE64
Content-Description: Picture A

[encoded jpeg image]
--example-2
Content-Type: image/jpeg
Content-ID: 950118.AECB@X...
Content-Transfer-Encoding: BASE64
Content-Description: Picture B

[encoded jpeg image]
--example-2--



-John




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/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@i... the following message;
unsubscribe 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.