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" <[EMAIL PROTECTED]> 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