Solved

Good validating XML/XSLT parser for Windows needed

Posted on 2003-11-04
5
646 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Error opening .xml with Excel 2013 4 29
D3, dragging and rotating. 7 145
selectSingleNode in Access 2013 11 59
Powershell XML in variable 4 21
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 …
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

773 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