Hi
Im trying to send XML document as an attachment using SMTP in webMethods.
But the XML file has the content like Firstname “ampersand in symbol format” Lastname because it is fetched from database since xml does not allow this tag with ampersand error occurs.
I want to know how it can dynamically be changed in the Flow Service to Firstname & Lastname before emailing that document.
What you have to do when you use the recordToDocument(4.6) or XMLDocumentToXMLString(6.x) and set the input parameter encode=true the output xmldata will encode the ampersand to &in the xmldata.
I wonder why encode=true isn’t the default? I cannot think of a case where encode should be false (other than for efficiency when one is absolutely sure the source data will not have special chars).
Unless we set explicity encode=true,then only DocumentToXMLString xmldata output converts & to & and when encode=false it shows & symbol in the xmldata.
I see, you were describing the functionality of documentToXMLString. I think I have a pretty good handle on that.
My question was “why is false the default for encode?” IMO, having the default be false only creates problems–having ‘&’ (or any of the other characters that need to be converted to character entities) appear within XML is never valid. IMO, encode should default to true.