You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by "Saigal, Ankur" <an...@sap.com> on 2001/10/03 19:09:41 UTC

Xalan - SAX parser

Hi All,
I am new to XALAN and have some doubts,great if some one can help me here,

If I understand correctly Xalan is using Xerces as a default XML parser.I
use the SAX parser to parse an XML document that looks like this

<?xml version="1.0" encoding="UTF-8"?>
<mb:root xmlns:mb="urn:xyz.com:CRM-Middleware:Map"
         xmlns:mt="urn:xyz.com:CRM-Middleware:MapTag" type="bulk"
boname="Activity">

   <mt:Activity>
	<name>prasad</name>
   </mt:Activity>	 
   <mt:Activity>
	<name>ankur</name>
   </mt:Activity>	 
   <mt:Activity>
	<name>bikram</name>
   </mt:Activity>	 
   <mt:Activity>
	<name>sridhar</name>
   </mt:Activity>
</mb:root>	


Now when my parser parses this file it throws "void characters(char[] ch,int
start,int length)" event even if it comes across the <Activity> tag 
and the array contains some blank spaces etc.And this doesnot happen if I
write the XML file as.. 

<?xml version="1.0" encoding="UTF-8"?>
<mb:root xmlns:mb="urn:xyz.com:CRM-Middleware:Map"
         xmlns:mt="urn:xyz.com:CRM-Middleware:MapTag" type="bulk"
boname="Activity">

   <mt:Activity><name>prasad</name>
   </mt:Activity>	 
   <mt:Activity><name>ankur</name>
   </mt:Activity>	 
   <mt:Activity><name>bikram</name>
   </mt:Activity>	 
   <mt:Activity><name>sridhar</name>
   </mt:Activity>
</mb:root>	

To my understanding the parser shud throw "void characters(char[] ch,int
start,int length)" events only for the text nodes.Is there any way to
configure 
the parser so that It does not throw this event when it encounters blank
spaces or new line characters.


Thanks and Regards

Ankur