Solved

Good validating XML/XSLT parser for Windows needed

Posted on 2003-11-04
5
654 Views
Last Modified: 2008-02-01
Hi

I'm currently creating some XML stuff which should be displayed as an HTML page after being processed with XSLT.  Internet Explorer does he trick, but it doesn't seem to be validating (I can completely ignore my DTD if I want).  This XML stuff will end up on a webpage for users to download, an many of these users will not be XML experts.

So I'm looking for a parser with the following requirements:

1. Easy to install (laymen should be able to do it)
2. For Windows
3. Parses XML, XSL/XSLT (converts to HTML)
4. If possible, a GUI
5. Free
6. Allows to print the parsed document

Does anyone know if such a parser exists?  Thanks.
0
Comment
Question by:IconMan7
  • 2
  • 2
5 Comments
 
LVL 3

Author Comment

by:IconMan7
ID: 9684816
Ah, forgot one requirement:

7. It must be validating :)
0
 
LVL 26

Accepted Solution

by:
rdcpro earned 100 total points
ID: 9685469
You're describing MSXML...

1. Easy to install (laymen should be able to do it)
--> Comes with IE6
2. For Windows
--> Comes with IE6 for Windows
3. Parses XML, XSL/XSLT (converts to HTML)
--> Parses XML, includes XSLT processor
4. If possible, a GUI
--> Comes with IE6
5. Free
--> Comes with IE6
6. Allows to print the parsed document
--> Comes with IE6 (using javascript: window.print, or File >> Print)
7. It must be validating :)
--> Completely conforming and validating using DTD.  Version 4 validates against W3C XML Schema

The thing is, Internet Explorer does not validate when simply loading and XML Document into the window.  It does validate whenever you load xml in code (unless you tell it not to).  Here's a transformation tool that will show you some of the code you need to work with XML.

http://dev.rdcpro.com/Members/rdcpro/tools

Here's an example of Javascript that might run in a browser to load and validate an XML document.

var xmlDoc = new ActiveXObject("Msxml2.DomDocument")
xmlDoc.async = false;
xmlDoc.validateOnParse = true;  // this is the default
xmlDoc.resolveExternals = true;
try
{
    xmlDoc.load("foo.xml")
    var err = xmlDoc.parseError
    if (err.errorCode != 0)
    {
        alert("Parse Error: " + err.reason)
    }
}
catch (e)
{
    alert("error: " + e);
}



Regards,
Mike Sharp
0
 
LVL 4

Expert Comment

by:Xikilm
ID: 9688157
Greetings IconMan7:

Personally, I like to use Xalan: http://xml.apache.org/xalan-c/index.html

>1. Easy to install (laymen should be able to do it)
It is easy to install and comes with pretty good instructions
>2. For Windows
It has a native Windows binary and it runs on the various *nixs
>3. Parses XML, XSL/XSLT (converts to HTML)
No problems here
>4. If possible, a GUI
There is no frontend GUI that I know of, only command line
>5. Free
Free and opensource
>6. Allows to print the parsed document
You can output to file, command shell, or (from command line) you could send its output to a printer
>7. It must be validating :)
This is covered as well.

HTH,
Xikilm
0
 
LVL 26

Expert Comment

by:rdcpro
ID: 9691493
Technically speaking, Xalan isn't a parser, it's an XSLT processor.  It does not do validation.  It requires Xerces to parse the XML.  Validation with Xerces is a separate issue, as it is with all parsers to my knowledge.  The XML Spec does not require validation of the parser.

I'm not completely clear on what the OP is trying to do, but if the end result is XML being processed and validated in an HTML page, the target browser is probably going to determine what parser (and XSLT processor) is going to be used.  If the XML is being processed on the server, it doesn't matter so much which is being used, but still there's going to be a particular platform involved, which will dictate to some extent what parser is needed.  I think the OP had some misunderstandings of what's happening when XML is downloaded and displayed in the browser.  While the browser needs to resolve externals (and it will do so), validation on the client seems unnecessary, if the XML is created on the server, and all the browser is doing is displaying the HTML result of a transform.  

Regards,
Mike Sharp
0
 
LVL 3

Author Comment

by:IconMan7
ID: 9725258
Looks like IE6 will be my best option.  Thanks.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question