XML Output Format
Moderators: chulett, rschirm, roy
XML Output Format
Two of my output columns are float and decimal.
The input is 8.99 and 1998
When I parse the input, zeros come out on the numeric fields. Is there a way to see my output correctly without putting a XML transformer in the stream.
Thanks
The input is 8.99 and 1998
When I parse the input, zeros come out on the numeric fields. Is there a way to see my output correctly without putting a XML transformer in the stream.
Thanks
Jim Stewart
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 612
- Joined: Thu May 03, 2007 4:59 am
- Location: Melbourne
Try with varchar of 255
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
Sorry Ray, I agree, my message is very vague.
I am taking a XML file (sequential stage) and parsing it using the XML Input stage. On the output tab, I loaded the XML format in the description column. It is defined as /CATALOG/CD/PRICE/text(). But my price comes out as zeros. I am not sure if I am suppose to define it differently.
Thanks
I am taking a XML file (sequential stage) and parsing it using the XML Input stage. On the output tab, I loaded the XML format in the description column. It is defined as /CATALOG/CD/PRICE/text(). But my price comes out as zeros. I am not sure if I am suppose to define it differently.
Thanks
Jim Stewart
I used the metadata imported to load the layout. My input is one field called TITLE. All the infomation is correct until I reach the numeric values.
THe XML File is:
- <CATALOG>
- <CD>
<TITLE>Empire Burlesque</TITLE>
<ARTIST>Bob Dylan</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>Columbia</COMPANY>
<PRICE>10.90</PRICE>
<YEAR>1985</YEAR>
</CD>
My output layout is:
/CATALOG/CD/TITLE/text()
/CATALOG/CD/ARTIST/text()
/CATALOG/CD/COUNTRY/text()
/CATALOG/CD/COMPANY/text()
/CATALOG/CD/PRICE/text()
/CATALOG/CD/YEAR/text()
THe XML File is:
- <CATALOG>
- <CD>
<TITLE>Empire Burlesque</TITLE>
<ARTIST>Bob Dylan</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>Columbia</COMPANY>
<PRICE>10.90</PRICE>
<YEAR>1985</YEAR>
</CD>
My output layout is:
/CATALOG/CD/TITLE/text()
/CATALOG/CD/ARTIST/text()
/CATALOG/CD/COUNTRY/text()
/CATALOG/CD/COMPANY/text()
/CATALOG/CD/PRICE/text()
/CATALOG/CD/YEAR/text()
Jim Stewart
Hi Jim...
Is that the "actual" XML file? (just curious --- it looks like a cut/paste from IE)...you might want to be sure that the file is clean in notepad or some other pure text editor.....
Otherwise, you are right --- it should be ok with the Xpath that you have specified. What are your datatypes on the columns? For simplicity, what happens when you make all of your columns pure VARCHAR with length of 255? This might be something that is happening after the xml parsing is completed.
Also, how are you looking at the results? Peek? Sending to a flat file? Something else? Make 'em all char or varchar and lets see what you get. Sounds possibly like an EE import thing and not an XMLPack thing...
Ernie
Is that the "actual" XML file? (just curious --- it looks like a cut/paste from IE)...you might want to be sure that the file is clean in notepad or some other pure text editor.....
Otherwise, you are right --- it should be ok with the Xpath that you have specified. What are your datatypes on the columns? For simplicity, what happens when you make all of your columns pure VARCHAR with length of 255? This might be something that is happening after the xml parsing is completed.
Also, how are you looking at the results? Peek? Sending to a flat file? Something else? Make 'em all char or varchar and lets see what you get. Sounds possibly like an EE import thing and not an XMLPack thing...
Ernie
This is the real file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Edited with XML Spy v2007 (http://www.altova.com) -->
<CATALOG>
<CD>
<TITLE>Empire Burlesque</TITLE>
<ARTIST>Bob Dylan</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>Columbia</COMPANY>
<PRICE>10.90</PRICE>
<YEAR>1985</YEAR>
</CD>
I am using the PEEK stage to verify the output.
The first four field are varchar(255) unicode
The price is FLOAT(10) scale 2
The year is DECIMAL(10)
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Edited with XML Spy v2007 (http://www.altova.com) -->
<CATALOG>
<CD>
<TITLE>Empire Burlesque</TITLE>
<ARTIST>Bob Dylan</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>Columbia</COMPANY>
<PRICE>10.90</PRICE>
<YEAR>1985</YEAR>
</CD>
I am using the PEEK stage to verify the output.
The first four field are varchar(255) unicode
The price is FLOAT(10) scale 2
The year is DECIMAL(10)
Jim Stewart