docbook-apps

Expand all | Collapse all

titlepage.xsl anomaly

  • 1.  titlepage.xsl anomaly

    Posted 09-07-2012 20:30
    I am running into something strange when building a custom titlepage.xsl for the epub3 stylesheets.

    When I built my custom titlepage.xsl file, using the template/titlepage.xsl file from the 1.77.1 ns distribution, the stylesheet does not put the
    elements into a name space. The result is that when the epub3 stylesheets are run, you end up with a bunch of
    elements in a null name space (i.e.,
    ), which makes some of my downstream processing unhappy.

    I went back and rebuilt the standard titlepage.xsl file, just in case I had changed something, but got the same result (and the same result using either saxon or xsltproc).

    It looks like epub3/titlepage.xsl was either built with a different template/titlepage.xsl file or some other options were used.

    Does anyone have any idea what might be going on?

    Best Regards,
    Dick Hamilton
    -------
    XML Press
    XML for Technical Communicators
    http://xmlpress.net
    hamilton@xmlpress.net






  • 2.  Re: [docbook-apps] titlepage.xsl anomaly

    Posted 09-10-2012 07:51
    On 7.9.2012 22:29, Richard Hamilton wrote:
    > I am running into something strange when building a custom titlepage.xsl for the epub3 stylesheets.
    >
    > When I built my custom titlepage.xsl file, using the template/titlepage.xsl file from the 1.77.1 ns distribution, the stylesheet does not put the
    elements into a name space. The result is that when the epub3 stylesheets are run, you end up with a bunch of
    elements in a null name space (i.e.,
    ), which makes some of my downstream processing unhappy.
    >
    > I went back and rebuilt the standard titlepage.xsl file, just in case I had changed something, but got the same result (and the same result using either saxon or xsltproc).
    >
    > It looks like epub3/titlepage.xsl was either built with a different template/titlepage.xsl file or some other options were used.
    >
    > Does anyone have any idea what might be going on?

    Hi,

    quite recently in order to support all FO, HTML and XHTML titlepage I
    have introduced "ns" parameter in titlepage.xsl holding namespace of
    target vocabulary. Try running titlepage.xsl and specifying

    ns=http://www.w3.org/1999/xhtml

    HTH,

    Jirka

    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    ------------------------------------------------------------------
    Professional XML consulting and training services
    DocBook customization, custom XSLT/XSL-FO document processing
    ------------------------------------------------------------------
    OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
    ------------------------------------------------------------------




  • 3.  Re: [docbook-apps] titlepage.xsl anomaly

    Posted 09-10-2012 19:15
    Hi Jirka,

    Thanks for the information. Is the change you describe in titlepage.xsl in 1.77.1 or is it newer? I ask because I tried this with 1.77.1 and it didn't change anything, so I suspect I don't have a version of the stylesheets that has this change.

    Best regards,
    Dick
    -------
    XML Press
    XML for Technical Communicators
    http://xmlpress.net
    hamilton@xmlpress.net



    On Sep 10, 2012, at 12:50 AM, Jirka Kosek wrote:

    > On 7.9.2012 22:29, Richard Hamilton wrote:
    >> I am running into something strange when building a custom titlepage.xsl for the epub3 stylesheets.
    >>
    >> When I built my custom titlepage.xsl file, using the template/titlepage.xsl file from the 1.77.1 ns distribution, the stylesheet does not put the
    elements into a name space. The result is that when the epub3 stylesheets are run, you end up with a bunch of
    elements in a null name space (i.e.,
    ), which makes some of my downstream processing unhappy.
    >>
    >> I went back and rebuilt the standard titlepage.xsl file, just in case I had changed something, but got the same result (and the same result using either saxon or xsltproc).
    >>
    >> It looks like epub3/titlepage.xsl was either built with a different template/titlepage.xsl file or some other options were used.
    >>
    >> Does anyone have any idea what might be going on?
    >
    > Hi,
    >
    > quite recently in order to support all FO, HTML and XHTML titlepage I
    > have introduced "ns" parameter in titlepage.xsl holding namespace of
    > target vocabulary. Try running titlepage.xsl and specifying
    >
    > ns=http://www.w3.org/1999/xhtml
    >
    > HTH,
    >
    > Jirka
    >
    > --
    > ------------------------------------------------------------------
    > Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    > ------------------------------------------------------------------
    > Professional XML consulting and training services
    > DocBook customization, custom XSLT/XSL-FO document processing
    > ------------------------------------------------------------------
    > OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
    > ------------------------------------------------------------------
    >




  • 4.  Re: [docbook-apps] titlepage.xsl anomaly

    Posted 09-10-2012 20:47
    On 10.9.2012 21:15, Richard Hamilton wrote:

    > Thanks for the information. Is the change you describe in
    > titlepage.xsl in 1.77.1 or is it newer? I ask because I tried this
    > with 1.77.1 and it didn't change anything, so I suspect I don't have
    > a version of the stylesheets that has this change.

    This change is from October 2011, so it should be in 1.77.1 I suppose.
    Are you sure that
    is comming from code generated by
    titlepage.xsl. It might be that you forgot namespace declaration in your
    titlepage template file.

    Jirka

    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    ------------------------------------------------------------------
    Professional XML consulting and training services
    DocBook customization, custom XSLT/XSL-FO document processing
    ------------------------------------------------------------------
    OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
    ------------------------------------------------------------------




  • 5.  Re: [docbook-apps] titlepage.xsl anomaly

    Posted 09-10-2012 22:02
    Hi Jirka,

    The
    is not coming from titlepage.xsl, it is happening later in some custom processing. However, the reason the null namespace gets inserted downstream is that the
    elements in the generated titlepage.xsl are not in any namespace.

    I.e., the generated titlepage.xsl file has no default namespace declaration (just declarations for xsl, exsl, and docbook, all three with prefixes), but it does have elements that have no namespace prefix (those
    elements). This is different from the titlepage.xsl file in the 1.77.1 distribution, which has namespace declarations on each
    element.

    The titlepage template file (I presume you mean titlepage.xml) does have a default declaration (xhtml, as expected). In fact, once this started happening, I re-generated the distributed titlepage.xml file and got a generated titlepage.xsl file that was identical to the one in epub3/titlepage.xsl, except that the
    elements have no namespace declaration on them and there is no default declaration.

    So, I can manually fix the problem by adding a default namespace declaration to the generated titlepage.xsl file. However, I don't know why the epub3/titlepage.xsl file in the distribution puts
    in a namespace, but a file generated from the same xml file doesn't.

    Thanks,
    Dick
    -------
    XML Press
    XML for Technical Communicators
    http://xmlpress.net
    hamilton@xmlpress.net



    On Sep 10, 2012, at 1:47 PM, Jirka Kosek wrote:

    > On 10.9.2012 21:15, Richard Hamilton wrote:
    >
    >> Thanks for the information. Is the change you describe in
    >> titlepage.xsl in 1.77.1 or is it newer? I ask because I tried this
    >> with 1.77.1 and it didn't change anything, so I suspect I don't have
    >> a version of the stylesheets that has this change.
    >
    > This change is from October 2011, so it should be in 1.77.1 I suppose.
    > Are you sure that
    is comming from code generated by
    > titlepage.xsl. It might be that you forgot namespace declaration in your
    > titlepage template file.
    >
    > Jirka
    >
    > --
    > ------------------------------------------------------------------
    > Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    > ------------------------------------------------------------------
    > Professional XML consulting and training services
    > DocBook customization, custom XSLT/XSL-FO document processing
    > ------------------------------------------------------------------
    > OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
    > ------------------------------------------------------------------
    >




  • 6.  Re: [docbook-apps] titlepage.xsl anomaly

    Posted 09-11-2012 08:03
    On 11.9.2012 0:02, Richard Hamilton wrote:

    > The titlepage template file (I presume you mean titlepage.xml) does
    > have a default declaration (xhtml, as expected). In fact, once this
    > started happening, I re-generated the distributed titlepage.xml file
    > and got a generated titlepage.xsl file that was identical to the one
    > in epub3/titlepage.xsl, except that the
    elements have no
    > namespace declaration on them and there is no default declaration.

    This is really strange. On my machine deleting
    epub3/titlepage.templates.xsl and running make produces file identical
    to the distribution with XHTML namespace declared on each


    > So, I can manually fix the problem by adding a default namespace
    > declaration to the generated titlepage.xsl file. However, I don't
    > know why the epub3/titlepage.xsl file in the distribution puts

    > in a namespace, but a file generated from the same xml file doesn't.

    Ah, you have been using xsl-ns, right? I see the problem now,
    template/titlepage.xsl in xsl-ns distribution doesn't support ns
    parameter which is cruical. I have to investigate how xsl-ns is
    generated, I'm not using them regularly.


    Jirka

    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    ------------------------------------------------------------------
    Professional XML consulting and training services
    DocBook customization, custom XSLT/XSL-FO document processing
    ------------------------------------------------------------------
    OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
    ------------------------------------------------------------------




  • 7.  Re: [docbook-apps] titlepage.xsl anomaly

    Posted 09-11-2012 08:09
    Em 11-09-2012 10:02, Jirka Kosek escreveu:
    > Ah, you have been using xsl-ns, right? I see the problem now,
    > template/titlepage.xsl in xsl-ns distribution doesn't support ns
    > parameter which is cruical. I have to investigate how xsl-ns is
    > generated, I'm not using them regularly.

    I also remember having the same problem with Slides, which uses the ns
    distribution as well. The enclosing div should belong in the xhtml
    namespace and it should be declared as default namespace on the div or
    otherwise the declaration remains there and the output doesn't
    validate with W3C's XHTML DTD. I still have it my TODO list and wanted
    to play with it more but it seems then it is a common problem, not
    just for me.

    Gabor



  • 8.  Re: [docbook-apps] titlepage.xsl anomaly

    Posted 09-11-2012 08:15
    On 11.9.2012 0:02, Richard Hamilton wrote:

    > So, I can manually fix the problem by adding a default namespace declaration to the generated titlepage.xsl file. However, I don't know why the epub3/titlepage.xsl file in the distribution puts
    in a namespace, but a file generated from the same xml file doesn't.

    Dick, can you try to use attached stylesheet instead of
    template/titlepage.xsl in xsl-ns distribution? Please specify
    ns=http://www.w3.org/1999/xhtml parameter on invocation. Does it fix
    problem?

    Jirka

    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    ------------------------------------------------------------------
    Professional XML consulting and training services
    DocBook customization, custom XSLT/XSL-FO document processing
    ------------------------------------------------------------------
    OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
    ------------------------------------------------------------------



  • 9.  Re: [docbook-apps] titlepage.xsl anomaly

    Posted 09-11-2012 08:40
    Em 11-09-2012 10:14, Jirka Kosek escreveu:
    > On 11.9.2012 0:02, Richard Hamilton wrote:
    >
    >>> So, I can manually fix the problem by adding a default
    >>> namespace declaration to the generated titlepage.xsl file.
    >>> However, I don't know why the epub3/titlepage.xsl file in the
    >>> distribution puts
    in a namespace, but a file generated
    >>> from the same xml file doesn't.
    > Dick, can you try to use attached stylesheet instead of
    > template/titlepage.xsl in xsl-ns distribution? Please specify
    > ns=http://www.w3.org/1999/xhtml parameter on invocation. Does it
    > fix problem?

    For Slides, it works nicely! But it should be generated there as a
    part of the build process. Is there any way I can easily adjust this
    parameter?

    Thanks,
    Gabor



  • 10.  Re: [docbook-apps] titlepage.xsl anomaly

    Posted 09-11-2012 08:48
    On 11.9.2012 10:39, Gabor Kovesdan wrote:

    > For Slides, it works nicely! But it should be generated there as a
    > part of the build process. Is there any way I can easily adjust this
    > parameter?

    Build process sets this paremeter, for example makefile for epub3 says:

    include $(DOCBOOK_SVN)/buildtools/Makefile.incl

    TARGETNS=http://www.w3.org/1999/xhtml

    titlepage.templates.xsl: titlepage.templates.xml
    $(NESTLEVEL)../template/titlepage.xsl
    $(XSLT) $< $(NESTLEVEL)../template/titlepage.xsl $@ ns=$(TARGETNS)

    Jirka

    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    ------------------------------------------------------------------
    Professional XML consulting and training services
    DocBook customization, custom XSLT/XSL-FO document processing
    ------------------------------------------------------------------
    OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
    ------------------------------------------------------------------




  • 11.  Re: [docbook-apps] titlepage.xsl anomaly

    Posted 09-11-2012 12:13
    On 11.9.2012 10:39, Gabor Kovesdan wrote:

    > For Slides, it works nicely! But it should be generated there as a
    > part of the build process. Is there any way I can easily adjust this
    > parameter?

    Or you could try this:

    http://docbook.svn.sourceforge.net/viewvc/docbook/trunk/releasetools/xslnsfiles/titlepage.xsl?revision=9599

    This version tries to guess proper namespace automatically if parameter
    is not supplied externally.

    Jirka

    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    ------------------------------------------------------------------
    Professional XML consulting and training services
    DocBook customization, custom XSLT/XSL-FO document processing
    ------------------------------------------------------------------
    OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
    ------------------------------------------------------------------




  • 12.  Re: [docbook-apps] titlepage.xsl anomaly

    Posted 09-12-2012 18:30
    Hi Jirka,

    That did it. Thanks.

    Dick
    -------
    XML Press
    XML for Technical Communicators
    http://xmlpress.net
    hamilton@xmlpress.net



    On Sep 11, 2012, at 1:14 AM, Jirka Kosek wrote:

    > On 11.9.2012 0:02, Richard Hamilton wrote:
    >
    >> So, I can manually fix the problem by adding a default namespace declaration to the generated titlepage.xsl file. However, I don't know why the epub3/titlepage.xsl file in the distribution puts
    in a namespace, but a file generated from the same xml file doesn't.
    >
    > Dick, can you try to use attached stylesheet instead of
    > template/titlepage.xsl in xsl-ns distribution? Please specify
    > ns=http://www.w3.org/1999/xhtml parameter on invocation. Does it fix
    > problem?
    >
    > Jirka
    >
    > --
    > ------------------------------------------------------------------
    > Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    > ------------------------------------------------------------------
    > Professional XML consulting and training services
    > DocBook customization, custom XSLT/XSL-FO document processing
    > ------------------------------------------------------------------
    > OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
    > ------------------------------------------------------------------