topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday December 12, 2024, 7:15 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA : XML Stripper  (Read 7445 times)

mino.ganzerli

  • Participant
  • Joined in 2010
  • *
  • default avatar
  • Posts: 1
    • View Profile
    • Donate to Member
IDEA : XML Stripper
« on: October 18, 2011, 02:41 PM »
Hy all!
I've been using some of your utility (Shortcut Creator, OpeningHours, Screenshot Captor, to tell you some) and in the last months I'm searching for a way to manipulate, hem, strip, the XML tag from some XML files.
I'm a inSSIDer user ( http://www.metageek....t/products/inssider/ ) and I would like to save in XML bacause has a lot of info, more than saving in CSV, but to manage, organize and list wlan I'm using Libre Office.
The passage that I always do is :

open a text editor
search for ant XML marker and replace with "tab"
import the text in Libre Office Calc
start to organize the list
export the list to XML

If I have a tool that strip all the unwanted XML marker and give me the old plain text ready to import in Calc I will be really happy!
My final goal is to have a list of all the wlan in my city, divided per blocks, per streets, per channel and so on, but without the XML stripper it's a long and boring "search and replace hell"...
Maybe someone can help me?

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Re: IDEA : XML Stripper
« Reply #1 on: October 18, 2011, 02:59 PM »
Usually, anyone requiring special XML formatting I direct to the Apache FOP project, but you'll find FOP is quite a tank to swat a fly with :D

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3,205
    • View Profile
    • Donate to Member
Re: IDEA : XML Stripper
« Reply #2 on: October 18, 2011, 03:13 PM »
A quick Google search turns up a few SED and PERL scripts that might work, at least partially?

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Re: IDEA : XML Stripper
« Reply #3 on: October 18, 2011, 03:28 PM »
SED or PERL are good choices for this case, I guess, the file-layout is rather static.

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,287
    • View Profile
    • Donate to Member
Re: IDEA : XML Stripper
« Reply #4 on: October 18, 2011, 03:36 PM »
Why not use one of the dedicated XML editors out there instead of all this converting from XML and then converting back to XML?

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3,205
    • View Profile
    • Donate to Member
Re: IDEA : XML Stripper
« Reply #5 on: October 18, 2011, 03:36 PM »
There's even:

XMLgawk

http://home.vrweb.de...rgen.kahrs/gawk/XML/

XMLgawk is an experimental extension of the GNU Awk interpreter. It includes a small XML parsing library which is built upon the Expat XML parser. The parsing library is a very thin layer on top of Expat (implementing a pull-interface) and can also be used without GNU Awk to read XML data files. Both, XMLgawk and its XML puller library only require an ANSI C compatible compiler (GCC works, as do most vendors' ANSI C compilers) and a 'make' program.

XMLgawk provides the following functionality:

    * AWK's way of reading data line by line is supplemented by reading XML files node by node.
[...]
Someone has compiled binaries for Windows, though it looks like you might need Cygwin or something else as well.

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: IDEA : XML Stripper
« Reply #6 on: October 18, 2011, 03:39 PM »
If you have to knock something together yourself you might try AutoIt3 using _StringBetween() function. This line I used with an xml subtitle file to get the start time:

$lines = _StringBetween($chapterTimes[$x], "<ChapterTimeStart>", "</ChapterTimeStart>")

You could have a 2 dimensional array with start and end tags you are looking for if you only need to find a few tags. If it's wide-reaching then you may need to use RegEx patterns.  But to catch simple start and end tags _StringBetween should be good enough. It's easy to use.

If it finds the delimiters it returns an array of the strings between them.

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: IDEA : XML Stripper
« Reply #7 on: October 18, 2011, 03:44 PM »
Looks like this XmlGawk mod was compiled with MinGW as stand-alone Windows binary:

http://www.wim-blit....20for%20Windows.html