cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Savory <and...@luminas.co.uk>
Subject SQL Transformer substitute-value woes with 2.0.4
Date Thu, 16 Jan 2003 12:21:41 GMT

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: andrew@luminas.co.uk
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:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message