You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by Morten Bruun <hr...@gmail.com> on 2006/03/17 10:25:58 UTC
The URL used an unsupported protocol
Hi there,
Having installed the xalan-c I'm experiencing a strange problem when
applying XSLT to XML documents that have a PUBLIC DOCTYPE in them.
I didn't see anything about this in the FAQ.
When using this XSLT:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml"/>
<xsl:template match="html">
<foo>Testing</foo>
</xsl:template>
</xsl:stylesheet>
On this XML document:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
"http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html>
<head>
<title>t001</title>
</head>
<body></body>
</html>
I get the following error:
bruun@linux:~/test> /usr/local/xml-xalan/c/bin/Xalan test.xml style.xsl
Fatal Error.Occurred at file test.xml, line 3, column 72. An exception
occurred! Type:MalformedURLException, Message:The URL used an
unsupported protocol
SAXParseException: An exception occurred! Type:MalformedURLException,
Message:The URL used an unsupported protocol (test.xml, line 3, column 72)
If I use <DOCTYPE html> it works fine. And with xalan-j it also works fine.
Does anybody have a pointer to what I'm doing wrong?
Kind regards,
Morten Bruun
Re: The URL used an unsupported protocol
Posted by Morten Bruun <hr...@gmail.com>.
David Bertoni wrote:
> Morten Bruun wrote:
>> Hi there,
>>
>> Having installed the xalan-c I'm experiencing a strange problem when
>> applying XSLT to XML documents that have a PUBLIC DOCTYPE in them.
>>
> If you built your own local copy of Xerces-C, you should rebuild it and
> supply the appropriate type of net accessor you want, using the -n
> option. The default is "socket," which works fine on my copy of Linux.
>
> Dave
>
That did the trick - thanks a lot!
/Morten
Re: The URL used an unsupported protocol
Posted by David Bertoni <db...@apache.org>.
Morten Bruun wrote:
> Hi there,
>
> Having installed the xalan-c I'm experiencing a strange problem when
> applying XSLT to XML documents that have a PUBLIC DOCTYPE in them.
>
> I didn't see anything about this in the FAQ.
>
> When using this XSLT:
>
...
>
> I get the following error:
>
> bruun@linux:~/test> /usr/local/xml-xalan/c/bin/Xalan test.xml style.xsl
>
> Fatal Error.Occurred at file test.xml, line 3, column 72. An exception
> occurred! Type:MalformedURLException, Message:The URL used an
> unsupported protocol
> SAXParseException: An exception occurred! Type:MalformedURLException,
> Message:The URL used an unsupported protocol (test.xml, line 3, column 72)
>
> If I use <DOCTYPE html> it works fine. And with xalan-j it also works fine.
>
> Does anybody have a pointer to what I'm doing wrong?
This is an issue with Xerces-C, and your specific platform, and how the
binaries were built.
On Windows, this works by default, because the appropriate Xerces-C
network accessor is configured. On other platforms, you may not get the
same behavior, so the default for your platform might be to support only
file URLs.
If you built your own local copy of Xerces-C, you should rebuild it and
supply the appropriate type of net accessor you want, using the -n
option. The default is "socket," which works fine on my copy of Linux.
If you have more questions, I suggest you subscribe and post to the
Xerces-C user list.
Dave