use of com.twinsoft.convertigo.beans.steps.XMLComplexStep in project convertigo by convertigo.
the class StepUtils method createElementStep.
private static Step createElementStep(Sequence mainSequence, Object parent, Element element) throws EngineException {
Step step = null;
if (element != null) {
if (parent != null) {
// element.getAttribute(xsd.getXmlGenerationDescription().getOccursAttribute());
String occurs = element.getAttribute("maxOccurs");
if (!occurs.equals("")) {
if (occurs.equals("unbounded"))
occurs = "10";
if (Long.parseLong(occurs, 10) > 1) {
parent = createIteratorStep(mainSequence, parent, element);
}
}
}
String tagName = element.getTagName();
String localName = element.getLocalName();
String elementNodeName = (localName == null) ? tagName : localName;
Node firstChild = element.getFirstChild();
boolean isComplex = ((firstChild != null) && (firstChild.getNodeType() != Node.TEXT_NODE));
if (isComplex) {
step = new XMLComplexStep();
((XMLComplexStep) step).setNodeName(elementNodeName);
} else {
step = new XMLElementStep();
((XMLElementStep) step).setNodeName(elementNodeName);
}
step.bNew = true;
addStepToParent(mainSequence, parent, step);
}
return step;
}
Aggregations