Request for ideas/direction

Discussion in 'XML' started by Mark Woods, Sep 13, 2004.

  1. Mark Woods

    Mark Woods Guest

    Hello Everyone,

    Have a question for the group...

    At work, we use a software/hardware inventory product called "Alchemy
    Network Inventory". It scans each computer that logs into our network
    and creates a result file on a server. The result files are tagged-text,
    with an extension of ".XML". These files are not truly valid XML, as
    they are missing the XML statement at the top and do not have a link to a
    DTD/schema. I have asked the manufacturer for such a DTD/schema, but
    they have not honored my request at this time.

    They have a console program that reads the result files and can display
    each computer and it's components/software, and this program can also
    export any/all of the result files to more traditional file formats such
    as Excel, CSV and Access (via ODBC).

    What I'm looking for are ideas on what parsers/programming languages I
    could use that would be able to "read" these result files and generate
    reports in either HTML, pure text, etc.

    Need something that I can do immediate, ad hoc reports and have been
    looking at Perl, Python, VBScript, XSLT, etc., but am a novice programmer
    and am looking to learn in the process of doing it.

    Thanks in advance...


    ----------

    Mark L. Woods
    Saint Louis, MO USA
     
    Mark Woods, Sep 13, 2004
    #1
    1. Advertising

  2. Mark Woods wrote:


    > At work, we use a software/hardware inventory product called "Alchemy
    > Network Inventory". It scans each computer that logs into our network
    > and creates a result file on a server. The result files are tagged-text,
    > with an extension of ".XML". These files are not truly valid XML, as
    > they are missing the XML statement at the top and do not have a link to a
    > DTD/schema. I have asked the manufacturer for such a DTD/schema, but
    > they have not honored my request at this time.


    If by "XML statement" you mean the XML declaration e.g.
    <?xml version="1.0"?>
    then it is allowed to leave that out if the encoding of the file is
    UTF-8 or UTF-16.
    And "a link to a DTD", e.g. the DOCTYPE node
    <!DOCTYPE root SYSTEM "whatever.dtd">
    is also optional thus what you have could indeed be XML if it is
    well-formed markup.


    > What I'm looking for are ideas on what parsers/programming languages I
    > could use that would be able to "read" these result files and generate
    > reports in either HTML, pure text, etc.


    If it is XML then any XML parser would do and then you can use DOM or
    XSLT to create other formats.

    The programming language to choose obviously needs to support XML
    parsing but most languages do that so your choice should be driven by
    what you are comfortable with.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Sep 13, 2004
    #2
    1. Advertising

  3. Mark Woods wrote:

    > and creates a result file on a server. The result files are tagged-text,
    > with an extension of ".XML". These files are not truly valid XML, as
    > they are missing the XML statement at the top and do not have a link to a


    xmllint accepts such files.

    > What I'm looking for are ideas on what parsers/programming languages I
    > could use that would be able to "read" these result files and generate
    > reports in either HTML, pure text, etc.


    The canonical solution seems to be to use XSL.

    > Need something that I can do immediate, ad hoc reports and have been
    > looking at Perl, Python, VBScript, XSLT, etc., but am a novice programmer
    > and am looking to learn in the process of doing it.


    I would use a script language rather than XSL.
    Script languages allow you to implement stand-alone
    scripts with a minimum of requirements.
     
    =?ISO-8859-1?Q?J=FCrgen_Kahrs?=, Sep 13, 2004
    #3
  4. Mark Woods

    Rolf Kemper Guest

    Mark,
    if I undestood it right, you want to convert the invalid xml into a
    valid xml.
    In case you have it in Excel, you could write out the Excel file as
    XML. It has all the Excell items and declarations with it. Then you
    might apply some xslt to the transform it to your target format. But
    all this this might be a total overkill.
    If I would have to do the job, I would use perl (some regex and
    XML::Simple , which is quite easy)and write out xml. Then translate it
    to HTML , text, etc. by xlst.

    Rolf


    Mark Woods <> wrote in message news:<Xns9562D2FC57794mbear67earthlinknet@216.168.3.30>...
    > Hello Everyone,
    >
    > Have a question for the group...
    >
    > At work, we use a software/hardware inventory product called "Alchemy
    > Network Inventory". It scans each computer that logs into our network
    > and creates a result file on a server. The result files are tagged-text,
    > with an extension of ".XML". These files are not truly valid XML, as
    > they are missing the XML statement at the top and do not have a link to a
    > DTD/schema. I have asked the manufacturer for such a DTD/schema, but
    > they have not honored my request at this time.
    >
    > They have a console program that reads the result files and can display
    > each computer and it's components/software, and this program can also
    > export any/all of the result files to more traditional file formats such
    > as Excel, CSV and Access (via ODBC).
    >
    > What I'm looking for are ideas on what parsers/programming languages I
    > could use that would be able to "read" these result files and generate
    > reports in either HTML, pure text, etc.
    >
    > Need something that I can do immediate, ad hoc reports and have been
    > looking at Perl, Python, VBScript, XSLT, etc., but am a novice programmer
    > and am looking to learn in the process of doing it.
    >
    > Thanks in advance...
    >
    >
    > ----------
    >
    > Mark L. Woods
    > Saint Louis, MO USA
     
    Rolf Kemper, Sep 13, 2004
    #4
  5. Mark Woods

    Andy Dingley Guest

    On Mon, 13 Sep 2004 01:44:29 -0000, Mark Woods <>
    wrote:

    >These files are not truly valid XML, as
    >they are missing the XML statement at the top and do not have a link to a
    >DTD/schema.


    These may not even be valid XML, but they're probably well-formed XML
    and that's all you need.

    XML alone can just be "well-formed", which means that the syntax is
    correct. XML prologs, DTDs and schemas are all optional.

    XML for a named application can go one better than this, and could be
    "valid". This means that it's written according to a DTD/schema and
    it matches that DTD/schema. Containing an explicit link to that
    DTD/schema is still optional.


    >I have asked the manufacturer for such a DTD/schema, but
    >they have not honored my request at this time.


    They very rarely do. If they would tell you, they'd have told you
    already and been proud of it.


    >What I'm looking for are ideas on what parsers/programming languages I
    >could use


    Some scripting language that you know / like, and that can connect to
    an XML DOM / XSLT transformer. Perl or Python could easily do this.
    By the sound of things you're on Windows (what about the servers ?)
    so a handy XML tool is Microsft's MSXML that is a free download and
    does both XML and XSLT.

    Depending on the structure and usage of the schema, you may be able to
    process the document entirely with XSLT. This is unlikely though -
    it's usual that you need a slightly smart "wrapper" around it, so as
    to feed it the right files and maybe some metadata from other sources.

    You may also need to perform some internal computation or string
    mangling that's hard in pure XSLT 1, but trivial in JavaScript or
    regexes. This is a job for an extension to XSLT, a simple little
    snippet of JavaScript embedded in the stylesheet. They're not very
    portable for web-wide distribution, but they work fine for in house
    tools.

    Michael Kay's XSLT book is the one to have.
    --
    Smert' spamionam
     
    Andy Dingley, Sep 14, 2004
    #5
  6. Mark Woods

    William Park Guest

    Mark Woods <> wrote:
    >
    > Hello Everyone,
    >
    > Have a question for the group...
    >
    > At work, we use a software/hardware inventory product called "Alchemy
    > Network Inventory". It scans each computer that logs into our network
    > and creates a result file on a server. The result files are tagged-text,
    > with an extension of ".XML". These files are not truly valid XML, as
    > they are missing the XML statement at the top and do not have a link to a
    > DTD/schema. I have asked the manufacturer for such a DTD/schema, but
    > they have not honored my request at this time.
    >
    > They have a console program that reads the result files and can display
    > each computer and it's components/software, and this program can also
    > export any/all of the result files to more traditional file formats such
    > as Excel, CSV and Access (via ODBC).
    >
    > What I'm looking for are ideas on what parsers/programming languages I
    > could use that would be able to "read" these result files and generate
    > reports in either HTML, pure text, etc.
    >
    > Need something that I can do immediate, ad hoc reports and have been
    > looking at Perl, Python, VBScript, XSLT, etc., but am a novice programmer
    > and am looking to learn in the process of doing it.
    >
    > Thanks in advance...


    Sounds like the result files just use the format of XML syntax. And,
    that's all you need to parse it. I can think of Gawk and Bash, both
    with Expat XML parser interface. Their URLs have been posted in this
    newsgroup, I think.

    If you can post a sample input you have and sample output you want, we
    wouldn't have to guess. :)

    --
    William Park <>
    Open Geometry Consulting, Toronto, Canada
     
    William Park, Sep 14, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tero Kapanen

    Slicing of an array: wrong direction

    Tero Kapanen, Nov 4, 2003, in forum: VHDL
    Replies:
    11
    Views:
    7,257
    Allan Herriman
    Nov 7, 2003
  2. john

    Bus direction

    john, Sep 16, 2005, in forum: VHDL
    Replies:
    5
    Views:
    1,918
  3. Brian Birtle
    Replies:
    2
    Views:
    2,055
    John Saunders
    Oct 16, 2003
  4. VK

    Strange form request - Ideas or input requested

    VK, Feb 22, 2005, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    119
    MasterGaurav
    Feb 25, 2005
  5. Kirk Haines
    Replies:
    11
    Views:
    211
    Gavin Sinclair
    Sep 7, 2004
Loading...

Share This Page