You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by David LAGARDERE <dl...@yahoo.fr> on 2002/06/07 12:15:05 UTC

CIncludeT-SQLT- XSLT

Hello.

I got more details about what I thought being
an error with Xalan and XPath.
What I'm doing is getting data from a main XML file
including other XML files containg SQL requests with
the cinclude::include. These requests are processed in
another pipeline and SQL data is retrieved thanks to
the SQL Transformer and xml serialized. I finally get
the resulting data from the "SQL pipeline" in the
first pipeline (thanks to the CInclude transformer)
which is passed to an XSLT transformer and html
serialized.

My problem is that the resulting XML is not processed
by XSLT as expected :

==> Main XML page <==

<?xml version="1.0" encoding="UTF-8"?>
<search
xmlns:ci="http://apache.org/cocoon/include/1.0">
	<ci:include src="cocoon:/sql/table.xml"/>
</search>	

==> Resulting XML <==

<search>
 <table>
  <rowset>
  <!-- Some data fetched by the SQL transformer -->
  </rowset>
 </table>
</search>

==> XSL applied <==

<xsl:template match="search">
 <!-- Some HTML -->
 <xsl:apply-templates select="table/rowset">
 <!-- Some HTML -->
</xsl:template>

<xsl:template match="table/rowset">
 <!-- Some HTML -->
</xsl:template>

The (bad) result I get is that the "table/rowset"
template is never reached !

Here is the sitemap :

<map:pipelines>
 <map:pipeline>			
  <map:match pattern="sql/**.xml">
   <map:generate src="xml/sql/{1}.xml"/>
   <map:transform type="sql">
    <map:parameter name="use-connection"
value="personnel"/>
    <map:parameter name="show-nr-of-rows"
value="false"/> 
   </map:transform>
   <map:serialize type="xml"/>
  </map:match>
 </map:pipeline>
 <map:pipeline>
  <map:match pattern="**.xml">
   <map:generate src="xml/{1}.xml"/>
   <map:transform type="cinclude"/>
   <map:transform src="xsl/{1}.xsl" type="xslt"/>
   <map:serialize type="xml"/>
  </map:match>
 </map:pipeline>
</map:pipelines>

NB:the same happens if I use one pipeline
and three matchers

I really some help to get around this...

Thanks in advance

David LAGARDERE

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: CIncludeT-SQLT- XSLT

Posted by Luca Morandini <lu...@tin.it>.
> -----Original Message-----
> From: David LAGARDERE [mailto:dlagardere@yahoo.fr]
> Sent: Friday, June 07, 2002 12:41 PM
> To: cocoon-users@xml.apache.org; lmorandini@ieee.org
> Subject: RE: CIncludeT-SQLT- XSLT
>
>
>  --- Luca Morandini <lu...@tin.it> a écrit :
> > David,
> >
> > may you try prefixing the elements produced by
> > SQLTransformer with the
> > "sql:" namespace in your XSL (like in: <xsl:template
> > match="table/sql:rowset">) ?
> >
> > Best regards,
> >
> >
>
> Many thanks, Luca.
> It was the problem ! But I really don't
> understand why the sql namespace declaration and
> the namespace prefix don't appear in the resulting
> XML code (I mean, if I take a snapshot before the
> XSLT transformation). Does Cocoon hide it ?

well, I wondered the same and didn't find an explanation for it... could you
spare some time to investigate the matter ?

I apologize for not being of much assistance... right now I'm horribly
busy... this will be the second working-weekend in a row :(

Best regards,

---------------------------------------------
               Luca Morandini
               GIS Consultant
              lmorandini@ieee.org
http://utenti.tripod.it/lmorandini/index.html
---------------------------------------------

>
>
> ___________________________________________________________
> Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
> Yahoo! Mail : http://fr.mail.yahoo.com


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: CIncludeT-SQLT- XSLT

Posted by David LAGARDERE <dl...@yahoo.fr>.
 --- Luca Morandini <lu...@tin.it> a écrit :
> David,
> 
> may you try prefixing the elements produced by
> SQLTransformer with the
> "sql:" namespace in your XSL (like in: <xsl:template
> match="table/sql:rowset">) ?
> 
> Best regards,
> 
> 

Many thanks, Luca.
It was the problem ! But I really don't
understand why the sql namespace declaration and
the namespace prefix don't appear in the resulting
XML code (I mean, if I take a snapshot before the 
XSLT transformation). Does Cocoon hide it ?


___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: CIncludeT-SQLT- XSLT

Posted by Luca Morandini <lu...@tin.it>.
David,

may you try prefixing the elements produced by SQLTransformer with the
"sql:" namespace in your XSL (like in: <xsl:template
match="table/sql:rowset">) ?

Best regards,


---------------------------------------------
               Luca Morandini
               GIS Consultant
              lmorandini@ieee.org
http://utenti.tripod.it/lmorandini/index.html
---------------------------------------------


> -----Original Message-----
> From: David LAGARDERE [mailto:dlagardere@yahoo.fr]
> Sent: Friday, June 07, 2002 12:15 PM
> To: cocoon-users@xml.apache.org
> Subject: CIncludeT-SQLT- XSLT
>
>
> Hello.
>
> I got more details about what I thought being
> an error with Xalan and XPath.
> What I'm doing is getting data from a main XML file
> including other XML files containg SQL requests with
> the cinclude::include. These requests are processed in
> another pipeline and SQL data is retrieved thanks to
> the SQL Transformer and xml serialized. I finally get
> the resulting data from the "SQL pipeline" in the
> first pipeline (thanks to the CInclude transformer)
> which is passed to an XSLT transformer and html
> serialized.
>
> My problem is that the resulting XML is not processed
> by XSLT as expected :
>
> ==> Main XML page <==
>
> <?xml version="1.0" encoding="UTF-8"?>
> <search
> xmlns:ci="http://apache.org/cocoon/include/1.0">
> 	<ci:include src="cocoon:/sql/table.xml"/>
> </search>
>
> ==> Resulting XML <==
>
> <search>
>  <table>
>   <rowset>
>   <!-- Some data fetched by the SQL transformer -->
>   </rowset>
>  </table>
> </search>
>
> ==> XSL applied <==
>
> <xsl:template match="search">
>  <!-- Some HTML -->
>  <xsl:apply-templates select="table/rowset">
>  <!-- Some HTML -->
> </xsl:template>
>
> <xsl:template match="table/rowset">
>  <!-- Some HTML -->
> </xsl:template>
>
> The (bad) result I get is that the "table/rowset"
> template is never reached !
>
> Here is the sitemap :
>
> <map:pipelines>
>  <map:pipeline>
>   <map:match pattern="sql/**.xml">
>    <map:generate src="xml/sql/{1}.xml"/>
>    <map:transform type="sql">
>     <map:parameter name="use-connection"
> value="personnel"/>
>     <map:parameter name="show-nr-of-rows"
> value="false"/>
>    </map:transform>
>    <map:serialize type="xml"/>
>   </map:match>
>  </map:pipeline>
>  <map:pipeline>
>   <map:match pattern="**.xml">
>    <map:generate src="xml/{1}.xml"/>
>    <map:transform type="cinclude"/>
>    <map:transform src="xsl/{1}.xsl" type="xslt"/>
>    <map:serialize type="xml"/>
>   </map:match>
>  </map:pipeline>
> </map:pipelines>
>
> NB:the same happens if I use one pipeline
> and three matchers
>
> I really some help to get around this...
>
> Thanks in advance
>
> David LAGARDERE
>
> ___________________________________________________________
> Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
> Yahoo! Mail : http://fr.mail.yahoo.com
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>