Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import javax.xml.XMLConstants;

public class Main {
    public static String[] splitQName(String qualifiedName) {
        if (qualifiedName == null) {
            throw new IllegalArgumentException("Null QName");
        }
        int idx = qualifiedName.indexOf(':');
        String[] parts = { null, null };
        if (idx >= 0) {
            parts[0] = qualifiedName.substring(0, idx);
            parts[1] = qualifiedName.substring(idx + 1);
        } else {
            parts[0] = XMLConstants.DEFAULT_NS_PREFIX;
            parts[1] = qualifiedName;
        }
        return parts;
    }
}