List Info

Thread: no element found error




no element found error
country flaguser name
United States
2007-02-21 00:28:21
Hi i get the following error
when i try parsing this file. as far as my knowledge the file is wellformed:
 
no element found at line 1, column 0, byte 0 at D:/Perl/lib/XML/Parser.pm line 187
<?xml version="1.0" encoding="ISO-8859-1"?>
 ; <species name="Camelus bactrianus" size="20ft">
 ; &nbsp; <common-name>Bactrian Camel</common-name>
   ; <physical-characteristics>
 &nbsp; &nbsp;  <mass&gt;450 to 500 kg.</mass>
&nbsp; &nbsp; &nbsp; <appearance><;/appearance>
 ; &nbsp; </physical-characteristics>;
 &nbsp;  <natural-history&gt;
 &nbsp; &nbsp;  <food-habits>
&nbsp;   ; &nbsp; &nbsp; This is foodhabits tag.
 ; &nbsp; &nbsp;  </food-habits>
  ; &nbsp;  <reproduction>
  ; &nbsp; &nbsp; &nbsp; This is reproduction tag.
 ; &nbsp; &nbsp;  </reproduction>
 &nbsp; &nbsp;  <behavior>
&nbsp; &nbsp; &nbsp; &nbsp;  This is behaviour tag.
 ; &nbsp; &nbsp;  </behavior>
&nbsp; &nbsp; &nbsp; <habitat>
 ; &nbsp; &nbsp; &nbsp;  This is habitat tag.
 ; &nbsp; &nbsp;  </habitat>
&nbsp; &nbsp; </natural-history&gt;
 &nbsp;  <conservation status="endangered"&gt;
 &nbsp; &nbsp;  <detail>
   ; &nbsp; &nbsp; This is detail tag.
 ; &nbsp; &nbsp; </detail>
 ; &nbsp; </conservation>
  </species>
in my prevoius post i was talking abt xml to flat file conversion and stillfinding way for that and will post all i collect immediately after i complete that..I thank one and all for ur advices on that.
 
Thanks in advance..


Here’s a new way to find what you're looking for - Yahoo! Answers
Re: no element found error
country flaguser name
New Zealand
2007-02-21 01:42:33
On Wed, 2007-02-21 at 06:28 +0000, vikram veer wrote:
> Hi i get the following error 
> when i try parsing this file. as far as my knowledge
the file is
> wellformed:
>  
> no element found at line 1, column 0, byte 0 at
> D:/Perl/lib/XML/Parser.pm line 187
> <?xml version="1.0"
encoding="ISO-8859-1"?>
>   <species name="Camelus bactrianus"
size="20ft">

The first thing that springs to mind is that you might have
a blank line
before the XML declaration.  If your XML has the <?xml
... bit at the
beginning, then the '<' *must* be the first character in
the file.

Having said that, the particular message you're getting is
more
consistent with XML::Parser encountering a completely empty
file.  Are
you sure your filename is correct and you're calling the
right parse
method?  Or if you're parsing from a string, are you sure
the string has
XML in it?

Also are you using XML::Parser directly?  That would
probably not be a
good idea.  XML::XPath is a good layer on top of XML::Parser
but if you
can get it on your platform the XML::LibXML is a better
bet.

Cheers
Grant

Regards
Grant


_______________________________________________
Perl-XML mailing list
Perl-XMLlistserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )