[Home] [By Thread] [By Date] [Recent Entries]
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
|

Cart



