You are using SQL Transformer. I had thought it would have a way of
specifying bits of XML as parameters, which would then get escaped for you,
but I looked at the docs and it appears not. It does take parameters from
the pipeline, but I am no expert on using those, perhaps someone else can
offer advice on that. You can use the XSLT template that Luca kindly
provided, or you might consider using the modular database Actions (with
which I am even less familiar). There are many ways to do something in
Cocoon - I would recommend you look through the docs on these various
topics until you see an example that works like you want. Good luck.
-Christopher
|---------+---------------------------->
| | "Mustafa Yalniz" |
| | <[EMAIL PROTECTED]|
| | h> |
| | |
| | 07/24/2003 05:37 |
| | AM |
| | Please respond to|
| | users |
| | |
|---------+---------------------------->
>--------------------------------------------------------------------------------------------------------------|
|
|
| To: <[EMAIL PROTECTED]>
|
| cc:
|
| Subject: Re: escaping characters
|
>--------------------------------------------------------------------------------------------------------------|
My pipeline looks like as below.
<map:match pattern="vipresource-sunrise-newuser">
<map:generate src="vip/resources/sunrise-newuser-db.xml"/>
<map:transform type="sunShine"/>
<map:transform src="vip/styles/sunrise-newuser-db.xsl"/>
<map:transform type="sql"/>
<map:transform src="vip/styles/sunrise-newuser-sql.xsl"/>
<map:serialize type="xml"/>
</map:match>
sunrise-newuser-db.xml is below.
<?xml version="1.0"?> <!-- sunrise-newuser-db.xml -->
<adduser xmlns:sunshine="http://cocoon.apache.org/sunshine/1.0">
<name><sunshine:getxml context="request" path="/parameter/ID"/></name>
...
<lastname><sunshine:getxml context="request" path
="/parameter/lastname"/></lastname>
...
</adduser>
And sunrise-newuser-db.xsl is below.
<?xml version="1.0"?> <!-- sunrise-newuser-db.xsl -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="adduser">
<adduser>
<sql:execute-query xmlns:sql="http://apache.org/cocoon/SQL/2.0">
<sql:use-connection>vip_db</sql:use-connection>
<sql:query>
insert into user_tb
set name = '<xsl:value-of select="name"/>',
password = '<xsl:value-of select="password"/>',
role = '<xsl:value-of select="role"/>',
title = '<xsl:value-of select="title"/>',
firstname = '<xsl:value-of select="firstname"/>',
lastname = '<xsl:value-of select="lastname"/>',
company = '<xsl:value-of select="company"/>',
street = '<xsl:value-of select="street"/>',
zipcode = '<xsl:value-of select="zipcode"/>',
city = '<xsl:value-of select="city"/>',
country = '<xsl:value-of select="country"/>',
phone = '<xsl:value-of select="phone"/>',
fax = '<xsl:value-of select="fax"/>',
email = '<xsl:value-of select="email"/>',
bankid = '<xsl:value-of select="bankid"/>',
bankname = '<xsl:value-of select="bankname"/>',
accountid = '<xsl:value-of select="accountid"/>'
</sql:query>
</sql:execute-query>
</adduser>
</xsl:template>
</xsl:stylesheet>
Best regards,
Mustafa
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]