Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import org.w3c.dom.Node;

import org.xml.sax.SAXParseException;

public class Main {
    static String[] typeDescription(String type, String defaultNameSpace, Node node) throws SAXParseException {
        final String typeNameSpace;
        final String typeName;
        String[] split = type.split(":");
        switch (split.length) {
        case 1:
            typeNameSpace = defaultNameSpace;
            typeName = split[0];
            break;
        case 2:
            typeNameSpace = node.lookupNamespaceURI(split[0]);
            typeName = split[1];
            break;
        default:
            throw new SAXParseException("Illegal type format: " + type, null);
        }
        return new String[] { typeNameSpace, typeName };
    }
}