[xquery-talk] Delete in xquery
Jason Hunter
jhunter at xquery.com
Thu May 19 10:05:08 PDT 2005
Although XQuery hasn't formalized a standardized update capability, most
vendors have added delete mechanisms. For example, in Mark Logic you
can use the xdmp:node-delete() function:
xdmp:node-delete(doc("foo.xml")//wsdl:binding)
(Bind the wsdl namespace prefix first of course. And if you might get
more than one match to the XPath, use a FLWOR to iterate and
node-delete() each item individually.)
http://xqzone.marklogic.com/pubs/2.2/apidocs/UpdateBuiltins.html
-jh-
Michael Kay wrote:
> Please avoid including pictures in your mail - it causes a security
> warning and could dissuade some people from replying.
>
> XQuery does not currently have an update capability. The way you delete
> something from a document is to copy everything in the source except the
> thing you want to delete. This is not actually that easy to achieve -
> it's an example of something that XSLT does a lot better. But you can do
> it with a recursive function that copies an element by copying all its
> children other than the binding element. Last time this question came up
> we discovered that you can't do this in a way that guaratees to copy all
> the namespaces from the source document - which may or may not be a good
> thing in your case.
>
> Michael Kay
> http://www.saxonica.com/
>
> ------------------------------------------------------------------------
> *From:* talk-bounces at xquery.com [mailto:talk-bounces at xquery.com] *On
> Behalf Of *santosh subrahmanya
> *Sent:* 19 May 2005 12:07
> *To:* talk at xquery.com
> *Subject:* [xquery-talk] Delete in xquery
>
>
> Hi,
> Is there any way to delete an element from either a wsdl or an xml
> file. suppose I have a wsdl file like this -
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <wsdl:definitions targetNamespace="http://faults.samples1"
> xmlns="http://schemas.xmlsoap.org/wsdl/"
> xmlns:apachesoap="http://xml.apache.org/xml-soap"
> xmlns:impl="http://faults.samples1"
> xmlns:intf="http://faults.samples1"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <wsdl:types>
> <schema targetNamespace="http://faults.samples1"
> xmlns="http://www.w3.org/2001/XMLSchema">
> <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
> <complexType name="ItemVO">
> <sequence>
> <element name="itemDesc" nillable="true" type="xsd:string" />
> <element name="itemID" type="xsd:int" />
> <element name="itemPrice" type="xsd:float" />
> <element name="itemQty" type="xsd:int" />
> </sequence>
> </complexType>
> <complexType name="Vector">
> <sequence>
> <element maxOccurs="unbounded" minOccurs="0" name="item"
> type="xsd:anyType" />
> </sequence>
> </complexType>
> <complexType name="AdvanceShipmentNoticeVO">
> <sequence>
> <element name="consignmentID" type="xsd:int" />
> <element name="items" nillable="true" type="impl:Vector" />
> <element name="orderID" nillable="true" type="xsd:string" />
> <element name="shipmentDate" nillable="true" type="xsd:string" />
> </sequence>
> </complexType>
> </schema>
> <schema targetNamespace="http://xml.apache.org/xml-soap"
> xmlns="http://www.w3.org/2001/XMLSchema">
> <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
> </schema>
> </wsdl:types>
> <wsdl:message name="generateShipmentAccuracyDetailsRequest">
> <wsdl:part name="resp" type="impl:Vector" />
> </wsdl:message>
> <wsdl:message name="searchASNResponse">
> <wsdl:part name="searchASNReturn" type="xsd:string" />
> </wsdl:message>
> <wsdl:message name="generateASNResponse">
> <wsdl:part name="generateASNReturn" type="xsd:string" />
> </wsdl:message>
> <wsdl:message name="generateASNRequest">
> <wsdl:part name="in" type="impl:AdvanceShipmentNoticeVO" />
> </wsdl:message>
> <wsdl:message name="generateShipmentAccuracyDetailsResponse">
> <wsdl:part name="generateShipmentAccuracyDetailsReturn"
> type="xsd:string" />
> </wsdl:message>
> <wsdl:message name="searchASNRequest">
> <wsdl:part name="asnID" type="xsd:string" />
> </wsdl:message>
> <wsdl:portType name="AdvanceShipmentws">
> <wsdl:operation name="generateASN" parameterOrder="in">
> <wsdl:input message="impl:generateASNRequest"
> name="generateASNRequest" />
> <wsdl:output message="impl:generateASNResponse"
> name="generateASNResponse" />
> </wsdl:operation>
> <wsdl:operation name="searchASN" parameterOrder="asnID">
> <wsdl:input message="impl:searchASNRequest"
> name="searchASNRequest" />
> <wsdl:output message="impl:searchASNResponse"
> name="searchASNResponse" />
> </wsdl:operation>
> <wsdl:operation name="generateShipmentAccuracyDetails"
> parameterOrder="resp">
> <wsdl:input message="impl:generateShipmentAccuracyDetailsRequest"
> name="generateShipmentAccuracyDetailsRequest" />
> <wsdl:output
> message="impl:generateShipmentAccuracyDetailsResponse"
> name="generateShipmentAccuracyDetailsResponse" />
> </wsdl:operation>
> </wsdl:portType>
> <wsdl:binding name="AdvanceShipmentNoticeWSSoapBinding"
> type="impl:AdvanceShipmentws">
> <wsdlsoap:binding style="rpc"
> transport="http://schemas.xmlsoap.org/soap/http" />
> <wsdl:operation name="generateASN">
> <wsdlsoap:operation soapAction="" />
> <wsdl:input name="generateASNRequest">
> <wsdlsoap:body
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="http://faults.samples1" use="encoded" />
> </wsdl:input>
> <wsdl:output name="generateASNResponse">
> <wsdlsoap:body
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="http://faults.samples1" use="encoded" />
> </wsdl:output>
> </wsdl:operation>
> <wsdl:operation name="searchASN">
> <wsdlsoap:operation soapAction="" />
> <wsdl:input name="searchASNRequest">
> <wsdlsoap:body
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="http://faults.samples1" use="encoded" />
> </wsdl:input>
> <wsdl:output name="searchASNResponse">
> <wsdlsoap:body
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="http://faults.samples1" use="encoded" />
> </wsdl:output>
> </wsdl:operation>
> <wsdl:operation name="generateShipmentAccuracyDetails">
> <wsdlsoap:operation soapAction="" />
> <wsdl:input name="generateShipmentAccuracyDetailsRequest">
> <wsdlsoap:body
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="http://faults.samples1" use="encoded" />
> </wsdl:input>
> <wsdl:output name="generateShipmentAccuracyDetailsResponse">
> <wsdlsoap:body
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="http://faults.samples1" use="encoded" />
> </wsdl:output>
> </wsdl:operation>
> </wsdl:binding>
> <wsdl:service name="AdvanceShipmentwsService">
> <wsdl:port binding="impl:AdvanceShipmentNoticeWSSoapBinding"
> name="AdvanceShipmentNoticeWS">
> <wsdlsoap:address
> location="http://localhost:7001/scemaws/services/AdvanceShipmentNoticeWS"
> />
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
>
> How do I delete the binding element from this file.
>
> Regards
> Santosh Subrahmanya
>
>
>
> <http://clients.rediff.com/signature/track_sig.asp>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> talk at xquery.com
> http://xquery.com/mailman/listinfo/talk
More information about the talk
mailing list