You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Siobhan <sr...@curamsoftware.com> on 2008/08/14 12:54:59 UTC

DOMParser.parse method hanging when trying to parse a UTF-16 document

Hi 
I am using xerces 2.6.2.
I am using DOMParser to parse an inputStream with an encoding of type UTF-16
and the parser is hanging. I have successfully parsed documents where the
encoding is set to UTF-8. 

I have the following:
ppin = new FilterInputStream (new BufferedInputStream(socket
          .getInputStream())); 

DOMParser myParser = new DOMParser();

myParser.parse(new InputSource(ppin));

Any suggestions/comments would be much appreciated.
thanks

-- 
View this message in context: http://www.nabble.com/DOMParser.parse-method-hanging-when-trying-to-parse-a-UTF-16-document-tp18979412p18979412.html
Sent from the Xerces - J - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


Re: DOMParser.parse method hanging when trying to parse a UTF-16 document

Posted by Siobhan <sr...@curamsoftware.com>.
Hi
Its something similar to below. I am using sockets here, so I have shortened
down what is happening.

Client Code:

Socket clientSocket;
PrintStream output;
BufferedInputStream input;


clientSocket = new Socket(host, port); // valid ip and port number
input = new BufferedInputStream(clientSocket.getInputStream());
output = new PrintStream=(clientSocket.getOutputStream(),false,"UTF-16");

output.print("Test");
output.flush();

Server Code:

ServerSocket socket = new ServerSocket(port); // port should correspond to
the client port.
FilterInputStream myFilterStream = 
  new FilterInputStream(newBufferedInputStream(socket.getInputStream()));

DOMParser myParser = new DOMParser();

myParser.parse(new InputSource(myFilterStream)); // this is where it hangs.


Arthur De Magalhaes wrote:
> 
> Hi Siobhan,
> 
> Do you have a testcase we can try out?
> 
> Thanks,
> 
> Arthur De Magalhaes
> XML Parser Development
> IBM Toronto Lab
> Phone: 905-413-2993 T/L 313-2993
> E-mail: arthurdm@ca.ibm.com
> 
> 
> 
> 
> Siobhan <sr...@curamsoftware.com> 
> 08/14/2008 06:54 AM
> Please respond to
> j-dev@xerces.apache.org
> 
> 
> To
> j-dev@xerces.apache.org
> cc
> 
> Subject
> DOMParser.parse method hanging when trying to parse a UTF-16 document
> 
> 
> 
> 
> 
> 
> 
> Hi 
> I am using xerces 2.6.2.
> I am using DOMParser to parse an inputStream with an encoding of type 
> UTF-16
> and the parser is hanging. I have successfully parsed documents where the
> encoding is set to UTF-8. 
> 
> I have the following:
> ppin = new FilterInputStream (new BufferedInputStream(socket
>           .getInputStream())); 
> 
> DOMParser myParser = new DOMParser();
> 
> myParser.parse(new InputSource(ppin));
> 
> Any suggestions/comments would be much appreciated.
> thanks
> 
> -- 
> View this message in context: 
> http://www.nabble.com/DOMParser.parse-method-hanging-when-trying-to-parse-a-UTF-16-document-tp18979412p18979412.html
> 
> Sent from the Xerces - J - Dev mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-dev-help@xerces.apache.org
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/DOMParser.parse-method-hanging-when-trying-to-parse-a-UTF-16-document-tp18979412p18994348.html
Sent from the Xerces - J - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


Re: DOMParser.parse method hanging when trying to parse a UTF-16 document

Posted by Arthur De Magalhaes <ar...@ca.ibm.com>.
Hi Siobhan,

Do you have a testcase we can try out?

Thanks,

Arthur De Magalhaes
XML Parser Development
IBM Toronto Lab
Phone: 905-413-2993 T/L 313-2993
E-mail: arthurdm@ca.ibm.com




Siobhan <sr...@curamsoftware.com> 
08/14/2008 06:54 AM
Please respond to
j-dev@xerces.apache.org


To
j-dev@xerces.apache.org
cc

Subject
DOMParser.parse method hanging when trying to parse a UTF-16 document







Hi 
I am using xerces 2.6.2.
I am using DOMParser to parse an inputStream with an encoding of type 
UTF-16
and the parser is hanging. I have successfully parsed documents where the
encoding is set to UTF-8. 

I have the following:
ppin = new FilterInputStream (new BufferedInputStream(socket
          .getInputStream())); 

DOMParser myParser = new DOMParser();

myParser.parse(new InputSource(ppin));

Any suggestions/comments would be much appreciated.
thanks

-- 
View this message in context: 
http://www.nabble.com/DOMParser.parse-method-hanging-when-trying-to-parse-a-UTF-16-document-tp18979412p18979412.html

Sent from the Xerces - J - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org