public void endDocument() throws SAXException {

    outputFirstElementIfNeeded();

    // Output global properties
    if (properties.size() > 0) {
      final AttributesImpl newAttributes = new AttributesImpl();
      for (final Map.Entry<String, String> currentEntry : properties.entrySet()) {
        final String propertyName = currentEntry.getKey();
        newAttributes.addAttribute(
            XFormsConstants.XXFORMS_NAMESPACE_URI,
            propertyName,
            "xxforms:" + propertyName,
            ContentHandlerHelper.CDATA,
            currentEntry.getValue());
      }

      super.startPrefixMapping("xxforms", XFormsConstants.XXFORMS_NAMESPACE_URI);
      super.startElement("", "properties", "properties", newAttributes);
      super.endElement("", "properties", "properties");
      super.endPrefixMapping("xxforms");
    }

    super.endElement("", "static-state", "static-state");
    super.endDocument();
  }
 private void sendStartPrefixMappings() throws SAXException {
   for (Enumeration e = namespaceSupport.getPrefixes(); e.hasMoreElements(); ) {
     final String namespacePrefix = (String) e.nextElement();
     final String namespaceURI = namespaceSupport.getURI(namespacePrefix);
     if (!namespacePrefix.startsWith("xml"))
       super.startPrefixMapping(namespacePrefix, namespaceURI);
   }
 }
 public void startPrefixMapping(String prefix, String uri) throws SAXException {
   namespaceSupport.startPrefixMapping(prefix, uri);
   if (inXFormsOrExtension) super.startPrefixMapping(prefix, uri);
 }