Hi there,
I am somewhat new to XML and working on using XML in some data intergrations. I have gotten an XML file and the attribute column reuses iteself over and over for the column names. I think they did this since I will specify it once in the DTD and then someone can add or remove columns all they want without re-creating the DTD.
What I want to know, is how to parse out each column of data associated with the top level attribute (in this case a part #). Then about 80 columns underneath it, are the columns associated to that part number and then it ends and repeats itself for a new part # etc.
I have my example below (you can see the FEATURE attributekey keeps repeating itself with a new column name). I basically want to pull out each attributekey and make that the column header and take the value and put it in the same row below the column header to make one full record.
Is this a common way to use XML? Seems quite messy.
FEATURE attributekey="PArt_Number" changedby="admin" changedat="20050503195200">
<VALUE>08586241</VALUE>
</FEATURE>
<FEATURE attributekey="Name" lang="ENS" sourcelang="ENS" changedby="admin" changedat="20050503195200">
<VALUE>A1 Project Development</VALUE>
</FEATURE>
</FEATURE>
<FEATURE attributekey="Active_Sales" changedby="admin" changedat="20050503195200">
<VALUE>Y</VALUE>
</FEATURE>
<FEATURE attributekey="Active_Spare" changedby="admin" changedat="20050503195200">
<VALUE>N</VALUE>
</FEATURE>
<FEATURE attributekey="Buyer_Status" changedby="admin" changedat="20050503195200">
<VALUE>A</VALUE>
</FEATURE>
<FEATURE attributekey="Additional_Text" lang="ENS" sourcelang="ENS" changedby="admin" changedat="20050602094300">
<VALUE>Test Text</VALUE>
</FEATURE>
I am somewhat new to XML and working on using XML in some data intergrations. I have gotten an XML file and the attribute column reuses iteself over and over for the column names. I think they did this since I will specify it once in the DTD and then someone can add or remove columns all they want without re-creating the DTD.
What I want to know, is how to parse out each column of data associated with the top level attribute (in this case a part #). Then about 80 columns underneath it, are the columns associated to that part number and then it ends and repeats itself for a new part # etc.
I have my example below (you can see the FEATURE attributekey keeps repeating itself with a new column name). I basically want to pull out each attributekey and make that the column header and take the value and put it in the same row below the column header to make one full record.
Is this a common way to use XML? Seems quite messy.
FEATURE attributekey="PArt_Number" changedby="admin" changedat="20050503195200">
<VALUE>08586241</VALUE>
</FEATURE>
<FEATURE attributekey="Name" lang="ENS" sourcelang="ENS" changedby="admin" changedat="20050503195200">
<VALUE>A1 Project Development</VALUE>
</FEATURE>
</FEATURE>
<FEATURE attributekey="Active_Sales" changedby="admin" changedat="20050503195200">
<VALUE>Y</VALUE>
</FEATURE>
<FEATURE attributekey="Active_Spare" changedby="admin" changedat="20050503195200">
<VALUE>N</VALUE>
</FEATURE>
<FEATURE attributekey="Buyer_Status" changedby="admin" changedat="20050503195200">
<VALUE>A</VALUE>
</FEATURE>
<FEATURE attributekey="Additional_Text" lang="ENS" sourcelang="ENS" changedby="admin" changedat="20050602094300">
<VALUE>Test Text</VALUE>
</FEATURE>