use of net.heartsome.xml.Element in project translationstudio8 by heartsome.
the class TBXTemplateUtil method getTemplateFiles.
public static Vector<String> getTemplateFiles(String catalogueFile, String templatePath, boolean needArray) {
Vector<String> result = new Vector<String>();
File templateDir = new File(templatePath);
String[] contents = templateDir.list();
if (contents != null) {
for (int i = 0; i < contents.length; i++) {
File currentFile = new File(templateDir.getAbsolutePath(), contents[i]);
if (currentFile.isFile()) {
try {
SAXBuilder builder = new SAXBuilder();
if (!catalogueFile.equals("")) {
//$NON-NLS-1$
Catalogue cat = new Catalogue(catalogueFile);
builder.setEntityResolver(cat);
}
Document doc = builder.build(currentFile.getAbsolutePath());
Element tbxXCS = doc.getRootElement();
//$NON-NLS-1$
Element datCatSet = tbxXCS.getChild("datCatSet");
if (datCatSet != null) {
result.add(currentFile.getName());
}
} catch (Exception e) {
LOGGER.error("", e);
}
}
}
}
return result;
}
use of net.heartsome.xml.Element in project translationstudio8 by heartsome.
the class TBXTemplateUtil method getItemDescription.
public String getItemDescription(int item) {
Element spec = items.get(item);
//$NON-NLS-1$
String itemDesc = spec.getAttributeValue("display");
if (itemDesc.equals("")) {
//$NON-NLS-1$
return getItemName(item);
}
return itemDesc;
}
use of net.heartsome.xml.Element in project translationstudio8 by heartsome.
the class ReverseConversionValidateWithLibrary3 method createList.
/**
* 创建翻译节点列表
* @param rootPara
* ;
*/
private void createList(Element rootPara) {
List<Element> files = rootPara.getChildren();
Iterator<Element> it = files.iterator();
while (it.hasNext()) {
Element el = it.next();
if (el.getName().equals("trans-unit")) {
//$NON-NLS-1$
segments.add(el);
} else {
createList(el);
}
}
}
Aggregations