Package org.xml.sax

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


    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


            // first define the current namespaces
            String[] prefixes = session.getNamespacePrefixes();
            handler.startDocument();
            for (String prefix : prefixes) {
                handler.startPrefixMapping(prefix, session.getNamespaceURI(prefix));
            }
            AttributesImpl attrs = new AttributesImpl();

            attrs.addAttribute(Name.NS_SV_URI, "name", "sv:name", "CDATA", name);
            handler.startElement(Name.NS_SV_URI, "node", "sv:node", 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

                    ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING);
            // first define the current namespaces
            String[] prefixes = session.getNamespacePrefixes();
            handler.startDocument();
            for (String prefix: prefixes) {
                handler.startPrefixMapping(prefix, session.getNamespaceURI(prefix));
            }
            AttributesImpl attrs = new AttributesImpl();
            attrs.addAttribute(Name.NS_SV_URI, "name", "sv:name", "CDATA", ni.name);
            handler.startElement(Name.NS_SV_URI, "node", "sv:node", attrs);
View Full Code Here

            // Now call start prefixes if namespaces are not empty
            ContentHandler contentHandler = readerStack.peek().getContentHandler();
            if (contentHandler != null) {
                for (Map.Entry<String,String> ns : namespaces) {
                    contentHandler.startPrefixMapping(ns.getKey(), ns.getValue());
                }
            }
        }

        namespaceStack.push(nsToURI);
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

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.