View Full Version : XML 1.0 vs 1.1 does it really matter?


ebookn00b
01-14-2013, 10:04 AM
Most of the documents that I convert to ePub are Word docs with heavy formatting. Many times these are training/user manuals with small paragraphs, bullets, italicized and center headers and so on. If I have a XML1.1 document and I have a paragraph that is centered with <p align="center"> this gets flagged by FlightCrew, however if the XML is 1.0 it does not get flagged, I understand why it gets flagged in XML 1.1 (certain hmtl tags are being phased out) but my question is does it really matter if I use <p align="center>? Whether I use that or a CSS class to center the section it is centered either way. The reason I ask is that when if I copy and paste a paragraph from word to an HTML editor the centered text is designtated with <p align> Its not that difficult to create classes and do a find replace to the <p align> tags but why spend the extra time if in the end it works even though Flightcrew flags it.

mrmikel
01-14-2013, 10:37 AM
The question might be how long these materials might be in use. If it is for a short term, then it probably makes not difference. But for the longer term, you could have trouble. Upgraded devices, new devices may require newer standards. But this has moved pretty slowly so far.

That said, it is much easier to maintain documents that use CSS than all these inline tags. One change in CSS is much easier to do than searching and replacing hundreds of times and potentially blowing up the formatting because of something you did not remember or anticipate.

It may hinge more on the devices than on standards, since none completely adhere to standards, and some are worse than others.

Be sure you are previewing all your fancy formatting on the target device(s). A lot of fancy formatting is lost on small devices of any sort.

JSWolf
01-15-2013, 05:01 PM
Styles in the XML are just bad form and lazy. Put the styles in the CSS and use classes.

dgatwood
01-18-2013, 09:52 PM
If I have a XML1.1 document and I have a paragraph that is centered with <p align="center"> this gets flagged by FlightCrew, however if the XML is 1.0 it does not get flagged, I understand why it gets flagged in XML 1.1 (certain hmtl tags are being phased out) but my question is does it really matter if I use <p align="center>? Whether I use that or a CSS class to center the section it is centered either way.

According to the specification:

"Any construct deprecated in XHTML 1.1 is either deprecated or omitted from this specification ..."

which suggests to me that readers are freely allowed to ignore align="center". It probably won't break any readers if you include it (as long as the file passes validation), but you should not count on readers actually supporting it. Try doing a mass search-and-replace, changing align="center" to class="center". Then define a CSS style:

.center {
text-align: center;
}

mrmikel
01-19-2013, 06:14 AM
However, <center> works in some readers like Sony where css does not.

Toxaris
01-19-2013, 08:35 AM
Ehm, as far as I know, only iBooks has issues (sometimes) with:

.center {
text-align: center;
}

dgatwood
01-19-2013, 05:08 PM
However, <center> works in some readers like Sony where css does not.

CSS works for me on the Sony readers. Might be a specificity problem in your CSS. Try doing something like

div.centered {
...
}

instead of just

.centered {
...
}

JSWolf
01-19-2013, 05:12 PM
However, <center> works in some readers like Sony where css does not.

Centering via CSS works with Sony Readers.

Jellby
01-20-2013, 04:16 AM
Except if you try something like:

<img class="centered" ... />

But that's just wrong XHTML code (or rather a misunderstanding of what the CSS works), and not the device's fault.

mrmikel
01-20-2013, 06:58 AM
Perhaps I was thinking of centering tables.