How can I better understand and move the structure of large XML files

I am going through a somewhat large XML file. Say I'm looking for a specific value in a tree. I find it manually, but then to find it programmatically, I need to know the path. Right now, I am using tidyand vimto print the file so that I can inspect it manually. However, it becomes very fast because the file has more than 30,000 lines. Therefore, when I found the above value, it is quite difficult to determine the full path. Ideally, I need a tool that allows me to perform a full search of the contents of the xml file, and then display the full path to the root. This question has some great suggestions, but they are all Windows only. Is there anything for the Macs?

+5
source share
3 answers

There are some powerful XML tools for the Mac. In particular, if you are interested in a way, I like to use the Eclipse XML editor. If you download the Helios version (go for the “Eclipse IDE for JavaScript web developers”), you can set it as your default XML editor (in Finder, install Open With), and it has very robust XML tools and shows path in the status bar.

There are other tools, GIYF.

+1
source

I am using a combination of vim, xmllint, xpath and the cgrep tool, which you can find at http://plg1.cs.uwaterloo.ca/~ftp/mt/cgrep/ .

vim - .

xmllint , xml-.

xpath xmllint iirc , xpath .

cgrep - grep, , , (xml, ini, properties, yaml ..). , xpath.

, gcc , , C - , .

+1

, Mac XML, , Apple: http://developer.apple.com/mac/library/samplecode/XMLBrowser/Introduction/Intro.html

You can view XML, as well as check various XQuery strings to see what is returned.

+1
source

All Articles