I am using saxon parser to generate html after parsing my input xml file content

I have xslt transforms stylesheet for html.

In my input xml I have several sections. For each section and its content I am creating one html file. The input xml data has few junk character.

In my transforms.xsl I am using xsl:output method as html and encoding as utf-8.

I am using saxon parser to parse my xml. I am passing command line arguments to saxon as mentioned below

"cmd /c java net.sf.saxon.Transform -s:source.xml -xsl:transforms.xsl -o:output"

The problem is saxon parser is stop parsing the xml when it reached junk character.

But when I use xsl:output method as xml and encoding as utf-8, it will parse the xml completely without any complaints and generates the html file.

As I am new to this, I dint understand the difference between using xsl:output method as xml and html.

What is the mechanism behind using xsl:output method as xml and html. How xsl:output method xml will ignore these characters.

Is there an option where I can pass it as an command line argument to saxon to ignore these characters?

Please provide a detailed information on xsl:output element with xml && html.

Thanking you in advance.