to start, do you have FMP Advanced? It allows custom functions. Two things about HTML ...
- the format is <tagName>data</tagNaame> (note the </)
- you will probably need to convert special characters ...
this is a calculation with a text result. the text is text.
<Amount>" & YOUR FIELD VALUE HERE FORMATTED WITH CALC IF NECESSARY
Instead of using literal text enclosed in quotes, set up a calculation.
"HTTP:the url for the server goes here?TerminalTransaction=<request><PaymentType>Credit</PaymentType><TransType>Sale</TransType><Amount>" & TableOccurrence::FilemakerFieldGoesHere & "</Amount>"
1 of 1 people found this helpful
As you wrote in function name, this is not HTML, is XML.
Additionally whole value need to be encoded (if value have some character should be encoded)
GetAsURLEncoded( "<request" ....
This is the correct method (once the text is created by calculation to embed field data).
This function removes all styles from text. All characters are first converted to UTF-8 format. Characters that are neither letters nor digits, or digits that are in the upper ASCII range, are converted to %HH format (a percent sign followed by the character’s hexadecimal value).
more about URL encoding:
I meant it for the OP to use to format the individual elements. e.g.
I'm assuming that the character conversions can be useful in his scenario - Insert From URL.
David your function is for helping the user "build" tagged text (used by SGML, HTML, XML and other "L"s)
and you are converting the value if it contains any "reserved" characters. rather than convert such values likely would be inside CDATA
where the values are NOT converted
However when pushing to an URL any of these characters (as part of the tag) would be correctly encoded with the FM function GetAsURLencoded() if the text is calculated.
Just as a test, you might create some text with your custom function and then GetAsURLencoded().