Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Request for ideas/direction

Reply
Thread Tools

Request for ideas/direction

 
 
Mark Woods
Guest
Posts: n/a
 
      09-13-2004

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
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      09-13-2004


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/
 
Reply With Quote
 
 
 
 
=?ISO-8859-1?Q?J=FCrgen_Kahrs?=
Guest
Posts: n/a
 
      09-13-2004
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.
 
Reply With Quote
 
Rolf Kemper
Guest
Posts: n/a
 
      09-13-2004
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 <(E-Mail Removed)> 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

 
Reply With Quote
 
Andy Dingley
Guest
Posts: n/a
 
      09-14-2004
On Mon, 13 Sep 2004 01:44:29 -0000, Mark Woods <(E-Mail Removed)>
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
 
Reply With Quote
 
William Park
Guest
Posts: n/a
 
      09-14-2004
Mark Woods <(E-Mail Removed)> 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 <(E-Mail Removed)>
Open Geometry Consulting, Toronto, Canada
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Just got two emails: 1. your request for a new Access Code and 2. Request for my MCP ID# What's going on??!! belfast-biker Microsoft Certification 0 01-14-2006 12:49 PM
Re: Accessing Request.InputStream / Request.BinaryRead *as the request is occuring*: How??? Brian Birtle ASP .Net 2 10-16-2003 02:11 PM
best way to get data: request.form, request.params, controlname.value Christian H ASP .Net 1 07-29-2003 05:27 AM
Re: difference bet. request.querystring and Request.Params Daniel Bass ASP .Net 2 07-04-2003 12:12 PM
System.Web.HttpException: Request timed out - [HttpException (0x80004005): Request timed out.] Steve ASP .Net 0 07-01-2003 12:11 AM



Advertisments