docbook-apps

  • 1.  Re: [docbook-apps] [QUESTION] Generating XHTML 1.1 from docbook-xsl

    Posted 12-20-2006 08:46
    Hi Kevin,
    Currently there are no parameters that fix the two problems you mention.
    In XHTML 1.0, either lang or xml:lang is permitted. In XHTML 1.1, only
    xml:lang is permitted. You can copy the template named
    'language.attribute' from common/l10n.xsl to your customization layer and
    change this line:

    <xsl:attribute name="lang">
    to
    <xsl:attribute name="xml:lang">

    For the width attribute in the admonition td, you'll have to copy the
    template named 'graphical.admonition' from xhtml/admon.xsl to your
    customization layer and remove the width attribute.

    I think setting a parameter for XHTML 1.1 might be a good thing, and would
    make a fine feature request. But feature requests made on this mailing
    list get forgotten, so I would suggest you request it in the SourceForge
    project for DocBook. Select Submit New on this page:

    http://sourceforge.net/tracker/?group_id=21935&atid=373750

    Bob Stayton
    Sagehill Enterprises
    DocBook Consulting
    bobs@sagehill.net





  • 2.  Re: [docbook-apps] [QUESTION] Generating XHTML 1.1 from docbook-xsl

    Posted 12-20-2006 10:06
    Bob Stayton wrote:

    > I think setting a parameter for XHTML 1.1 might be a good thing, and
    > would make a fine feature request. But feature requests made on this
    > mailing list get forgotten, so I would suggest you request it in the
    > SourceForge project for DocBook. Select Submit New on this page:

    The question is whether it is worth to spend time implementing support
    for XHTML 1.1 when major browser doesn't support it without resorting to
    ugly hacks and, pragmatically, there is nothing in XHTML 1.1 what
    couldn't be done in XHTML 1.0/HTML 4.01 except Ruby which is neither
    supported by DocBook.

    Jirka

    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://www.kosek.cz
    ------------------------------------------------------------------
    Profesionální školení a poradenství v oblasti technologií XML.
    Podívejte se na náš nove spuštený web http://DocBook.cz
    Podrobný prehled školení http://xmlguru.cz/skoleni/
    ------------------------------------------------------------------
    Nejbližší termíny školení:
    ** XML pro vývojáre 19.-22.3.2007 ** XML schémata 16.-18.4.2007 **
    ** XSL-FO 15.-16.5.2007 ** DocBook 26.-28.6.2007 **
    ------------------------------------------------------------------
    http://xmlguru.cz Blog mostly about XML for English readers
    ------------------------------------------------------------------




  • 3.  Re: [docbook-apps] [QUESTION] Generating XHTML 1.1 from docbook-xsl

    Posted 12-20-2006 12:33
    Hi Jirka

    > The question is whether it is worth to spend time implementing support
    > for XHTML 1.1 when major browser doesn't support it

    I must admit that, after waiting for years for Internet Explorer to support
    CSS Fixed Positioning and noting that IE7 finally does, I rather assumed
    that
    other areas of standards compliance had been addressed as well. However,
    having (just) checked, I see that, although XHTML is better supported than
    in IE6, support for the MIME type application/xml+xhtml has slipped to
    the next release.

    (For other people who did not know this, there is an explanation at:
    http://blogs.msdn.com/ie/archive/2005/09/15/467901.aspx )

    > without resorting to ugly hacks

    Adding a mod_rewrite rule to Apache cfg files is certainly ugly, but no
    great problem. IMHO, reducing the priority of support for
    standards because certain vendors don't do a good job of supporting them
    risks leading us into a vicious circle. On the other hand, supporting and
    evangelising standards can have the opposite effect. I do not
    think that IE7's greatly improved support for CSS would have come without
    pressure being applied from the user community.

    > and, pragmatically, there is nothing in XHTML 1.1 what
    > couldn't be done in XHTML 1.0/HTML 4.01 except Ruby which is neither
    > supported by DocBook.

    True enough, perhaps, if a little harsh on the XHTML developers, given
    that the purpose of XHTML 1.1 is to modularise XHTML rather than add
    user-visible features :-)

    Personally speaking, I am grateful for the easier validation of XHTML,
    which allows me to have more confidence in the quality of the finished
    pages.

    More generally, I am all in favour of the direction expressed by
    the developers of XHTML in the various specs. For example:

    http://www.w3.org/TR/xhtml1/#why
    http://www.w3.org/TR/xhtml-modularization/introduction.html#s_intro_xhtml_mods
    http://www.w3.org/TR/xhtml2/introduction.html#aims

    Regards
    Kevin



  • 4.  Re: [docbook-apps] [QUESTION] Generating XHTML 1.1 from docbook-xsl

    Posted 12-20-2006 20:46
    Kevin Ruscoe wrote:

    > Adding a mod_rewrite rule to Apache cfg files is certainly ugly, but no
    > great problem.

    It depends on your web-hosters, and I have in mind completely different
    hack (attaching identity stylesheets with <xsl:output method="html"/>
    which allows to server XHTML as text/html to IE).

    > risks leading us into a vicious circle. On the other hand, supporting and
    > evangelising standards can have the opposite effect. I do not
    > think that IE7's greatly improved support for CSS would have come without
    > pressure being applied from the user community.

    But it doesn't make sense to evangelize standard which doesn't offer
    almost anything new compared to the previous standards. XHTML states
    itself as "extensible" but it is totaly "inextensible" if you want to
    conform to XHTML specification (you are not allowed to remove !DOCTYPE
    and thus you can't use your own additional elements in a custom namespace).

    > Personally speaking, I am grateful for the easier validation of XHTML,
    > which allows me to have more confidence in the quality of the finished
    > pages.

    Then you must be using something else then W3C validator which uses the
    same validation technology for both HTML and XHTML. You can give a try
    to Relaxed validator (http://relaxed.vse.cz/) which uses RELAX NG +
    Schematron for XHTML/HTML validation. (The same combination of schema
    languages is also used for DocBook V5.)

    > http://www.w3.org/TR/xhtml1/#why
    > http://www.w3.org/TR/xhtml-modularization/introduction.html#s_intro_xhtml_mods
    >
    > http://www.w3.org/TR/xhtml2/introduction.html#aims

    I'm wondering whether browser vendors ever read those pages :-(

    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://www.kosek.cz
    ------------------------------------------------------------------
    Profesionální školení a poradenství v oblasti technologií XML.
    Podívejte se na náš nove spuštený web http://DocBook.cz
    Podrobný prehled školení http://xmlguru.cz/skoleni/
    ------------------------------------------------------------------
    Nejbližší termíny školení:
    ** XML pro vývojáre 19.-22.3.2007 ** XML schémata 16.-18.4.2007 **
    ** XSL-FO 15.-16.5.2007 ** DocBook 26.-28.6.2007 **
    ------------------------------------------------------------------
    http://xmlguru.cz Blog mostly about XML for English readers
    ------------------------------------------------------------------




  • 5.  Re: [docbook-apps] [QUESTION] Generating XHTML 1.1 from docbook-xsl

    Posted 12-21-2006 01:07
    On 12/20/06, Kevin Ruscoe <kevin@sapphireoflondon.org> wrote:
    > Hi Jirka
    >
    > > The question is whether it is worth to spend time implementing support
    > > for XHTML 1.1 when major browser doesn't support it
    >
    > I must admit that, after waiting for years for Internet Explorer to support
    > CSS Fixed Positioning and noting that IE7 finally does, I rather assumed
    > that
    > other areas of standards compliance had been addressed as well. However,
    > having (just) checked, I see that, although XHTML is better supported than
    > in IE6, support for the MIME type application/xml+xhtml has slipped to
    > the next release.
    >
    > (For other people who did not know this, there is an explanation at:
    > http://blogs.msdn.com/ie/archive/2005/09/15/467901.aspx )
    >
    > > without resorting to ugly hacks
    >
    > Adding a mod_rewrite rule to Apache cfg files is certainly ugly, but no
    > great problem. IMHO, reducing the priority of support for
    > standards because certain vendors don't do a good job of supporting them
    > risks leading us into a vicious circle. On the other hand, supporting and
    > evangelising standards can have the opposite effect. I do not
    > think that IE7's greatly improved support for CSS would have come without
    > pressure being applied from the user community.

    This is probably the wrong list on which to be speaking of such
    things, but one does not need to use mod_rewrite to serve xhtml or
    html as needed if one is willing to use Apache's mod_negotiation and
    the MultiViews directive. Content negotiation is a standard part of
    HTTP, but IE complicates things.

    Content negotiation + MultiViews will cause /dir/blah.xhtml and
    /dir/blah.html to be considered for delivery to a client if the
    requested URL is http://www.example.com/dir/blah (instead of having
    .html or .xhtml on the end).

    The method of selecting the page is given here:
    http://httpd.apache.org/docs/2.0/content-negotiation.html

    The trick to making IE receive the right page involves thwarting IE's
    overly permissive http-accept header. Here is what a header from IE
    looks like:

    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
    application/x-shockwave-flash, application/vnd.ms-excel,
    application/vnd.ms-powerpoint, application/msword, */*

    Notice the complete lack of quality settings and the */*. Thus, IE
    says it accepts every MIME type with equal "quality" (q). IMHO, making
    IE do this is a poor decision.

    Here is what a header from Firefox looks like:
    Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5

    Notice that the xml based formats are at a (default) quality of 1.0,
    while text/html is at a quality of 0.9 and */* is at a quality of 0.5.

    As stated (I think) in Apache's content negotiation description, the
    client side quality is multiplied with the server side source quality
    (qs) to come up with a ranking for which item to deliver when using
    MultiViews. So, to cause IE to always receive the html file, just set
    the quality for the xhtml file to be less than 1 and greater than 0.95
    (so that Firefox will continue to recieve the XHTML version).

    The relevant line in Apache's httpd.conf might look like:

    AddType application/xhtml+xml;qs=.99 .xhtml

    As an added benefit, one can specify your page URLs without the file extensions.

    By the way, one may also need to set the DirectoryIndex to index
    instead of index.html:

    DirectoryIndex index

    --
    http://chris.chiasson.name/



  • 6.  RE: [docbook-apps] [QUESTION] Generating XHTML 1.1 from docbook-xsl

    Posted 12-21-2006 08:34
    Please consider that there might be other consumers besides web browsers.

    XHTML 1.1 (and even more so XHTML 2.0) is a great exchange format for mixing content from different sources (there is a world outside DocBook) -- before a final transformation to whatever delivery format is appropriate.

    kind regards
    Peter Ring


    >


  • 7.  Re: [docbook-apps] [QUESTION] Generating XHTML 1.1 from docbook-xsl

    Posted 12-20-2006 11:54
    Hi Bob

    > You can copy the template named 'language.attribute' from common/l10n.xsl
    > to your customization layer and change this line
    [snip]

    That worked fine thanks.

    > For the width attribute in the admonition td, you'll have to copy the
    > template named 'graphical.admonition' from xhtml/admon.xsl to your
    > customization layer and remove the width attribute.

    That did not go so well. The mere copying of the graphical.admonition
    section into my customisation layer changed the behaviour: the image
    disappeared and I got two extra XHTML validation errors. The relevant
    snippet
    of XHTML code is:

    ==============================================================================
    style="margin-left: 0.5in; margin-right: 0.5in;">








    [Important]



    Throughout this website, the navigation bar will remain fixed in
    position when you scroll down the page
    if
    you use a browser with good support for Cascading Style Sheets,
    such as Firefox or Internet Explorer v7.




    ==============================================================================

    ==============================================================================

    The new errors are:

    Error /Line 47 column 42/: value of fixed attribute "xmlns" not equal to
    default.|
    ...div xmlns="http://www.w3.org/TR/xhtml*"* class="important"||
    style="margin-left:

    |Error /Line 47 column 110/: document type does not allow element "div"
    here;
    missing one of "button", "map", "object", "ins", "del", "noscript"
    start-tag.|
    ...in-left: 0.5in; margin-right: 0.5in;"*>
    *
    |==============================================================================


    I do not see how copying some of the XSL unchanged into my customisation
    layer
    could change the behaviour and am worried I am missing something obvious :-)

    > I think setting a parameter for XHTML 1.1 might be a good thing,
    > and would make a fine feature request. But feature requests made on this
    > mailing list get forgotten, so I would suggest you request it in the
    > SourceForge project for DocBook.

    Done.
    http://sourceforge.net/tracker/index.php?func=detail&aid=1619359&group_id=21935&atid=373750

    Regards
    Kevin



  • 8.  Re: [docbook-apps] [QUESTION] Generating XHTML 1.1 from docbook-xsl

    Posted 12-20-2006 11:56
    Hi Bob

    > You can copy the template named 'language.attribute' from common/l10n.xsl
    > to your customization layer and change this line
    [snip]

    That worked fine thanks.

    > For the width attribute in the admonition td, you'll have to copy the
    > template named 'graphical.admonition' from xhtml/admon.xsl to your
    > customization layer and remove the width attribute.

    That did not go so well. The mere copying of the graphical.admonition
    section into my customisation layer changed the behaviour: the image
    disappeared and I got two extra XHTML validation errors. The relevant
    snippet
    of XHTML code is:

    ==============================================================================
    style="margin-left: 0.5in; margin-right: 0.5in;">








    [Important]



    Throughout this website, the navigation bar will remain fixed in
    position when you scroll down the page
    if
    you use a browser with good support for Cascading Style Sheets,
    such as Firefox or Internet Explorer v7.




    ==============================================================================

    ==============================================================================

    The new errors are:

    Error /Line 47 column 42/: value of fixed attribute "xmlns" not equal to
    default.|
    ...div xmlns="http://www.w3.org/TR/xhtml*"* class="important"||
    style="margin-left:

    |Error /Line 47 column 110/: document type does not allow element "div"
    here;
    missing one of "button", "map", "object", "ins", "del", "noscript"
    start-tag.|
    ...in-left: 0.5in; margin-right: 0.5in;"*>
    *
    |==============================================================================


    I do not see how copying some of the XSL unchanged into my customisation
    layer
    could change the behaviour and am worried I am missing something obvious :-)

    > I think setting a parameter for XHTML 1.1 might be a good thing,
    > and would make a fine feature request. But feature requests made on this
    > mailing list get forgotten, so I would suggest you request it in the
    > SourceForge project for DocBook.

    Done.
    http://sourceforge.net/tracker/index.php?func=detail&aid=1619359&group_id=21935&atid=373750

    Regards
    Kevin