Package org.xml.sax

Examples of org.xml.sax.ContentHandler.endPrefixMapping()


      String prefix;
      for (Iterator i=d_toUnmap.iterator(); i.hasNext();)
      {
         handler = (ContentHandler)i.next();
         prefix = (String)i.next();
         handler.endPrefixMapping(prefix);
      }
      d_toUnmap.clear();
  }

  private HashMap d_uriToPrefix;
View Full Code Here


        handler.endElement(null, "b", "b");
        handler.startElement(null, "c", "c", new AttributesImpl());
        handler.endElement(null, "c", "c");
        handler.characters("xyz".toCharArray(), 0, 3);
        handler.endElement("uri", "a", "p:a");
        handler.endPrefixMapping("p");
        handler.endDocument();

        String xml = writer.toString();
        assertContains(xml, "<p:a");
        assertContains(xml, "xmlns:p");
View Full Code Here

        handler.startPrefixMapping("bar", "http://a.b.c/");
        handler.startElement("", "test", "test", new AttributesImpl());
        handler.startPrefixMapping("foo", "http://a.b.c/");
        handler.startElement("", "tset", "tset", new AttributesImpl());
        handler.endElement("", "tset", "tset");
        handler.endPrefixMapping("foo");
        handler.startElement("", "tset", "tset", new AttributesImpl());
        handler.endElement("", "tset", "tset");
        handler.endElement("", "test", "test");
        handler.endPrefixMapping("bar");
        handler.endPrefixMapping("foo");
View Full Code Here

        handler.endElement("", "tset", "tset");
        handler.endPrefixMapping("foo");
        handler.startElement("", "tset", "tset", new AttributesImpl());
        handler.endElement("", "tset", "tset");
        handler.endElement("", "test", "test");
        handler.endPrefixMapping("bar");
        handler.endPrefixMapping("foo");
        handler.endDocument();
        assertEquals(
                "<?xml version=\"1.0\"?>"
                + "<test xmlns:foo=\"http://x.y.z/\" xmlns:bar=\"http://a.b.c/\">"
View Full Code Here

        handler.endPrefixMapping("foo");
        handler.startElement("", "tset", "tset", new AttributesImpl());
        handler.endElement("", "tset", "tset");
        handler.endElement("", "test", "test");
        handler.endPrefixMapping("bar");
        handler.endPrefixMapping("foo");
        handler.endDocument();
        assertEquals(
                "<?xml version=\"1.0\"?>"
                + "<test xmlns:foo=\"http://x.y.z/\" xmlns:bar=\"http://a.b.c/\">"
                + "<tset xmlns:foo=\"http://a.b.c/\"/><tset/>"
View Full Code Here

    while (prefixes.hasMoreElements())
    {
      String prefix = (String) prefixes.nextElement();

      handler.endPrefixMapping(prefix);
    }
  }

  /**
   * Check to see if we should switch serializers based on the
View Full Code Here

        NamespaceResolver tmpresolver = getTempResolver(elem);
        if (tmpresolver != null) {
            ContentHandler contentHandler = getContentHandler();
            String defaultNamespace = tmpresolver.getDefaultNamespaceURI();
            if(null != defaultNamespace) {
                contentHandler.endPrefixMapping(XMLConstants.EMPTY_STRING);
            }
            if(tmpresolver.hasPrefixesToNamespaces()) {
                for(Entry<String, String> entry : tmpresolver.getPrefixesToNamespaces().entrySet()) {
                    contentHandler.endPrefixMapping(entry.getKey());
                }
View Full Code Here

            if(null != defaultNamespace) {
                contentHandler.endPrefixMapping(XMLConstants.EMPTY_STRING);
            }
            if(tmpresolver.hasPrefixesToNamespaces()) {
                for(Entry<String, String> entry : tmpresolver.getPrefixesToNamespaces().entrySet()) {
                    contentHandler.endPrefixMapping(entry.getKey());
                }
            }
        }
    }
View Full Code Here

    while (prefixes.hasMoreElements())
    {
      String prefix = (String) prefixes.nextElement();

      handler.endPrefixMapping(prefix);
    }
  }

  /**
   * Check to see if we should switch serializers based on the
View Full Code Here

    for (;;) {
      String prefix = nss.checkContext(pContext);
      if (prefix == null) {
        return;
      }
      h.endPrefixMapping(prefix);
    }
  }

  public void printConversionEvent(Object pObject, String pMsg, Exception pException) throws SAXException {
    ValidationEventHandler handler = getJMMarshaller().getEventHandler();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.