Search in sources :

Example 51 with CaseSensitiveXMLElement

use of com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement in project navajo by Dexels.

the class GeoPolygonGroup method createPlaceMark.

@Override
public XMLElement createPlaceMark() {
    XMLElement c = new CaseSensitiveXMLElement("Placemark");
    c.addTagKeyValue("name", myName);
    c.addChild(createElement());
    return c;
}
Also used : CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) XMLElement(com.dexels.navajo.document.nanoimpl.XMLElement)

Example 52 with CaseSensitiveXMLElement

use of com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement in project navajo by Dexels.

the class XMLMap method parseString.

private void parseString(String s) throws UserException {
    XMLElement xe = new CaseSensitiveXMLElement(true);
    try {
        xe.parseFromReader(new StringReader(s));
    } catch (IOException ex) {
        throw new UserException("Error parsing:", ex);
    }
    this.name = xe.getName();
    parseXML(xe);
}
Also used : CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) StringReader(java.io.StringReader) IOException(java.io.IOException) UserException(com.dexels.navajo.script.api.UserException) CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) XMLElement(com.dexels.navajo.document.nanoimpl.XMLElement)

Example 53 with CaseSensitiveXMLElement

use of com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement in project navajo by Dexels.

the class BaseContextImpl method getArticleArguments.

private Map<String, String> getArticleArguments(File file) {
    FileReader fr = null;
    Map<String, String> result = new HashMap<String, String>();
    try {
        fr = new FileReader(file);
        XMLElement x = new CaseSensitiveXMLElement();
        x.parseFromReader(fr);
        final Iterator<String> enumerateAttributeNames = x.enumerateAttributeNames();
        while (enumerateAttributeNames.hasNext()) {
            String attr = enumerateAttributeNames.next();
            result.put(attr, x.getStringAttribute(attr));
        }
    } catch (IOException e) {
        logger.error("Problem parsing article: ", e);
    } finally {
        if (fr != null) {
            try {
                fr.close();
            } catch (IOException e) {
            }
        }
    }
    return result;
}
Also used : CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) HashMap(java.util.HashMap) FileReader(java.io.FileReader) IOException(java.io.IOException) CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) XMLElement(com.dexels.navajo.document.nanoimpl.XMLElement)

Aggregations

CaseSensitiveXMLElement (com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement)53 XMLElement (com.dexels.navajo.document.nanoimpl.XMLElement)49 IOException (java.io.IOException)10 InputStreamReader (java.io.InputStreamReader)7 FileReader (java.io.FileReader)5 HashMap (java.util.HashMap)5 File (java.io.File)3 FileInputStream (java.io.FileInputStream)3 APIException (com.dexels.navajo.article.APIException)2 Message (com.dexels.navajo.document.Message)2 Property (com.dexels.navajo.document.Property)2 BufferedReader (java.io.BufferedReader)2 InputStream (java.io.InputStream)2 PrintWriter (java.io.PrintWriter)2 Reader (java.io.Reader)2 StringReader (java.io.StringReader)2 StringWriter (java.io.StringWriter)2 ArrayList (java.util.ArrayList)2 XMLParseException (com.dexels.navajo.document.nanoimpl.XMLParseException)1 AdapterFieldDependency (com.dexels.navajo.mapping.compiler.meta.AdapterFieldDependency)1