Solved

Good validating XML/XSLT parser for Windows needed

Posted on 2003-11-04
5
649 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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 Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

791 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