Hi I have an xml like this:
<ns1:books><ns2:book category="WEB"><ns3:title lang="en">Learning XML</ns3:title>
<ns3:author>Erik T. Ray</ns3:author><ns3:year>2003</ns3:year><ns3:price>39.95</price>
Using Saxon xquery I want to remove the ns3:author element, could anyone let me know how can I do it ?
I know there is a fn:remove(..) method but I don't want to use that as it takes an integer as a 2nd argument
Any complete code will be much appreciated
Also with saxon I am facing the error like
Caused by: net.sf.saxon.trans.StaticError: XQuery syntax error in #...nt-node() external; copy $temp#: Unexpected token "$" beyond end of query
and I used the xml
declare namespace soapenv="http://www.w3.org/2003/05/soap-envelope"; declare namespace reg="http://www.mycompany.com/internal/xsd/registrationservice"; declare namespace reg1="http://www.mycompany.com/internal/xsd/registrationtypes";
declare variable $RegistrationServiceRequest := <reg:RegistrationServiceRequest><reg1:RegistrationAttributes> <reg1:Username>fdf</reg1:Username><reg1:Password>passwdfdford1</reg1:Password> <reg1:Title>Mdfdfr</reg1:Title><reg1:FirstName>fdsfdsfsd</reg1:FirstName>
</reg1:RegistrationAttributes><reg1:AutoLogin> <reg1:AutoLogin1>trtrtrt</reg1:AutoLogin1></reg1:AutoLogin>
</reg:RegistrationServiceRequest>;
copy $temp := $RegistrationServiceRequest
modify delete node $temp/reg1:AutoLogin
return $temp
but when i tried with zorba it worked fine , the only problem is with the saxon and the error is at copy line
Any idea how to fix this ?
Thanks S