Package org.xml.sax

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


        String svuri = Name.NS_SV_URI;
        String svprefix = Name.NS_SV_PREFIX + ":";

        ContentHandler ch = superuser.getImportContentHandler(testRootNode.getPath(), ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
        ch.startDocument();
        ch.startPrefixMapping(prefix, uri);

        String nN = "node";
        AttributesImpl attrs = new AttributesImpl();
        attrs.addAttribute(svuri, "name", svprefix + "name", "CDATA", nodeName1);
        ch.startElement(svuri, nN, svprefix + nN, attrs);
View Full Code Here


                // simulate the start of the document.
                winner.setDocumentLocator(locator);
                winner.startDocument();
                for( int i=0; i<prefixes.size(); i++ ) {
                    String[] d = (String[])prefixes.get(i);
                    winner.startPrefixMapping( d[0], d[1] );
                }
                winner.startElement(namespaceURI,localName,qName,atts);
                // redirect all successive events to the winner.
                parser.setContentHandler(winner);
            }
View Full Code Here

        String svuri = Name.NS_SV_URI;
        String svprefix = Name.NS_SV_PREFIX + ":";

        ContentHandler ch = superuser.getImportContentHandler(testRootNode.getPath(), ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
        ch.startDocument();
        ch.startPrefixMapping(prefix, uri);

        String nN = "node";
        AttributesImpl attrs = new AttributesImpl();
        attrs.addAttribute(svuri, "name", svprefix + "name", "CDATA", nodeName1);
        ch.startElement(svuri, nN, svprefix + nN, attrs);
View Full Code Here

        String svuri = Name.NS_SV_URI;
        String svprefix = Name.NS_SV_PREFIX + ":";

        ContentHandler ch = superuser.getImportContentHandler(testRootNode.getPath(), ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
        ch.startDocument();
        ch.startPrefixMapping(prefix, uri);

        String nN = "node";
        AttributesImpl attrs = new AttributesImpl();
        attrs.addAttribute(svuri, "name", svprefix + "name", "CDATA", nodeName1);
        ch.startElement(svuri, nN, svprefix + nN, attrs);
View Full Code Here

        StringWriter writer = new StringWriter();

        ContentHandler handler =
            SerializingContentHandler.getSerializer(writer);
        handler.startDocument();
        handler.startPrefixMapping("p", "uri");
        handler.startElement("uri", "a", "p:a", new AttributesImpl());
        AttributesImpl attributes = new AttributesImpl();
        attributes.addAttribute("uri", "foo", "p:foo", "CDATA", "bar");
        handler.startElement(null, "b", "b", attributes);
        handler.characters("abc".toCharArray(), 0, 3);
View Full Code Here

    public void testXmlns() throws SAXException {
        ContentHandler handler =
            new XmlnsContentHandler(new ToXmlContentHandler());
        handler.startDocument();
        handler.startPrefixMapping("foo", "http://x.y.z/");
        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");
View Full Code Here

    public void testXmlns() throws SAXException {
        ContentHandler handler =
            new XmlnsContentHandler(new ToXmlContentHandler());
        handler.startDocument();
        handler.startPrefixMapping("foo", "http://x.y.z/");
        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");
View Full Code Here

            new XmlnsContentHandler(new ToXmlContentHandler());
        handler.startDocument();
        handler.startPrefixMapping("foo", "http://x.y.z/");
        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");
View Full Code Here

        String svuri = Name.NS_SV_URI;
        String svprefix = Name.NS_SV_PREFIX + ":";

        ContentHandler ch = superuser.getImportContentHandler(testRootNode.getPath(), ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
        ch.startDocument();
        ch.startPrefixMapping(prefix, uri);

        String nN = "node";
        AttributesImpl attrs = new AttributesImpl();
        attrs.addAttribute(svuri, "name", svprefix + "name", "CDATA", nodeName1);
        ch.startElement(svuri, nN, svprefix + nN, attrs);
View Full Code Here

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

      handler.startPrefixMapping(prefix, m_nsSupport.getURI(prefix));
    }
  }

  /**
   * Add the attributes that have been declared to the attribute list.
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.