Re: [xsl] Entity Problems...

Subject: Re: [xsl] Entity Problems...
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 17 Aug 2007 17:17:20 +0100
entities need to be defined in a DTD, otherwise an XML parser will flag
an error on undefined entities, so if a file has &nbsp; it needs to
start with something line

<!DOCTYPE something [
<!ENTITY nbsp "&#160;">
]>
<something> ....

this is an XML requirement, not an XSLT one.

Alternatively the DTD can be defaulted, but how to do that depends on
the system but a catalog file could specify that any document with
document element <something> should be parsed using a specified DTD that
defined this entity.

Or of course you could perhaps use a non-xml parser. For exampe saxon
can use any sax parser and is often used with the tagsoup html parser
which reports sax events to xslt as if an xml file was being parsed but
parses pretty much anytrhing that looks a bit like html, including any
use of any html entity names.

David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

Current Thread