You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Emmanuel Guiton <em...@elodig.fr> on 2007/05/02 19:08:40 UTC
MalformedURLException, No protocol prefix present
Hi all,
I try setting
parser->setStandardUriConformant(true);
onmy DOMParser and I got an exception with the following result :
An exception occurred! Type:MalformedURLException, Message:No protocol
prefix present
It seems that it occurs on the first line of my file since the exception
is even thrown when using parseFirst().
Though I can't find anything wron g with my file, nor it does anything
when trying to change the first element tag.
<?xml version="1.0" encoding="utf-8" ?>
<log xmlns="http://www.elodig.fr/logs"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.elodig.fr/logs
file:///eloworld/configuration/xsd/elomsn_logs.xsd">
<id>1</id>
<bubu></bubu>
<extension>base</extension>
<event_type>action</event_type>
<data type="bubu">
<data_element>
<element_name>bibi</element_name>
<element_value>il est content</element_value>
</data_element>
<data_element>
<element_name>bubu</element_name>
<element_value>il est pas content</element_value>
</data_element>
</data>
</log>
Thanks for any help,
- Emmanuel
--
Directeur
Elodig SARL
30-32, avenue de la République
94800 Villejuif
Tel: 01 46 77 47 68
E-mail: emmanuel.guiton@elodig.fr
http://www.elodig.fr
Re: MalformedURLException, No protocol prefix present
Posted by David Bertoni <db...@apache.org>.
Emmanuel Guiton wrote:
> Hi all,
>
> I try setting
> parser->setStandardUriConformant(true);
> onmy DOMParser and I got an exception with the following result :
>
> An exception occurred! Type:MalformedURLException, Message:No protocol
> prefix present
>
> It seems that it occurs on the first line of my file since the exception
> is even thrown when using parseFirst().
>
> Though I can't find anything wron g with my file, nor it does anything
> when trying to change the first element tag.
What sort of URL are you providing to the parser in your InputSource? If
you're using a LocalFileInputSource, that may be the problem. Instead, use
a regular InputSource, and provide a fully qualified URL:
file:///home/foo/foo.xml
Or, perhaps all you need to do is the the system ID of the
LocalFileInputSource, such that it has a correct corresponding URL for the
file name.
Dave
RE: MalformedURLException, No protocol prefix present
Posted by Jesse Pelton <js...@PKC.com>.
I'd guess that the problem is the URI of the document that you're trying to parse, not anything in the document itself.
-----Original Message-----
From: Emmanuel Guiton [mailto:emmanuel.guiton@elodig.fr]
Sent: Wednesday, May 02, 2007 1:09 PM
To: c-users@xerces.apache.org
Subject: MalformedURLException, No protocol prefix present
Hi all,
I try setting
parser->setStandardUriConformant(true);
onmy DOMParser and I got an exception with the following result :
An exception occurred! Type:MalformedURLException, Message:No protocol
prefix present
It seems that it occurs on the first line of my file since the exception
is even thrown when using parseFirst().
Though I can't find anything wron g with my file, nor it does anything
when trying to change the first element tag.
<?xml version="1.0" encoding="utf-8" ?>
<log xmlns="http://www.elodig.fr/logs"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.elodig.fr/logs
file:///eloworld/configuration/xsd/elomsn_logs.xsd">
<id>1</id>
<bubu></bubu>
<extension>base</extension>
<event_type>action</event_type>
<data type="bubu">
<data_element>
<element_name>bibi</element_name>
<element_value>il est content</element_value>
</data_element>
<data_element>
<element_name>bubu</element_name>
<element_value>il est pas content</element_value>
</data_element>
</data>
</log>
Thanks for any help,
- Emmanuel
--
Directeur
Elodig SARL
30-32, avenue de la République
94800 Villejuif
Tel: 01 46 77 47 68
E-mail: emmanuel.guiton@elodig.fr
http://www.elodig.fr