Hi,

As far as I can tell, using substitute-value with SQL Transformer does not
work in 2.0.4 (and there aren't any examples of it in the samples,
something I'll rectify if I ever get the darn thing working!).

Here's what I've got:

test.xml:

<?xml version="1.0" encoding="iso-8859-1"?>

<page xmlns:sql="http://apache.org/cocoon/SQL/2.0";>

  <sql:execute-query xmlns:sql="http://apache.org/cocoon/SQL/2.0";>
    <sql:query>
      SELECT DISTINCT contributor_id, name FROM foo WHERE 
contributor_id='<substitute-value sql:name="contributor_id"/>'
    </sql:query>
  </sql:execute-query>
</page>

sitemap.xmap:

<map:match pattern="contributor/*/list">
  <map:generate src="test.xml"/>
  <map:transform type="sql">
    <map:parameter name="use-connection" value="bar"/>
    <map:parameter name="contributor_id" value="{1}"/>
  </map:transform>
  <map:transform src="stylesheets/simple-xml2html.xsl"/>
  <map:serialize/>
</map:match>

... but in my sitemap.log, I get:

DEBUG   (2003-01-16) 12:11.46:611   [sitemap.transformer.sql]
(/contributor/1/list) Thread-33/AbstractSAXTransformer: END endRecording 
fragment=<?xml version="1.0" encoding="ISO-8859-1"?>

                        SELECT DISTINCT id, contributor_id, name FROM contributor 
WHERE contributor_id='<substitute-value sql:name="contributor_id"/>'
DEBUG   (2003-01-16) 12:11.46:617   [sitemap.transformer.sql] (/contributor/1/list) 
Thread-33/AbstractSAXTransformer: END endSerializedXMLRecording xml=
                        SELECT DISTINCT id, contributor_id, name FROM contributor 
WHERE contributor_id=''

DEBUG   (2003-01-16) 12:11.46:618   [sitemap.transformer.sql] (/contributor/1/list) 
Thread-33/SQLTransformer: QUERY IS "
                        SELECT DISTINCT id, contributor_id, name FROM contributor 
WHERE contributor_id=''
                "

... as far as I can tell, the substitute value just doesn't work. I've
tried swapping {1} for 1 in the sitemap, and that doesn't help.

Any ideas?


Andrew.

-- 
Andrew Savory                                Email: [EMAIL PROTECTED]
Managing Director                              Tel:  +44 (0)870 741 6658
Luminas Internet Applications                  Fax:  +44 (0)700 598 1135
This is not an official statement or order.    Web:    www.luminas.co.uk

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

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to