Can't extract double quoted text from XML?
Posted: Wed Aug 03, 2011 12:34 am
I have this data in lblFileContents:
I call the function this way:
And the function works with anything but embedded double quotes:
(note:
The replace function finds the embedded double quotes without issue.
But for some reason the wordOffset function does NOT)
Any positive constructive suggestions would be greatly appreciated.
Code: Select all
...
<period>Monthly</period>
<fee unit="AUD$">999.99</fee>
...
I call the function this way:
Code: Select all
put ExtractTagData("period") into strperiod --works
put ExtractTagData("fee unit=" & quote & "AUD$" & quote,"Fee" ) into strFee -- does NOT work
And the function works with anything but embedded double quotes:
(note:
The replace function finds the embedded double quotes without issue.
But for some reason the wordOffset function does NOT)
Code: Select all
Function ExtractTagData tagName, tagEndName
put field lblFileContents into tagData
if tagEndName is Empty then
put tagName into tagEndName
end if
replace "<" & tagName & ">" with " <" & tagName & "> " in tagData -- this replace finds the fee with double quotes
replace "</" & tagEndName & ">" with " </" & tagEndName & "> " in tagData
Put wordOffset("<" & tagName & ">",tagData) into tWordStartNum -- this wordOffset DOES NOT find the fee with double quotes
Put wordOffset("</" & tagEndName & ">",tagData) into tWordEndNum
Delete word tWordEndNum to -1 of tagData
Delete word 1 to tWordStartNum of tagData
return tagData
end ExtractTagData