/**
* Handles a subtree of the parsed XML data structure.
*
* @exception org.xml.sax.SAXException
* if one of the handlers throw such exception
*/
private void handleSubTree(XMLElement element,
SAXLocator locator)
throws SAXException
{
AttributeListImpl attrList = new AttributeListImpl();
locator.setLineNr(element.getLineNr());
Enumeration enum2 = element.enumeratePropertyNames();
while (enum2.hasMoreElements())
{
String key = (String)(enum2.nextElement());
String value = element.getProperty(key);
attrList.addAttribute(key, "CDATA", value);
}
this.documentHandler.startElement(element.getTagName(), attrList);
if (element.getContents() == null)
{
enum2 = element.enumerateChildren();
while (enum2.hasMoreElements())
{
this.handleSubTree((XMLElement)(enum2.nextElement()),
locator);
}
}
else
{
char[] chars = element.getContents().toCharArray();
this.documentHandler.characters(chars, 0, chars.length);
}
locator.setLineNr(-1);
this.documentHandler.endElement(element.getTagName());
}
SAXParser.java 文件源码
java
阅读 34
收藏 0
点赞 0
评论 0
项目:janala2-gradle
作者:
评论列表
文章目录