I have a business that sometimes sneaks a / charcater in the middle of 2 XML tags. So when I run XMLNodetoDocument I get and error stating cannot find closing tag blah blah blah. Its because inside that tag that have “/” in the name. How can I run a search and replace but not search inside the XML tags. So for instance if I have a huge XML string I want to look on at what is in between the tags and not what is inside the tags themselves
I want to search the string bug ignore the tags names else it would remove the / before Name and make things worse.
Thanks for any help.
Which version of IS you are using ?
Also as a rule of thumb, I would advice that the incoming XML from source system should follow the W3C norms. In case of any special characters in XML, it should have escape sequences.
However, sometimes we face such kind of problems, I have checked it in webMethods 7.1 and it is not giving any error.
Your right. Im running IS 6.1. The problem was not the “/”. It was the problem of a “&” character in the string. I didn’t realize that this would be a problem. I did a search and replace using “&” with “&”. It seems like the business is not submitting correctly with escape characters. Its weird that I get an error on the “&” and not on the “/”. Are there other character that will cause issues? I can create a flow service that I can pass any XMLString through and it will correct all of the characters that could be potential problems.
Search the web for characters that must be encoded in XML data (search for “xml character entities”). A search and replace is not a good strategy. The source system must fix their side to generate valid XML.