From Dwayne Wright PMP, PMI-ACP
Certified FileMaker Developer
A READER ASKS
I created a calculation field in FileMaker that concatenates multiple fields into one text string that is suitable for ingestion into InDesign for our typesetting department. Things went fine for awhile but they are complaining that the XML is broke because of an ampersand character?
I'm not quite sure what to do next?
Yep, I had that happen to me as well. There is a great article that covers XML and how to escape these troublesome characters, here is a link http://www.xmlnews.org/docs/xml-basics.html .
I wrote a custom function to handle this for me using the following calc,
name = Substitute ( “the field to fix” ; "&" ; "&" );
name = Substitute ( name; "<" ; "<;" );
name = Substitute ( name ; ">" ; ">;" );
name = Substitute ( name ; "'" ; "';" )
Then I looked at briandunning.com just to see if there was already a custom function out there. There is at least one named EscapeXML ( http://www.briandunning.com/cf/1332 ), ironically the same troublesome characters are substituted on brians page. If you look down into the comments area, you can see that Ibrahim includes the proper calculation down there.
Hope that helps!
More info about the author and FileMaker in general, contact me at email@example.com.
© 2013 - Dwayne Wright - dwaynewright.com
The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.