transformer does not always need a generator

Robby Pelssers <[email protected]>
Newsgroups gmane.text.xml.cocoon.user
Message-ID <927C66C0775CCA43B88EB1E3006614B31E4AA6D8@eu1rdcrdc1wx032.exi.nxp.com>
Hi guys,

Just wanted to point out a small mistake in the pipeline concept.  It seems like a pipeline should not always (have to admit most of the times it does) start with  a generator. I accidentally ran into this .

An XSLT can load data by itself using document() and collection function.    I know that cocoon style of working is to usually use a generator instead of calling the document function inside an XSLT. But not so for a collection though.

Let me show you.  To get this working in Cocoon I had to use a dummy generator just to get this working.  No big deal... just mentioning it.

      <map:match pattern="mergefeatures">
        <map:generate src="page/index.html"/> <!-- dummy generator -->
        <map:transform src="xslt/merge/mergeFeaturesAndBenefits.xslt" type="saxon"/>
        <map:serialize type="xml"/>
      </map:match>


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

  <xsl:variable name="fb_topics" select="collection('file:///C:/tmp/value-proposition/67/features-benefits/?select=*.dita')"/>

  <xsl:template match="/">
    <result><xsl:value-of select="count($fb_topics)"/></result>
  </xsl:template>
</xsl:stylesheet>

Robby
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.