← Prev in month ← Prev in thread

Question of SAX Fileter

From
Dong ST <>
To
Date
2003-01-06T08:21:01Z
ID
<>
Thread
Question of SAX Fileter
hi,everyone!

I m a newbie of using SAX.I need alter a attribute value use SAX.
Ex. 
the xml document frag is below:

.....
<theElement link ="here"/>
.....

I want to alter the attribute link's value to "there", How can i do
this throw SAX Filter.

I know I can alter a element tage used SAX Filter. Like the code below.
#################################################
public class XFormFilter extends XMLFilterImpl {

  public XFormFilter() {
  }

  public XFormFilter(XMLReader parent)
  {
    super(parent);
  }

  public void startElement (String uri,
                            String localName,
                            String qName,
                            Attributes atts)
      throws SAXException
  {
   if(localName=="theElement"){
       //alter the local name.
       localName ="thatElement";
      }
    }

    super.startElement(uri, localName, qName, atts);
  }
################################################################

someone help me, and thanks in advance.


Jack 




_________________________________________________________________
享用世界上最大的电子邮件系统― MSN Hotmail。 http://www.hotmail.com
← Prev in month ← Prev in thread