forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <thors...@apache.org>
Subject Re: [Summary] Recent proposals around v2
Date Wed, 23 Nov 2005 17:59:18 GMT
El mié, 23-11-2005 a las 18:34 +0800, Gav.... escribió:
> Thanks for this Thorsten, ...
> 
> ----- Original Message ----- 
> From: "Thorsten Scherler" <thorsten@apache.org>
> To: <dev@forrest.apache.org>
> Sent: Wednesday, November 23, 2005 6:05 AM
> Subject: [spam] [Summary] Recent proposals around v2
> 
> 
> | Hi all,
> |
> | trying to summarize a wee bit the recent discussion around v2.
> |
> | forrest:contracts & forrest:properties
> | **************************************
> | Structurer
> | ^^^^^^^^^^
> | 1) nuggets (extra data requested by the contract)
> | Nuggets are now defined in the contract element instead of in the
> | forrest:properties. As well the former @nugget is now called @dataURI to
> | reflect better the function of the attribute.
> | e.g.
> | <forrest:contract name="nav-main-testing"
> |        dataURI="cocoon://index.navigation.xml"/>
> 
> A light bulb just went on in McDonald Towers :)
> All this time, without investigation admittedly I was thinking,
> "Nugget, what the hecks a Nugget ??"
> Now as dataURI it is very clear.
> 
> Just goes to show that for people like me, naming conventions
> need to be carefully thought out and made as obvious as
> possible. !
> 

Totally agree. I am sometimes not the best to choose such names, like we
all know I took over the title mister confusion from nicola. ;-)

> |
> | 2) The properties have lost their parent node.
> | e.g.
> | <forrest:contract name="nav-main-testing"
> |  dataURI="cocoon://index.navigation.xml">
> |  <forrest:property name="nav-main-testing-test1" >x</forrest:property>
> |  <forrest:property name="nav-main-testing-test2" >
> |    <foo/>
> |  </forrest:property>
> |  <forrest:property name="nav-main-testing-test3"
> | >xxx</forrest:property>
> | </forrest:contract>
> |
> | Contract implementation
> | ^^^^^^^^^^^^^^^^^^^^^^^
> | 1) contracts are now standalone, which means that they need to
> | match="/".
> |
> | a) If raw data (dataURI) is requested it matches the first element of
> | the dataURI.
> |
> | b) If no dataURI is requested the dispatcher passes a dummy document to
> | the transformation containing only one element: forrest:foo.
> | e.g.
> | <xsl:stylesheet version="1.1"
> | xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> |  <xsl:param name="nav-main-testing" select="/"/>
> |  <xsl:template match="/" >
> |    <content>
> |      <div id="tabs">
> |        <xsl:comment>+ |start Tabs new +</xsl:comment>
> |        <xsl:copy-of
> |          select="$nav-main-testing/navigation/tab/ul[@id='nav-main']"/>
> |        <xsl:comment>+ |end Tabs +</xsl:comment>
> |      </div>
> |    </content>
> |  </xsl:template>
> | </xsl:stylesheet>
> |
> | 2) the resulting transformation have to go into a container element
> | named "content".
> |
> | a) We proposed two new attributes for the "content" element (@xpath and
> | @structureAware).
> | Actually I gave it a second thought and I think it would be better to
> | only apply @xpath under the new circumstances of path-prefixing hooks.
> |
> | The attribute @xpath determines that the elements within the content
> | container should be insert in a given location. In html for example some
> | function need to be inserted into the /html/head and/or /html/body.
> |
> | The location of the /html/body *normally* is defined through a
> | forrest:hook path (we called it structureAware="true"). So I propose
> | that
> | <content>
> | ...
> | </content>
> | stands for structureAware="true" -> the contract will be injected in the
> | path determined by the forrest:hooks.
> |
> | When the @xpath it set, the container content will be added to the value
> | of the @xpath.
> | <content xpath="/html/head">
> | ...
> | </content>
> | Like element("/html/head").appendChild(newChild).
> 
> That seems like a good move to me.
> 
> |
> | b) Till now we assumed that all hooks go
> | into /html/body but this need to be more flexible. I propose to add a
> | new attribute @hooksXpath to the forrest:view. I propose this attribute
> | @hooksXpath as required.
> |
> | <forrest:view type="html" hooksXpath="/html/body">
> | <forrest:hook name="htmlBodyHook"/>
> | </forrest:view>
> |
> | that will be transformed into
> | <html>
> | <body>
> |  <forrest:hook name="htmlBodyHook"/>
> | </body>
> | </html>
> |
> | c) We need another attribute in hooks @element which would not create
> | a div but the value of @element:
> | <forrest:hook element="html">
> | <forrest:hook element="body">
> |  <forrest:hook name="htmlBodyHook"/>
> | </forrest:hook>
> | </forrest:hook>
> |
> | that will be transformed into
> | <html>
> |  <body>
> |   <forrest:hook name="htmlBodyHook"/>
> |  </body>
> | </html>
> 
> 
> b) and c) above both transform to the same output ?

Yes, but note the different markup to archive it.

> 
> I think I need a walkthrough. Like others perhaps I have been both very busy
> (had to leave Forrest Friday before I even got started, sorry) and also just
> 'watching' progress until I begin to understand it.
> 
> I need to learn again by doing, I have been gleaning www.xml.com and going 
> back to
> basics with xsl and pipelines as I have been fumbling my way through so far.
> 
> Could you possibly, if you ever get the time, walk through for me how to add 
> an xhtml2
> coded page to a v2 site. (or an xml) and what happens along the way.

Please start with 
http://forrest.apache.org/docs_0_80/howto/howto-structurer-install.html
http://forrest.apache.org/docs_0_80/howto/howto-structurer-dsl.html
http://forrest.apache.org/docs_0_80/howto/howto-structurer-contracts.html

NOTE: this instruction do *NOT* contain the recent changes (as in this
summary) till the transformer is in svn and official part of forrest.

Sure I will help you walking through to add whatever to v2 if you read
above howtos and can ask some specific questions regarding the process.

Thanks Gav for your feedback, that helps a lot to discover points that
are not clear.

salu2
-- 
thorsten

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


Mime
View raw message