Guoliang --

I'm not sure what you mean here.  When you say "use a customized SAX
parser" are you talking about a ContentHandler?  If so, I expect that
you can emit some type of text or element that wouldn't normally appear
and then set a flag in your ContentHandler so that any new input would
be ignored (or treated as CDATA) until the ending signal occurs.

Is this what you want to do?

Gary

Guoliang Cao wrote:
> 
> Thanks Gary,
> 
> I saw your comments.  You are right. So I'm looking for a solution for
> this question -
> 
> I set transformation result as a SAXResult and use a customized SAX
> parser to parse the result. To achieve a better performance, I want the
> SAX parser to skip parsing some elements and treat them as a cdata
> section. What I did is using  <xsl:value-of
> disable-output-escaping="yes" select="&lt;![CDATA["/> and <xsl:value-of
> disable-output-escaping="yes" select="]]&gt;"/> to encapsulate that
> section.  Then I expect the SAXParser will find the <![CDATA[ and not
> parse the following elements until met the closing ]]>.  However, it
> seems this is not achievable. Only after I serialize the output, I can
> let a SAX parser to treat that section as a cdata.  Am I correct here?
> Any ideas?
> 
> Guoliang
> 
> ---  a sample of xsl -------------------
> 
> <xsl:value-of disable-output-escaping="yes" select="&lt;![CDATA["/>
>    <xsl:copy-of select="a"/>
> <xsl:value-of disable-output-escaping="yes" select="]]&gt;"/>
> 
> --- expected output -------------------
> 
> <![CDATA[<a>....</a>]]>
> <a>...</a> will be treated as a text node and not be parsed by SAX parser.
> ----------------------------------------
> 
> > I have updated bugzilla.  Basically, Xalan is working as designed.  See
> > the comments in bugzilla and the javadoc for the Result interface.
> >
> > Gary
> >
> > Guoliang Cao wrote:
> >
> >> I reported it two months ago. It's still in NEW status. If it can't be
> >> fixed, I have to change my code to avoid using SAXResult. I really
> >> don't like to do that.
> >>
> >> Sincerely,
> >>
> >> Guoliang
> >

Reply via email to