You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Derek Hohls <DH...@csir.co.za> on 2009/01/20 10:52:50 UTC
Error with SQL Transformer - nested query + Filter Transformer
Working with Cocoon 2.1.8, Windows XP
With reference to this thread:
http://marc.info/?l=xml-cocoon-users&m=103097078912239&w=3
which did not seem to be resolved, I am also having
problems with the Filter Transformer. The error I have is:
java.util.EmptyStackException
at org.apache.xml.utils.IntStack.peek(IntStack.java:125)
at org.apache.xml.dtm.ref.sax2dtm.SAX2DTM.endElement(SAX2DTM.java:2032)
at org.apache.xalan.transformer.TransformerHandlerImpl.endElement(TransformerHandlerImpl.java:522)
at org.apache.cocoon.xml.AbstractXMLPipe.endElement(AbstractXMLPipe.java:111)
at org.apache.cocoon.transformation.FilterTransformer.endElement(FilterTransformer.java:172)
at org.apache.cocoon.xml.AbstractXMLPipe.endElement(AbstractXMLPipe.java:111)
...
Attached are relevant portions of code/data.
Thanks
Derek
QUERY:
<sq2:execute-query>
<sq2:query name="source-list">
SELECT DISTINCT source.sourceID AS sourceid
FROM source
</sq2:query>
<!-- problem for filter transformer ??? if removed then no error... -->
<sq2:execute-query>
<sq2:query name="source-viability">
SELECT DISTINCT ViabilityDate AS viabilitydate, ViabilityStatus AS viabilitystatus
FROM sourceviability
WHERE sourceID=<sq2:ancestor-value sq2:name="source.sourceID" sq2:level="1"/>
ORDER BY ViabilityDate DESC
LIMIT 0,1
</sq2:query>
</sq2:execute-query>
</sq2:execute-query>
OUTPUT FRAGMENT:
<page xmlns:sq2="http://apache.org/cocoon/SQL/2.0" xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
<sq2:rowset nrofrows="8" name="source-list">
<sq2:row>
<sq2:id>6</sq2:id>
<sq2:sourceid>6</sq2:sourceid>
<sq2:sourcelabel>P3</sq2:sourcelabel>
<sq2:rowset nrofrows="1" name="source-viability">
<sq2:row>
<sq2:viabilitydate>2009-01-20</sq2:viabilitydate>
<sq2:viabilitystatus>34</sq2:viabilitystatus>
</sq2:row>
</sq2:rowset>
</sq2:row>
...
SITEMAP:
<map:match pattern="db/list-*">
<map:generate src="SQL/list/{1}.xml" type="jx" label="debug1">
<use-request-parameters>true</use-request-parameters>
</map:generate>
<map:transform type="sql" label="debug2">
<map:parameter name="use-connection" value="foo"/>
<map:parameter name="show-nr-of-rows" value="true"/>
<map:parameter name="clob-encoding" value="UTF-8"/>
</map:transform>
<!-- ??? not with nested query -->
<map:transform type="filter" label="debug3">
<map:parameter name="element-name" value="row"/>
<use-request-parameters>true</use-request-parameters>
<map:parameter name="count" value="20"/>
<map:parameter name="blocknr" value="{request-param:bl}"/>
</map:transform>
--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard.
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.
This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean. MailScanner thanks Transtec Computers for their support.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org