All Downloads are FREE. Search and download functionalities are using the official Maven repository.

txw2.xmlschema.src.XsdTest Maven / Gradle / Ivy

Go to download

Ehcache is an open source, standards-based cache used to boost performance, offload the database and simplify scalability. Ehcache is robust, proven and full-featured and this has made it the most widely-used Java-based cache.

There is a newer version: 2.10.9.2
Show newest version

import com.sun.tools.jxc.gen.xmlschema.Schema;
import com.sun.tools.jxc.gen.xmlschema.TopLevelElement;
import com.sun.xml.txw2.TXW;
import com.sun.xml.txw2.output.StreamSerializer;

import javax.xml.namespace.QName;

/**
 * @author Kohsuke Kawaguchi
 */
public class XsdTest {
    private static final StringBuilder newline = new StringBuilder("\n");

    public static void main(String[] args) {
        Schema root = TXW.create(Schema.class,new StreamSerializer(System.out));

        root._namespace("http://www.w3.org/2001/XMLSchema","xs");

        root.version("1.0").targetNamespace("http://foobar/");
        root._pcdata(newline);
        root.complexType().name("ink").sequence();
        root._pcdata(newline);

        TopLevelElement e = root.element();
        e.name("foo").type(new QName("abc","def"));
        e.commit();
        System.out.print("[committed]");

        root.commit();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy