I saw the woody's binding samples and use dom to save form data.I modified js like:
if (isbind=="true") {
document = loadDocument(documentURI);
// bind the document data to the form
form.load(document);
}
// shows the form to the user until is validated successfully
form.showForm(formname+"-display");
if (form.binding != null){
// bind the form's data back to the document
form.save(document);
cocoon.sendPage(formname+"-save",{"data":document});
}
document = loadDocument(documentURI);
// bind the document data to the form
form.load(document);
}
// shows the form to the user until is validated successfully
form.showForm(formname+"-display");
if (form.binding != null){
// bind the form's data back to the document
form.save(document);
cocoon.sendPage(formname+"-save",{"data":document});
}
Object document is a dom object then.
I use a pipeline to display the result:
<map:match pattern="*-save">
<map:generate type="jxt" src="" />
<map:serialize type="xml"/>
</map:match>
<map:generate type="jxt" src="" />
<map:serialize type="xml"/>
</map:match>
Everything goes fine until I enter Simplyfied Chinese in the form,the xml result apear wrong encoding character:
<laiwendanwei>test</laiwendanwei>
<shouwenmingcheng>盲赂?shy;忙</shouwenmingcheng> <--error here
the form encoding is unicode.
If I use action to get the value from the context using JXPathContext is the same result?
It must be woody form binding encoding problem.
What can I do to solve the problem?
roy huang
使用 MSN Messenger 与联机的朋友进行交流
