Fixed bug that caused NullPointerException.
Added option to add selected elements to the default subnode collection via element.childelement = prototype._children.
This commit is contained in:
parent
d6d7141350
commit
d41c6d5657
1 changed files with 11 additions and 4 deletions
|
@ -217,6 +217,8 @@ public class XmlConverter implements XmlConstants {
|
||||||
if ( helmaKey==null && !sparse ) {
|
if ( helmaKey==null && !sparse ) {
|
||||||
helmaKey = childElement.getNodeName().replace(':',defaultSeparator);
|
helmaKey = childElement.getNodeName().replace(':',defaultSeparator);
|
||||||
}
|
}
|
||||||
|
if (helmaKey == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
// get the node on which to opererate, depending on the helmaKey
|
// get the node on which to opererate, depending on the helmaKey
|
||||||
// value from the properties file.
|
// value from the properties file.
|
||||||
|
@ -232,11 +234,16 @@ public class XmlConverter implements XmlConstants {
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// try to get the virtual node
|
// try to get the virtual node
|
||||||
helma.objectmodel.INode worknode = node.getNode( helmaKey, false );
|
INode worknode = null;
|
||||||
|
if ("_children".equals (helmaKey)) {
|
||||||
|
worknode = node;
|
||||||
|
} else {
|
||||||
|
node.getNode( helmaKey, false );
|
||||||
if ( worknode==null ) {
|
if ( worknode==null ) {
|
||||||
// if virtual node doesn't exist, create it
|
// if virtual node doesn't exist, create it
|
||||||
worknode = helmaNode.createNode( helmaKey );
|
worknode = helmaNode.createNode( helmaKey );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
debug( "mounting child "+ childElement.getNodeName() + " at worknode " + worknode.toString() );
|
debug( "mounting child "+ childElement.getNodeName() + " at worknode " + worknode.toString() );
|
||||||
// now mount it, possibly re-using the helmaNode that's been created before
|
// now mount it, possibly re-using the helmaNode that's been created before
|
||||||
|
|
Loading…
Add table
Reference in a new issue