Java XML Namespace printNamespace(XMLStreamReader xmlr, int index, StringBuffer result)

Here you can find the source of printNamespace(XMLStreamReader xmlr, int index, StringBuffer result)

Description

print Namespace

License

LGPL

Declaration

private static void printNamespace(XMLStreamReader xmlr, int index, StringBuffer result) 

Method Source Code

//package com.java2s;
/*/*ww  w.  j  av a 2  s.  c om*/
 * Copyright LGPL3
 * YES Technology Association
 * http://yestech.org
 *
 * http://www.opensource.org/licenses/lgpl-3.0.html
 */

import javax.xml.stream.XMLStreamReader;

public class Main {
    private static void printNamespace(XMLStreamReader xmlr, int index, StringBuffer result) {
        String prefix = xmlr.getNamespacePrefix(index);
        String uri = xmlr.getNamespaceURI(index);
        result.append(" ");
        if (prefix == null)
            result.append("xmlns='").append(uri).append("'");
        else
            result.append("xmlns:").append(prefix).append("='").append(uri).append("'");
    }
}

Related

  1. getTEINamespaceContext()
  2. getXmlSchemaNamespace(Class clazz)
  3. isNamespaceAware()
  4. isValidFragment(final Object obj, final String namespace, final String localPart)
  5. logWriter(Logger logger, String msg, XMLStreamWriter writer, String namespaceURI)
  6. printNamespaces(XMLStreamReader xmlr)
  7. readXML(InputStream input, boolean isNamespaceAware)
  8. stringToDoc(String s, boolean nameSpaceAware)
  9. writeNamespace(XMLStreamWriter out, String prefix, String namespaceURI)