GetNthCdataContents ( xmlToSearch ; n )
Gets the contents of the nth CDATA instance within an XML blob.
Average rating: 4.6 (20 votes) Log in to vote
Cristos Lianides-Chin - Show more from this author
Codence https://www.codence.com |
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
GetNthCdataContents ( xmlToSearch ; n )
PURPOSE:
Gets the contents of the nth CDATA instance within an XML blob.
RETURNS:
Text string, of the data contained between the opening and closing CDATA tags.
EXAMPLE:
CALL:
GetNthCdataContents ( "T00183
RESPONSE:
"
Comments
Bruce, Redmond WA Oct 1, 2015 |
||
Sorta works. However, if you ask for N outside the range of actual values, it does not work correctly. For instance, in your example, which has two occurrences of CDATA, ask for N with a value of 5. Oops. |
||
Cristos Lianides-Chin, Codence Oct 1, 2015 |
||
Thanks for pointing out the issue, Bruce. I've updated the code to return "?" if *n* is out-of-bounds. | ||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.