Here you can find the source of createQName(String qnameString)
Parameter | Description |
---|---|
qnameString | a qualified name. |
public static QName createQName(String qnameString)
//package com.java2s; /******************************************************************************* * Copyright (c) 2002-2005 IBM Corporation 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:// ww w. ja v a 2 s. c o m * IBM - Initial API and implementation *******************************************************************************/ import javax.xml.namespace.QName; public class Main { /** * Create QName. * * @param qnameString a qualified name. * @return a QName object. */ public static QName createQName(String qnameString) { QName qname = null; // Locate local part int index = qnameString.lastIndexOf(":"); // Create new QName if (index != -1) { qname = new QName(qnameString.substring(0, index), qnameString.substring(index + 1)); } else { qname = new QName(qnameString); } return qname; } }