On Thursday, 07/18/2002 at 09:29 AST, Bennett <[EMAIL PROTECTED]> wrote:
> how to best handle images with XML

Standard solution #1: Reference them as separate documents, just as HTML does. XLink is one proposal for fancy references from one document to another, but a simple URI may also suffiice. XHTML is taking this approach...

Standard soluition #2: If you really need to embed them in the same file, encode them as base64 to convert them into text characters, then make that block of text the content of some element (more often) or attribute as appropriate. The application can convert the text back to a block of binary data and render it appropriately.

Standard solution #3: For machine-generated graphics, send a description of how to generate the picture rather than the picture itself. SVG is one example of an XML-based graphics language.


> - First off, from where I stand now, it appears *ultimately* that
> the browsers (IE 5.5+, NS 6+, Opera, etc) will be sent XML with a
> stylesheet of some kind and render the resulting page based on rules
> defined in the stylesheet.

That's the direction everyone's trying to go. Deliver semantic information, let the application render it appropriately. Note that this is actually where HTML started, though with very simple text-document semantics ... unfortunately folks started relying on specific renderings and that level of abstraction was lost.

However, NOT ALL DATA IS BEST REPRESENTED IN XML. Images -- depending on the kind of image, as noted above -- are an example that is probably best kept in a more targeted representation.

> - Should I plan on using CSS on the sent XML to try to call
> the images and position them in the correct spot?

Or XSLT rather that CSS, which is my own preference... The answer depends on whether the image is part of your style (in which case the style should retrieve and insert it appropriately) or part of your content (in which case the document provides or references the image and the stylesheet just gets involved in placing it on the page.

> - Should I plan on using both XSLT and CSS on the XML?

Some would. I wouldn't, partly because I've never much liked CSS. Besides, you're asking in an XSLT discussion group!

> - Should I somehow use XSCHEMA to define an XML element as one
> that handles images?

If you're going to validate against a schema, or use schema information to help guide your processing of the image, then using the types to indicate that a value is (a reference to) an image is a Good Thing. How you do that depends on how you design the schema -- in other words, how you design the markup language for this sort of document.

Note that XSLT 2.0 is expected to be schema-aware; you'll be able to say "if an element represents an image, process it this way" independent of where the element is located in the document or how it's named. (Or in combination with that syntactic info, if that's more useful for the styling you wish to perform.)

______________________________________
Joe Kesselman / IBM Research

Reply via email to