I am involved in a project where I must parse dates from an XML document. The application uses RMCobol and XML Extensions to create/parse XML. The issue is the dates are in different formats within the received XML. I have no control over the incoming XML, nor can I ask the formatting to remain consistent. The integration partner sends the data as they send the data and it's up to us how to handle it.
Here are 2 examples of the dates within the XML:
<InvoiceDate>2014-08-01Z</InvoiceDate>
<PayTermsString>20140818</PayTermsString>
My only idea was to replace the non-numeric characters with a space, put the data together without spaces, then break the date apart as 4-year, 2-month, and 2-day. However, I don't trust the data coming from the integration partner and what I described won't work if the data comes in as 2-month, 2-day, 4-year.
My question:
Is there anything I can do within the parsing style sheet to ensure the incoming dates are in a consistent format?