Manoj Chaurasia Posted August 28, 2009 Share Posted August 28, 2009 I have a BusinessWorks process which renders an XML file at the end. How do I remove the empty XML tags during mapping of the fields Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted September 1, 2009 Author Share Posted September 1, 2009 I've hundred of mapped fields in BusinessWorks Design processes and they are optional fields but I don't really want to go through each one of them and insert a "When Condition" to map only if data exists in the XPath Formula Builder. This is time consuming. Is there a quick and better way of doing this Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted September 2, 2009 Author Share Posted September 2, 2009 You can try going into the .process file with a text editor and search/replace directly. Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted May 4, 2010 Author Share Posted May 4, 2010 I Have same problem. Please help me if you got the answer. also let me know which function I can use to check When Data Exists Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted May 9, 2010 Author Share Posted May 9, 2010 1) You can check whether value exists or not multiple ways a) using exists() function, this function checks whether the xml tag is coming or not. For ex if the element tag is coming as Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted May 9, 2010 Author Share Posted May 9, 2010 Thanks for your reply....But is there any way to check for all at one time instead of doing for each element I have around 20 elements to check.. Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted May 9, 2010 Author Share Posted May 9, 2010 If A1,A2, A3 are your source elements and which are optional.B1,B2,B3 are your target elements and if you are mapping one-to-one then you have to apply if(EXISTS()) function for each element. You can't apply only one IF condifition if any subset of elements may come in the source element. In case if your scenario is some thing like the source xml contains all of A1,A2,A3 or none of them (not a subset of A1,A2,A3) then you can apply a single IF condition on the top. Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted February 1, 2011 Author Share Posted February 1, 2011 Ajit's solution works good. Just to add to it, if you would also want to eliminate the additional spaces that appear instead of the tags, they can be done using the xslt below: Thanks, Soumya Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted September 15, 2011 Author Share Posted September 15, 2011 Hello all, Just a quick question regarding performance issue : Is the XSL sheet loaded each time my process def. will be trigerred or once Thanks for your help. Arnaud Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted May 4, 2012 Author Share Posted May 4, 2012 Thanks Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted May 4, 2012 Author Share Posted May 4, 2012 Thanks a million that's what exactly what Iam searching for Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted October 23, 2015 Author Share Posted October 23, 2015 hi If your empty element is required, you can't remove it and must set a value for it. If your element is optional, you shouldn't set any value for it and this element won't write in your xml output. Steel Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted October 23, 2015 Author Share Posted October 23, 2015 You can easily achieve it using XLST transformation. Save below content to a XSLT file. Then use XSLT tranformation activity in Tibco to remove emtty element. The input to XSLT tranformation activity is below file name and the XML with empty elements Thanks, Ajit Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted October 23, 2015 Author Share Posted October 23, 2015 you can add this property "java.property.automatic_mapper_if_surround=true" to add surround with if function for optional to optional fields so that we will not see empty tags in xml's.. Link to comment Share on other sites More sharing options...
Nitin Pawar 2 Posted October 23, 2015 Share Posted October 23, 2015 If we do not map any value, we get an empty close xml tag. but its a single closing tag. Is there any way we can get and empty open and close tag for values we have no mapping Link to comment Share on other sites More sharing options...
Jurgen Jacobs Posted February 21, 2018 Share Posted February 21, 2018 did you ever found a solution for this Link to comment Share on other sites More sharing options...
George Obretin Posted December 18, 2019 Share Posted December 18, 2019 Hi, could you say where to add this property "java.property.automatic_mapper_if_surround=true" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now