Java XML QName Get getQNameFromSerialzedForm(String qNameAsString)

Here you can find the source of getQNameFromSerialzedForm(String qNameAsString)

Description

get Q Name From Serialzed Form

License

Open Source License

Declaration

public static QName getQNameFromSerialzedForm(String qNameAsString) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2008, 2012 IBM Corporation, University of Stuttgart (IAAS) and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:/*from   w w w . ja  v a2s. c om*/
 *     IBM Corporation, University of Stuttgart (IAAS) - initial API and implementation
 *******************************************************************************/

import javax.xml.namespace.QName;

public class Main {
    public static QName getQNameFromSerialzedForm(String qNameAsString) {

        int pos = qNameAsString.lastIndexOf("}"); //$NON-NLS-1$

        String ns = qNameAsString.substring(1, pos);
        String name = qNameAsString.substring(pos + 1, qNameAsString.length());

        QName qName = new QName(ns, name);

        return qName;
    }
}

Related

  1. getQNameAttribute(Map attributes, QName qName)
  2. getQNameAttribute(Node n, String namespace, String attributeName)
  3. getQNameComparator()
  4. getQNameConstant(QName name)
  5. getQNameForNode(Node node)
  6. getQNameFromString(Element element, String qnameAsString)
  7. getQNameFromString(Object obj)
  8. getQNameHashCode(QName aQName)
  9. getQNameType(List objects, QName qName)

    HOME | Copyright © www.java2s.com 2016