@Override
    public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
        String[] qNameParts = qName.split(":");
        if (qNameParts.length > 1 && qNameParts[0].equals("subst"))  {
            if (contentResolvers != null && contentResolvers.keySet().contains(localName)) {
                ContentResolver resolver = contentResolvers.get(localName);
                resolver.setConditions(attributes);
                replacementObject = resolver.getReplacement();
            } else {
                throw new XmlException("Resolver for local name '" + localName + "' is missing", null);
            }
        } else {
            XmlNode newXmlNode = NodeFactory.createNode(localName);
            if (result == null) {
                result = newXmlNode;
            }
            if (currentObject != null) {
                flushCurrentCharacters();
                currentObject.addChild(newXmlNode);
            }
            currentObject = newXmlNode;
            for (int i = 0; i < attributes.getLength(); i++) {
                String name = attributes.getLocalName(i);
                String value = attributes.getValue(i);
                currentObject.addAttribute(name, value);
            }
        }
    }