Hi all,
Could you please help me in reading below XML file .I need to produce an sequential file from Xml input file .
<Employee Place="USA" Status="Active" Date="2012-09-30">
<Name="AAA" No="1" Grade="B" />
<Name="BBB" No="2" Grade="D" />
<Name="CCC" No="3" Grade="F" />
</Employee>
I need to Create output file as below format
Name,No,Grade
AAA,1,B
BBB,2,D
CCC,3,F
Need help while reading xml file
Moderators: chulett, rschirm, roy
Need help while reading xml file
Chandra Mouli
What everyone is saying here is to just follow the doc and give it a shot...the xml above is actually very straightforward and an excellent one to start with when learning about the various xml stages. Hint --- you'll need a table definition, and for this, the xmlInput Stage will be fine..... and spend more time doing searches thru the forum here. There are many threads that discuss xml, how to read it from disk, what to specify in the Stages, etc.
Ernie
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
I take that back. Sorry --- the xml that you have pasted up above is not legitimate xml. There needs to be an element name collecting the various attributes for each "name" line.
Did you cut and paste this from somwhere or type it in manually?
<Employee Place="USA" Status="Active" Date="2012-09-30">
<Name="AAA" No="1" Grade="B" />
<Name="BBB" No="2" Grade="D" />
<Name="CCC" No="3" Grade="F" />
</Employee>
Look carefully at the source again. It "should" be easy, but not in this format.
A good tricks to always try:
...put a string like that in an editor, like Notepad and add an xml header line at the top....
<?xml version="1.0" ?>
...then try to open it in IE or other favorite browser. You'll see that this one dies. It is not well-formed.
The problem is the attribute lines...the probably should be something like:
<EmployeeDetail Name="AAA" No="1" Grade="B" />
Ernie
Did you cut and paste this from somwhere or type it in manually?
<Employee Place="USA" Status="Active" Date="2012-09-30">
<Name="AAA" No="1" Grade="B" />
<Name="BBB" No="2" Grade="D" />
<Name="CCC" No="3" Grade="F" />
</Employee>
Look carefully at the source again. It "should" be easy, but not in this format.
A good tricks to always try:
...put a string like that in an editor, like Notepad and add an xml header line at the top....
<?xml version="1.0" ?>
...then try to open it in IE or other favorite browser. You'll see that this one dies. It is not well-formed.
The problem is the attribute lines...the probably should be something like:
<EmployeeDetail Name="AAA" No="1" Grade="B" />
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>