|
List Info
Thread: XSL transformation as part of the page content?
|
|
| XSL transformation as part of the page
content? |

|
2006-02-13 09:33:51 |
El lun, 13-02-2006 a las 01:27 -0800, Victor Okunev
escribió:
> I guess this approach won't work if the transformation
produces raw
> html, which is not to be interpreted by Forrest. E.g.
the result of my
> transformation is not an HTML table but rather a
<div>-based layout.
> However, according to http:/
/forrest.apache.org/dtd/document-v20.dtd,
> these tags are not allowed in <body> element.
>
> I think a situation like this one is very typical:
someone has a
> legacy html that does not necessarily validates against
Forrest DTD,
> but it needs to be embedded to the page.
...and this is why we developing the dispatcher (new feature
in 0.8-dev)
which solves this problem.
salu2
> -- Victor
>
> On 2/12/06, David Crossley <crossley apache.org> wrote:
> > Victor Okunev wrote:
> > > Hi All,
> > >
> > > I have an XSLT style sheet that I use to
generate an HTML table. Is it
> > > possible with Forrest v0.7 to perform the
transformation as part of
> > > the site build and include the results under
a document's section?
> > > Here is a pseudo code that kind of
illustrates what I am after:
> > >
> > > index.xml
> > >
> > > <?xml version="1.0"
encoding="UTF-8"?>
> > > <!--
> > > Copyright....
> > > -->
> > > <!DOCTYPE document PUBLIC
"-//APACHE//DTD Documentation V2.0//EN"
> > > "http:/
/forrest.apache.org/dtd/document-v20.dtd">
> > > <document>
> > > <header>
> > > <title>Page Title</title>
> > > </header>
> > > <body>
> > > <section
id="sectionid">
> > > <title>Section
Title</title>
> > > <transform
src="data.xml"
stylesheet="table.xsl"/>
> > > </section>
> > > </body>
> > > </document>
> >
> > Yes, the Cocoon sitemap enables this and more.
> > This is a good situation to explain the powers
> > of teh Cocoon sitemap.
> >
> > Remove that <transform ... from your source xml
> > and use the sitemap language to specify the extra
> > transformer to inject the table into the xml
stream.
> >
> > h
ttp://forrest.apache.org/docs/project-sitemap.html
> >
> > I attached some example files to a new issue.
> > http://i
ssues.apache.org/jira/browse/FOR-814
> > You can download and use them. Later we will
create
> > a document from this explanation.
> >
> > The source file xdocs/one-announce.xml is the main
> > announcement text. Like yours above, but without
> > the <transform> pseudo-stuff and with
another section.
> >
> > The data table will be inserted in the top of the
> > first section.
> >
> > Here is the data file xdocs/one-data.xml
> > <data>
> > <item>Foo</item>
> > </data>
> >
> > Here is the relevant section of the sitemap ...
> >
> > <map:pipelines>
> > <map:pipeline>
> > <map:match
pattern="**-announce.xml">
> > <map:aggregate
element="announce-and-data">
> > <map:part
src="{project:content.xdocs}-announce.xml"/&g
t;
> > <map:part
src="{project:content.xdocs}-data.xml"/>
> > </map:aggregate>
> > <map:transform
src="{project:resources.stylesheets}/add-table.xsl&qu
ot; />
> > <map:serialize
type="xml-document"/>
> > </map:match>
> > </map:pipeline>
> > </map:pipelines>
> >
> > Browser request is
localhost:8888/one-announce.html
> >
> > So that generates an aggregated xml stream like
this ...
> > <announce-and-data>
> > <document>
> > ... the normal source xdoc, e.g.
one-announce.xml
> > </document>
> > <data>
> > <item>Foo</item>
> > </data>
> > </announce-and-data>
> >
> > The add-table transformer then strips off the
outer wrapper,
> > copies over the <document> content, deals
with the first
> > <section> element and inserts the table by
processing
> > the <data> element. It serialises as the
"xml-document"
> > which is Forrest's internal format. Forrest takes
over
> > and does the rest of the transforming and
rendering.
> >
> > That is the general idea. There are probably other
> > ways to do it too.
> >
> > The new dispatcher will be even more versatile.
> >
> > -David
> >
--
thorsten
"Together we stand, divided we fall!"
Hey you (Pink Floyd)
|
|
| XSL transformation as part of the page
content? |

|
2006-02-13 13:03:00 |
Thorsten Scherler wrote:
> El lun, 13-02-2006 a las 01:27 -0800, Victor Okunev
escribió:
>
>>I guess this approach won't work if the
transformation produces raw
>>html, which is not to be interpreted by Forrest.
E.g. the result of my
>>transformation is not an HTML table but rather a
<div>-based layout.
>>However, according to http:/
/forrest.apache.org/dtd/document-v20.dtd,
>>these tags are not allowed in <body> element.
>>
>>I think a situation like this one is very typical:
someone has a
>>legacy html that does not necessarily validates
against Forrest DTD,
>>but it needs to be embedded to the page.
>
>
> ...and this is why we developing the dispatcher (new
feature in 0.8-dev)
> which solves this problem.
It is possible to solve this problem with the dispatcher,
however, this
is integration of content into individual pages. The
dispatcher is not
ideal for this since it would require a new structurer
definition for
each page wanting to include something different.
The xi:include, or XSL processing of the source content is
more
efficient in this particular case. The dispatcher is more
efficient if
you want to put the same content into a large number of
pages.
Ross
|
|
| XSL transformation as part of the page
content? |

|
2006-02-13 13:28:29 |
El lun, 13-02-2006 a las 13:03 +0000, Ross Gardler
escribió:
> Thorsten Scherler wrote:
> > El lun, 13-02-2006 a las 01:27 -0800, Victor
Okunev escribió:
> >
> >>I guess this approach won't work if the
transformation produces raw
> >>html, which is not to be interpreted by
Forrest. E.g. the result of my
> >>transformation is not an HTML table but rather
a <div>-based layout.
> >>However, according to http:/
/forrest.apache.org/dtd/document-v20.dtd,
> >>these tags are not allowed in <body>
element.
> >>
> >>I think a situation like this one is very
typical: someone has a
> >>legacy html that does not necessarily validates
against Forrest DTD,
> >>but it needs to be embedded to the page.
> >
> >
> > ...and this is why we developing the dispatcher
(new feature in 0.8-dev)
> > which solves this problem.
>
> It is possible to solve this problem with the
dispatcher, however, this
> is integration of content into individual pages. The
dispatcher is not
> ideal for this since it would require a new structurer
definition for
> each page wanting to include something different.
>
> The xi:include, or XSL processing of the source content
is more
> efficient in this particular case. The dispatcher is
more efficient if
> you want to put the same content into a large number of
pages.
Well the current version of the dispatcher is really not
ideal for it
*yet*, but I am ATM playing around with contract definitions
*in* xdocs
(but xhtml2 based docs) and I can tell you that is *way*
easier, but
this is a dev topic.
...and Victors problem is that he cannot use e.g. XInclude
(it would be
better to use CInclude anyway because it is cacheable ->
but this as
well a dev topic) because he want to add non valid markup
(regarding
xdocs dtd) into his doc.
If he goes the XInclude road he needs to trigger the include
*after* the
site2xhtml.xsl.
salu2
--
Thorsten Scherler
COO Spain
Wyona Inc. - Open Source Content Management - Apache
Lenya
http://www.wyona.com
http://lenya.apache.org
thorsten.scherler wyona.com thorsten apache.org
|
|
| XSL transformation as part of the page
content? |

|
2006-02-13 21:27:46 |
Thorsten Scherler wrote:
> El lun, 13-02-2006 a las 13:03 +0000, Ross Gardler
escribió:
...
>
>>The xi:include, or XSL processing of the source
content is more
>>efficient in this particular case. The dispatcher is
more efficient if
>>you want to put the same content into a large number
of pages.
>
...
>
> ...and Victors problem is that he cannot use e.g.
XInclude (it would be
> better to use CInclude anyway because it is cacheable
-> but this as
> well a dev topic) because he want to add non valid
markup (regarding
> xdocs dtd) into his doc.
>
> If he goes the XInclude road he needs to trigger the
include *after* the
> site2xhtml.xsl.
Not necessarily, see my earlier post on this subject.
Ross
|
|
[1-4]
|
|
|
about | contact Other archives ( Real Estate discussion Medical topics )
|