You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@forrest.apache.org by Helena Edelson <he...@greenjaguar.com> on 2006/01/22 18:32:39 UTC

common+skins document2html.xsl questions

I am confused on getting data into xdocs content.
I've been testing some of my own hacks (manglings) for getting meta data 
into sections of xdoc xml content files(document 2.0 dtd)

This is simple with xslt files, jsp/servlets, php  where aspects are 
easily split so one can set in say a language file
the messages to output (Forrest has this but..) in various areas of the 
Content (xdocs/*.xml).

Am I missing something or is it in 0.8 ?
Maybe it is in teh all-talked about coat or views. Is 0.8 in MVC?

The only way I see is to customize both common document2html.xsl and 
skins document2html.xsl
(very messy:reusability rather sad)

class="fork" is being stripped by my editor and <link> not allowed.
tested a custom template for matching <a> to implement class fork but it 
kept being stripped.
did a bunch of (starts-with...) to catch "http:" and if found, do <a 
href="{@href} target="_blank"> just like "fork"
with no luck either on like ten tries at template variations. Anyone 
have any ideas?

greatful for any insight,
helena

Re: common+skins document2html.xsl questions

Posted by Ross Gardler <rg...@apache.org>.
Helena Edelson wrote:
> 
> I am confused on getting data into xdocs content.
> I've been testing some of my own hacks (manglings) for getting meta data 
> into sections of xdoc xml content files(document 2.0 dtd)
> 
> This is simple with xslt files, jsp/servlets, php  where aspects are 
> easily split so one can set in say a language file
> the messages to output (Forrest has this but..) in various areas of the 
> Content (xdocs/*.xml).
> 
> Am I missing something or is it in 0.8 ?

SVN head has the dispatcher, which makes this *much* easier.

> Maybe it is in teh all-talked about coat or views. 

"Views" was the original development name of the Dispatcher.  We changed 
the name because of lots of confusion with other uses of the word "views"...

> Is 0.8 in MVC?

... and there is one of those other uses. Since Forrest is not an 
application framework there is no sense in it providing an MVC model. 
However, Forrest is a Cocoon application and Cocoon provides a full MVC 
application framework so  you can use Forrest in an MVC application. 
However, I digress...

> The only way I see is to customize both common document2html.xsl and 
> skins document2html.xsl
> (very messy:reusability rather sad)

All document2html.xsl files in skins import import the common file:

<xsl:import href="../../../common/xslt/html/document-to-html.xsl"/>

You therefore make whatever edit you need in the appropriate file. That 
is, if the skin overrides the match you want to edit then do it in the 
skins document2html.xsl otherwise consider whether the change is skin 
specific or not.

If it is specific to a particular skin then your edit goes in the skin 
document2html.xsl file, whereas if it is useful in all skins then it 
goes in the common one.

> class="fork" is being stripped by my editor and <link> not allowed.
> tested a custom template for matching <a> to implement class fork but it 
> kept being stripped.

Did you really mean to say my "stripped by my editor"? If so then that 
is a misconfiguration of your editor and nothing to do with Forrest.

Ross

Re: common+skins document2html.xsl questions

Posted by Thorsten Scherler <th...@apache.org>.
Note: I have not replied to your earlier mail because my recommendation
is the dispatcher (once again). Since as soon as I mention this on @user
we start to point out that is not ready for production so I just stop to
mention it on this list. The dispatcher is dev stuff so all questions
regarding it should be directed to dev@f.a.o. It is not a user topic
since only "devs" are using the dispatcher. 

El dom, 22-01-2006 a las 12:32 -0500, Helena Edelson escribió:
> I am confused on getting data into xdocs content.

does it has to be *in* the xdocs? Or is it that is coming just
afterward? Is it xdocs itself, if so did you try a "simple" cinclude on
the xdocs (before skining)?

> I've been testing some of my own hacks (manglings) for getting meta data 
> into sections of xdoc xml content files(document 2.0 dtd)
> 

What is this meta data can you give an example?

> This is simple with xslt files, jsp/servlets, php  where aspects are 
> easily split so one can set in say a language file
> the messages to output (Forrest has this but..) in various areas of the 
> Content (xdocs/*.xml).

That sounds like you want to include another language in the content,
right? 

> 
> Am I missing something or is it in 0.8 ?

What do you mean?

> Maybe it is in teh all-talked about coat or views. Is 0.8 in MVC?
> 

If you mean the dispatcher, then yes one can say it is following the
model-view-controller (mvc) pattern, but the dispatcher != skins.

> The only way I see is to customize both common document2html.xsl and 
> skins document2html.xsl
> (very messy:reusability rather sad)
> 

Yes, that is why I started the work on the dispatcher aka views. Here
you can easily define custom business services that you can include and
process in your output.

> class="fork" is being stripped by my editor and <link> not allowed.

link is xdocs < 2.0 and in =>2.0  it is <a/>.
http://forrest.apache.org/dtdx/document-v20.html#changes-20

Seems you need to configure your editor that @class does not get
stripped. Try with "vi", that will not strip it. ;-)

> tested a custom template for matching <a> to implement class fork but it 
> kept being stripped.
> did a bunch of (starts-with...) to catch "http:" and if found, do <a 
> href="{@href} target="_blank"> just like "fork"
> with no luck either on like ten tries at template variations. Anyone 
> have any ideas?

Hmm, I have just tested it on the lenya docu and it is working like a
charm.
<p> The server <a href="ext:lenya-zone"
class="fork">lenya.zones.apache.org</a> provides our testing and
demonstration area. It is managed by Apache Lenya committers. </p>

get transformed to 
<p> The server <a target="_blank" class="fork"
href="http://lenya.zones.apache.org">lenya.zones.apache.org</a>
provides our testing and demonstration area. It is managed by Apache
Lenya committers. </p>

HTH

salu2
-- 
thorsten

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