From: Winston <co...@ho...> - 2007-10-17 00:04:28
|
Greetings, I have am having some trouble with an 'update replace' call. I am trying to simply get the value of a field from a html form via a POST and then replace a node in my xml doc with that value. The weirdness is that if I print out the value by itself (outside of any update method) the value is correct, but if I try to use it in an update replace than it reads the value as blank. Here is the XQuery: xquery version "1.0"; declare namespace request="http://exist-db.org/xquery/request"; declare namespace session="http://exist-db.org/xquery/session"; declare namespace util="http://exist-db.org/xquery/util"; declare option exist:serialize "method=xhtml omit-xml-declaration=no indent=yes encoding=UTF-8 doctype-public=-//W3C//DTD XHTML 1.0 Transitional//EN doctype-system=http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"; let $fullname := request:get-parameter("field12", "null") let $newprofile := doc('xmldb:exist://myserver.webhop.net:8080//rest/db/profiles/0.xml') return <html> <head> <title>Test Page</title> </head> <body> {update replace $newprofile/profile/fullname with <fullname>{$fullname}</fullname>} <div>The value of the field is {$fullname}</div> </body> </html> What is entered into the database is <fullname>null</fullname> as if the field in the html form was left blank...but it wasn't left blank. But the variable called by itself at the end of "The value of the field is" gets the field correctly. Why does it fail when it is used in the 'update replace' call? -- View this message in context: http://www.nabble.com/Problem-with-Update-Replace-from-html-form-POST-tf4637505.html#a13244759 Sent from the exist-open mailing list archive at Nabble.com. |