Re: [xsl] Problem with extracting text from svg file

Subject: Re: [xsl] Problem with extracting text from svg file
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Wed, 10 Oct 2012 08:15:00 +0100
On 10/10/2012 00:54, G. Ken Holman wrote:
At 2012-10-09 18:30 -0500, Russell Urquhart wrote:
Looking in the source svg file i DID find the following:

<DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd";>

As I expected (except for the need for "!" after "<").


Am i going to have to strip out these lines from the source svg files, or is there some way to get the xslt to disregard them?

You can leave the files untouched and get Saxon to disregard the W3C web site by supplying Saxon with an XML catalogue that redirects the W3 URI with a URI pointing to a copy of the DTD in your local system.



Actually, it shouldn't even be necessary to use catalogs. Saxon 9.4 has built in copies of commonly-used W3C DTDs including this one, and if you use default parsing options for your source file then Saxon should automatically direct the XML parser to these local copies.


If you are using 9.4 and this isn't happening, it would be useful to know exactly how you invoke the transformation.

The error message

java.net.UnknownHostException:www.w3.org

suggests to me a slightly different problem. That's not the normal failure you get when trying to retrieve DTDs from the W3C web site (the most common symptom is a long delay followed possibly by an HTTP timeout).

If you're running from the command line, try the -t option which may give more clues as to what's going on.



Michael Kay
Saxonica

Current Thread