XML Parser

Daria Spescha daria.spescha at id.unibe.ch
Thu Mar 3 13:45:01 UTC 2005


I have looked at the problem and I have figured out that the parser is
able to handle entities given as numbers (&#..; constructs), but it can
handle hexadecimals only if the character numbers (A-F) are written in
uppercase letters. To solve the problem, it is enough to add the
following line at the end of XMLTokenizer class>>initialize and doit in
the method.
($a to: $f) do: [:each | DigitTable at: each asciiValue put: each
asUppercase digitValue].

>Not sure...maybe XMLTokenizer>>initEntities.  I override it in 
>SeasideTesting to add nbsp.
I tried to do this for the german umlaute (ä ... ). If I give a
character like $< as the value for the entity declaration, it works
fine. But if I give "normal" characters like $ä or $h, then they are
doubled. From M&auml;use I get Määuse. I stepped through the parsing
with the debugger but I couldn't find out where the duplication takes
place. 

Daria


>-----Ursprüngliche Nachricht-----
>Von: squeak-dev-bounces at lists.squeakfoundation.org 
>[mailto:squeak-dev-bounces at lists.squeakfoundation.org] Im 
>Auftrag von C. David Shaffer
>Gesendet: Donnerstag, 24. Februar 2005 14:57
>An: The general-purpose Squeak developers list
>Betreff: Re: XML Parser
>
>
>Daria Spescha wrote:
>
>> Hi!
>>  
>> I'm using the Soap Stuff to call webservices and this uses the
>> XMLDOMParser to parse the response. This works well normally. But as 
>> soon as there is a carriage return (&#xd;) somewhere in the 
>response, 
>> the result returned by call invoke contained an error message: 
>> SAXParseException: XML expected. The parser doesn't seem to able to 
>> handle carriage returns although &#xd; is XML 1.0 compliant. What is 
>> wrong? Where would I have to change this?
>>  
>> Thanks!
>> Daria
>>
>>--------------------------------------------------------------
>---------
>>-
>>
>>
>>  
>>
>Not sure...maybe XMLTokenizer>>initEntities.  I override it in 
>SeasideTesting to add nbsp.
>
>David
>
>-- 
>C. David Shaffer
>http://www.cs.westminster.edu/~shaffer
>http://www.shaffer-consulting.com
>
>




More information about the Squeak-dev mailing list