venta: (Default)
venta ([personal profile] venta) wrote2007-12-04 05:43 pm
Entry tags:

Another boring XML/DocBook question

I apologise for the volley of XML/HTML/other baleful pointy-bracket-related questions on here of late. Me and the pointy brackets are not friends.

So, if anyone knows anything about Docbook XML, I'd like to know why the following...
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">

<article>
<articleinfo>
<mediaobject>
<imageobject>
<imagedata fileref="my_graphic.png" format="PNG"/>
</imageobject>
</mediaobject>
<title>An Exciting Document</title>
<copyright><year>2007</year>
<holder>Venta</holder>
</copyright>
</articleinfo>

... rest of article...

generates an article which has no graphics at all in the header. The generated html doesn't have any reference to my graphic in it at all.

The DocBook DTD says that mediaobject can be a child of articleinfo, and the XML is perfectly valid according to xmllint (which validates it against the DTD).

I'm assuming that the DocBook stylesheets must somehow be failing to generate any <img> tags, but the DocBook stylesheet set is so large and behemothlike that I'm being a bit daunted at the prospect of how I'm going to find the relevant clause in it. I don't speak anything but very basic XSL.

So, does anyone have any idea (a) what the problem might be, or (b) how I might go about tracking it down. A means of determining which clauses had been invoked from the stylesheets (like a debugging parser, maybe) would be useful if such a thing exists.

[identity profile] dmh.livejournal.com 2007-12-04 06:17 pm (UTC)(link)
May be irrelevant, but I see you public identifier contradicts your system identifier. http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd vs http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd

[identity profile] venta.livejournal.com 2007-12-05 10:23 am (UTC)(link)
Hmm. Good point. I suspect it isn't relevant, but should be fixed anyway.

[identity profile] leathellin.livejournal.com 2007-12-04 06:42 pm (UTC)(link)
Well you could download a free trial of something with a debugging parser like Oxygen or similar (Stylus Studio, I personally don't like Altova but XMLspy exists).

Or wait a short while for me to prod them with sticks - anything is better than the housework :-)

[identity profile] dmh.livejournal.com 2007-12-04 06:53 pm (UTC)(link)
What happens if you place the mediaobject after the closing </articleinfo>?

Alternately, what is the image? If it's the LizCorp logo, have you tried:

<article>
<articleinfo>
<corpcredit>
<inlinemediaobject>
<imageobject>
<imagedata fileref="my_graphic.png" format="PNG"/>
</imageobject>
</inlinemediaobject>
</corpcredit>

[identity profile] venta.livejournal.com 2007-12-05 10:25 am (UTC)(link)
Still nothing using the corpcredit tag :(

Placing anything directly after the closing articleinfo tag is illegal, it'd have to go after the sect1 which must follow articleinfo. And by then my LizCorp logo is in the body of the document, not in the header :(

(But if the reason you were asking was to check that mediaobject works, then yes it does).

[identity profile] dmh.livejournal.com 2007-12-05 08:35 pm (UTC)(link)
Gah, why can't you just be like a normal person and use Microsoft Word? :o)

[identity profile] leathellin.livejournal.com 2007-12-04 07:44 pm (UTC)(link)
I am starting to get a sneaking suspicion that graphic has been supported in the articleinfo and mediaobject isn't yet - despite the first being deprecated.

Of course to check that one of us would need to do an experiment and [livejournal.com profile] metame is going to get back and throw housework at me shortly :-)

[identity profile] leathellin.livejournal.com 2007-12-04 07:49 pm (UTC)(link)
Possibly not even graphic actually.
Sigh.

[identity profile] venta.livejournal.com 2007-12-05 10:22 am (UTC)(link)
Certainly graphic doesn't work... I switched to mediaobject because graphic didn't work (and checking suggested it might be deprecated) :(