OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Question of SAX Fileter

[ Lists Home | Date Index | Thread Index ]

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 





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS