<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>using XMLFilter</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Hello!</FONT>
</P>
<P><FONT SIZE=2>I would like to wirte a simple filter that removes som Tags form the input file. I don't understand how to set up the filter.</FONT></P>
<P><FONT SIZE=2>Something is missing because I get an empty document. </FONT>
<BR><FONT SIZE=2>The jdom-b7 examples have not been helpfull to me. </FONT>
<BR><FONT SIZE=2>I think I need to set a parent XMLReader when constructing the XMLFilterImpl but I have no idea where to find a parent.</FONT>
</P>
<P><FONT SIZE=2>Public Document input ( File in_file )</FONT>
<BR><FONT SIZE=2>{</FONT>
<BR><FONT SIZE=2> Document in_doc;</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> SAXBuilder builder = new SAXBuilder ();</FONT>
</P>
<P><FONT SIZE=2> // testing </FONT>
<BR><FONT SIZE=2> builder.setXMLFilter ( new org.xml.sax.helpers.XMLFilterImpl () );</FONT>
</P>
<P><FONT SIZE=2> try</FONT>
<BR><FONT SIZE=2> {</FONT>
<BR><FONT SIZE=2> in_doc = builder.build ( in_file );</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> catch ( JDOMException e )</FONT>
<BR><FONT SIZE=2> {</FONT>
<BR><FONT SIZE=2> System.out.println ( "Reading source file: JDom Error" );</FONT>
<BR><FONT SIZE=2> e.printStackTrace ();</FONT>
<BR><FONT SIZE=2> } </FONT>
</P>
<P><FONT SIZE=2> return in_doc;</FONT>
<BR><FONT SIZE=2>}</FONT>
</P>
<P><FONT SIZE=2>Stefan</FONT>
</P>
</BODY>
</HTML>