Opinions/Suggestions for XML Data

Get help with using AutoHotkey and its commands and hotkeys
MannyKSoSo
Posts: 122
Joined: 28 Apr 2018, 21:59

Opinions/Suggestions for XML Data

18 Jul 2018, 12:03

So I am looking for opinions/suggestions on the best way/approach to gather information from this xml. This is only a small section of the xml, but the formatting remains the same throughout the whole thing.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Currently what I am doing is first separating the data by a small sections via their rows (since all the data I want is contained within a row). But as you can see, there is no specific ID's for each data point, and some of them are almost exactly the same in some cases. So I wrote a small section of code to clean up all the mess of the xml so its manageable.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Which this code will produce the following result.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Which this isn't terrible to deal with, but it also means that I have to separate each line as a data point that I want to obtain. Specifically I would like to be the variables as follows

#: 958 INT#: 1336
Title: International Chart Series, Baltic Sea - Sweden and Denmark, Bornholmsgat. Scale: 1:100,000
Plan: A Title: Christiansø. Limits: (null) Scale: 1:12,500
Plan: B Title: Rønne. Limits: 55° 05´·03 N. — 55° 06´·42 N., 14° 40´·57 E. — 14° 42´·03 E. Scale: 1:12,500
Plan: C Title: Nexø. Limits: (null) Scale: 1:8,000
Remark 1: Includes changes to depths, wrecks, restricted areas, extraction areas and aids to navigation. The limits of panel B have been changed to provide improved coverage of Rønne. (A modified reproduction of INT1336 published by Denmark.)
Remark 2: Note: On publication of this New Edition former Notice 6042(P)/17 is cancelled.
Folio: 10
Page: 34

Any suggestions or hints welcome. Thanks
PS #BlameAdobe for the silly format of the xml and the repetitive Italics
MannyKSoSo
Posts: 122
Joined: 28 Apr 2018, 21:59

Re: Opinions/Suggestions for XML Data

20 Jul 2018, 12:34

Update to previous post. I have updated my code somewhat to improve finding the data appropriately. This is what I have come up with

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


This will produce a better looking file (removes the extra line breaks), but there are still things to be improved. For example, depending on how the original pdf was, there are a few inheritances that still can hinder some of the data.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


The above is the newer format that I have come up with so far, but the issue remains with line "Marau Sound. Lungga Roads. Honiara."
Instead of the line being split like it is in the example xml, instead the xml lumps them together like so

Code: [Select all] [Download] GeSHi © Codebox Plus

<Font html:Size="9" html:Face="Times New Roman" x:Family="Roman" html:Color="#000000">Marau Sound. Lungga Roads. Honiara. </Font>

Any suggestions are appreciated (also before you say StrSplit by periods, its not a 100% guarantee that the names will have a period).

Also since all of the data that I will be gathering from these xml's are going to be placed in database file I have decided to use justme's SQLiteDB Class script for searching and maintaining the database, I would also like to hear suggestions of how to best display the data. I am jumping back and forth between a ListView and a TreeView (other recommendations accepted), but everything I put in the database will need to have its own unique ID so you can view the history of what is going on with the chart.

Return to “Ask For Help”

Who is online

Users browsing this forum: Hellbent, ZeroX4 and 65 guests