On 24/02/11 23:32, Christian Kampka wrote:
Hi folks,

You are correct, but the problem is with dblatex -- the
id="_einführung" attribute is perfectly legal DocBook. If you run the
same test using FOP instead of dblatex it works fine.
Your patch does allow dblatex to execute without errors but it will
cause legal id attributes from other languages to degenerate to
possibly ambiguous (and hence illegal) underscores e.g. id="_" will be
generated instead of id="_这是一 个测试"

Stuart, I agree with you that this is actually a dblatex problem,
however, this is the way that dblatex used to behave for a long time now
and I consider it at least questionable if a (by the numbers) minor
release should break compatibility for a toolchain that has been around
for a while and is probably in use by a lot of people.
Also, the transition from dblatex to FOP is some work that I would like
to avoid for now.

You are correct that my patch does not actually address the problem,
it's intention is to make sure that the status quo is preserved as in
documents that used to compile with the asciidoc 8.6.3 version will
still compile as expected by the user in asciidoc 8.6.4+, especially
since there is no hint of a regression of any kind in the change/upgrade
logs. Reliability on the toolchain part is a must for a proper
documentation project, especially in the enterprise environment.

You can work around the dblatex problem by specifying explicit ids
e.g.


[_einf_hrung]
== Einführung
This is a test

This works well when using the article doctype but it actually creates
illegal docbook as soon as you use the book doctype.

asciidoc: WARNING: test.txt: line 6: missing section: [_einf_hrung]
a2x: executing: xmllint --nonet --noout --valid test.xml
test.xml:11: element book: validity error : Element book content does
not follow the DTD, expecting ((title , subtitle? , titleabbrev?)? ,
bookinfo? , (dedication | toc | lot | glossary | bibliography | preface
| chapter | reference | part | article | appendix | index | setindex |
colophon)*), got (bookinfo simpara )
</book>

So this does not work for me either.

My mistake, it should have read [[_einf_hrung]] i.e. a block id element not an attribute list (which in this case was interpreted as a non-existent section style):

[[_einf_hrung]]
== Einführung
This is a test


I'd agree that a patch that fixes one language but breaks another is
not a good idea.

Lex, I agree, that is exactly why I sent this patch. Currently, language
support is broken for documents that used to build earlier. I find it
odd to break compatibility with working documents in favor of documents
that did not work in the first place (correct me if I'm wrong here).

We're between a rock and a hard place on this one:

- The original auto-generated ids was broken -- for non-ascii character sets it generates non-unique (i.e. illegal() ids.

- Lex's solution works around the dblatex bug and the asciidoc id uniqueness bug but will break all existing document links to auto-generated ids (aside from my other misgiving).

Keeping AsciiDoc broken to work around a bug in dblatex is not a good idea so I won't be reverting to 8.6.3 behavior. The workarounds I posted work and require very little extra work, and of course there's no requirement to upgrade.

I do not break compatibility unless there are compelling reasons, but to move forward you occasionally have to break a few eggs to make an omlette, this is one such occasion (search the CHANGELOG for 'Regression issues' for other examples).


Cheers, Stuart




Cheers,
Christian


--
You received this message because you are subscribed to the Google Groups 
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/asciidoc?hl=en.

Reply via email to