Re: [xslt] Should I be loading DTDs?

On Thu, Aug 19, 2004 at 04:14:25PM -0700, David Hyatt wrote:
> I asked for some good XSLT test cases on my blog, and one of the ones 
> presented to me can be found here.
> The author pointed out that he had a link to an external DTD that 
> defined entities, and suggested that the DTD should be loaded.  I'm 
> basically looking for suggestions as to what the "correct" default 
> behavior should be for Safari.  Should I tell libxml to load the 
> external DTDs by default when parsing XSL stylesheets and XML docs that 
> do transforms?

  Yes, the parser options you should use to be compliant at the tree
level with the XPath data model are XSLT_PARSE_OPTIONS, which is a 
shortcut for 


    - load the external subset
    - substitute entities
    - expand DTD defaulted attributes
    - pass CDATA sections a normal text nodes
 you will probably have to play with libxml2 I/O (xmlIO.h) to get the
DTD loaded.

The good XSLT case will be when you manage to format some DocBook documentation
on the fly without loss of formating and with decent speed. This may be a 
challenge especially with DocBook very complex DTDs and stylesheets.
And for XSLT test case there is a few hundreds in libxslt tests subdir,
including DocBook...


Daniel Veillard      | Red Hat Desktop team
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]