|
View:
New views
11 Messages
—
Rating Filter:
Alert me
|
|
|
imagedata EMPTYThere's something I'm not doing right. I have lots of elements like this
one: <para><informalfigure floatstyle='right'><mediaobject><alt>The Java AWT Reference</alt><imageobject><imagedata fileref='awt.gif' width='107px' depth='140px'></imagedata></imageobject></mediaobject></informalfigure></para> Both libxml and Xerces-J are giving me error messages like this when I validate the document: [Error] Java_Course_Notes.xml:32916:170: The content of element type "imagedata" is incomplete, it must match "(info?,EMPTY)". However, looking at the error message and the DTD and TDG, it seems like my imagedata element should be OK. What am I missing? -- Elliotte Rusty Harold elharo@... Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-unsubscribe@... For additional commands, e-mail: docbook-help@... |
|
|
|
|
|
Re: imagedata EMPTYHi Elliotte,
That is a strange error message, especially since your imagedata looks ok to me. Which version of DocBook are you validating against? Since you have an <alt> in your mediaobject, I presume it is DocBook 5. When I cut and pasted your sample para into a DocBook 5 document, the document validated in xmllint 2.6.23. Bob Stayton Sagehill Enterprises DocBook Consulting bobs@... ----- Original Message ----- From: "Elliotte Harold" <elharo@...> To: <docbook@...> Sent: Wednesday, August 09, 2006 7:21 AM Subject: [docbook] imagedata EMPTY > There's something I'm not doing right. I have lots of elements like this > one: > > > <para><informalfigure floatstyle='right'><mediaobject><alt>The Java AWT > Reference</alt><imageobject><imagedata fileref='awt.gif' width='107px' > depth='140px'></imagedata></imageobject></mediaobject></informalfigure></para> > > Both libxml and Xerces-J are giving me error messages like this when I > validate the document: > > [Error] Java_Course_Notes.xml:32916:170: The content of element type > "imagedata" is incomplete, it must match "(info?,EMPTY)". > > > However, looking at the error message and the DTD and TDG, it seems like > my imagedata element should be OK. What am I missing? > > -- > Elliotte Rusty Harold elharo@... > Java I/O 2nd Edition Just Published! > http://www.cafeaulait.org/books/javaio2/ > http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: docbook-unsubscribe@... > For additional commands, e-mail: docbook-help@... > > > --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-unsubscribe@... For additional commands, e-mail: docbook-help@... |
|
|
Re: imagedata EMPTYBob Stayton wrote:
> Hi Elliotte, > That is a strange error message, especially since your imagedata looks > ok to me. Which version of DocBook are you validating against? Since > you have an <alt> in your mediaobject, I presume it is DocBook 5. When > I cut and pasted your sample para into a DocBook 5 document, the > document validated in xmllint 2.6.23. Yes, it is indeed DocBook 5; and it is strange. However I get very similar messages from Xerces-J and xmllint, so I think it must be my bug: Java_Course_Notes.xml:32916: element imagedata: validity error : Element imagedata content does not follow the DTD, expecting (info? , EMPTY), got mageobject><imagedata fileref='awt.gif' width='107px' depth='140px'></imagedata> [Error] Java_Course_Notes.xml:32916:201: The content of element type "imagedata" is incomplete, it must match "(info?,EMPTY)". One thing I considered based on the error message was whether it could possibly expect an element named EMPTY. But I can't see that in the DTD. I even tried that, but as expected it wasn't valid. Adding an empty info element didn't fix it either. I'm sure there must be some crucial mistake, but so far I can't find it. I guess the next step is to boil my 500 page document down to a simple test case. -- Elliotte Rusty Harold elharo@... Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-unsubscribe@... For additional commands, e-mail: docbook-help@... |
|
|
Re: imagedata EMPTYHi Elliotte,
If that isn't a typo in your error example, then xmllint is saying the content of imagedata starts with "mageobject>" and contains an <imagedata> element? Normally xmllint's "got" message says what it found in the element. Bob Stayton Sagehill Enterprises DocBook Consulting bobs@... ----- Original Message ----- From: "Elliotte Harold" <elharo@...> To: "Bob Stayton" <bobs@...> Cc: <docbook@...> Sent: Wednesday, August 09, 2006 4:40 PM Subject: Re: [docbook] imagedata EMPTY > Bob Stayton wrote: >> Hi Elliotte, >> That is a strange error message, especially since your imagedata looks >> ok to me. Which version of DocBook are you validating against? Since >> you have an <alt> in your mediaobject, I presume it is DocBook 5. When >> I cut and pasted your sample para into a DocBook 5 document, the >> document validated in xmllint 2.6.23. > > Yes, it is indeed DocBook 5; and it is strange. However I get very > similar messages from Xerces-J and xmllint, so I think it must be my bug: > > Java_Course_Notes.xml:32916: element imagedata: validity error : Element > imagedata content does not follow the DTD, expecting (info? , EMPTY), got > mageobject><imagedata fileref='awt.gif' width='107px' > depth='140px'></imagedata> > > [Error] Java_Course_Notes.xml:32916:201: The content of element type > "imagedata" is incomplete, it must match "(info?,EMPTY)". > > One thing I considered based on the error message was whether it could > possibly expect an element named EMPTY. But I can't see that in the DTD. > I even tried that, but as expected it wasn't valid. Adding an empty info > element didn't fix it either. > > I'm sure there must be some crucial mistake, but so far I can't find it. > I guess the next step is to boil my 500 page document down to a simple > test case. > > -- > Elliotte Rusty Harold elharo@... > Java I/O 2nd Edition Just Published! > http://www.cafeaulait.org/books/javaio2/ > http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ > > --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-unsubscribe@... For additional commands, e-mail: docbook-help@... |
|
|
Re: imagedata EMPTYBob Stayton wrote:
> Hi Elliotte, > If that isn't a typo in your error example, then xmllint is saying the > content of imagedata starts with "mageobject>" and contains an > <imagedata> element? Normally xmllint's "got" message says what it > found in the element. > I don't think that's it. xmllint is just showing what's a certain number of characters around the error point. Here's a complete document that still demonstrates the problem: <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V5.0//EN" "file:///opt/xml/docbook-5.0b7/dtd/docbook.dtd"> <book xmlns='http://docbook.org/ns/docbook' > <chapter> <para> <informalfigure floatstyle='right'> <mediaobject><textobject><phrase>The Java AWT Reference</phrase></textobject> <imageobject><imagedata fileref='awt.gif' width='107px' depth='140px'></imagedata></imageobject> </mediaobject></informalfigure></para> </chapter> </book> -- Elliotte Rusty Harold elharo@... Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-unsubscribe@... For additional commands, e-mail: docbook-help@... |
|
|
Re: imagedata EMPTYHere's an even simpler case that gives the same error message:
~/projects/workspace/cs905/build$ more testcase.xml <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V5.0//EN" "http://www.docbook.o rg/xml/5.0b7/dtd/docbook.dtd"> <book xmlns='http://docbook.org/ns/docbook' > <chapter> <mediaobject> <imageobject> <imagedata fileref="figures/eiffeltower.eps" /> </imageobject> </mediaobject> </chapter> </book> ~/projects/workspace/cs905/build$ java -classpath /opt/xml/xerces/xercesSamples.jar:/opt/xml/xerces/xercesImpl.jar sax.Counter -v testcase.xml [Error] testcase.xml:7:52: The content of element type "imagedata" is incomplete, it must match "(info?,EMPTY)". testcase.xml: 2715 ms (5 elems, 1 attrs, 21 spaces, 0 chars) ~/projects/workspace/cs905/build$ -- Elliotte Rusty Harold elharo@... Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-unsubscribe@... For additional commands, e-mail: docbook-help@... |
|
|
Re: imagedata EMPTYOK, turns out this is a bug in the DTD version of DocBook 5.0, starting
with b6 and included in b7. I should have noticed that this content model looked bogus: "(info?,EMPTY)" A content model is either EMPTY, or is has something optional. This should be just "(info?)". As written, it expects a required element named <EMPTY> but none is declared in the DTD. Could you please bug report this on the SourceForge site? Bob Stayton Sagehill Enterprises DocBook Consulting bobs@... ----- Original Message ----- From: "Elliotte Harold" <elharo@...> To: "Bob Stayton" <bobs@...> Cc: <docbook@...> Sent: Wednesday, August 09, 2006 5:00 PM Subject: Re: [docbook] imagedata EMPTY > Here's an even simpler case that gives the same error message: > > ~/projects/workspace/cs905/build$ more testcase.xml > <?xml version='1.0' encoding='UTF-8'?> > <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V5.0//EN" > "http://www.docbook.o > rg/xml/5.0b7/dtd/docbook.dtd"> > <book xmlns='http://docbook.org/ns/docbook' > > <chapter> > <mediaobject> > <imageobject> > <imagedata fileref="figures/eiffeltower.eps" /> > </imageobject> > </mediaobject> > </chapter> > </book> > ~/projects/workspace/cs905/build$ java -classpath > /opt/xml/xerces/xercesSamples.jar:/opt/xml/xerces/xercesImpl.jar > sax.Counter -v testcase.xml > [Error] testcase.xml:7:52: The content of element type "imagedata" is > incomplete, it must match "(info?,EMPTY)". > testcase.xml: 2715 ms (5 elems, 1 attrs, 21 spaces, 0 chars) > ~/projects/workspace/cs905/build$ > > > -- > Elliotte Rusty Harold elharo@... > Java I/O 2nd Edition Just Published! > http://www.cafeaulait.org/books/javaio2/ > http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ > > --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-unsubscribe@... For additional commands, e-mail: docbook-help@... |
|
|
Re: imagedata EMPTYBob Stayton wrote:
> OK, turns out this is a bug in the DTD version of DocBook 5.0, starting > with b6 and included in b7. I should have noticed that this content > model looked bogus: > > "(info?,EMPTY)" > You know, I had thought of this; and had specifically looked to see if that might be in the DTD. I don't know how I missed that. > Could you please bug report this on the SourceForge site? Done. http://sourceforge.net/tracker/index.php?func=detail&aid=1537924&group_id=21935&atid=373747 In the RELAX NG schema we have: <define name="db.imagedata"> <element name="imagedata"> <a:documentation>Pointer to external image data</a:documentation> <ref name="db.imagedata.attlist"/> <ref name="db.imagedata.info"/> <empty/> </element> </define> Perhaps the <empty/> element doesn't belong there, or perhaps the converter is buggy in this case? I'm not a RELAX NG expert so I'm not sure. The RELAX NG schema finds some mistakes the DTD doesn't, but it doesn't seem to flag the imagedata elements, so perhaps the bug is in the converter? -- Elliotte Rusty Harold elharo@... Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-unsubscribe@... For additional commands, e-mail: docbook-help@... |
|
|
Re: imagedata EMPTY-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 Elliotte Harold a écrit : > Bob Stayton wrote: >> OK, turns out this is a bug in the DTD version of DocBook 5.0, >> starting with b6 and included in b7. I should have noticed that this >> content model looked bogus: >> >> "(info?,EMPTY)" >> > > You know, I had thought of this; and had specifically looked to see if > that might be in the DTD. I don't know how I missed that. > >> Could you please bug report this on the SourceForge site? > > Done. > > http://sourceforge.net/tracker/index.php?func=detail&aid=1537924&group_id=21935&atid=373747 > > > In the RELAX NG schema we have: > > <define name="db.imagedata"> > <element name="imagedata"> > <a:documentation>Pointer to external image data</a:documentation> > <ref name="db.imagedata.attlist"/> > <ref name="db.imagedata.info"/> > <empty/> > </element> > </define> empty, aka no child elements. > Perhaps the <empty/> element doesn't belong there, or perhaps the > converter is buggy in this case? I'm not a RELAX NG expert so I'm not > sure. The RELAX NG schema finds some mistakes the DTD doesn't, but it > doesn't seem to flag the imagedata elements, so perhaps the bug is in > the converter? > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFE20H+jv9P65BfOUMRAvNqAJ449rxsg0eu5nix3Dm0PmMK5zpnPwCgueEA u+OhxZuLMU4nHE2+AECUdAA= =fmWl -----END PGP SIGNATURE----- [camille.vcf] begin:vcard fn;quoted-printable:Camille B=C3=A9gnis n;quoted-printable:B=C3=A9gnis;Camille org:NeoDoc adr:Domaine du petit Arbois BP 88;;CEEI;Aix en Provence Cedex 4;;13545;France email;internet:camille@... tel;work:+33.4.42.22.62.35 tel;cell:+33.6.33.15.10.23 note;quoted-printable:Rejoignez mon r=C3=A9seau sur viaduc:=0D=0A= =0D=0A= http://www.viaduc.com/invitationpersonnelle/002lm14bc0jlkfk x-mozilla-html:FALSE url:http://neodoc.biz version:2.1 end:vcard --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-unsubscribe@... For additional commands, e-mail: docbook-help@... |
|
|
Re: imagedata EMPTY> also, I am not sure if the alt tag is the right way to mark up html
> alt text. I usually use textobject inside imageobject. to get the @alt attribute to get written to the html <mediaobject> <imageobject role="html"> <imagedata format="GIF" fileref="images/myFilenamegif"/> </imageobject> <textobject> <phrase>the alt text goes here</phrase> </textobject> </mediaobject> - just a minor thing that may help someone out.
|
| Free embeddable forum powered by Nabble | Forum Help |