You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Greg Stark <gs...@electrorent.com> on 2005/09/10 01:10:53 UTC

Invalid XML character (Unicode: 0x0)

fop-users,
How can I resolve this?  Is there a way on Solaris to search and replace
0000x0 characters.  This is an XSLT question, I am asking here because it is
part of my FOP process before the file is translated to fo and then a PDF.  

The file saved as UTF-8 contains Chinese characters.  I go to that location,
and there is no null character there!  I can replace spaces before the
location with &#160; and this seems to move the message to a new location.
No pattern has emerged yet.

/usr/local/FOP/xalan.sh -v
>>>>>>> Xalan Version Xalan Java 2.2.D11, <<<<<<<

/usr/local/FOP/xalan.sh -in maporder2153450ZHSS.xml -XSL ZHrsShip_data.xsl
-out tmp2.xml
[Fatal Error] ZHrsShip_data.xsl:420:95: An invalid XML character (Unicode:
0x0) was found in the element content of the document.
file:///XMLFOP/rsship/ZHrsShip_data.xsl; Line 420; Column 95; XSLT Error
(javax.xml.transform.TransformerConfigurationException):
javax.xml.transform.TransformerException: org.xml.sax.SAXParseException: An
invalid XML character (Unicode: 0x0) was found in the element content of the
document.

  ZHrsShip_data.xsl file available on request.

I appreciate your time and help.
Thank you very much.

Greg Stark <gstark at electrorent dot com>



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Invalid XML character (Unicode: 0x0)

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Greg Stark wrote:
> How can I resolve this?  Is there a way on Solaris to search and replace
> 0000x0 characters.  This is an XSLT question, I am asking here because it is
> part of my FOP process before the file is translated to fo and then a PDF.  
> 
> The file saved as UTF-8 contains Chinese characters.  I go to that location,
> and there is no null character there!

If you look at the file using a text editor, it's likely you wont
see NUL characters.

Try a hex editor, or one of the character analyzation tools
like
   http://www.cis.upenn.edu/~wjposer/unidesc.html
or a character encoding translator which should give you a
byte offset for the problem position.
I'd also check whether your editor has known bugs WRT saving
files in UTF-8.

J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: Invalid XML character (Unicode: 0x0)

Posted by Greg Stark <gs...@electrorent.com>.
Mike & J.Pietschmann,
Thank you for your help.  J. was right, the editor I use had botched the
file.  I used babelpad which showed the corruption.  I fixed the text and it
runs now.  

Thank you.
Greg Stark

-----Original Message-----
From: Mike Ferrando [mailto:mikeferrando@yahoo.com] 
Sent: Saturday, September 10, 2005 7:31 PM
To: fop-users@xmlgraphics.apache.org; gstark@electrorent.com
Subject: Re: Invalid XML character (Unicode: 0x0)

Greg S.,
Those line numbers in this case (of an illegal character) are
approximations.

I would suggest that you save your original document.

Use a copy of your document.

Cut the first 100 lines. (It has to be well formed of course.) Send it
through.
Keep going until your are close to the error.

If you can take the short cut, then get a freeware unicode aware program to
check your document. I use babelpad.

Open the document in Babelpad.
Tools>Document analysis

This will give you a line and position that is exact.

You can do this alot of ways, but these are my suggestions. I assume that
you have your encodings correct in your stylesheet for output UTF-8.

Mike Ferrando
Library Technician
Library of Congress
Washington, DC
202-707-4454

--- Greg Stark <gs...@electrorent.com> wrote:

> fop-users,
> How can I resolve this?  Is there a way on Solaris to search and 
> replace 0000x0 characters.  This is an XSLT question, I am asking here 
> because it is part of my FOP process before the file is translated to 
> fo and then a PDF.
> 
> The file saved as UTF-8 contains Chinese characters.  I go to that 
> location, and there is no null character there!  I can replace spaces 
> before the
> location with   and this seems to move the message to a new
> location.
> No pattern has emerged yet.
> 
> /usr/local/FOP/xalan.sh -v
> >>>>>>> Xalan Version Xalan Java 2.2.D11, <<<<<<<
> 
> /usr/local/FOP/xalan.sh -in maporder2153450ZHSS.xml -XSL 
> ZHrsShip_data.xsl -out tmp2.xml [Fatal Error] 
> ZHrsShip_data.xsl:420:95: An invalid XML character
> (Unicode:
> 0x0) was found in the element content of the document.
> file:///XMLFOP/rsship/ZHrsShip_data.xsl; Line 420; Column 95; XSLT 
> Error
> (javax.xml.transform.TransformerConfigurationException):
> javax.xml.transform.TransformerException:
> org.xml.sax.SAXParseException: An
> invalid XML character (Unicode: 0x0) was found in the element content 
> of the document.
> 
>   ZHrsShip_data.xsl file available on request.
> 
> I appreciate your time and help.
> Thank you very much.
> 
> Greg Stark <gstark at electrorent dot com>
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail:
> fop-users-help@xmlgraphics.apache.org
> 
> 



	
		
______________________________________________________
Click here to donate to the Hurricane Katrina relief effort.
http://store.yahoo.com/redcross-donate3/

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Invalid XML character (Unicode: 0x0)

Posted by Mike Ferrando <mi...@yahoo.com>.
Greg S.,
Those line numbers in this case (of an illegal character) are
approximations.

I would suggest that you save your original document.

Use a copy of your document.

Cut the first 100 lines. (It has to be well formed of course.)
Send it through.
Keep going until your are close to the error.

If you can take the short cut, then get a freeware unicode aware
program to check your document. I use babelpad.

Open the document in Babelpad.
Tools>Document analysis

This will give you a line and position that is exact.

You can do this alot of ways, but these are my suggestions. I assume
that you have your encodings correct in your stylesheet for output
UTF-8.

Mike Ferrando
Library Technician
Library of Congress
Washington, DC
202-707-4454

--- Greg Stark <gs...@electrorent.com> wrote:

> fop-users,
> How can I resolve this?  Is there a way on Solaris to search and
> replace
> 0000x0 characters.  This is an XSLT question, I am asking here
> because it is
> part of my FOP process before the file is translated to fo and then
> a PDF.  
> 
> The file saved as UTF-8 contains Chinese characters.  I go to that
> location,
> and there is no null character there!  I can replace spaces before
> the
> location with   and this seems to move the message to a new
> location.
> No pattern has emerged yet.
> 
> /usr/local/FOP/xalan.sh -v
> >>>>>>> Xalan Version Xalan Java 2.2.D11, <<<<<<<
> 
> /usr/local/FOP/xalan.sh -in maporder2153450ZHSS.xml -XSL
> ZHrsShip_data.xsl
> -out tmp2.xml
> [Fatal Error] ZHrsShip_data.xsl:420:95: An invalid XML character
> (Unicode:
> 0x0) was found in the element content of the document.
> file:///XMLFOP/rsship/ZHrsShip_data.xsl; Line 420; Column 95; XSLT
> Error
> (javax.xml.transform.TransformerConfigurationException):
> javax.xml.transform.TransformerException:
> org.xml.sax.SAXParseException: An
> invalid XML character (Unicode: 0x0) was found in the element
> content of the
> document.
> 
>   ZHrsShip_data.xsl file available on request.
> 
> I appreciate your time and help.
> Thank you very much.
> 
> Greg Stark <gstark at electrorent dot com>
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail:
> fop-users-help@xmlgraphics.apache.org
> 
> 



	
		
______________________________________________________
Click here to donate to the Hurricane Katrina relief effort.
http://store.yahoo.com/redcross-donate3/

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org