I have three elements in my source schema: BIRTH_DAY, BIRTH_MONTH, and BIRTH_YEAR. I need these converted into a single element (DOB) in my target schema. The DOB will follow the following 10 character format:
YYYY-MM-DD
How do I do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here’s one option…
XML Input
XSLT 1.0
XML Output
Edit for different month format.
This is a lot easier in XSLT 2.0, but in 1.0 what I would do is a named template that will return the numerical month. In the example below, the numerical month is returned if the entire month or the first 3 letters of the month are used. It’s case insensitive as well.
XML Input
XSLT 1.0
XML Output