Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] tXMLMap is not working correctly with date fields

Hi,
I am working TOS 551 and using xml data. I noticed an issue with xml date fields. See below example:
This simple job reads an xml file, uses the tXMLMap and outputs the data to the log.
0683p000009MBWu.png
Content of tFileInputXML. Nothing special done here. Just reading a testDate.xml file which contains a date field.
0683p000009MBkC.png
In the Map Editor I did an import from File and used my xsd file.
This simple xsd (also attached) contains an type="xs:date" field.
The result is shown below:
0683p000009MBkC.png

As you can see the data is not shown correctly.
Can you please explain what I am doing wrong or if this is a bug, can you please fix?
Looks like Talend is expecting a date always to be in format "dd-mm-yyyy" while the xml dat format is "yyyy-mm-dd".
I'm working around this by changing the date type in the xsd by the String type.
The xml:
<testDate xmlns:xsd="" xmlns:xsi="">
<runDate>2014-09-27</runDate>
</testDate>
The xsd:
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="">
  <xs:element name="testDate">
    <xs:complexType>
      <xs:sequence>
        <xs:element type="xs:date" name="runDate"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
testDate.zip.zip
Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi
Click Tree schema editor tab, and then you are able to modify all columns!
Shong

View solution in original post

5 Replies
Anonymous
Not applicable
Author

Hi 
By default, the date pattern of a Date column is " dd-MM-yyyy ", you can change manually it to other format.
Best regards
Shong
Anonymous
Not applicable
Author

Thanks Shong. But I believe that is not possible when reading a date from an xml file.
Please show me where I can change it.
See attached screenshot.
On the top left you'll see the xml tree. I can't change it there. On the bottom left you'll see that the type is document. On the right I can change the output format of the date. If I change that into "yyyy-MM-dd" I just get the result: "0033-03-06" while the input-date was: "2014-09-27"!

regards, Martin
0683p000009MBkH.png
Anonymous
Not applicable
Author

Hi
Click Tree schema editor tab, and then you are able to modify all columns!
Shong
Anonymous
Not applicable
Author

Shong,
Cool! I totally missed that extra tab.
This indeed solves the issues.
Thanks, Martin
Anonymous
Not applicable
Author

Created account just so I could give you Kudo. Can't say how many hours I have spent before I stumbled into this solution... 0683p000009MPcz.png 0683p000009MPcz.png 0683p000009MPcz.png I had date in XML file "2018-04-14T09:10:20.88" and the error message was Unparseable Date when I tried to execute Job