User bio
404 bio not found
Member since Nov 11, 2020
Replies:

Hey Ashok.

I think there's a slight correction needed for your code snippet.

Specifically, for the line "do object.Organizations.GetAt(key).%DeleteId(key)" the DeleteId using the value of Key will not be the correct value to delete the intended object.

Should the code block instead be:

ClassMethod %OnDelete(oid As %ObjectIdentity) As %Status [ Private, ServerOnly = 1 ]
{
    Set object = ..%Open(oid,,.status)
    If $$$ISERR(status) Quit status
    If $ISOBJECT(object.Organizations) {
        Set org= object.OrganizationsGetSwizzled()
        While org.GetNext(.key){
            Set tID = object.Organizations.GetAt(key).%Id()
            Do object.Organizations.GetAt(key).%DeleteId(tID)
        }
    }
    Quit $$$OK
}

Hey David.

I'll give XPath a try and see how I get on and update accordingly.

Edit:

It seems that trying to use xpath for the elements within the cdata block fail, and attempting to use xpath for <jkl> returns the content of the entire cdata as a stream object. However I think this is going to be a limitation of the xml I am working with rather than xpath itself.

Hey Julius, thank you for this. 

Unfortunately, there is a risk of hitting the maxstring lengths due to one of the fields within the CData blocks will be a base64 encoded document or two. But this does look interesting for other use cases.

Certifications & Credly badges:
Julian has no Certifications & Credly badges yet.
Followers:
Following: