Author |
Message
|
rbicheno |
Posted: Wed Jun 29, 2011 5:05 am Post subject: |
|
|
Apprentice
Joined: 07 Jul 2009 Posts: 43
|
I would also suggest you search for some generic java or XSLT code to remove empty elements, its not an uncommon issue, that's been solved before in those technologies. Then drop the code into an XSLT or Java compute node. Its not as efficient as using ESQL as you will not be working directly on the tree but should work and save time! |
|
Back to top |
|
 |
joebuckeye |
Posted: Wed Jun 29, 2011 5:08 am Post subject: |
|
|
 Partisan
Joined: 24 Aug 2007 Posts: 365 Location: Columbus, OH
|
How are you doing the mapping between the COBOL format and XML?
We use ESQL to our mapping and wrote a generic function for getting XML data from the COBOL fields.
This function trims leading and trailing spaces from the COBOL fields and if the resulting data field is nothing the function returns NULL, thus deleting the XML field.
Here is a sample call we make:
SET outputRef.outputField1 = getXMLData(inputRef.cobolField1);
Every SET statement uses this getXMLData() function to clean the input data and allow the removal of empty data fields. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Jun 29, 2011 5:09 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Of course, if you remove an empty element and the XSD that describes the data does not indicate that the field is nillable, then you have created a non-conforming document. |
|
Back to top |
|
 |
joebuckeye |
Posted: Wed Jun 29, 2011 5:29 am Post subject: |
|
|
 Partisan
Joined: 24 Aug 2007 Posts: 365 Location: Columbus, OH
|
Well, there is that.
We use Datapower in addition to the broker and we are amazed by the number of providers we use that give us a WSDL for their web service and then their own responses aren't valid according to the WSDL's and/or schemas they give us. So we end up having to turn off response validation in the Web Service Proxy. |
|
Back to top |
|
 |
kimbert |
Posted: Sat Jul 02, 2011 11:11 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
Of course, if you remove an empty element and the XSD that describes the data does not indicate that the field is nillable, then you have created a non-conforming document. |
I hate to be pedantic but...
making an element nillable does not allow you to delete it from the document. Setting minOccurs to zero would. |
|
Back to top |
|
 |
mqjeff |
Posted: Sat Jul 02, 2011 11:58 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
kimbert wrote: |
Quote: |
Of course, if you remove an empty element and the XSD that describes the data does not indicate that the field is nillable, then you have created a non-conforming document. |
I hate to be pedantic but... |
I think I know you too well to believe that...
kimbert wrote: |
making an element nillable does not allow you to delete it from the document. Setting minOccurs to zero would. |
Regardless, one can't just randomly remove elements from an XML document without understanding the meaning of the document. |
|
Back to top |
|
 |
madi |
Posted: Thu Jul 07, 2011 8:39 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
joebuckeye wrote: |
How are you doing the mapping between the COBOL format and XML?
We use ESQL to our mapping and wrote a generic function for getting XML data from the COBOL fields.
This function trims leading and trailing spaces from the COBOL fields and if the resulting data field is nothing the function returns NULL, thus deleting the XML field.
Here is a sample call we make:
SET outputRef.outputField1 = getXMLData(inputRef.cobolField1);
Every SET statement uses this getXMLData() function to clean the input data and allow the removal of empty data fields. |
how is the performance? isnt calling a function on every mapping resource intensive?? _________________ IBM Certified Solutions Developer - WMB 6.0 |
|
Back to top |
|
 |
joebuckeye |
Posted: Fri Jul 08, 2011 5:17 am Post subject: |
|
|
 Partisan
Joined: 24 Aug 2007 Posts: 365 Location: Columbus, OH
|
madi wrote: |
joebuckeye wrote: |
How are you doing the mapping between the COBOL format and XML?
We use ESQL to our mapping and wrote a generic function for getting XML data from the COBOL fields.
This function trims leading and trailing spaces from the COBOL fields and if the resulting data field is nothing the function returns NULL, thus deleting the XML field.
Here is a sample call we make:
SET outputRef.outputField1 = getXMLData(inputRef.cobolField1);
Every SET statement uses this getXMLData() function to clean the input data and allow the removal of empty data fields. |
how is the performance? isnt calling a function on every mapping resource intensive?? |
Performance is acceptable in our case.
This is a very small ESQL function that is within the same ESQL module as the procedure that is calling it.
Not sure if calling an ESQL function repeatedly would be any more resource intensive than having the code inline.
If for nothing else the ease of maintenance by having this functionality in a function is worth it. |
|
Back to top |
|
 |
|