laptop_01 Posted September 26, 2003 Posted September 26, 2003 Hi; I need to convert data stored in flat binary file (legacy database) to XML tags. The data are typically arrays of integers, float, logical ... and so forth. I have read few XML books but none seems to touch the issue of presenting Array data in XML tags. I need to maintain awarness of the array name, indexes and values for each index. Any one got an idea on how to do this or knows a site where I can check it out? Thansk Quote
AlexCode Posted September 29, 2003 Posted September 29, 2003 I'm not shure on this ... but I think you should read some XSLT books... If you build your own XSLT to do that it must work... But... Good luck... Quote Software bugs are impossible to detect by anybody except the end user.
laptop_01 Posted September 29, 2003 Author Posted September 29, 2003 Thanks for the reply. If you happen to know the title of a good book, please post the name. There is a book for Riley (not sure what the title is ... something XSLT something) which I will probably end up buying. This array issue is a pain. I can create a bunch of tags but I can't believe there is no standard or guidance ... at least I have not seen one. Quote
cyclonebri Posted October 1, 2003 Posted October 1, 2003 From what I understand of XML, the reason you might not find a standard is because XML is what you make of it. I am thinking about your array issue and wondering, could you do something like this: <root> <Array Name="myStrings" Type="String"> <Value Position="0" sValue="Foo"/> <Value Position="1" sValue="Bar"/> </Array> <Array Name="myArray" Type="Integer"> <Value Position="0" iValue="37"/> <Value Position="1" iValue="65"/> </Array> </root> Is that something like what you are looking for? Or are you looking for the actual code to do this? Quote
laptop_01 Posted October 1, 2003 Author Posted October 1, 2003 cyclonebri, Thanks for the reply: <root> <Array Name="myStrings" Type="String"> <Value Position="0" sValue="Foo"/> <Value Position="1" sValue="Bar"/> </Array> <Array Name="myArray" Type="Integer"> <Value Position="0" iValue="37"/> <Value Position="1" iValue="65"/> </Array> </root> Is that something like what you are looking for? Or are you looking for the actual code to do this? Can you extrpolate this to 2D array, a 2 by 3 like this? MyArray(1,1) = 14 MyArray(1,2) = 25 MyArray(1,3) = 35 MyArray(2,1) = 13 MyArray(2,2) = 46 MyArray(2,3) = 44 I would appreciate a tip on how to transform it to a table. Quote
cyclonebri Posted October 1, 2003 Posted October 1, 2003 <root> <Array Name="myStrings" Type="String"> <Value Position1="1" Position2="1" sValue="Fourteen"/> <Value Position1="1" Position2="2" sValue="Twenty-Five"/> </Array> <Array Name="myArray" Type="Integer"> <Value Position1="1" Position2="1" iValue="14"/> <Value Position1="1" Position2="2" iValue="25"/> </Array> </root> Is this what you mean? I am unsure what exactly you were asking in your last post. I assume you are looking for something like this. With xml, just remember you set it how you want it. All I did here that is different from the last one was just gave the Value tags another attribute for Position2 and changed the original position to Position1. You can add as many attributes as you need to the tag, but this seems to be the way that I would do what you are trying to do. The xml for this follows this path: <root> (<array><value />*</array>)* </root> remember, since Xml is what you make of it, you could have done whatever you wanted <root> (<anyTagName>(<Whatever><NestedTags />*</Whatever>)*</anyTagName>)* </root> .Net gives us some powerful ways using the DOM Document and datasets to get the xml attributes and so that is why I just put it to one level for the values. You could have done tags for each position, but it's a lot more work that way. Anyway, I hope this has been helpful. Brian Quote
laptop_01 Posted October 1, 2003 Author Posted October 1, 2003 cyclonebri, Thanks a lot. I appreciate your feed back. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.