You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by HANAX <ha...@hanaxsoftware.com> on 2005/07/09 22:34:19 UTC

TOC in output plugin - solved :)

ok, this one works :)
But still xhtml serializer throws error, but probably i don't really need it... I've already read about serializers, about xhtml specifically but there is too little information for me, for example i stil don't know how it transforms its input, or what it really does..
Anyway, big thanks, I am about to continue this way... 
Finally one question: where I can find xdoc specification? I mean, I know structure and elements of the input file but it goes throgh several transformations during input and internal processing, doesn't it? So are there some informational elements or attributes added? How it will be modified? Which elements are allowed in xdoc? Can I use any element I want?
I hope today I make some good progress and read a lot of documents, so for now it's time for bed :)
Once more - thanx.
HANAX
______________________________________________________________________
PÔVODNÁ SPRÁVA
Od: "Ross Gardler" <rg...@apache.org>
Pre: dev@forrest.apache.org
Predmet: Re: TOC in output plugin
Dátum/Čas: 9. 7. 2005 19:53:00

> HANAX wrote:
> > That's true, I really need to start with small steps.
> > So here ve are:
> > Expecting document in format you described:
> >  <document>
> >     <header>
> >       <title>My Document</title>
> >     <header>
> >     <body>
> >       <section>
> >         <title>Section 1</title>
> >         ...
> >         <section>
> >           <title>Section 1.1</title>
> >           ...
> >         </section>
> >         ...
> >       </section>
> >   
> >       <section>
> >         <title>Section 2</title>
> >         ...
> >       </section>
> >     </body>
> >  </document>
> > 
> > Now what I need:
> > <head> 
> >   <title>The title</title>
> >   <vxml:form>
> >     <vxml:field name="section1">
> >        ...
> >     </vxml:field>
> >     <vxml:field name="section1_1">
> >        ...
> >     </vxml:field>
> >     <vxml:field name="section1_2">
> >        ...
> >     </vxml:field>
> >   </vxml:form>
> > </head> 
> > 
> > How this should be done? Using xsl?
>  
> Yes, using XSL
>  
> > Currently I have:
>  
> >   <map:pipelines>
> >     <map:pipeline>
> >       <!-- Voice -->
> >       <map:match type="regexp" pattern="^(.*?)([^/]*).mxml$">
> >         <map:aggregate element="site">
> >           <map:part src="cocoon://{1}{2}.xml"/>
> >         </map:aggregate>
> >         <map:transform src="resources/stylesheets/document2mxml.xsl"/>
> >         <map:serialize type="xhtml"/>
> >       </map:match>
> >     </map:pipeline>
> >   </map:pipelines>
>  
> You have this in your output.xmap of the plugin, right?
>  
> This looks fine, now in your document2mxml.xsl you need
>  
> <xsl:template name="voiceNavigation">
>    <vxml:form>
>    <xsl:for-each select="//section">
>         <vxml:field>
>   <xsl:attribute name="name">
>             <xsl:value-of select="title"/>
>           </xsl:attribute>
>           ...
>         </vsml:field>
>    </xsl:for-each>
>    </vxml:form>
> </xsl:tempalte>
>  
> To call the template at the relevant point in your stylesheet you need:
>  
> <xsl:apply-tempalte name="voiceNavigation"/>
>  
> Once we have this basic stuff working we can work with Thorsten getting 
> it into a template for views.
>  
> NOTE
> The map:aggregate is not needed since you are not aggregating any 
> documents. Just use <map:generate src="cocoon://{1}{2}.xml"/>, this will 
> make the root element of your input to the transformation <document>, so 
> you will need to change your XSL accordingly.
>  
>  
> > What about serialization? I need output in xhml, what <map:serialize type="xhtml"/> element really does?
>  
> See http://cocoon.apache.org/2.1/userdocs/serializers/xhtml-serializer.html
>  
> Ross


Re: TOC in output plugin - solved :)

Posted by Ross Gardler <rg...@apache.org>.
HANAX wrote:
> ok, this one works :)
> But still xhtml serializer throws error, but probably i don't really need it... I've already read about serializers, about xhtml specifically but there is too little information for me, for example i stil don't know how it transforms its input, or what it really does..

It doesn't transform the output, it simply serialises for consumption by 
whatever requested the document.

> Finally one question: where I can find xdoc specification? I mean, I know structure and elements of the input file but it goes 
throgh several transformations during input and internal processing, 
doesn't it? So are there some informational elements or attributes 
added? How it will be modified? Which elements are allowed in xdoc? Can 
I use any element I want?

The XDoc DTD is at http://forrest.apache.org/dtdx/document-v20.dtdx.html
There is a reasonably complete example at 
http://forrest.apache.org/dtdx/document-v20.html

However, I think what you are really asking is what are the intermediate 
steps between XDoc and the XHTML output. The answer to this depends on 
whether you work with skins  or views. In 0.8 skins will be deprecated 
and replaced with views. So, as Torsten suggests you should really be 
working with views. Unfortunately, there is very little newbie 
documentation for views.

The problem we have now is that we (I think I speak for all other 
developers here) do not understand the voicexml schema. I think the best 
way to progress now is to describe exactly what you need to achieve. 
That is, create a simple XDoc and then create an XHTML representation of 
that document with the voiceXML markup. If you provide both of these 
documents we will be able to understand what you want to achieve and 
Thorsten can tell us how to do it with views.

Does that sound like a sensible course of action?

> I hope today I make some good progress and read a lot of documents, so for now it's time for bed :)

It certainly sounds like you have achieved allot. You deserve a good sleep.

Ross