fixed formatting and indentation.
This commit is contained in:
parent
96cd8c406c
commit
47a3202ba8
1 changed files with 222 additions and 224 deletions
|
@ -114,22 +114,19 @@ public class XmlReader implements XmlConstants {
|
||||||
try {
|
try {
|
||||||
childElement = (Element)list.item(i);
|
childElement = (Element)list.item(i);
|
||||||
} catch( ClassCastException e ) {
|
} catch( ClassCastException e ) {
|
||||||
continue; // ignore CDATA, comments etc
|
// ignore CDATA, comments etc
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
INode workNode = null;
|
INode workNode = null;
|
||||||
|
|
||||||
if ( childElement.getTagName().equals("hop:child") ) {
|
if ( childElement.getTagName().equals("hop:child") ) {
|
||||||
|
|
||||||
convert (childElement, helmaNode.createNode(null));
|
convert (childElement, helmaNode.createNode(null));
|
||||||
|
} else if ( !"".equals(childElement.getAttribute("id")) ||
|
||||||
} else if ( !"".equals(childElement.getAttribute("id")) || !"".equals(childElement.getAttribute("idref")) ) {
|
!"".equals(childElement.getAttribute("idref")) ) {
|
||||||
|
|
||||||
String childTagName = childElement.getTagName();
|
String childTagName = childElement.getTagName();
|
||||||
INode newNode = convert (childElement, helmaNode.createNode (childTagName));
|
INode newNode = convert (childElement, helmaNode.createNode (childTagName));
|
||||||
helmaNode.setNode (childTagName, newNode);
|
helmaNode.setNode (childTagName, newNode);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
String type = childElement.getAttribute("type");
|
String type = childElement.getAttribute("type");
|
||||||
String key = childElement.getTagName();
|
String key = childElement.getTagName();
|
||||||
String content = XmlUtil.getTextContent(childElement);
|
String content = XmlUtil.getTextContent(childElement);
|
||||||
|
@ -170,7 +167,7 @@ public class XmlReader implements XmlConstants {
|
||||||
// FIXME: this method should use Element.getAttributeNS():
|
// FIXME: this method should use Element.getAttributeNS():
|
||||||
// FIXME: do we need the name value or is it retrieved through mappings anyway?
|
// FIXME: do we need the name value or is it retrieved through mappings anyway?
|
||||||
String name = element.getAttribute("name");
|
String name = element.getAttribute("name");
|
||||||
// String name = null;
|
// String name = null;
|
||||||
String id = element.getAttribute("id");
|
String id = element.getAttribute("id");
|
||||||
String prototype = element.getAttribute("prototype");
|
String prototype = element.getAttribute("prototype");
|
||||||
if ( "".equals(prototype) )
|
if ( "".equals(prototype) )
|
||||||
|
@ -189,13 +186,14 @@ public class XmlReader implements XmlConstants {
|
||||||
int len = list.getLength();
|
int len = list.getLength();
|
||||||
Hashtable propMap = new Hashtable();
|
Hashtable propMap = new Hashtable();
|
||||||
List subnodes = new ExternalizableVector();
|
List subnodes = new ExternalizableVector();
|
||||||
for ( int i=0; i<len; i++ ) {
|
|
||||||
|
|
||||||
|
for ( int i=0; i<len; i++ ) {
|
||||||
Element childElement;
|
Element childElement;
|
||||||
try {
|
try {
|
||||||
childElement = (Element)list.item(i);
|
childElement = (Element)list.item(i);
|
||||||
} catch( ClassCastException e ) {
|
} catch( ClassCastException e ) {
|
||||||
continue; // ignore CDATA, comments etc
|
// ignore CDATA, comments etc
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( childElement.getTagName().equals("hop:child") ) {
|
if ( childElement.getTagName().equals("hop:child") ) {
|
||||||
|
@ -213,11 +211,11 @@ public class XmlReader implements XmlConstants {
|
||||||
|
|
||||||
// if we come until here, childelement is a property value
|
// if we come until here, childelement is a property value
|
||||||
Property prop = new Property (childElement.getTagName(), helmaNode);
|
Property prop = new Property (childElement.getTagName(), helmaNode);
|
||||||
if ( !"".equals(childElement.getAttribute("id")) || !"".equals(childElement.getAttribute("idref")) ) {
|
if ( !"".equals(childElement.getAttribute("id")) ||
|
||||||
|
!"".equals(childElement.getAttribute("idref")) ) {
|
||||||
// we've got an object!
|
// we've got an object!
|
||||||
String idref = childElement.getAttribute("idref");
|
String idref = childElement.getAttribute("idref");
|
||||||
prop.setNodeHandle (new NodeHandle(new DbKey(null,idref)));
|
prop.setNodeHandle (new NodeHandle(new DbKey(null,idref)));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
String type = childElement.getAttribute("type");
|
String type = childElement.getAttribute("type");
|
||||||
String content = XmlUtil.getTextContent(childElement);
|
String content = XmlUtil.getTextContent(childElement);
|
||||||
|
|
Loading…
Add table
Reference in a new issue