-----Original Message-----
From: Jonathan Spaeth [mailto:[EMAIL PROTECTED]
Sent: den 27 juni 2003 21:50
To: '[EMAIL PROTECTED]'
Subject: sql transformer bug?Can somebody please point me in the right direction:
I am attempting to use the sql transformer to update an oracle database.
I am using a jdk 1.4
Running with cocoon version 2.1m2Here is my sitemap:
<map:match pattern="create.xsql">
<map:generate src=""/>
<map:transform type="sql">
<map:parameter name="use-connection" value="{global:sql-data-source}"/>
<map:parameter name="date" value="date"/>
<map:parameter name="time" value="time"/>
<map:parameter name="clli" value="clli"/>
<map:parameter name="remarks" value="remarks"/>
<!--
<map:parameter name="date" value="{request-param:/date}"/>
<map:parameter name="time" value="{request-param:/time}"/>
<map:parameter name="clli" value="{request-param:/clli}"/>
<map:parameter name="remarks" value="{request-param:/remarks}"/>
-->
</map:transform>
<map:serialize/>
</map:match>Here is my xsql input file:
<?xml version="1.0"?>
<page>
<sql:execute-query xmlns:sql="http://apache.org/cocoon/SQL/2.0">
<sql:query isupdate="true">
INSERT INTO NOC_EQUIPMENT_TROUBLES (
trouble_id, trouble_date, trouble_time, trouble_clli, trouble_remarks
)
VALUES (
NOC_EQUIPMENT_TROUBLES_SEQ.NEXTVAL,
'<sql:substitute-value sql:name="date">',
'<sql:substitute-value sql:name="time">',
'<sql:substitute-value sql:name="clli">',
'<sql:substitute-value sql:name="remarks">'
)
</sql:query>
</sql:execute-query>
</page>Here is my flow script:
function jxFormMain(form) {
var page = null;
while (true) {
page = cocoon.request.getParameter("/page");
if (page == null) {
form.setModel(new java.util.HashMap());
form.sendView("index.xform");
}
else if (page == "create") {
form.sendView("create.xform");
form.sendView("create.xsql");
}
}
}When I attempt to view create.xsql, the following exception is thrown from the SQL Transformer:
Original Exception: java.lang.IllegalStateException: SQLTransformer: Not expecting a start substitute value element
at org.apache.cocoon.transformation.SQLTransformer.throwIllegalStateException(SQLTransformer.java:361)
at org.apache.cocoon.transformation.SQLTransformer.startSubstituteValueElement(SQLTransformer.java:547)
at org.apache.cocoon.transformation.SQLTransformer.startTransformingElement(SQLTransformer.java:716)
at org.apache.cocoon.transformation.AbstractSAXTransformer.startElement(AbstractSAXTransformer.java:330)
at org.apache.cocoon.components.sax.XMLTeePipe.startElement(XMLTeePipe.java:118)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:318)
at org.apache.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:337)
at org.apache.cocoon.components.source.SourceUtil.parse(SourceUtil.java:198)
at org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:140)
....Am I formatting the input xml incorrectly or what?
Please help.
Thanks,
Jon
Title: Message
'<sql:substitute-value sql:name="date">',
should
be
'<sql:substitute-value
sql:name="date"/>',
note
the / at the end.
/LS
- sql transformer bug? Jonathan Spaeth
- Re: sql transformer bug? Leo Sutic
- Re: sql transformer bug? David Kavanagh
- RE: sql transformer bug? Jonathan Spaeth