[Expat-discuss] Re: Newbies questions

ta-meyer@ihug.co.nz ta-meyer@ihug.co.nz
Tue Aug 20 02:40:02 2002


> What's the diference between a parser and a validator ? (in my poor 
> perception both are the same :-) )

To use expat as a parser, the XML must be "well-formed".  This must mean that 
it is 'valid' XML - i.e. all the tags that are opened are closed, you aren't 
missing any '>'s, and so on.

To be valid (i.e. validated by a validating parser) the XML must conform to 
some type of given structure, like a DTD.  (It must also be well-formed, as 
above).  Obviously, if there is no DTD specified (or similar structure-giving 
device), an XML document can't be 'valid'.

Expat checks for well-formedness, but does not validate (in the sense given 
above).

Obviously it depends on your situation whether being valid (in this way) is 
important, or whether well-formedness is enough.  (Well-formness is _always_ 
important, though, unless you want to spend a lot of time coding for possible 
typos in the XML).

> And some practical tutorials about XML DTD and XSL ?
Actually, when I first learned how to use XML (and DTD's and XSL and so on), I 
found that good-old-fashioned books were best.  So I'd personally recommend 
your local library.  I guess it depends on how good that library is (mine is a 
university library, so probably more up-to-date than some others).  No doubt 
others on the list will have online tutorials that might be useful.

Hope this helps.

= Tony Meyer
Auckland,
NZ