C$XML Fails to Get Child

0 Likes

Problem:

A call to C$XML using CXML-GET-CHILD-BY-NAME returns "0" which means it did not find the child.  The child exists and can be clearly seen when viewing the raw xml. 

Resolution:

The problem is that the xml-name argument in this call is a regular expression:

call "C$XML" using CXML-GET-CHILD-BY-NAME, xml-handle, xml-name.

For the specific xml file used in this case the xml-name regular expression matched an element which had no children, thus the status "0".  The way to make it work as a text search is to add a previously undocumented flag for this operation - AREGEXP-COMPILE-NO-REGEXP. 

Here is the call that will produce the expected results:

call "C$XML" using CXML-GET-CHILD-BY-NAME, cur-handle, xml-name, AREGEXP-COMPILE-NO-REGEXP.  

Comment List
Related
Recommended