Author Topic: <img></img> syntax  (Read 11232 times)


  • Sr. Member
  • ****
  • Posts: 126
    • Carpe Chaos
<img></img> syntax
« on: March 31, 2011, 05:12:55 AM »
For almost all the images in my books I use this format for image tags:
Code: [Select]
<img><src scale=".5"></src><src scale="1.0"></src></img>
But every so often I have an image that doesn't change a different scales and invariably I write:
Code: [Select]
Which silently fails, and I spend 15 minutes figuring out that I'm supposed to use:
Code: [Select]
<img src=""/>
And by then I've moved it up and down in the xml to make sure it's not hidden under something, but it wasn't, which means it now is... and then I debug that.

Could we add support for the non-property sourcing of images without the src tags? Like this:
Code: [Select]
That way use of the <img> tag can be consistent with or without <src> tags.

If that's undesirable or impossible, can an <img> tag without a src property that doesn't contain a <src> tag throw a warning?
See my megazine at

Hans Nücke

  • Administrator
  • Hero Member
  • *****
  • Posts: 960
  • MegaZine3 Sales Manager
Re: <img></img> syntax
« Reply #1 on: March 31, 2011, 10:28:59 AM »
That change is "undesirable" ;-)
Reason: it is in conflict with the standard structure and syntax.

The easiest, fastest and safest approach is to us a validator.
We suggest

Copy and paste the complete content of your megazine.mz3 file into the field "source code" and have it validated.
You'll either get as result a "valid document" message, or in case of problems a detailed error report. Which in most cases clearly identifies the row of failure with a description of what is wrong.

Give it a try with one of your problematic files and you'll see that you can solve and find issues very fast!
Good luck

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1972
  • MegaZine3 Developer
    • MegaZine3
Re: <img></img> syntax
« Reply #2 on: March 31, 2011, 12:46:16 PM »
For future reference: to allow validating, add the line
Code: (xml)
  1. <!DOCTYPE book SYSTEM "">
to the top of your book definition XML (.mz3 file). Otherwise validome won't know which doctype to use.

Also, to clarify Hans' statement regarding why this alternative syntax probably won't make it in: child nodes (and text is technically a child node) are used for several other things, such as dynamic scaling and localization. So I'd like to avoid possible hiccups arising from changing that bit :/
But as Hans said, just push your XML through validome and it'll point you to all those spots anyway :)
For the Snark was a Boojum, you see.

Before you ask a question
          After you get an answer
  • please document your problem with the answer in the Project Wiki. (e.g. in the FAQs)
  • help others out if you can, by answering their questions on the forum.