/* * Returns the parent element if available, null otherwise * * public Element getParentElement() { * return (parent instanceof Element) * ? ((Element) parent) * : null; * } */ /** * Builds the child elements from the given Parser. By overwriting * parse, an element can take complete control over parsing its * subtree. */ public override void parse(XmlPullParser parser) { for (int i = parser.getNamespaceCount(parser.getDepth() - 1); i < parser.getNamespaceCount(parser.getDepth()); i++) { setPrefix(parser.getNamespacePrefix(i), parser.getNamespaceUri(i)); } for (int i = 0; i < parser.getAttributeCount(); i++) { setAttribute(parser.getAttributeNamespace(i), // parser.getAttributePrefix (i), parser.getAttributeName(i), parser.getAttributeValue(i)); } // if (prefixMap == null) throw new RuntimeException ("!!"); init(); if (parser.isEmptyElementTag()) { parser.nextToken(); } else { parser.nextToken(); base.parse(parser); if (getChildCount() == 0) { addChild(IGNORABLE_WHITESPACE, ""); } } parser.require( XmlPullParser.END_TAG, getNamespace(), getName()); parser.nextToken(); }