You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Ferdinand Soethe <fe...@apache.org> on 2005/08/24 11:15:03 UTC

Bugs in the XHTML-Pipeline

I keep finding bugs in the html pipeline that I'm using for xhtml.
One of them is that the transformation will overwrite any existing
class-attributes in <table> with class='forresttable'.

In order to fix that I'm trying to identify the current html-pipeline
in head but keep getting tangled up in my lack of knowledge and our
lack of documentation in the sitemaps.

Could sbdy pls. help me and give me some clues on how and where to find the
steps of the html-pipeline?

Thanks,

--
Ferdinand Soethe


Re: Bugs in the XHTML-Pipeline

Posted by Thorsten Scherler <th...@apache.org>.
On Wed, 2005-08-24 at 12:15 +0200, Ferdinand Soethe wrote:
> Thorsten Scherler wrote:
> 
> > grep "ForrestTable" * -r|grep -v .svn|grep class
> 
> > brings:
> > forrest-trunk/main/webapp/skins/common/xslt/html/document2html.xsl:
> > <table cellpadding="4" cellspacing="1" class="ForrestTable">
> 
> Hmm. Taking one closer look at this document I realized that this is
> part of the skinning.
> 
> But then (pardon my desire to understand this), how do you explain
> that I already get
> 
> <table class="ForrestTable" cellspacing="1" cellpadding="4">
> <tr>
> 
> when I call http://localhost:8888/body-lernorte.html
> 
> Should this not be the unskinned version of my document's body and thus
> have not applied the above transformation to it?

No, not necessarily because
grep body- * -n

gives you:
sitemap.xmap:461:      <map:match pattern="**body-*.html">
sitemap.xmap:475:      <map:match pattern="**body-*.html">

The first one is for raw html docs. There you find:
<map:transform src="{forrest:stylesheets}/html2htmlbody.xsl" />

The second is for the internal format. 

Anyway, both have transformations in it before returning the document.

HTH

salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)

--------------------------------------------------------------
Thorsten Scherler
Wyona Inc.  -  Open Source Content Management  -  Apache Lenya
http://www.wyona.com                   http://lenya.apache.org
thorsten.scherler@wyona.com                thorsten@apache.org




Re: Bugs in the XHTML-Pipeline

Posted by Ross Gardler <rg...@apache.org>.
Ferdinand Soethe wrote:
> Ferdinand Soethe wrote:
> 
> 
>>But then (pardon my desire to understand this), how do you explain
>>that I already get
> 
> 
>><table class="ForrestTable" cellspacing="1" cellpadding="4">
>><tr>
> 
> 
>>when I call http://localhost:8888/body-lernorte.html
> 
> 
> Although removing the fixed class in
> forrest-trunk/main/webapp/skins/common/xslt/html/document2html.xsl
> does indeed fix the problem partially.
> 
> However the table-element now has no class attribute even though it
> does have one in the source

I've not looked at the code, but am trying to provide clues.

There are two places (that I can think of) where the class attribute may 
be lost/overwritten. One is in the skinning stage as Thorsten already 
identified. The other is in resources/stylesheet/html2document.xsl

Since you checked the skinning part, I'd be tempted to look in the 
html2document part.

Ross

Re: Bugs in the XHTML-Pipeline

Posted by Ferdinand Soethe <fe...@apache.org>.
Ferdinand Soethe wrote:

> But then (pardon my desire to understand this), how do you explain
> that I already get

> <table class="ForrestTable" cellspacing="1" cellpadding="4">
> <tr>

> when I call http://localhost:8888/body-lernorte.html

Although removing the fixed class in
forrest-trunk/main/webapp/skins/common/xslt/html/document2html.xsl
does indeed fix the problem partially.

However the table-element now has no class attribute even though it
does have one in the source

> <h2 id="Bildungsverein_Hauptstelle">Büro und Seminarräume Oststadt/List</h2>
> <table class="Lernort_Details">
> <tr>

and the there is a copy instruction in the transformation:

> <table cellpadding="4" cellspacing="1" >
>       <xsl:copy-of select="@cellspacing | @cellpadding | @border | @class | @bgcolor |@id"/>
>       <xsl:apply-templates/>
>     </table>



--
Ferdinand Soethe


Re: Bugs in the XHTML-Pipeline

Posted by Ferdinand Soethe <fe...@apache.org>.
Thorsten Scherler wrote:

> grep "ForrestTable" * -r|grep -v .svn|grep class

> brings:
> forrest-trunk/main/webapp/skins/common/xslt/html/document2html.xsl:
> <table cellpadding="4" cellspacing="1" class="ForrestTable">

Hmm. Taking one closer look at this document I realized that this is
part of the skinning.

But then (pardon my desire to understand this), how do you explain
that I already get

<table class="ForrestTable" cellspacing="1" cellpadding="4">
<tr>

when I call http://localhost:8888/body-lernorte.html

Should this not be the unskinned version of my document's body and thus
have not applied the above transformation to it?

Confused to say the least!

--
Ferdinand Soethe


Re: Bugs in the XHTML-Pipeline

Posted by Ferdinand Soethe <fe...@apache.org>.
Thorsten Scherler wrote:

> May the power of grep be with you. ;-) BTW any decent IDE let you search
> for test occurrence within a directory. 

Thanks oh thee wizard of grep :-)

But I was really trying to understand the sequence of steps in the
pipeline to fix this among other problems.

One reason for this being:

In html2document we have a section

> <xsl:template match="/">
>      <xsl:choose>
>          <xsl:when test="name(child::node())='html'">
>          <xsl:apply-templates/>
>          </xsl:when>
>            
>          <xsl:otherwise>
>            <document>
>             <header><title>Error in conversion</title></header>
>             <body>
>              <warning>This file is not in a html format, please convert manually.</warning>
>             </body>
>            </document>
>          </xsl:otherwise>
>      </xsl:choose>
>     </xsl:template>

Which to me means that when I change the root element in my source
document to <ahtml> I should be getting the warning message from the
otherwise branch.

But I didn't.

--
Ferdinand Soethe


Re: Bugs in the XHTML-Pipeline

Posted by Thorsten Scherler <th...@apache.org>.
On Wed, 2005-08-24 at 11:15 +0200, Ferdinand Soethe wrote:
> I keep finding bugs in the html pipeline that I'm using for xhtml.
> One of them is that the transformation will overwrite any existing
> class-attributes in <table> with class='forresttable'.
> 
> In order to fix that I'm trying to identify the current html-pipeline
> in head but keep getting tangled up in my lack of knowledge and our
> lack of documentation in the sitemaps.
> 
> Could sbdy pls. help me and give me some clues on how and where to find the
> steps of the html-pipeline?
> 
> Thanks,

May the power of grep be with you. ;-) BTW any decent IDE let you search
for test occurrence within a directory. 

grep "ForrestTable" * -r|grep -v .svn|grep class

brings:
forrest-trunk/main/webapp/skins/common/xslt/html/document2html.xsl:
<table cellpadding="4" cellspacing="1" class="ForrestTable">

HTH

salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)