use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.
the class TslMetaDataHandler method addIncludes.
/**
* @param xn
* @param element
*/
private void addIncludes(XMLElement xn, String element) {
TreeSet<String> s = includesScriptMap.get(element);
if (s == null) {
return;
}
for (Iterator<String> iter = s.iterator(); iter.hasNext(); ) {
String include = iter.next();
XMLElement xnincl = new CaseSensitiveXMLElement();
xnincl.setName("include");
xnincl.setAttribute("name", include);
xn.addChild(xnincl);
}
}
use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.
the class TslMetaDataHandler method parse.
public void parse(File f) {
flushAll();
FileReader fr = null;
XMLElement xe = new CaseSensitiveXMLElement();
try {
fr = new FileReader(f);
xe.parseFromReader(fr);
} catch (IOException e) {
logger.error("Error: ", e);
} finally {
if (fr != null) {
try {
fr.close();
} catch (IOException e) {
}
}
}
}
use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.
the class NS3ToNSXML method parseMappedArrayField.
private MapTag parseMappedArrayField(NS3Compatible parent, XMLElement currentXML) throws Exception {
currentXML.setAttribute("PROCESSED", "true");
MapTag ft = new MapTag(myNavascript);
ft.addParent(parent);
if (parent != null && parent instanceof MapTag) {
ft.setParent((MapTag) parent);
}
ft.setOldStyleMap(true);
Vector<XMLElement> children = currentXML.getChildren();
boolean hasFilter = false;
for (XMLElement child : children) {
String name = child.getName();
String content = (child.getContent() != null && !"".equals(child.getContent()) ? child.getContent() : null);
if (name.equals("MappableIdentifier")) {
String fieldRef = parseMappableIdentifier(child);
ft.setRefAttribute(fieldRef);
}
if (name.equals("FieldName")) {
ft.setRefAttribute(content);
}
if (name.equals("TOKEN") && content.equals("filter")) {
hasFilter = true;
}
if (hasFilter && name.equals("Expression")) {
ExpressionFragment ef = new ExpressionFragment();
consumeContent(ef, child);
ft.setFilter(ef.consumedFragment());
}
if (name.equals("InnerBody") || name.equals("InnerBodySelection")) {
List<NS3Compatible> innerBodyElements = parseInnerBody(ft, child);
for (NS3Compatible ib : innerBodyElements) {
addChildTag(ft, ib);
}
}
}
return ft;
}
use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.
the class NS3ToNSXML method parseBreak.
private BreakTag parseBreak(NS3Compatible parent, XMLElement currentXML) throws Exception {
currentXML.setAttribute("PROCESSED", "true");
BreakTag bt = new BreakTag(myNavascript);
bt.addParent(parent);
Vector<XMLElement> children = currentXML.getChildren();
for (XMLElement child : children) {
String name = child.getName();
String content = (child.getContent() != null && !"".equals(child.getContent()) ? child.getContent() : null);
if (name.equals("Conditional")) {
ConditionFragment currentFragment = new ConditionFragment();
consumeContent(currentFragment, child);
bt.setCondition(currentFragment.consumedFragment());
}
if (name.equals("BreakParameters")) {
parseBreakParameters(bt, child);
}
}
return bt;
}
use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.
the class NS3ToNSXML method parseMappableIdentifier.
/**
* Parse
* <Identifier><Arguments>
*
* @param currentXML
* @return
*/
private String parseMappableIdentifier(XMLElement currentXML) {
StringBuffer result = new StringBuffer();
Vector<XMLElement> children = currentXML.getChildren();
for (XMLElement child : children) {
String name = child.getName();
String content = (child.getContent() != null && !"".equals(child.getContent()) ? child.getContent() : null);
if (name.equals("Identifier")) {
result.append("$" + content);
}
if (name.equals("Arguments")) {
ExpressionFragment ef = new ExpressionFragment();
consumeContent(ef, child);
result.append(ef.consumedFragment());
}
}
return result.toString();
}
Aggregations