You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by vg...@sevencs.com on 2004/01/05 11:11:05 UTC

content aggregation + links to used files

Hi all!

I want to create an xml document by extracting
defined elements from files conforming to a
known format. When assembling the document I need
to keep in mind which element originates from
which file to be able to link the element with
the corresponding file after transformation into
HTML. The resulting HTML document consists - among
other things - of links to all processed files.

How do I achieve this with Cocoon?

All suggestions will be appreciated!
Thanks in advance,
Nele.


I tried the following using a directory generator
and aggregation, but it doesn't work.

+-----------------------------------------+
| directories within COCOON context       |
+-----------------------------------------+
+---myContentDir/
    +---file1.xml
    +---file2.xml
    +---file3.xml


I aggregate the files in "myContentDir" using the
following sitemap snippet:

+-----------------------------------------+
| sitemap snippet                         |
+-----------------------------------------+
<map:match pattern="content">
  <map:generate src="/myContentDir" type="directory">
    <map:parameter name="depth" value="1"/>
  </map:generate>
  <map:transform src="cincludeFiles.xsl">
    <map:parameter name="part" value="content"/>
  </map:transform>
  <map:transform type="cinclude"/>
  <map:transform src="content2page.xsl"/>
  <map:serialize type="xml"/>
</map:match>


Within the stylesheet "cincludeFiles.xsl", I transform the
xml stream coming from the directory generator. Iteratively
all files are inserted by <cinclude:include src="{$path}"/>.
An element named "file" with an attribute "path" is created.

+-----------------------------------------+
| stylesheet snippet "cincludeFiles.xsl"  |
+-----------------------------------------+
<xsl:template match="dir:file">
  <xsl:param name="path"/>
  <xsl:element name="file">
    <xsl:attribute name="path">
      <xsl:value-of select="$path"/>
    </xsl:attribute>
  <cinclude:include src="{$path}"/>
  </xsl:element>
</xsl:template>


The transform outputs the following
([...] stands for more xml elements):

[...]
  <file path="myContentDir/file1.xml">[...]</file>
  <file path="myContentDir/file2.xml">[...]</file>
  <file path="myContentDir/file3.xml">[...]</file>
[...]


+-----------------------------------------+
| stylesheet snippet "content2page.xsl"   |
+-----------------------------------------+
<xsl:template match="file">
  <xsl:text>following file was added:</xsl:text>
  <xsl:value-of select="./@path"/>
</xsl:template>

When I try to read the attribute value "path", my
stylesheet outputs nothing.

<xsl:template match="@path">
  <xsl:text>following file was added:</xsl:text>
  <xsl:value-of select="."/>
</xsl:template>

Doesn't work either.

This is really urgent. Thanks for your help!



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: content aggregation + links to used files follow up

Posted by Nicolas Toper <nt...@jouve.fr>.
sorry for this 2 mails post
So by slashing away all the NS you just make it work.

Besides, I consider this as a good practices, b/c ns creates complexity not 
always needed but it is better to introduce them in project with long 
lifecycles b/c one day or another you'll need them

For instance, in some pipeline in my project I use this to create generic and 
simple XSL: it just wouldn't work without it (or I don't know the * for NS; 
is there one?) but at other times I keep the NS b/c I have different 
documents with different meanings...

Nicolas


Le Lundi 05 Janvier 2004 17:24, Nicolas Toper a écrit :
> it's because as soon as you use a ns in your xml document, the xsl spec
> says that an unnommed xml tag refers to the default ns.
> So basically:
> <root xmlns:ns="ns" xmlns:"ns2">
> <ns2:one>
> 	<two>
> </...>
> two has actually ns as ns bc it is the default ns for this subsection of
> this xml doc
>
> Le Lundi 05 Janvier 2004 17:06, Nele Vogel a écrit :
> > Hi Nicolas!
> >
> > I used your suggestion and removed all namespaces from the XML stream:
> > The XSL transform actually outputs the correct values. Can you please
> > explain to me, why this approach works?
> >
> > Thank you very much for your help!
> > Nele
> >
> > Nicolas wrote:
> > > In that case use that in another transformer: it'll remove all NS from
> > > the XML
> > >
> > > <?xml version="1.0" encoding="UTF-8"?>
> > > <xsl:stylesheet version="1.0"
> > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> > >   <xsl:output method="xml" version="1.0" encoding="UTF-8"
> > > indent="yes"/> <xsl:template match="*">
> > >       <!-- remove element prefix (if any) -->
> > >       <xsl:element name="{local-name()}">
> > >         <!-- process attributes -->
> > >         <xsl:for-each select="@*">
> > >           <!-- remove attribute prefix (if any) -->
> > >           <xsl:attribute name="{local-name()}">
> > >             <xsl:value-of select="."/>
> > >           </xsl:attribute>
> > >         </xsl:for-each>
> > >         <xsl:apply-templates/>
> > >
> > >       </xsl:element>
> > >   </xsl:template>
> > > </xsl:stylesheet>
> > >
> > >> Nicolas wrote:
> > >> > If I understand everything: you want a big XML files like that:
> > >> > <root>
> > >> > <news>
> > >> >    <file path="news/news1.xml">
> > >> >      <article>
> > >> >       [...]
> > >> >      </article>
> > >> >    </file>
> > >> >  </news>
> > >> >
> > >> > <news>
> > >> >    <file path="news/news1.xml">
> > >> >      <article>
> > >> >       [...]
> > >> >      </article>
> > >> >    </file>
> > >> >  </news>
> > >> > </root>
> > >>
> > >> It should look like this:
> > >>
> > >> <root>
> > >>   <news>
> > >>
> > >>     <file path="news/news1.xml">
> > >>       <article>
> > >>         [...]
> > >>       </article>
> > >>     </file>
> > >>
> > >>     <file path="news/news2.xml">
> > >>       <article>
> > >>         [...]
> > >>       </article>
> > >>     </file>
> > >>
> > >>   </news>
> > >> </root>
> > >>
> > >> > And your problem is the XML file generated is transformed badly?
> > >>
> > >> Yes, exactly. Koen and Simon pointed out, it might be a namespace
> > >> problem.
> > >>
> > >> Thanks a lot for your help!
> > >> Nele.
> > >>
> > >> >> Nicolas wrote:
> > >> >> > it depends on which information you need exactly: the name of the
> > >> >>
> > >> >> file:
> > >> >> > put it as a parameter into the URL and pass it to the XSL
> > >> >>
> > >> >> I need the path (relative or absolute) to the processed file.
> > >> >>
> > >> >> I am able to extract the relative path inside the first XSL
> > >> >> transform (cincludeFiles.xsl):
> > >> >>
> > >> >>   <xsl:template match="dir:directory">
> > >> >>     <xsl:param name="path"/>
> > >> >>     <xsl:apply-templates>
> > >> >>       <xsl:with-param name="path">
> > >> >>         <xsl:value-of select="concat($path,./@name,'/')"/>
> > >> >>       </xsl:with-param>
> > >> >>     </xsl:apply-templates>
> > >> >>   </xsl:template>
> > >> >>
> > >> >>
> > >> >>   <xsl:template match="dir:file">
> > >> >>     <xsl:param name="path"/>
> > >> >>     <xsl:element name="file">
> > >> >>       <xsl:attribute name="path">
> > >> >>         <xsl:value-of select="concat($path,./@name)"/>
> > >> >>       </xsl:attribute>
> > >> >>       <cinclude:include src="{concat($path,./@name)}"/>
> > >> >>     </xsl:element>
> > >> >>   </xsl:template>
> > >> >>
> > >> >> The output looks like this:
> > >> >>
> > >> >> <news>
> > >> >>   <file path="news/news1.xml">
> > >> >>     <article>
> > >> >>      [...]
> > >> >>     </article>
> > >> >>   </file>
> > >> >> </news>
> > >> >>
> > >> >> The path inside element <file> is correct.
> > >> >>
> > >> >> However, when I try to process the XML stream for a second time,
> > >> >> the templates within "content2page.xsl" neither match element
> > >> >> <news> nor element <file>. Why?
> > >> >>
> > >> >> Thank you for your help, Nicolas!
> > >> >> Nele
> > >> >>
> > >> >> >> Nicolas wrote:
> > >> >> >> > If the orginal docs aren't XML you should have a look at
> > >>
> > >> Chaperon
> > >>
> > >> >> >> The original documents are also XML documents.
> > >> >> >>
> > >> >> >> My problem is linking an element with the file it originates
> > >> >> >> from. Is it possible to store the information the directory
> > >> >> >> generator
> > >> >>
> > >> >> extracts
> > >> >>
> > >> >> >> about my directory structure - maybe as a file?
> > >> >> >>
> > >> >> >> Thank you for your response!
> > >> >> >> Nele.
> > >> >> >>
> > >> >> >> >> Hi all!
> > >> >> >> >>
> > >> >> >> >> I want to create an xml document by extracting
> > >> >> >> >> defined elements from files conforming to a
> > >> >> >> >> known format. When assembling the document I need
> > >> >> >> >> to keep in mind which element originates from
> > >> >> >> >> which file to be able to link the element with
> > >> >> >> >> the corresponding file after transformation into
> > >> >> >> >> HTML. The resulting HTML document consists - among
> > >> >> >> >> other things - of links to all processed files.
> > >> >> >> >>
> > >> >> >> >> How do I achieve this with Cocoon?
> > >> >> >> >>
> > >> >> >> >> All suggestions will be appreciated!
> > >> >> >> >> Thanks in advance,
> > >> >> >> >> Nele.
> > >> >> >> >>
> > >> >> >> >>
> > >> >> >> >> I tried the following using a directory generator
> > >> >> >> >> and aggregation, but it doesn't work.
> > >> >> >> >>
> > >> >> >> >> +-----------------------------------------+
> > >> >> >> >>
> > >> >> >> >> | directories within COCOON context       |
> > >> >> >> >>
> > >> >> >> >> +-----------------------------------------+
> > >> >> >> >> +---myContentDir/
> > >> >> >> >>     +---file1.xml
> > >> >> >> >>     +---file2.xml
> > >> >> >> >>     +---file3.xml
> > >> >> >> >>
> > >> >> >> >>
> > >> >> >> >> I aggregate the files in "myContentDir" using the
> > >> >> >> >> following sitemap snippet:
> > >> >> >> >>
> > >> >> >> >> +-----------------------------------------+
> > >> >> >> >>
> > >> >> >> >> | sitemap snippet                         |
> > >> >> >> >>
> > >> >> >> >> +-----------------------------------------+
> > >> >> >> >> <map:match pattern="content">
> > >> >> >> >>   <map:generate src="/myContentDir" type="directory">
> > >> >> >> >>     <map:parameter name="depth" value="1"/>
> > >> >> >> >>   </map:generate>
> > >> >> >> >>   <map:transform src="cincludeFiles.xsl">
> > >> >> >> >>     <map:parameter name="part" value="content"/>
> > >> >> >> >>   </map:transform>
> > >> >> >> >>   <map:transform type="cinclude"/>
> > >> >> >> >>   <map:transform src="content2page.xsl"/>
> > >> >> >> >>   <map:serialize type="xml"/>
> > >> >> >> >> </map:match>
> > >> >> >> >>
> > >> >> >> >>
> > >> >> >> >> Within the stylesheet "cincludeFiles.xsl", I transform the
> > >> >> >> >> xml stream coming from the directory generator. Iteratively
> > >> >> >> >> all files are inserted by <cinclude:include src="{$path}"/>.
> > >> >> >> >> An element named "file" with an attribute "path" is created.
> > >> >> >> >>
> > >> >> >> >> +-----------------------------------------+
> > >> >> >> >>
> > >> >> >> >> | stylesheet snippet "cincludeFiles.xsl"  |
> > >> >> >> >>
> > >> >> >> >> +-----------------------------------------+
> > >> >> >> >> <xsl:template match="dir:file">
> > >> >> >> >>   <xsl:param name="path"/>
> > >> >> >> >>   <xsl:element name="file">
> > >> >> >> >>     <xsl:attribute name="path">
> > >> >> >> >>       <xsl:value-of select="$path"/>
> > >> >> >> >>     </xsl:attribute>
> > >> >> >> >>   <cinclude:include src="{$path}"/>
> > >> >> >> >>   </xsl:element>
> > >> >> >> >> </xsl:template>
> > >> >> >> >>
> > >> >> >> >>
> > >> >> >> >> The transform outputs the following
> > >> >> >> >> ([...] stands for more xml elements):
> > >> >> >> >>
> > >> >> >> >> [...]
> > >> >> >> >>   <file path="myContentDir/file1.xml">[...]</file>
> > >> >> >> >>   <file path="myContentDir/file2.xml">[...]</file>
> > >> >> >> >>   <file path="myContentDir/file3.xml">[...]</file>
> > >> >> >> >> [...]
> > >> >> >> >>
> > >> >> >> >>
> > >> >> >> >> +-----------------------------------------+
> > >> >> >> >>
> > >> >> >> >> | stylesheet snippet "content2page.xsl"   |
> > >> >> >> >>
> > >> >> >> >> +-----------------------------------------+
> > >> >> >> >> <xsl:template match="file">
> > >> >> >> >>   <xsl:text>following file was added:</xsl:text>
> > >> >> >> >>   <xsl:value-of select="./@path"/>
> > >> >> >> >> </xsl:template>
> > >> >> >> >>
> > >> >> >> >> When I try to read the attribute value "path", my
> > >> >> >> >> stylesheet outputs nothing.
> > >> >> >> >>
> > >> >> >> >> <xsl:template match="@path">
> > >> >> >> >>   <xsl:text>following file was added:</xsl:text>
> > >> >> >> >>   <xsl:value-of select="."/>
> > >> >> >> >> </xsl:template>
> > >> >> >> >>
> > >> >> >> >> Doesn't work either.
> > >> >> >> >>
> > >> >> >> >> This is really urgent. Thanks for your help!
> > >> >> >> >>
> > >> >> >> >>
> > >> >> >> >>
> > >> >> >> >> -------------------------------------------------------------
> > >> >> >> >>-- --- --- To unsubscribe, e-mail:
> > >> >> >> >> users-unsubscribe@cocoon.apache.org
> > >>
> > >> For
> > >>
> > >> >> >> >> additional commands, e-mail: users-help@cocoon.apache.org
> > >> >> >> >
> > >> >> >> > --------------------------------------------------------------
> > >> >> >> >-- --- -- To unsubscribe, e-mail:
> > >> >> >> > users-unsubscribe@cocoon.apache.org
> > >>
> > >> For
> > >>
> > >> >> >> > additional commands, e-mail: users-help@cocoon.apache.org
> > >> >> >>
> > >> >> >> ----------------------------------------------------------------
> > >> >> >>-- --- To unsubscribe, e-mail:
> > >> >> >> users-unsubscribe@cocoon.apache.org For additional commands,
> > >> >> >> e-mail: users-help@cocoon.apache.org
> > >> >> >
> > >> >> > -----------------------------------------------------------------
> > >> >> >-- -- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > >> >> > For additional commands, e-mail: users-help@cocoon.apache.org
> > >> >>
> > >> >> -------------------------------------------------------------------
> > >> >>-- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For
> > >> >> additional commands, e-mail: users-help@cocoon.apache.org
> > >> >
> > >> > --------------------------------------------------------------------
> > >> >- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For
> > >> > additional commands, e-mail: users-help@cocoon.apache.org
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > >> For additional commands, e-mail: users-help@cocoon.apache.org
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: content aggregation + links to used files

Posted by Lars Huttar <la...@sil.org>.
> it's because as soon as you use a ns in your xml document,
> the xsl spec says

Actually it is the XML Namespaces spec that describes this
behavior (http://www.w3.org/TR/1999/REC-xml-names-19990114/).

> that an unnommed xml tag refers to the default ns.
> So basically:
> <root xmlns:ns="ns" xmlns:"ns2">
> <ns2:one>
> 	<two>
> </...>
> two has actually ns as ns bc it is the default ns for this
> subsection of this
> xml doc

I'm not sure what was intended here... there are a few typos;
but the above statement is not accurate.

If Nicolas meant

<root xmlns:ns="ns" xmlns="ns2">
  <ns2:one>
    <two>
  </...>

then the element <two> is in the "ns2" namespace (the default namespace),
not in "ns". However this XML will not be accepted by a namespace-
aware application anyway, because the prefix "ns2" is not declared.


As for why removing namespaces fixed the problem, we have had these
sorts of problems before too, and had to remove namespaces to fix
them. We never could figure out why, other than assuming that Xalan
had a bug regarding namespaces.

Lars

> Le Lundi 05 Janvier 2004 17:06, Nele Vogel a écrit :
> > Hi Nicolas!
> >
> > I used your suggestion and removed all namespaces from the
> XML stream: The
> > XSL transform actually outputs the correct values. Can you
> please explain
> > to me, why this approach works?
> >
> > Thank you very much for your help!
> > Nele
> >


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: content aggregation + links to used files

Posted by Nicolas Toper <nt...@jouve.fr>.
it's because as soon as you use a ns in your xml document, the xsl spec says 
that an unnommed xml tag refers to the default ns.
So basically:
<root xmlns:ns="ns" xmlns:"ns2">
<ns2:one>
	<two>
</...>
two has actually ns as ns bc it is the default ns for this subsection of this 
xml doc

Le Lundi 05 Janvier 2004 17:06, Nele Vogel a écrit :
> Hi Nicolas!
>
> I used your suggestion and removed all namespaces from the XML stream: The
> XSL transform actually outputs the correct values. Can you please explain
> to me, why this approach works?
>
> Thank you very much for your help!
> Nele
>
> Nicolas wrote:
> > In that case use that in another transformer: it'll remove all NS from
> > the XML
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <xsl:stylesheet version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> >   <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
> >     <xsl:template match="*">
> >       <!-- remove element prefix (if any) -->
> >       <xsl:element name="{local-name()}">
> >         <!-- process attributes -->
> >         <xsl:for-each select="@*">
> >           <!-- remove attribute prefix (if any) -->
> >           <xsl:attribute name="{local-name()}">
> >             <xsl:value-of select="."/>
> >           </xsl:attribute>
> >         </xsl:for-each>
> >         <xsl:apply-templates/>
> >
> >       </xsl:element>
> >   </xsl:template>
> > </xsl:stylesheet>
> >
> >> Nicolas wrote:
> >> > If I understand everything: you want a big XML files like that:
> >> > <root>
> >> > <news>
> >> >    <file path="news/news1.xml">
> >> >      <article>
> >> >       [...]
> >> >      </article>
> >> >    </file>
> >> >  </news>
> >> >
> >> > <news>
> >> >    <file path="news/news1.xml">
> >> >      <article>
> >> >       [...]
> >> >      </article>
> >> >    </file>
> >> >  </news>
> >> > </root>
> >>
> >> It should look like this:
> >>
> >> <root>
> >>   <news>
> >>
> >>     <file path="news/news1.xml">
> >>       <article>
> >>         [...]
> >>       </article>
> >>     </file>
> >>
> >>     <file path="news/news2.xml">
> >>       <article>
> >>         [...]
> >>       </article>
> >>     </file>
> >>
> >>   </news>
> >> </root>
> >>
> >> > And your problem is the XML file generated is transformed badly?
> >>
> >> Yes, exactly. Koen and Simon pointed out, it might be a namespace
> >> problem.
> >>
> >> Thanks a lot for your help!
> >> Nele.
> >>
> >> >> Nicolas wrote:
> >> >> > it depends on which information you need exactly: the name of the
> >> >>
> >> >> file:
> >> >> > put it as a parameter into the URL and pass it to the XSL
> >> >>
> >> >> I need the path (relative or absolute) to the processed file.
> >> >>
> >> >> I am able to extract the relative path inside the first XSL transform
> >> >> (cincludeFiles.xsl):
> >> >>
> >> >>   <xsl:template match="dir:directory">
> >> >>     <xsl:param name="path"/>
> >> >>     <xsl:apply-templates>
> >> >>       <xsl:with-param name="path">
> >> >>         <xsl:value-of select="concat($path,./@name,'/')"/>
> >> >>       </xsl:with-param>
> >> >>     </xsl:apply-templates>
> >> >>   </xsl:template>
> >> >>
> >> >>
> >> >>   <xsl:template match="dir:file">
> >> >>     <xsl:param name="path"/>
> >> >>     <xsl:element name="file">
> >> >>       <xsl:attribute name="path">
> >> >>         <xsl:value-of select="concat($path,./@name)"/>
> >> >>       </xsl:attribute>
> >> >>       <cinclude:include src="{concat($path,./@name)}"/>
> >> >>     </xsl:element>
> >> >>   </xsl:template>
> >> >>
> >> >> The output looks like this:
> >> >>
> >> >> <news>
> >> >>   <file path="news/news1.xml">
> >> >>     <article>
> >> >>      [...]
> >> >>     </article>
> >> >>   </file>
> >> >> </news>
> >> >>
> >> >> The path inside element <file> is correct.
> >> >>
> >> >> However, when I try to process the XML stream for a second time, the
> >> >> templates within "content2page.xsl" neither match element <news> nor
> >> >> element <file>. Why?
> >> >>
> >> >> Thank you for your help, Nicolas!
> >> >> Nele
> >> >>
> >> >> >> Nicolas wrote:
> >> >> >> > If the orginal docs aren't XML you should have a look at
> >>
> >> Chaperon
> >>
> >> >> >> The original documents are also XML documents.
> >> >> >>
> >> >> >> My problem is linking an element with the file it originates from.
> >> >> >> Is it possible to store the information the directory generator
> >> >>
> >> >> extracts
> >> >>
> >> >> >> about my directory structure - maybe as a file?
> >> >> >>
> >> >> >> Thank you for your response!
> >> >> >> Nele.
> >> >> >>
> >> >> >> >> Hi all!
> >> >> >> >>
> >> >> >> >> I want to create an xml document by extracting
> >> >> >> >> defined elements from files conforming to a
> >> >> >> >> known format. When assembling the document I need
> >> >> >> >> to keep in mind which element originates from
> >> >> >> >> which file to be able to link the element with
> >> >> >> >> the corresponding file after transformation into
> >> >> >> >> HTML. The resulting HTML document consists - among
> >> >> >> >> other things - of links to all processed files.
> >> >> >> >>
> >> >> >> >> How do I achieve this with Cocoon?
> >> >> >> >>
> >> >> >> >> All suggestions will be appreciated!
> >> >> >> >> Thanks in advance,
> >> >> >> >> Nele.
> >> >> >> >>
> >> >> >> >>
> >> >> >> >> I tried the following using a directory generator
> >> >> >> >> and aggregation, but it doesn't work.
> >> >> >> >>
> >> >> >> >> +-----------------------------------------+
> >> >> >> >>
> >> >> >> >> | directories within COCOON context       |
> >> >> >> >>
> >> >> >> >> +-----------------------------------------+
> >> >> >> >> +---myContentDir/
> >> >> >> >>     +---file1.xml
> >> >> >> >>     +---file2.xml
> >> >> >> >>     +---file3.xml
> >> >> >> >>
> >> >> >> >>
> >> >> >> >> I aggregate the files in "myContentDir" using the
> >> >> >> >> following sitemap snippet:
> >> >> >> >>
> >> >> >> >> +-----------------------------------------+
> >> >> >> >>
> >> >> >> >> | sitemap snippet                         |
> >> >> >> >>
> >> >> >> >> +-----------------------------------------+
> >> >> >> >> <map:match pattern="content">
> >> >> >> >>   <map:generate src="/myContentDir" type="directory">
> >> >> >> >>     <map:parameter name="depth" value="1"/>
> >> >> >> >>   </map:generate>
> >> >> >> >>   <map:transform src="cincludeFiles.xsl">
> >> >> >> >>     <map:parameter name="part" value="content"/>
> >> >> >> >>   </map:transform>
> >> >> >> >>   <map:transform type="cinclude"/>
> >> >> >> >>   <map:transform src="content2page.xsl"/>
> >> >> >> >>   <map:serialize type="xml"/>
> >> >> >> >> </map:match>
> >> >> >> >>
> >> >> >> >>
> >> >> >> >> Within the stylesheet "cincludeFiles.xsl", I transform the
> >> >> >> >> xml stream coming from the directory generator. Iteratively
> >> >> >> >> all files are inserted by <cinclude:include src="{$path}"/>.
> >> >> >> >> An element named "file" with an attribute "path" is created.
> >> >> >> >>
> >> >> >> >> +-----------------------------------------+
> >> >> >> >>
> >> >> >> >> | stylesheet snippet "cincludeFiles.xsl"  |
> >> >> >> >>
> >> >> >> >> +-----------------------------------------+
> >> >> >> >> <xsl:template match="dir:file">
> >> >> >> >>   <xsl:param name="path"/>
> >> >> >> >>   <xsl:element name="file">
> >> >> >> >>     <xsl:attribute name="path">
> >> >> >> >>       <xsl:value-of select="$path"/>
> >> >> >> >>     </xsl:attribute>
> >> >> >> >>   <cinclude:include src="{$path}"/>
> >> >> >> >>   </xsl:element>
> >> >> >> >> </xsl:template>
> >> >> >> >>
> >> >> >> >>
> >> >> >> >> The transform outputs the following
> >> >> >> >> ([...] stands for more xml elements):
> >> >> >> >>
> >> >> >> >> [...]
> >> >> >> >>   <file path="myContentDir/file1.xml">[...]</file>
> >> >> >> >>   <file path="myContentDir/file2.xml">[...]</file>
> >> >> >> >>   <file path="myContentDir/file3.xml">[...]</file>
> >> >> >> >> [...]
> >> >> >> >>
> >> >> >> >>
> >> >> >> >> +-----------------------------------------+
> >> >> >> >>
> >> >> >> >> | stylesheet snippet "content2page.xsl"   |
> >> >> >> >>
> >> >> >> >> +-----------------------------------------+
> >> >> >> >> <xsl:template match="file">
> >> >> >> >>   <xsl:text>following file was added:</xsl:text>
> >> >> >> >>   <xsl:value-of select="./@path"/>
> >> >> >> >> </xsl:template>
> >> >> >> >>
> >> >> >> >> When I try to read the attribute value "path", my
> >> >> >> >> stylesheet outputs nothing.
> >> >> >> >>
> >> >> >> >> <xsl:template match="@path">
> >> >> >> >>   <xsl:text>following file was added:</xsl:text>
> >> >> >> >>   <xsl:value-of select="."/>
> >> >> >> >> </xsl:template>
> >> >> >> >>
> >> >> >> >> Doesn't work either.
> >> >> >> >>
> >> >> >> >> This is really urgent. Thanks for your help!
> >> >> >> >>
> >> >> >> >>
> >> >> >> >>
> >> >> >> >> ---------------------------------------------------------------
> >> >> >> >>--- --- To unsubscribe, e-mail:
> >> >> >> >> users-unsubscribe@cocoon.apache.org
> >>
> >> For
> >>
> >> >> >> >> additional commands, e-mail: users-help@cocoon.apache.org
> >> >> >> >
> >> >> >> > ----------------------------------------------------------------
> >> >> >> >--- -- To unsubscribe, e-mail:
> >> >> >> > users-unsubscribe@cocoon.apache.org
> >>
> >> For
> >>
> >> >> >> > additional commands, e-mail: users-help@cocoon.apache.org
> >> >> >>
> >> >> >> ------------------------------------------------------------------
> >> >> >>--- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For
> >> >> >> additional commands, e-mail: users-help@cocoon.apache.org
> >> >> >
> >> >> > -------------------------------------------------------------------
> >> >> >-- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For
> >> >> > additional commands, e-mail: users-help@cocoon.apache.org
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> >> >> For additional commands, e-mail: users-help@cocoon.apache.org
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> >> > For additional commands, e-mail: users-help@cocoon.apache.org
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> >> For additional commands, e-mail: users-help@cocoon.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: content aggregation + links to used files

Posted by Nicolas Toper <nt...@jouve.fr>.
Well, in that case it is b/c the ouput must be namespace less if I remember 
right
Le Mercredi 07 Janvier 2004 02:13, Joerg Heinicke a écrit :
> I don't think, simply removing all namespaces is a good solution, though
> the namespace might not be needed here. Furthermore this approach slows
> down the processing through an additional transformer step where it is
> not necessary.
>
> Her problem is the output of cincludeFiles.xsl in the default namespace.
> Matching on such elements has to be done in XSLT prefixed, i.e. the
> namespace must be bound to a prefix and then these elements can be
> matched. So the news.xsl has to be something like the following:
>
> <xsl:stylesheet version="1.0"
>      xmlns="http://www.sevencs.com"
>      xmlns:s="http://www.sevencs.com"
>      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
> ...
>
>    <xsl:template match="s:file">
>      <xsl:text>following file was added:</xsl:text>
>      <xsl:value-of select="./@path"/>
>    </xsl:template>
>
> </xsl:stylesheet>
>
> It's an XSLT FAQ and more about it can be found here:
> http://www.dpawson.co.uk/xsl/sect2/N5536.html#d5360e970.
>
> Joerg
>
> On 05.01.2004 16:04, Nicolas Toper wrote:
> > In that case use that in another transformer: it'll remove all NS from
> > the XML
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <xsl:stylesheet version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> >   <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
> >     <xsl:template match="*">
> >       <!-- remove element prefix (if any) -->
> >       <xsl:element name="{local-name()}">
> >         <!-- process attributes -->
> >         <xsl:for-each select="@*">
> >           <!-- remove attribute prefix (if any) -->
> >           <xsl:attribute name="{local-name()}">
> >             <xsl:value-of select="."/>
> >           </xsl:attribute>
> >         </xsl:for-each>
> >         <xsl:apply-templates/>
> >
> >       </xsl:element>
> >   </xsl:template>
> > </xsl:stylesheet>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: content aggregation + links to used files

Posted by Joerg Heinicke <jo...@gmx.de>.
I don't think, simply removing all namespaces is a good solution, though 
the namespace might not be needed here. Furthermore this approach slows 
down the processing through an additional transformer step where it is 
not necessary.

Her problem is the output of cincludeFiles.xsl in the default namespace. 
Matching on such elements has to be done in XSLT prefixed, i.e. the 
namespace must be bound to a prefix and then these elements can be 
matched. So the news.xsl has to be something like the following:

<xsl:stylesheet version="1.0"
     xmlns="http://www.sevencs.com"
     xmlns:s="http://www.sevencs.com"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

...

   <xsl:template match="s:file">
     <xsl:text>following file was added:</xsl:text>
     <xsl:value-of select="./@path"/>
   </xsl:template>

</xsl:stylesheet>

It's an XSLT FAQ and more about it can be found here: 
http://www.dpawson.co.uk/xsl/sect2/N5536.html#d5360e970.

Joerg

On 05.01.2004 16:04, Nicolas Toper wrote:

> In that case use that in another transformer: it'll remove all NS from the XML
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>   <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
>     <xsl:template match="*">
>       <!-- remove element prefix (if any) -->
>       <xsl:element name="{local-name()}">
>         <!-- process attributes -->
>         <xsl:for-each select="@*">
>           <!-- remove attribute prefix (if any) -->
>           <xsl:attribute name="{local-name()}">
>             <xsl:value-of select="."/>
>           </xsl:attribute>
>         </xsl:for-each>
>         <xsl:apply-templates/>
>        
>       </xsl:element>
>   </xsl:template>
> </xsl:stylesheet>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: content aggregation + links to used files

Posted by Nele Vogel <vg...@sevencs.com>.
Hi Nicolas!

I used your suggestion and removed all namespaces from the XML stream: The
XSL transform actually outputs the correct values. Can you please explain
to me, why this approach works?

Thank you very much for your help!
Nele


Nicolas wrote:
> In that case use that in another transformer: it'll remove all NS from the
> XML
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>   <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
>     <xsl:template match="*">
>       <!-- remove element prefix (if any) -->
>       <xsl:element name="{local-name()}">
>         <!-- process attributes -->
>         <xsl:for-each select="@*">
>           <!-- remove attribute prefix (if any) -->
>           <xsl:attribute name="{local-name()}">
>             <xsl:value-of select="."/>
>           </xsl:attribute>
>         </xsl:for-each>
>         <xsl:apply-templates/>
>
>       </xsl:element>
>   </xsl:template>
> </xsl:stylesheet>
>


>> Nicolas wrote:
>> > If I understand everything: you want a big XML files like that:
>> > <root>
>> > <news>
>> >    <file path="news/news1.xml">
>> >      <article>
>> >       [...]
>> >      </article>
>> >    </file>
>> >  </news>
>> >
>> > <news>
>> >    <file path="news/news1.xml">
>> >      <article>
>> >       [...]
>> >      </article>
>> >    </file>
>> >  </news>
>> > </root>
>>
>> It should look like this:
>>
>> <root>
>>   <news>
>>
>>     <file path="news/news1.xml">
>>       <article>
>>         [...]
>>       </article>
>>     </file>
>>
>>     <file path="news/news2.xml">
>>       <article>
>>         [...]
>>       </article>
>>     </file>
>>
>>   </news>
>> </root>
>>
>> > And your problem is the XML file generated is transformed badly?
>>
>> Yes, exactly. Koen and Simon pointed out, it might be a namespace
>> problem.
>>
>> Thanks a lot for your help!
>> Nele.
>>
>> >> Nicolas wrote:
>> >> > it depends on which information you need exactly: the name of the
>> >>
>> >> file:
>> >> > put it as a parameter into the URL and pass it to the XSL
>> >>
>> >> I need the path (relative or absolute) to the processed file.
>> >>
>> >> I am able to extract the relative path inside the first XSL transform
>> >> (cincludeFiles.xsl):
>> >>
>> >>   <xsl:template match="dir:directory">
>> >>     <xsl:param name="path"/>
>> >>     <xsl:apply-templates>
>> >>       <xsl:with-param name="path">
>> >>         <xsl:value-of select="concat($path,./@name,'/')"/>
>> >>       </xsl:with-param>
>> >>     </xsl:apply-templates>
>> >>   </xsl:template>
>> >>
>> >>
>> >>   <xsl:template match="dir:file">
>> >>     <xsl:param name="path"/>
>> >>     <xsl:element name="file">
>> >>       <xsl:attribute name="path">
>> >>         <xsl:value-of select="concat($path,./@name)"/>
>> >>       </xsl:attribute>
>> >>       <cinclude:include src="{concat($path,./@name)}"/>
>> >>     </xsl:element>
>> >>   </xsl:template>
>> >>
>> >> The output looks like this:
>> >>
>> >> <news>
>> >>   <file path="news/news1.xml">
>> >>     <article>
>> >>      [...]
>> >>     </article>
>> >>   </file>
>> >> </news>
>> >>
>> >> The path inside element <file> is correct.
>> >>
>> >> However, when I try to process the XML stream for a second time, the
>> >> templates within "content2page.xsl" neither match element <news> nor
>> >> element <file>. Why?
>> >>
>> >> Thank you for your help, Nicolas!
>> >> Nele
>> >>
>> >> >> Nicolas wrote:
>> >> >> > If the orginal docs aren't XML you should have a look at
>> Chaperon
>> >> >>
>> >> >> The original documents are also XML documents.
>> >> >>
>> >> >> My problem is linking an element with the file it originates from.
>> >> >> Is it possible to store the information the directory generator
>> >>
>> >> extracts
>> >>
>> >> >> about my directory structure - maybe as a file?
>> >> >>
>> >> >> Thank you for your response!
>> >> >> Nele.
>> >> >>
>> >> >> >> Hi all!
>> >> >> >>
>> >> >> >> I want to create an xml document by extracting
>> >> >> >> defined elements from files conforming to a
>> >> >> >> known format. When assembling the document I need
>> >> >> >> to keep in mind which element originates from
>> >> >> >> which file to be able to link the element with
>> >> >> >> the corresponding file after transformation into
>> >> >> >> HTML. The resulting HTML document consists - among
>> >> >> >> other things - of links to all processed files.
>> >> >> >>
>> >> >> >> How do I achieve this with Cocoon?
>> >> >> >>
>> >> >> >> All suggestions will be appreciated!
>> >> >> >> Thanks in advance,
>> >> >> >> Nele.
>> >> >> >>
>> >> >> >>
>> >> >> >> I tried the following using a directory generator
>> >> >> >> and aggregation, but it doesn't work.
>> >> >> >>
>> >> >> >> +-----------------------------------------+
>> >> >> >>
>> >> >> >> | directories within COCOON context       |
>> >> >> >>
>> >> >> >> +-----------------------------------------+
>> >> >> >> +---myContentDir/
>> >> >> >>     +---file1.xml
>> >> >> >>     +---file2.xml
>> >> >> >>     +---file3.xml
>> >> >> >>
>> >> >> >>
>> >> >> >> I aggregate the files in "myContentDir" using the
>> >> >> >> following sitemap snippet:
>> >> >> >>
>> >> >> >> +-----------------------------------------+
>> >> >> >>
>> >> >> >> | sitemap snippet                         |
>> >> >> >>
>> >> >> >> +-----------------------------------------+
>> >> >> >> <map:match pattern="content">
>> >> >> >>   <map:generate src="/myContentDir" type="directory">
>> >> >> >>     <map:parameter name="depth" value="1"/>
>> >> >> >>   </map:generate>
>> >> >> >>   <map:transform src="cincludeFiles.xsl">
>> >> >> >>     <map:parameter name="part" value="content"/>
>> >> >> >>   </map:transform>
>> >> >> >>   <map:transform type="cinclude"/>
>> >> >> >>   <map:transform src="content2page.xsl"/>
>> >> >> >>   <map:serialize type="xml"/>
>> >> >> >> </map:match>
>> >> >> >>
>> >> >> >>
>> >> >> >> Within the stylesheet "cincludeFiles.xsl", I transform the
>> >> >> >> xml stream coming from the directory generator. Iteratively
>> >> >> >> all files are inserted by <cinclude:include src="{$path}"/>.
>> >> >> >> An element named "file" with an attribute "path" is created.
>> >> >> >>
>> >> >> >> +-----------------------------------------+
>> >> >> >>
>> >> >> >> | stylesheet snippet "cincludeFiles.xsl"  |
>> >> >> >>
>> >> >> >> +-----------------------------------------+
>> >> >> >> <xsl:template match="dir:file">
>> >> >> >>   <xsl:param name="path"/>
>> >> >> >>   <xsl:element name="file">
>> >> >> >>     <xsl:attribute name="path">
>> >> >> >>       <xsl:value-of select="$path"/>
>> >> >> >>     </xsl:attribute>
>> >> >> >>   <cinclude:include src="{$path}"/>
>> >> >> >>   </xsl:element>
>> >> >> >> </xsl:template>
>> >> >> >>
>> >> >> >>
>> >> >> >> The transform outputs the following
>> >> >> >> ([...] stands for more xml elements):
>> >> >> >>
>> >> >> >> [...]
>> >> >> >>   <file path="myContentDir/file1.xml">[...]</file>
>> >> >> >>   <file path="myContentDir/file2.xml">[...]</file>
>> >> >> >>   <file path="myContentDir/file3.xml">[...]</file>
>> >> >> >> [...]
>> >> >> >>
>> >> >> >>
>> >> >> >> +-----------------------------------------+
>> >> >> >>
>> >> >> >> | stylesheet snippet "content2page.xsl"   |
>> >> >> >>
>> >> >> >> +-----------------------------------------+
>> >> >> >> <xsl:template match="file">
>> >> >> >>   <xsl:text>following file was added:</xsl:text>
>> >> >> >>   <xsl:value-of select="./@path"/>
>> >> >> >> </xsl:template>
>> >> >> >>
>> >> >> >> When I try to read the attribute value "path", my
>> >> >> >> stylesheet outputs nothing.
>> >> >> >>
>> >> >> >> <xsl:template match="@path">
>> >> >> >>   <xsl:text>following file was added:</xsl:text>
>> >> >> >>   <xsl:value-of select="."/>
>> >> >> >> </xsl:template>
>> >> >> >>
>> >> >> >> Doesn't work either.
>> >> >> >>
>> >> >> >> This is really urgent. Thanks for your help!
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >> ------------------------------------------------------------------
>> >> >> >>--- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For
>> >> >> >> additional commands, e-mail: users-help@cocoon.apache.org
>> >> >> >
>> >> >> > -------------------------------------------------------------------
>> >> >> >-- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For
>> >> >> > additional commands, e-mail: users-help@cocoon.apache.org
>> >> >>
>> >> >> ---------------------------------------------------------------------
>> >> >> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> >> >> For additional commands, e-mail: users-help@cocoon.apache.org
>> >> >
>> >> > ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> >> > For additional commands, e-mail: users-help@cocoon.apache.org
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> >> For additional commands, e-mail: users-help@cocoon.apache.org
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> > For additional commands, e-mail: users-help@cocoon.apache.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: content aggregation + links to used files

Posted by Nicolas Toper <nt...@jouve.fr>.
In that case use that in another transformer: it'll remove all NS from the XML

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="*">
      <!-- remove element prefix (if any) -->
      <xsl:element name="{local-name()}">
        <!-- process attributes -->
        <xsl:for-each select="@*">
          <!-- remove attribute prefix (if any) -->
          <xsl:attribute name="{local-name()}">
            <xsl:value-of select="."/>
          </xsl:attribute>
        </xsl:for-each>
        <xsl:apply-templates/>
       
      </xsl:element>
  </xsl:template>
</xsl:stylesheet>

Le Lundi 05 Janvier 2004 15:58, Nele Vogel a écrit :
> Hello Nicolas!
>
> Nicolas wrote:
> > If I understand everything: you want a big XML files like that:
> > <root>
> > <news>
> >    <file path="news/news1.xml">
> >      <article>
> >       [...]
> >      </article>
> >    </file>
> >  </news>
> >
> > <news>
> >    <file path="news/news1.xml">
> >      <article>
> >       [...]
> >      </article>
> >    </file>
> >  </news>
> > </root>
>
> It should look like this:
>
> <root>
>   <news>
>
>     <file path="news/news1.xml">
>       <article>
>         [...]
>       </article>
>     </file>
>
>     <file path="news/news2.xml">
>       <article>
>         [...]
>       </article>
>     </file>
>
>   </news>
> </root>
>
> > And your problem is the XML file generated is transformed badly?
>
> Yes, exactly. Koen and Simon pointed out, it might be a namespace problem.
>
> Thanks a lot for your help!
> Nele.
>
> >> Nicolas wrote:
> >> > it depends on which information you need exactly: the name of the
> >>
> >> file:
> >> > put it as a parameter into the URL and pass it to the XSL
> >>
> >> I need the path (relative or absolute) to the processed file.
> >>
> >> I am able to extract the relative path inside the first XSL transform
> >> (cincludeFiles.xsl):
> >>
> >>   <xsl:template match="dir:directory">
> >>     <xsl:param name="path"/>
> >>     <xsl:apply-templates>
> >>       <xsl:with-param name="path">
> >>         <xsl:value-of select="concat($path,./@name,'/')"/>
> >>       </xsl:with-param>
> >>     </xsl:apply-templates>
> >>   </xsl:template>
> >>
> >>
> >>   <xsl:template match="dir:file">
> >>     <xsl:param name="path"/>
> >>     <xsl:element name="file">
> >>       <xsl:attribute name="path">
> >>         <xsl:value-of select="concat($path,./@name)"/>
> >>       </xsl:attribute>
> >>       <cinclude:include src="{concat($path,./@name)}"/>
> >>     </xsl:element>
> >>   </xsl:template>
> >>
> >> The output looks like this:
> >>
> >> <news>
> >>   <file path="news/news1.xml">
> >>     <article>
> >>      [...]
> >>     </article>
> >>   </file>
> >> </news>
> >>
> >> The path inside element <file> is correct.
> >>
> >> However, when I try to process the XML stream for a second time, the
> >> templates within "content2page.xsl" neither match element <news> nor
> >> element <file>. Why?
> >>
> >> Thank you for your help, Nicolas!
> >> Nele
> >>
> >> >> Nicolas wrote:
> >> >> > If the orginal docs aren't XML you should have a look at Chaperon
> >> >>
> >> >> The original documents are also XML documents.
> >> >>
> >> >> My problem is linking an element with the file it originates from.
> >> >> Is it possible to store the information the directory generator
> >>
> >> extracts
> >>
> >> >> about my directory structure - maybe as a file?
> >> >>
> >> >> Thank you for your response!
> >> >> Nele.
> >> >>
> >> >> >> Hi all!
> >> >> >>
> >> >> >> I want to create an xml document by extracting
> >> >> >> defined elements from files conforming to a
> >> >> >> known format. When assembling the document I need
> >> >> >> to keep in mind which element originates from
> >> >> >> which file to be able to link the element with
> >> >> >> the corresponding file after transformation into
> >> >> >> HTML. The resulting HTML document consists - among
> >> >> >> other things - of links to all processed files.
> >> >> >>
> >> >> >> How do I achieve this with Cocoon?
> >> >> >>
> >> >> >> All suggestions will be appreciated!
> >> >> >> Thanks in advance,
> >> >> >> Nele.
> >> >> >>
> >> >> >>
> >> >> >> I tried the following using a directory generator
> >> >> >> and aggregation, but it doesn't work.
> >> >> >>
> >> >> >> +-----------------------------------------+
> >> >> >>
> >> >> >> | directories within COCOON context       |
> >> >> >>
> >> >> >> +-----------------------------------------+
> >> >> >> +---myContentDir/
> >> >> >>     +---file1.xml
> >> >> >>     +---file2.xml
> >> >> >>     +---file3.xml
> >> >> >>
> >> >> >>
> >> >> >> I aggregate the files in "myContentDir" using the
> >> >> >> following sitemap snippet:
> >> >> >>
> >> >> >> +-----------------------------------------+
> >> >> >>
> >> >> >> | sitemap snippet                         |
> >> >> >>
> >> >> >> +-----------------------------------------+
> >> >> >> <map:match pattern="content">
> >> >> >>   <map:generate src="/myContentDir" type="directory">
> >> >> >>     <map:parameter name="depth" value="1"/>
> >> >> >>   </map:generate>
> >> >> >>   <map:transform src="cincludeFiles.xsl">
> >> >> >>     <map:parameter name="part" value="content"/>
> >> >> >>   </map:transform>
> >> >> >>   <map:transform type="cinclude"/>
> >> >> >>   <map:transform src="content2page.xsl"/>
> >> >> >>   <map:serialize type="xml"/>
> >> >> >> </map:match>
> >> >> >>
> >> >> >>
> >> >> >> Within the stylesheet "cincludeFiles.xsl", I transform the
> >> >> >> xml stream coming from the directory generator. Iteratively
> >> >> >> all files are inserted by <cinclude:include src="{$path}"/>.
> >> >> >> An element named "file" with an attribute "path" is created.
> >> >> >>
> >> >> >> +-----------------------------------------+
> >> >> >>
> >> >> >> | stylesheet snippet "cincludeFiles.xsl"  |
> >> >> >>
> >> >> >> +-----------------------------------------+
> >> >> >> <xsl:template match="dir:file">
> >> >> >>   <xsl:param name="path"/>
> >> >> >>   <xsl:element name="file">
> >> >> >>     <xsl:attribute name="path">
> >> >> >>       <xsl:value-of select="$path"/>
> >> >> >>     </xsl:attribute>
> >> >> >>   <cinclude:include src="{$path}"/>
> >> >> >>   </xsl:element>
> >> >> >> </xsl:template>
> >> >> >>
> >> >> >>
> >> >> >> The transform outputs the following
> >> >> >> ([...] stands for more xml elements):
> >> >> >>
> >> >> >> [...]
> >> >> >>   <file path="myContentDir/file1.xml">[...]</file>
> >> >> >>   <file path="myContentDir/file2.xml">[...]</file>
> >> >> >>   <file path="myContentDir/file3.xml">[...]</file>
> >> >> >> [...]
> >> >> >>
> >> >> >>
> >> >> >> +-----------------------------------------+
> >> >> >>
> >> >> >> | stylesheet snippet "content2page.xsl"   |
> >> >> >>
> >> >> >> +-----------------------------------------+
> >> >> >> <xsl:template match="file">
> >> >> >>   <xsl:text>following file was added:</xsl:text>
> >> >> >>   <xsl:value-of select="./@path"/>
> >> >> >> </xsl:template>
> >> >> >>
> >> >> >> When I try to read the attribute value "path", my
> >> >> >> stylesheet outputs nothing.
> >> >> >>
> >> >> >> <xsl:template match="@path">
> >> >> >>   <xsl:text>following file was added:</xsl:text>
> >> >> >>   <xsl:value-of select="."/>
> >> >> >> </xsl:template>
> >> >> >>
> >> >> >> Doesn't work either.
> >> >> >>
> >> >> >> This is really urgent. Thanks for your help!
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >> ------------------------------------------------------------------
> >> >> >>--- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For
> >> >> >> additional commands, e-mail: users-help@cocoon.apache.org
> >> >> >
> >> >> > -------------------------------------------------------------------
> >> >> >-- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For
> >> >> > additional commands, e-mail: users-help@cocoon.apache.org
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> >> >> For additional commands, e-mail: users-help@cocoon.apache.org
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> >> > For additional commands, e-mail: users-help@cocoon.apache.org
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> >> For additional commands, e-mail: users-help@cocoon.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: content aggregation + links to used files

Posted by Nele Vogel <vg...@sevencs.com>.
Hello Nicolas!

Nicolas wrote:
> If I understand everything: you want a big XML files like that:
> <root>
> <news>
>    <file path="news/news1.xml">
>      <article>
>       [...]
>      </article>
>    </file>
>  </news>
>
> <news>
>    <file path="news/news1.xml">
>      <article>
>       [...]
>      </article>
>    </file>
>  </news>
> </root>
>

It should look like this:

<root>
  <news>

    <file path="news/news1.xml">
      <article>
        [...]
      </article>
    </file>

    <file path="news/news2.xml">
      <article>
        [...]
      </article>
    </file>

  </news>
</root>

> And your problem is the XML file generated is transformed badly?
Yes, exactly. Koen and Simon pointed out, it might be a namespace problem.

Thanks a lot for your help!
Nele.



>> Nicolas wrote:
>> > it depends on which information you need exactly: the name of the
>> file:
>> > put it as a parameter into the URL and pass it to the XSL
>>
>> I need the path (relative or absolute) to the processed file.
>>
>> I am able to extract the relative path inside the first XSL transform
>> (cincludeFiles.xsl):
>>
>>   <xsl:template match="dir:directory">
>>     <xsl:param name="path"/>
>>     <xsl:apply-templates>
>>       <xsl:with-param name="path">
>>         <xsl:value-of select="concat($path,./@name,'/')"/>
>>       </xsl:with-param>
>>     </xsl:apply-templates>
>>   </xsl:template>
>>
>>
>>   <xsl:template match="dir:file">
>>     <xsl:param name="path"/>
>>     <xsl:element name="file">
>>       <xsl:attribute name="path">
>>         <xsl:value-of select="concat($path,./@name)"/>
>>       </xsl:attribute>
>>       <cinclude:include src="{concat($path,./@name)}"/>
>>     </xsl:element>
>>   </xsl:template>
>>
>> The output looks like this:
>>
>> <news>
>>   <file path="news/news1.xml">
>>     <article>
>>      [...]
>>     </article>
>>   </file>
>> </news>
>>
>> The path inside element <file> is correct.
>>
>> However, when I try to process the XML stream for a second time, the
>> templates within "content2page.xsl" neither match element <news> nor
>> element <file>. Why?
>>
>> Thank you for your help, Nicolas!
>> Nele
>>
>> >> Nicolas wrote:
>> >> > If the orginal docs aren't XML you should have a look at Chaperon
>> >>
>> >> The original documents are also XML documents.
>> >>
>> >> My problem is linking an element with the file it originates from.
>> >> Is it possible to store the information the directory generator
>> extracts
>> >> about my directory structure - maybe as a file?
>> >>
>> >> Thank you for your response!
>> >> Nele.
>> >>
>> >> >> Hi all!
>> >> >>
>> >> >> I want to create an xml document by extracting
>> >> >> defined elements from files conforming to a
>> >> >> known format. When assembling the document I need
>> >> >> to keep in mind which element originates from
>> >> >> which file to be able to link the element with
>> >> >> the corresponding file after transformation into
>> >> >> HTML. The resulting HTML document consists - among
>> >> >> other things - of links to all processed files.
>> >> >>
>> >> >> How do I achieve this with Cocoon?
>> >> >>
>> >> >> All suggestions will be appreciated!
>> >> >> Thanks in advance,
>> >> >> Nele.
>> >> >>
>> >> >>
>> >> >> I tried the following using a directory generator
>> >> >> and aggregation, but it doesn't work.
>> >> >>
>> >> >> +-----------------------------------------+
>> >> >>
>> >> >> | directories within COCOON context       |
>> >> >>
>> >> >> +-----------------------------------------+
>> >> >> +---myContentDir/
>> >> >>     +---file1.xml
>> >> >>     +---file2.xml
>> >> >>     +---file3.xml
>> >> >>
>> >> >>
>> >> >> I aggregate the files in "myContentDir" using the
>> >> >> following sitemap snippet:
>> >> >>
>> >> >> +-----------------------------------------+
>> >> >>
>> >> >> | sitemap snippet                         |
>> >> >>
>> >> >> +-----------------------------------------+
>> >> >> <map:match pattern="content">
>> >> >>   <map:generate src="/myContentDir" type="directory">
>> >> >>     <map:parameter name="depth" value="1"/>
>> >> >>   </map:generate>
>> >> >>   <map:transform src="cincludeFiles.xsl">
>> >> >>     <map:parameter name="part" value="content"/>
>> >> >>   </map:transform>
>> >> >>   <map:transform type="cinclude"/>
>> >> >>   <map:transform src="content2page.xsl"/>
>> >> >>   <map:serialize type="xml"/>
>> >> >> </map:match>
>> >> >>
>> >> >>
>> >> >> Within the stylesheet "cincludeFiles.xsl", I transform the
>> >> >> xml stream coming from the directory generator. Iteratively
>> >> >> all files are inserted by <cinclude:include src="{$path}"/>.
>> >> >> An element named "file" with an attribute "path" is created.
>> >> >>
>> >> >> +-----------------------------------------+
>> >> >>
>> >> >> | stylesheet snippet "cincludeFiles.xsl"  |
>> >> >>
>> >> >> +-----------------------------------------+
>> >> >> <xsl:template match="dir:file">
>> >> >>   <xsl:param name="path"/>
>> >> >>   <xsl:element name="file">
>> >> >>     <xsl:attribute name="path">
>> >> >>       <xsl:value-of select="$path"/>
>> >> >>     </xsl:attribute>
>> >> >>   <cinclude:include src="{$path}"/>
>> >> >>   </xsl:element>
>> >> >> </xsl:template>
>> >> >>
>> >> >>
>> >> >> The transform outputs the following
>> >> >> ([...] stands for more xml elements):
>> >> >>
>> >> >> [...]
>> >> >>   <file path="myContentDir/file1.xml">[...]</file>
>> >> >>   <file path="myContentDir/file2.xml">[...]</file>
>> >> >>   <file path="myContentDir/file3.xml">[...]</file>
>> >> >> [...]
>> >> >>
>> >> >>
>> >> >> +-----------------------------------------+
>> >> >>
>> >> >> | stylesheet snippet "content2page.xsl"   |
>> >> >>
>> >> >> +-----------------------------------------+
>> >> >> <xsl:template match="file">
>> >> >>   <xsl:text>following file was added:</xsl:text>
>> >> >>   <xsl:value-of select="./@path"/>
>> >> >> </xsl:template>
>> >> >>
>> >> >> When I try to read the attribute value "path", my
>> >> >> stylesheet outputs nothing.
>> >> >>
>> >> >> <xsl:template match="@path">
>> >> >>   <xsl:text>following file was added:</xsl:text>
>> >> >>   <xsl:value-of select="."/>
>> >> >> </xsl:template>
>> >> >>
>> >> >> Doesn't work either.
>> >> >>
>> >> >> This is really urgent. Thanks for your help!
>> >> >>
>> >> >>
>> >> >>
>> >> >> ---------------------------------------------------------------------
>> >> >> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> >> >> For additional commands, e-mail: users-help@cocoon.apache.org
>> >> >
>> >> > ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> >> > For additional commands, e-mail: users-help@cocoon.apache.org
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> >> For additional commands, e-mail: users-help@cocoon.apache.org
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> > For additional commands, e-mail: users-help@cocoon.apache.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: content aggregation + links to used files

Posted by Nicolas Toper <nt...@jouve.fr>.
Hi,
If I understand everything: you want a big XML files like that:
<root>
<news>
   <file path="news/news1.xml">
     <article>
      [...]
     </article>
   </file>
 </news>

<news>
   <file path="news/news1.xml">
     <article>
      [...]
     </article>
   </file>
 </news>
</root>

And your problem is the XML file generated is transformed badly?

Le Lundi 05 Janvier 2004 14:50, Nele Vogel a écrit :
> Hello Nicolas!
>
> Nicolas wrote:
> > it depends on which information you need exactly: the name of the file:
> > put it as a parameter into the URL and pass it to the XSL
>
> I need the path (relative or absolute) to the processed file.
>
> I am able to extract the relative path inside the first XSL transform
> (cincludeFiles.xsl):
>
>   <xsl:template match="dir:directory">
>     <xsl:param name="path"/>
>     <xsl:apply-templates>
>       <xsl:with-param name="path">
>         <xsl:value-of select="concat($path,./@name,'/')"/>
>       </xsl:with-param>
>     </xsl:apply-templates>
>   </xsl:template>
>
>
>   <xsl:template match="dir:file">
>     <xsl:param name="path"/>
>     <xsl:element name="file">
>       <xsl:attribute name="path">
>         <xsl:value-of select="concat($path,./@name)"/>
>       </xsl:attribute>
>       <cinclude:include src="{concat($path,./@name)}"/>
>     </xsl:element>
>   </xsl:template>
>
> The output looks like this:
>
> <news>
>   <file path="news/news1.xml">
>     <article>
>      [...]
>     </article>
>   </file>
> </news>
>
> The path inside element <file> is correct.
>
> However, when I try to process the XML stream for a second time, the
> templates within "content2page.xsl" neither match element <news> nor
> element <file>. Why?
>
> Thank you for your help, Nicolas!
> Nele
>
> >> Nicolas wrote:
> >> > If the orginal docs aren't XML you should have a look at Chaperon
> >>
> >> The original documents are also XML documents.
> >>
> >> My problem is linking an element with the file it originates from.
> >> Is it possible to store the information the directory generator extracts
> >> about my directory structure - maybe as a file?
> >>
> >> Thank you for your response!
> >> Nele.
> >>
> >> >> Hi all!
> >> >>
> >> >> I want to create an xml document by extracting
> >> >> defined elements from files conforming to a
> >> >> known format. When assembling the document I need
> >> >> to keep in mind which element originates from
> >> >> which file to be able to link the element with
> >> >> the corresponding file after transformation into
> >> >> HTML. The resulting HTML document consists - among
> >> >> other things - of links to all processed files.
> >> >>
> >> >> How do I achieve this with Cocoon?
> >> >>
> >> >> All suggestions will be appreciated!
> >> >> Thanks in advance,
> >> >> Nele.
> >> >>
> >> >>
> >> >> I tried the following using a directory generator
> >> >> and aggregation, but it doesn't work.
> >> >>
> >> >> +-----------------------------------------+
> >> >>
> >> >> | directories within COCOON context       |
> >> >>
> >> >> +-----------------------------------------+
> >> >> +---myContentDir/
> >> >>     +---file1.xml
> >> >>     +---file2.xml
> >> >>     +---file3.xml
> >> >>
> >> >>
> >> >> I aggregate the files in "myContentDir" using the
> >> >> following sitemap snippet:
> >> >>
> >> >> +-----------------------------------------+
> >> >>
> >> >> | sitemap snippet                         |
> >> >>
> >> >> +-----------------------------------------+
> >> >> <map:match pattern="content">
> >> >>   <map:generate src="/myContentDir" type="directory">
> >> >>     <map:parameter name="depth" value="1"/>
> >> >>   </map:generate>
> >> >>   <map:transform src="cincludeFiles.xsl">
> >> >>     <map:parameter name="part" value="content"/>
> >> >>   </map:transform>
> >> >>   <map:transform type="cinclude"/>
> >> >>   <map:transform src="content2page.xsl"/>
> >> >>   <map:serialize type="xml"/>
> >> >> </map:match>
> >> >>
> >> >>
> >> >> Within the stylesheet "cincludeFiles.xsl", I transform the
> >> >> xml stream coming from the directory generator. Iteratively
> >> >> all files are inserted by <cinclude:include src="{$path}"/>.
> >> >> An element named "file" with an attribute "path" is created.
> >> >>
> >> >> +-----------------------------------------+
> >> >>
> >> >> | stylesheet snippet "cincludeFiles.xsl"  |
> >> >>
> >> >> +-----------------------------------------+
> >> >> <xsl:template match="dir:file">
> >> >>   <xsl:param name="path"/>
> >> >>   <xsl:element name="file">
> >> >>     <xsl:attribute name="path">
> >> >>       <xsl:value-of select="$path"/>
> >> >>     </xsl:attribute>
> >> >>   <cinclude:include src="{$path}"/>
> >> >>   </xsl:element>
> >> >> </xsl:template>
> >> >>
> >> >>
> >> >> The transform outputs the following
> >> >> ([...] stands for more xml elements):
> >> >>
> >> >> [...]
> >> >>   <file path="myContentDir/file1.xml">[...]</file>
> >> >>   <file path="myContentDir/file2.xml">[...]</file>
> >> >>   <file path="myContentDir/file3.xml">[...]</file>
> >> >> [...]
> >> >>
> >> >>
> >> >> +-----------------------------------------+
> >> >>
> >> >> | stylesheet snippet "content2page.xsl"   |
> >> >>
> >> >> +-----------------------------------------+
> >> >> <xsl:template match="file">
> >> >>   <xsl:text>following file was added:</xsl:text>
> >> >>   <xsl:value-of select="./@path"/>
> >> >> </xsl:template>
> >> >>
> >> >> When I try to read the attribute value "path", my
> >> >> stylesheet outputs nothing.
> >> >>
> >> >> <xsl:template match="@path">
> >> >>   <xsl:text>following file was added:</xsl:text>
> >> >>   <xsl:value-of select="."/>
> >> >> </xsl:template>
> >> >>
> >> >> Doesn't work either.
> >> >>
> >> >> This is really urgent. Thanks for your help!
> >> >>
> >> >>
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> >> >> For additional commands, e-mail: users-help@cocoon.apache.org
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> >> > For additional commands, e-mail: users-help@cocoon.apache.org
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> >> For additional commands, e-mail: users-help@cocoon.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: content aggregation + links to used files

Posted by Nele Vogel <vg...@sevencs.com>.
Hello Nicolas!

Nicolas wrote:
> it depends on which information you need exactly: the name of the file:
> put it as a parameter into the URL and pass it to the XSL
I need the path (relative or absolute) to the processed file.

I am able to extract the relative path inside the first XSL transform
(cincludeFiles.xsl):

  <xsl:template match="dir:directory">
    <xsl:param name="path"/>
    <xsl:apply-templates>
      <xsl:with-param name="path">
        <xsl:value-of select="concat($path,./@name,'/')"/>
      </xsl:with-param>
    </xsl:apply-templates>
  </xsl:template>


  <xsl:template match="dir:file">
    <xsl:param name="path"/>
    <xsl:element name="file">
      <xsl:attribute name="path">
        <xsl:value-of select="concat($path,./@name)"/>
      </xsl:attribute>
      <cinclude:include src="{concat($path,./@name)}"/>
    </xsl:element>
  </xsl:template>

The output looks like this:

<news>
  <file path="news/news1.xml">
    <article>
     [...]
    </article>
  </file>
</news>

The path inside element <file> is correct.

However, when I try to process the XML stream for a second time, the
templates within "content2page.xsl" neither match element <news> nor
element <file>. Why?

Thank you for your help, Nicolas!
Nele

>> Nicolas wrote:
>> > If the orginal docs aren't XML you should have a look at Chaperon
>>
>> The original documents are also XML documents.
>>
>> My problem is linking an element with the file it originates from.
>> Is it possible to store the information the directory generator extracts
>> about my directory structure - maybe as a file?
>>
>> Thank you for your response!
>> Nele.
>>
>> >> Hi all!
>> >>
>> >> I want to create an xml document by extracting
>> >> defined elements from files conforming to a
>> >> known format. When assembling the document I need
>> >> to keep in mind which element originates from
>> >> which file to be able to link the element with
>> >> the corresponding file after transformation into
>> >> HTML. The resulting HTML document consists - among
>> >> other things - of links to all processed files.
>> >>
>> >> How do I achieve this with Cocoon?
>> >>
>> >> All suggestions will be appreciated!
>> >> Thanks in advance,
>> >> Nele.
>> >>
>> >>
>> >> I tried the following using a directory generator
>> >> and aggregation, but it doesn't work.
>> >>
>> >> +-----------------------------------------+
>> >>
>> >> | directories within COCOON context       |
>> >>
>> >> +-----------------------------------------+
>> >> +---myContentDir/
>> >>     +---file1.xml
>> >>     +---file2.xml
>> >>     +---file3.xml
>> >>
>> >>
>> >> I aggregate the files in "myContentDir" using the
>> >> following sitemap snippet:
>> >>
>> >> +-----------------------------------------+
>> >>
>> >> | sitemap snippet                         |
>> >>
>> >> +-----------------------------------------+
>> >> <map:match pattern="content">
>> >>   <map:generate src="/myContentDir" type="directory">
>> >>     <map:parameter name="depth" value="1"/>
>> >>   </map:generate>
>> >>   <map:transform src="cincludeFiles.xsl">
>> >>     <map:parameter name="part" value="content"/>
>> >>   </map:transform>
>> >>   <map:transform type="cinclude"/>
>> >>   <map:transform src="content2page.xsl"/>
>> >>   <map:serialize type="xml"/>
>> >> </map:match>
>> >>
>> >>
>> >> Within the stylesheet "cincludeFiles.xsl", I transform the
>> >> xml stream coming from the directory generator. Iteratively
>> >> all files are inserted by <cinclude:include src="{$path}"/>.
>> >> An element named "file" with an attribute "path" is created.
>> >>
>> >> +-----------------------------------------+
>> >>
>> >> | stylesheet snippet "cincludeFiles.xsl"  |
>> >>
>> >> +-----------------------------------------+
>> >> <xsl:template match="dir:file">
>> >>   <xsl:param name="path"/>
>> >>   <xsl:element name="file">
>> >>     <xsl:attribute name="path">
>> >>       <xsl:value-of select="$path"/>
>> >>     </xsl:attribute>
>> >>   <cinclude:include src="{$path}"/>
>> >>   </xsl:element>
>> >> </xsl:template>
>> >>
>> >>
>> >> The transform outputs the following
>> >> ([...] stands for more xml elements):
>> >>
>> >> [...]
>> >>   <file path="myContentDir/file1.xml">[...]</file>
>> >>   <file path="myContentDir/file2.xml">[...]</file>
>> >>   <file path="myContentDir/file3.xml">[...]</file>
>> >> [...]
>> >>
>> >>
>> >> +-----------------------------------------+
>> >>
>> >> | stylesheet snippet "content2page.xsl"   |
>> >>
>> >> +-----------------------------------------+
>> >> <xsl:template match="file">
>> >>   <xsl:text>following file was added:</xsl:text>
>> >>   <xsl:value-of select="./@path"/>
>> >> </xsl:template>
>> >>
>> >> When I try to read the attribute value "path", my
>> >> stylesheet outputs nothing.
>> >>
>> >> <xsl:template match="@path">
>> >>   <xsl:text>following file was added:</xsl:text>
>> >>   <xsl:value-of select="."/>
>> >> </xsl:template>
>> >>
>> >> Doesn't work either.
>> >>
>> >> This is really urgent. Thanks for your help!
>> >>
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> >> For additional commands, e-mail: users-help@cocoon.apache.org
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> > For additional commands, e-mail: users-help@cocoon.apache.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: content aggregation + links to used files

Posted by Nicolas Toper <nt...@jouve.fr>.
it depends on which information you need exactly: the name of the file: put it 
as a parameter into the URL and pass it to the XSL
Le Lundi 05 Janvier 2004 13:36, vg@sevencs.com a écrit :
> Hello Nicolas!
> Hi everybody!
>
> Nicolas wrote:
> > If the orginal docs aren't XML you should have a look at Chaperon
>
> The original documents are also XML documents.
>
> My problem is linking an element with the file it originates from.
> Is it possible to store the information the directory generator extracts
> about my directory structure - maybe as a file?
>
> Thank you for your response!
> Nele.
>
> >> Hi all!
> >>
> >> I want to create an xml document by extracting
> >> defined elements from files conforming to a
> >> known format. When assembling the document I need
> >> to keep in mind which element originates from
> >> which file to be able to link the element with
> >> the corresponding file after transformation into
> >> HTML. The resulting HTML document consists - among
> >> other things - of links to all processed files.
> >>
> >> How do I achieve this with Cocoon?
> >>
> >> All suggestions will be appreciated!
> >> Thanks in advance,
> >> Nele.
> >>
> >>
> >> I tried the following using a directory generator
> >> and aggregation, but it doesn't work.
> >>
> >> +-----------------------------------------+
> >>
> >> | directories within COCOON context       |
> >>
> >> +-----------------------------------------+
> >> +---myContentDir/
> >>     +---file1.xml
> >>     +---file2.xml
> >>     +---file3.xml
> >>
> >>
> >> I aggregate the files in "myContentDir" using the
> >> following sitemap snippet:
> >>
> >> +-----------------------------------------+
> >>
> >> | sitemap snippet                         |
> >>
> >> +-----------------------------------------+
> >> <map:match pattern="content">
> >>   <map:generate src="/myContentDir" type="directory">
> >>     <map:parameter name="depth" value="1"/>
> >>   </map:generate>
> >>   <map:transform src="cincludeFiles.xsl">
> >>     <map:parameter name="part" value="content"/>
> >>   </map:transform>
> >>   <map:transform type="cinclude"/>
> >>   <map:transform src="content2page.xsl"/>
> >>   <map:serialize type="xml"/>
> >> </map:match>
> >>
> >>
> >> Within the stylesheet "cincludeFiles.xsl", I transform the
> >> xml stream coming from the directory generator. Iteratively
> >> all files are inserted by <cinclude:include src="{$path}"/>.
> >> An element named "file" with an attribute "path" is created.
> >>
> >> +-----------------------------------------+
> >>
> >> | stylesheet snippet "cincludeFiles.xsl"  |
> >>
> >> +-----------------------------------------+
> >> <xsl:template match="dir:file">
> >>   <xsl:param name="path"/>
> >>   <xsl:element name="file">
> >>     <xsl:attribute name="path">
> >>       <xsl:value-of select="$path"/>
> >>     </xsl:attribute>
> >>   <cinclude:include src="{$path}"/>
> >>   </xsl:element>
> >> </xsl:template>
> >>
> >>
> >> The transform outputs the following
> >> ([...] stands for more xml elements):
> >>
> >> [...]
> >>   <file path="myContentDir/file1.xml">[...]</file>
> >>   <file path="myContentDir/file2.xml">[...]</file>
> >>   <file path="myContentDir/file3.xml">[...]</file>
> >> [...]
> >>
> >>
> >> +-----------------------------------------+
> >>
> >> | stylesheet snippet "content2page.xsl"   |
> >>
> >> +-----------------------------------------+
> >> <xsl:template match="file">
> >>   <xsl:text>following file was added:</xsl:text>
> >>   <xsl:value-of select="./@path"/>
> >> </xsl:template>
> >>
> >> When I try to read the attribute value "path", my
> >> stylesheet outputs nothing.
> >>
> >> <xsl:template match="@path">
> >>   <xsl:text>following file was added:</xsl:text>
> >>   <xsl:value-of select="."/>
> >> </xsl:template>
> >>
> >> Doesn't work either.
> >>
> >> This is really urgent. Thanks for your help!
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> >> For additional commands, e-mail: users-help@cocoon.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: content aggregation + links to used files

Posted by vg...@sevencs.com.
Hello Nicolas!
Hi everybody!

Nicolas wrote:
> If the orginal docs aren't XML you should have a look at Chaperon
The original documents are also XML documents.

My problem is linking an element with the file it originates from.
Is it possible to store the information the directory generator extracts
about my directory structure - maybe as a file?

Thank you for your response!
Nele.


>> Hi all!
>>
>> I want to create an xml document by extracting
>> defined elements from files conforming to a
>> known format. When assembling the document I need
>> to keep in mind which element originates from
>> which file to be able to link the element with
>> the corresponding file after transformation into
>> HTML. The resulting HTML document consists - among
>> other things - of links to all processed files.
>>
>> How do I achieve this with Cocoon?
>>
>> All suggestions will be appreciated!
>> Thanks in advance,
>> Nele.
>>
>>
>> I tried the following using a directory generator
>> and aggregation, but it doesn't work.
>>
>> +-----------------------------------------+
>>
>> | directories within COCOON context       |
>>
>> +-----------------------------------------+
>> +---myContentDir/
>>     +---file1.xml
>>     +---file2.xml
>>     +---file3.xml
>>
>>
>> I aggregate the files in "myContentDir" using the
>> following sitemap snippet:
>>
>> +-----------------------------------------+
>>
>> | sitemap snippet                         |
>>
>> +-----------------------------------------+
>> <map:match pattern="content">
>>   <map:generate src="/myContentDir" type="directory">
>>     <map:parameter name="depth" value="1"/>
>>   </map:generate>
>>   <map:transform src="cincludeFiles.xsl">
>>     <map:parameter name="part" value="content"/>
>>   </map:transform>
>>   <map:transform type="cinclude"/>
>>   <map:transform src="content2page.xsl"/>
>>   <map:serialize type="xml"/>
>> </map:match>
>>
>>
>> Within the stylesheet "cincludeFiles.xsl", I transform the
>> xml stream coming from the directory generator. Iteratively
>> all files are inserted by <cinclude:include src="{$path}"/>.
>> An element named "file" with an attribute "path" is created.
>>
>> +-----------------------------------------+
>>
>> | stylesheet snippet "cincludeFiles.xsl"  |
>>
>> +-----------------------------------------+
>> <xsl:template match="dir:file">
>>   <xsl:param name="path"/>
>>   <xsl:element name="file">
>>     <xsl:attribute name="path">
>>       <xsl:value-of select="$path"/>
>>     </xsl:attribute>
>>   <cinclude:include src="{$path}"/>
>>   </xsl:element>
>> </xsl:template>
>>
>>
>> The transform outputs the following
>> ([...] stands for more xml elements):
>>
>> [...]
>>   <file path="myContentDir/file1.xml">[...]</file>
>>   <file path="myContentDir/file2.xml">[...]</file>
>>   <file path="myContentDir/file3.xml">[...]</file>
>> [...]
>>
>>
>> +-----------------------------------------+
>>
>> | stylesheet snippet "content2page.xsl"   |
>>
>> +-----------------------------------------+
>> <xsl:template match="file">
>>   <xsl:text>following file was added:</xsl:text>
>>   <xsl:value-of select="./@path"/>
>> </xsl:template>
>>
>> When I try to read the attribute value "path", my
>> stylesheet outputs nothing.
>>
>> <xsl:template match="@path">
>>   <xsl:text>following file was added:</xsl:text>
>>   <xsl:value-of select="."/>
>> </xsl:template>
>>
>> Doesn't work either.
>>
>> This is really urgent. Thanks for your help!
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: content aggregation + links to used files

Posted by Nicolas Toper <nt...@jouve.fr>.
If the orginal docs aren't XML you should have a look at Chaperon
Le Lundi 05 Janvier 2004 11:11, vg@sevencs.com a écrit :
> Hi all!
>
> I want to create an xml document by extracting
> defined elements from files conforming to a
> known format. When assembling the document I need
> to keep in mind which element originates from
> which file to be able to link the element with
> the corresponding file after transformation into
> HTML. The resulting HTML document consists - among
> other things - of links to all processed files.
>
> How do I achieve this with Cocoon?
>
> All suggestions will be appreciated!
> Thanks in advance,
> Nele.
>
>
> I tried the following using a directory generator
> and aggregation, but it doesn't work.
>
> +-----------------------------------------+
>
> | directories within COCOON context       |
>
> +-----------------------------------------+
> +---myContentDir/
>     +---file1.xml
>     +---file2.xml
>     +---file3.xml
>
>
> I aggregate the files in "myContentDir" using the
> following sitemap snippet:
>
> +-----------------------------------------+
>
> | sitemap snippet                         |
>
> +-----------------------------------------+
> <map:match pattern="content">
>   <map:generate src="/myContentDir" type="directory">
>     <map:parameter name="depth" value="1"/>
>   </map:generate>
>   <map:transform src="cincludeFiles.xsl">
>     <map:parameter name="part" value="content"/>
>   </map:transform>
>   <map:transform type="cinclude"/>
>   <map:transform src="content2page.xsl"/>
>   <map:serialize type="xml"/>
> </map:match>
>
>
> Within the stylesheet "cincludeFiles.xsl", I transform the
> xml stream coming from the directory generator. Iteratively
> all files are inserted by <cinclude:include src="{$path}"/>.
> An element named "file" with an attribute "path" is created.
>
> +-----------------------------------------+
>
> | stylesheet snippet "cincludeFiles.xsl"  |
>
> +-----------------------------------------+
> <xsl:template match="dir:file">
>   <xsl:param name="path"/>
>   <xsl:element name="file">
>     <xsl:attribute name="path">
>       <xsl:value-of select="$path"/>
>     </xsl:attribute>
>   <cinclude:include src="{$path}"/>
>   </xsl:element>
> </xsl:template>
>
>
> The transform outputs the following
> ([...] stands for more xml elements):
>
> [...]
>   <file path="myContentDir/file1.xml">[...]</file>
>   <file path="myContentDir/file2.xml">[...]</file>
>   <file path="myContentDir/file3.xml">[...]</file>
> [...]
>
>
> +-----------------------------------------+
>
> | stylesheet snippet "content2page.xsl"   |
>
> +-----------------------------------------+
> <xsl:template match="file">
>   <xsl:text>following file was added:</xsl:text>
>   <xsl:value-of select="./@path"/>
> </xsl:template>
>
> When I try to read the attribute value "path", my
> stylesheet outputs nothing.
>
> <xsl:template match="@path">
>   <xsl:text>following file was added:</xsl:text>
>   <xsl:value-of select="."/>
> </xsl:template>
>
> Doesn't work either.
>
> This is really urgent. Thanks for your help!
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org