A question about XHTML As A Single Source Document
September 25, 2003 |
7 Comments
Bear with me if this is a bit of a ramble.
There are many times when I find that I have materials that I need to deliver for both print and Web. It becomes a challenge as these documents are usually in Word format to begin with and then need to be converted to XHTML, PDF or whatever. It’s also a challenge to maintain version control, as these often branch off at some point and get out of synch.
I’m working to find a solution that would allow me to use XHTML (XML) as the source format for these documents. It’s already Web ready and should be able to be exported to programs like InDesign for printing.
Down at the hospital we’ve been working on this a bit and we’ve found that XML support in in InDesign is decent but not perfect as yet. You can import XML into InDesign and it will format that for print fairly well, however it has a problem dealing with elements that aren’t unique. You could use tags called “Intro” and “conclusion” but not a single tag with different identifying attributes.
So you couldn’t import multiple DIVs with classes assigned for example, like you would for CSS formatting. I imagine you could use XSLT to transform your XHTML into an XML format that InDesign can handle, or do it by hand with find and replace techniques, but it would seem so much more logical to use the XHMTL itself, which is a valid XML format, with semantic element and class attributes instead. That way you save a step.
Anyone have any experience with this? Pretty much I’m looking for an easy way to transform or import XHTML into a print design program without having to do too much manually.
If this can be worked out (and I imagine it may well have been) the time and money savings could be huge for many organizations. You go to one source document (an XHTML Web page) which you can then use as XML data to populate a program like InDesign, Quark or whatever. Just pull those pages in whenever you need to print a new version. Maintenance becomes easier, version control becomes easier, and the list goes on.
Please comment if you have thoughts, ideas or experience with this. I’ll let you know how it progresses.
Filed under: Web Development
Comments
1. Ethan said:
Hey, Keith–I’ve no experience with InDesign, but I’d recommend going directly from XHTML into PDF. Check out FOP[1]; it’s a solid technology (if not entirely compliant with the W3C standard for XSL formatting objects[2]), and I’ve had excellent luck with it before.
Hope it helps–later,
- E
[1] http://xml.apache.org/fop/index.html
[2] http://xml.apache.org/fop/compliance.html
Posted on September 25, 2003 05:22 PM | #
2. Anne van Kesteren said:
XHTML for print? The W3C is working on it:
- http://www.w3.org/TR/xhtml-print/
And where markup is, there is style:
- http://www.w3.org/TR/css-print/
(Unfortunately not ready yet.)
-Anne
Posted on September 25, 2003 10:54 PM | #
3. Thijs van der Vossen said:
I personally also use FOP for this kind of work and it works fine for me.
I do not understand why you have a problem using XSLT to transform yourt XHTML to an XML format that InDesign can handle. If InDesign is a bit broken in this regard, what is the problem with working around it using XSLT?
Posted on September 25, 2003 11:57 PM | #
4. P T Withington said:
I’ve had pretty good luck using Acrobat to render HTML into documents – it’s worth a look. I have used it to create a single-source document for my c.v., and experimented with using it to create a single-source document for a programming manual. The latter is HTML generated from javaDoc-style comments in the code which is viewable with a browser, and I used Acrobat to render the same HTML into a downloadable/printable PDF.
FOP looks very interesting!
Posted on September 26, 2003 05:11 AM | #
5. andrew said:
InDesign is tricky to make work with XML. I think your requirements have to be fairly modest to make it work well, which is a shame. I want to be able to make page templates in Indesign that work just like other template-driven publishing.
The other issue though is whether XHMTL is an adequate “single-source” doctype. It’s not really a semantic language, so you can’t mark up your content in a really meaningful way. How do you indicate an “author” or the “patients” of a “doctor”? What’s the “price” of an “automobile”? This is rudimentary XML but it’s not possible in XHTML.
Posted on September 30, 2003 09:36 AM | #
6. Keith said:
Andrew, what I was thinking is you could use attributes to mark your documents up, depending on your needs. For example for a simple document you could have a element with an attribute: <p class=”intro”>, for example, to designate an introductory paragraph.
Keep in mind, while I’ve got a fairly firm grasp on XHTML, my XML knowledge is a bit limited. It just seems like a single source, be-it XHTML or XML that can be easily “exported” to both print and Web would be awesome.
I assume this source is XML, but since most of the focus of the publishing I deal with is Web first now, I thought maybe XHTML would make a good single source for simple documents as it’s already Web ready.
Posted on September 30, 2003 05:21 PM | #
7. David Pratten said:
Perhaps you already have all the solutions that you need, however, XStory is a working GPL, XHTML+CSS single-source WYSIWYG editor generator that works hand in hand with Prince for PDF generation.
All the best
David
Posted on September 15, 2005 05:59 PM | #
Comments are now closed