Nele, Could you send me the files? hopefully it is a simple mistake. I need the xsl, as well as the xml to which you try to apply it.
There are two likely causes: - a missing template-apply or faulty 'select' clause, so that 'file' never gets processed (or something like that) - maybe a namespace problem (are you sure 'file' is in the default namespace?) K. > -----Original Message----- > From: Nele Vogel [mailto:[EMAIL PROTECTED] > Sent: 05 January 2004 14:41 > To: [EMAIL PROTECTED] > Subject: RE: content aggregation + links to used files > > Hello Koen! > > Koen wrote: > > I think your original approach is correct, but we need to determine > > why "path" is not returing a value. > > > Just to get things straight: the snippet you mentioned *does* match > > file (and outputs "following file was added:"), but just > the "./@path" > > is not resolved; correct? > > Unfortunately it *does not* match <file>. > > I don't understand why! > > *WITHOUT* the line "<map:transform src="content2page.xsl/>" > (in the sitemap snippet) the output looks like this: > > <news> > <file path="news/news1.xml"> > <article> > [...] > </article> > </file> > </news> > > *WITH* line "<map:transform src="content2page.xsl"/> neither > element <news> nor element <file> is processed > - they are missing. But I am able to process every element > inside <article>. There has to be an error in my XSL file! > > Thank you for your help, Koen! > > 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: [EMAIL PROTECTED] > >> >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > > >> > > >> > > >> > --------------------------------------------------------------------- > >> > To unsubscribe, e-mail: [EMAIL PROTECTED] > >> > For additional commands, e-mail: [EMAIL PROTECTED] > >> > > >> > > >> > > >> > >> > >> > --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
