You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Ross Gardler <rg...@apache.org> on 2009/02/26 17:29:25 UTC

Re: plugin: output.pdf: not resolved in helper-commonElements.xsl, bug or feature?

2009/2/26 EMMEL Thomas <th...@3ds.com>:
> Hi,
>
> there is a line in
> plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-commonElements.xsl
> which I changed locally for me:
>
>
> @@ -368,7 +368,7 @@
>       <xsl:apply-templates/>
>     </fo:block>
>   </xsl:template>
> -  <xsl:template match="link|fork|jump">
> +  <xsl:template match="link|fork|jump|a">
>     <xsl:variable name="color"
>       select="$config/colors/color[@name = 'body']/@link"/>
>     <xsl:choose>
>
> Is it a bug or feature that <a></a> is not supported here?
>
> If I add it, the links will be activated, however they might be not useful
> in all cases yet when generating the wholesite.pdf, where
> external links need to be changed to internal links...

In theory it is "feature".

Internally Forrest does not have the <a> element. Under what
circumstances do you find a document containing an <a> gets processed
by this stylesheet?

Ross

-- 
--
Ross Gardler

OSS Watch - awareness and understanding of open source software
development and use in education
http://www.oss-watch.ac.uk

Re: plugin: output.pdf: not resolved in helper-commonElements.xsl, bug or feature?

Posted by Ross Gardler <rg...@apache.org>.
2009/2/27 EMMEL Thomas <th...@3ds.com>:
> Ross Gardler schrieb:
> ...
>
> Such a hole would not show up when converting to HTML as the <a>
> element is legal there and would be passed through unmodified by the
> internal processing. However, given that Forrest is in use in a great
> many places and this hasn't raised it's head before I want to  check
> everything is in order. To that end we need an answer to my earlier
> question "Under what circumstances do you find a document containing
> an <a> gets processed  by this stylesheet?"
>
> Ross
>
> Ross,
>
> I think this is connected to my own dtd, since I need some new elements
> and change others. For the default document-v20.dtd everything works fine.
> However, I never touched <a> inside my dtd,
> therefore I think it might be a general problem since it happens all the
> time I use an own dtd.
> For example I do a forrest seed, create a new dtd as described in the
> documentation that is only a copy to the document-v20.dtd, e.g.
> myown-v12.dtd:
>
> <!ENTITY % common-charents PUBLIC
>     "-//APACHE//ENTITIES Common Character Entity Sets V1.0//EN"
>     "common-charents-v10.mod">
> %common-charents;
>
> <!ENTITY % document PUBLIC
>     "-//APACHE//ENTITIES Documentation V2.0//EN"
>     "document-v20.mod">
> %document;
>
> and refere to it in a document like this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE greeting PUBLIC "-//Test//DTD myown V1.2//EN" "myown-v12.dtd">
>
> <document>
>   <header>
>     <title>test</title>
>   </header>
> <body>
> <p>test this link:
>  <a href="http://forrest.apache.org">Forrest</a>.</p>
> </body>
> </document>
>
> I create the xcat-entry and run forrest
> Now, everything works fine for html-output, but fo and pdf miss the link.
>
> Any idea?

How is the above document processed? you should have an input plugin
that convers myown-v12.dtd to the internal XDoc v1.3, thus you would
not have any <a> elements internally only <link>, <jump> and <fork>. I
note that this is not clear in our docs.

You can choose to proceed as you are, but you need to be aware that if
you start using other output plugins you will continue to loose links.

However, since it works in HTML and your proposed change is quite
minor and will not affect users who are not making the kind of change
you suggest I'd be OK with that change going into the release. It does
not break backward compatability and would be correct if we eventually
move to XHTML2 subset anyway.

Feel free to provide a patch, please refer to this thread in the
description so that we can see why it is provided.

Ross

Ross

Re: plugin: output.pdf: not resolved in helper-commonElements.xsl, bug or feature?

Posted by EMMEL Thomas <th...@3ds.com>.
Ross Gardler schrieb:
...
>
> Such a hole would not show up when converting to HTML as the <a>
> element is legal there and would be passed through unmodified by the
> internal processing. However, given that Forrest is in use in a great
> many places and this hasn't raised it's head before I want to  check
> everything is in order. To that end we need an answer to my earlier
> question "Under what circumstances do you find a document containing
> an <a> gets processed  by this stylesheet?"
>
> Ross
>
Ross,

I think this is connected to my own dtd, since I need some new elements
and change others. For the default document-v20.dtd everything works fine.
However, I never touched <a> inside my dtd,
therefore I think it might be a general problem since it happens all the
time I use an own dtd.
For example I do a forrest seed, create a new dtd as described in the
documentation that is only a copy to the document-v20.dtd, e.g.
myown-v12.dtd:

<!ENTITY % common-charents PUBLIC
    "-//APACHE//ENTITIES Common Character Entity Sets V1.0//EN"
    "common-charents-v10.mod">
%common-charents;

<!ENTITY % document PUBLIC
    "-//APACHE//ENTITIES Documentation V2.0//EN"
    "document-v20.mod">
%document;

and refere to it in a document like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE greeting PUBLIC "-//Test//DTD myown V1.2//EN" "myown-v12.dtd">

<document>
  <header>
    <title>test</title>
  </header>
<body>
<p>test this link:
 <a href="http://forrest.apache.org">Forrest</a>.</p>
</body>
</document>

I create the xcat-entry and run forrest
Now, everything works fine for html-output, but fo and pdf miss the link.

Any idea?

Thanks

Thomas


Re: plugin: output.pdf: not resolved in helper-commonElements.xsl, bug or feature?

Posted by Ross Gardler <rg...@apache.org>.
2009/2/26 EMMEL Thomas <th...@3ds.com>:
> Ross Gardler schrieb:
>
> 2009/2/26 EMMEL Thomas <th...@3ds.com>:
>> Hi,
>>
>> there is a line in
>>
>> plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-commonElements.xsl
>> which I changed locally for me:
>>
>>
>> @@ -368,7 +368,7 @@
>>       <xsl:apply-templates/>
>>     </fo:block>
>>   </xsl:template>
>> -  <xsl:template match="link|fork|jump">
>> +  <xsl:template match="link|fork|jump|a">
>>     <xsl:variable name="color"
>>       select="$config/colors/color[@name = 'body']/@link"/>
>>     <xsl:choose>
>>
>> Is it a bug or feature that <a></a> is not supported here?
>>
>> If I add it, the links will be activated, however they might be not useful
>> in all cases yet when generating the wholesite.pdf, where
>> external links need to be changed to internal links...
>
> In theory it is "feature".
>
> Internally Forrest does not have the <a> element. Under what
> circumstances do you find a document containing an <a> gets processed
> by this stylesheet?

...

> Confusion !!!!
>
> <a> is the first element documented in the document-v20.dtd and is therefore
> very valid element in forrest I think.
>
> http://forrest.apache.org/dtdx/document-v20.dtdx.html#a
>
> I use it everywhere I need a link since <link> and <fork> and <jump> are not
> in the DTD...
>
> Do I miss something?????

Forrest does not use the V2 DTD *internally*, it uses the V1.3 DTD [1].

This is because of history rather than design. Ultimately the
intention is to move to a sbset of XHTML2 on the internals. XDoc V2 is
pretty much this subset already (give or take a few bits and pieces).
However, this has been the plan for a very long time and doesn't look
like being implemented any time soon - it's a major rewrite of both
input and output stylesheets.

It is likely that there is no harm in adding the match that you
identify. However, until we understand the circumstances in which you
are managing to get that element to the output plugin it is hard to
say. I'm worried that you might be doing something that bypasses the
internal processing (which is bad) or that we have a "hole" in one of
the internal processes.

Such a hole would not show up when converting to HTML as the <a>
element is legal there and would be passed through unmodified by the
internal processing. However, given that Forrest is in use in a great
many places and this hasn't raised it's head before I want to  check
everything is in order. To that end we need an answer to my earlier
question "Under what circumstances do you find a document containing
an <a> gets processed  by this stylesheet?"

Ross

[1] http://forrest.apache.org/dtdx/document-v13.dtdx.html


-- 
--
Ross Gardler

OSS Watch - awareness and understanding of open source software
development and use in education
http://www.oss-watch.ac.uk

Re: plugin: output.pdf: not resolved in helper-commonElements.xsl, bug or feature?

Posted by EMMEL Thomas <th...@3ds.com>.
Ross Gardler schrieb:
>
> 2009/2/26 EMMEL Thomas <th...@3ds.com>:
> > Hi,
> >
> > there is a line in
> >
> plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-commonElements.xsl
>
> > which I changed locally for me:
> >
> >
> > @@ -368,7 +368,7 @@
> >       <xsl:apply-templates/>
> >     </fo:block>
> >   </xsl:template>
> > -  <xsl:template match="link|fork|jump">
> > +  <xsl:template match="link|fork|jump|a">
> >     <xsl:variable name="color"
> >       select="$config/colors/color[@name = 'body']/@link"/>
> >     <xsl:choose>
> >
> > Is it a bug or feature that <a></a> is not supported here?
> >
> > If I add it, the links will be activated, however they might be not
> useful
> > in all cases yet when generating the wholesite.pdf, where
> > external links need to be changed to internal links...
>
> In theory it is "feature".
>
> Internally Forrest does not have the <a> element. Under what
> circumstances do you find a document containing an <a> gets processed
> by this stylesheet?
>
> Ross
>
> -- 
> -- 
> Ross Gardler
>
> OSS Watch - awareness and understanding of open source software
> development and use in education
> http://www.oss-watch.ac.uk
>
Confusion !!!!

<a> is the first element documented in the document-v20.dtd and is
therefore very valid element in forrest I think.

http://forrest.apache.org/dtdx/document-v20.dtdx.html#a

I use it everywhere I need a link since <link> and <fork> and <jump> are
not in the DTD...

Do I miss something?????

Thomas