Created attachment 491924 [details] Minimal DocBook 5 article Description of problem: Publican adds a "lang" attribute to nodes, but this attribute has been renamed to "xml:lang" in DocBook 5. DocBook 5 documents therefore do not validate. Version-Release number of selected component (if applicable): 2.5-1 How reproducible: 100% Steps to Reproduce: 1. set dtdver: 5.0 in the publican.cfg file 2. try to build a really minimal DocBook 5 document, like the sample attached. Actual results: Validation failed: docbook5test.xml:12: validity error : No declaration for attribute lang of element article Looking in tmp/en-US/xml, the root node is now: <article lang="en-US" version="5.0" xmlns="http://docbook.org/ns/docbook"> Expected results: Publican uses xml:lang instead of lang, so the root node is: <article xml:lang="en-US" version="5.0" xmlns="http://docbook.org/ns/docbook"> so the document should validate and build Additional info: Document builds fine with --novalid option
(In reply to comment #0) > Publican adds a "lang" attribute to nodes, but this attribute has been renamed > to "xml:lang" in DocBook 5. DocBook 5 documents therefore do not validate. The real problem doesn't come in the intermediate files, it comes in the source. xml:lang is an XML attribute and has always existed, it's use case is to say 'this content is authored in this language'. DocBook's lang attribute has a separate use case 'this content should only be displayed in the following languages'. So, xml:lang is a single language, in which the content was authored, and DocBook lang is a list of languages used for profiling, or filtering, output. If DocBook 5 has removed the lang attribute then we will lose the ability to selectively use content on a per language basis. Or at least we will need to try and use the condition tag for such use cases ... it will probably get ugly if books using lang this way also have other conditional logic. Cheers, Jeff.
> If DocBook 5 has removed the lang attribute then we will lose the ability to > selectively use content on a per language basis. Or at least we will need to > try and use the condition tag for such use cases ... it will probably get ugly > if books using lang this way also have other conditional logic. Yeah, "lang" is definitely gone, and the advice from docbook.org is to use xml:lang in its place: "DocBook V5.0 is built on top of existing XML standards as much as possible, for example the lang attribute is superseded by the standard xml:lang attribute." -- http://www.docbook.org/docs/howto/ (Note also the two examples on that page, immediately before this in the text -- Example 1. DocBook V4.5 document vs Example 2. DocBook V5.0 document) DocBook 4 common attributes: http://www.docbook.org/tdg/en/html/ref-elements.html#common.attributes DocBook 5 common attributes: http://www.docbook.org/tdg5/en/html/ref-elements.html#common.attributes Probably not good news :/ Cheers Rudi
(In reply to comment #2) > > If DocBook 5 has removed the lang attribute then we will lose the ability to > > selectively use content on a per language basis. Or at least we will need to > > try and use the condition tag for such use cases ... it will probably get ugly > > if books using lang this way also have other conditional logic. > > Yeah, "lang" is definitely gone, and the advice from docbook.org is to use > xml:lang in its place: > > "DocBook V5.0 is built on top of existing XML standards as much as possible, > for example the lang attribute is superseded by the standard xml:lang > attribute." -- http://www.docbook.org/docs/howto/ > > (Note also the two examples on that page, immediately before this in the text > -- Example 1. DocBook V4.5 document vs Example 2. DocBook V5.0 document) The two examples are not equivalent in profile mode, and we use profile mode. Although we do use our own profiling code, it does comply with the DocBook 4 profile use of lang. > DocBook 4 common attributes: > http://www.docbook.org/tdg/en/html/ref-elements.html#common.attributes > > DocBook 5 common attributes: > http://www.docbook.org/tdg5/en/html/ref-elements.html#common.attributes > > Probably not good news :/ I don't think it will affect many books, but it's probably going to be very painful on the two or three books this will affect. Cheers, Jeff.
Ensured xml:lang is set in intermediate files when XmlClean is run. Pushed To ssh://git.fedorahosted.org/git/publican.git 3ca01da..d497197 master -> master
build attached article.
Verified on publican-3.0-0.fc17.t180.noarch <article version="5.0" xml:lang="en-US" xmlns="http://docbook.org/ns/docbook">