Skip to main content.
May 30th, 2007

DocBook standard and expectations…

It’s so nice to have standards. DocBook is one which is good enough for many uses. E.g., the notes for the linux system and network administration course I’m writing which I mentioned about some posts ago.

So, tell me why if you ask for an SVG image to be right aligned, 5cm wide and to scale height appropriately, the results with, respectively, the Norman Walsh XHTML XSL stylesheets and his same FO stylesheets and FOP, are the following:

HTML rendering PDF rendering

The code was:

<imagedata
width=”5cm”
align=”right”
fileref=”stack_tcp_ip.svg”
format=”SVG”
scalefit=”1″/>

I know, I ask much, since I involved SVG, DocBook, XHTML, XSL and PDF all in a single cauldron, but… damn, they are ALL standards! :-P

– 2:15 update

I tried for a while to make things fit well, and they didn’t. So, I chose to make conversion to PNG beforehand. This worked well for HTML version, but gave very ugly results in PDF, which uses higher DPI. So I renounced to a single format, and gave double specification of images in the docbook (why have I used a vectorial format, then…). I tried to include PDF in PDF version, but FOP crashes on it (isn’t able to get information from PDF; the comic thing is that he says in turn: “Content is not allowed in prolog”, “Error while recovering image information” and “GRAVE: Image not available” - a perfect case of exception misunderstanding). So I chose for double version PNG (a 90dpi and a 600dpi one), and this way it worked. Almost. In the XHTML version, the “right” alignment is interpreted as a float, in the PDF, as a normal align. Well, I can’t have everything. All in all, I had to make some four trials, which should have all worked, and instead only one did. *GROWL*.

Posted by mattia as docbook, fo, fop, html, image, svg, xhtml, xml, xsl at 9:35 PM CEST

1 Comment »

May 23rd, 2007

XMLHttpRequest, responseXML and getElementByID

Substantially, this has made me mad. In the current status, you can’t reliably use getElementById on objects returned by an XMLHttpRequest. Useless to say, there’s a way to make things work correctly, but only under Firefox. Sigh.

Posted by mattia as ajax, ecmascript, html, xml at 2:19 PM CEST

No Comments »