Re: Working with XML...


Sandor Szatmari
 

Yea, it was a bummer that Apple shipped with large file support disabled. We regularly have XML files well above 100MB. This was a big surprise when we moved to El Capitain. We just downloaded the source from Appleā€™s open source repo and added that one option and rebuilt. Stashing it in /usr/local/... gives us the option to use it when needed.

Good luck!

Regards,
Sandor

On Dec 20, 2017, at 00:20, Jean-Christophe Helary <jean.christophe.helary@gmail.com> wrote:

Thank you Sandor,

I was just working on a 125mb file with 500,000 end nodes (not sure that's the right term) and all the tools I tried were pretty slow *except* for the dedicated tool I use for such tasks (that I suspect is not a strict XML parser since the file was not valid XML in the first place)...

Anyway, I'll keep investigate, but I'd rather work with out of the box solutions...

Jean-Christophe

On Dec 20, 2017, at 7:49, Sandor Szatmari <admin.szatmari.net@gmail.com> wrote:

The version did libxslt that was shipped with El Capitain, and maybe later, has large file support disabled. You can rebuild from source and add XML_PARSE_HUGE to the default XSLT_PARSE_OPTIONS to parse files larger than 10MB.

Sandor

On Dec 18, 2017, at 07:06, Jean-Christophe Helary <jean.christophe.helary@gmail.com> wrote:



On Dec 18, 2017, at 19:59, Shane Stanley <sstanley@myriad-com.com.au> wrote:

On 18 Dec 2017, at 5:13 pm, Jean-Christophe Helary <jean.christophe.helary@gmail.com> wrote:

I guess I'll have to try AppleScriptObjC then... Which means diving into your book...
It doesn't get much more than a passing reference, with one example using XPath queries. It's the sort of thing where the approach depends largely on the structure of the XML you're dealing with. That said, if XPath suits the job, it saves a lot of work and time.
Well, I'm not sure what will suit the job. Basically I want to create a few scripts that do QA checks on XML files of a specific type (tmx). The checks involve checking nodes uniqueness, data consistency between nodes, searches, etc. I have very little ideas where to start, so I'll just try a few things, see how that fares, and repeat until I find better ideas...



Jean-Christophe Helary
-----------------------------------------------
@brandelune http://mac4translators.blogspot.com

Jean-Christophe Helary
-----------------------------------------------
@brandelune http://mac4translators.blogspot.com




Join applescript@apple-dev.groups.io to automatically receive all group messages.