Page 1 of 1

Parsing XML file

Posted: Wed Mar 31, 2010 6:58 am
by Etler21
I have a XML file whose content I am trying to load into a table,I am not sure how to pull data from this XML file because I am not able to understand the metadata behind this XML.

I tried to Import this XML file into Import table defination section,XML as source and build a metadata which is then used in the XML imput stage.

Still,there are some issues with the design and Value coloumn is blank at all the places.I have pasted a sample XML file for the reference..
Anyone could please suggest me the way to read all data within the XML.

=================================================

<dumps Patcher="http://hoverif.comer:29081/d3p">
<dump time="Tue Mar 09 10:32:27 CST 2010">
<scom name="com.sepr:type=Metrics,service=monitorService">
<attributes>
<attribute name="Failed">
<value>
dd
</value>
</attribute>
<attribute name="Successful">
<value>
e0
</value>
</attribute>
<attribute name="Consolidated">
<value>
<composite>
<attribute name ="LastRes">
<value>
1084
</value>
</attribute>
<attribute name ="LastResponseUpdate">
<value>
Tue Mar 09 10:24:34 CST 2010
</value>
</attribute>
</composite>

</value>
</attribute>
<attribute name="Operational">
<value>
Available
</value>
</attribute>
<attribute name="NumberOfSuccessful">
<value>
0
</value>
</attribute>
<attribute name="LastResponse">
<value>
1084
</value>
</attribute>
<attribute name="TimeInThread">
<value>
10
</value>
</attribute>
<attribute name="ThreadQueueLength">
<value>
10
</value>
</attribute>
<attribute name="Health">
<value>
NotApplicable
</value>
</attribute>
</attributes>
</scom>
</dump>
</dumps>
=================================================

Posted: Wed Mar 31, 2010 7:35 am
by chulett
Tried to import the metadata? So, did you? What happened? If you have (or can get) an xsd for this, it would be a better source to import metadata from, by the way.

Posted: Thu Apr 01, 2010 4:34 am
by Etler21
can you please tell me how to get xsd for this xml file ?

Posted: Thu Apr 01, 2010 6:19 am
by chulett
Ask for it from whomever supplied you with the XML, meaning whomever created it. They should also have an xsd (the metadata) for it.

Posted: Fri Apr 02, 2010 12:03 pm
by Etler21
unfortunately no-one knows about that xsd of that XML file,this is an auto generated thing.this is the Metadata which I am using in the XML xformer stage.

Patcher VarChar(60) /dumps/@Patcher
Time VarChar(30) /dumps/dump/@time
scomname VarChar(80) /dumps/dump/scom/@name
name VarChar(50) /dumps/dump/scom/attributes/attribute/@name
Value Decimal(15) /dumps/dump/scom/attributes/attribute/@value

When I use this meta data and run the job,all colums get loaded properly but Value field is Blank..

I am sure about all other thing which is good in the job,but I am not sure about the metadata,Is there something wrong in the metadata ?

Posted: Fri Apr 02, 2010 12:12 pm
by anbu

Code: Select all

Value Decimal(15) /dumps/dump/scom/attributes/attribute/value/text()