Search in sources :

Example 1 with XSDBaseNode

use of easik.xml.xsd.nodes.XSDBaseNode in project fql by CategoricalData.

the class XMLSchema method toString.

/**
 * XML string of the Schema.
 *
 * @see Prettify
 * @return the prettied string
 */
@Override
public String toString() {
    final StringBuilder ret = new StringBuilder("<?xml version='1.0' ?>");
    final String lineSep = EasikTools.systemLineSeparator();
    ret.append(lineSep).append('<').append(getXsNSPrefix()).append("schema ").append(xsNS.toString()).append(attributeFormDefaultUnQualified ? " attributeFormDefault=\"unqualified\" " : " attributeFormDefault=\"qualified\" ").append(elementFormDefaultUnQualified ? " elementFormDefault=\"unqualified\" " : " elementFormDefault=\"qualified\" ").append(targetNS.prettyString("       ", lineSep)).append(" >").append(lineSep);
    for (final XSDType t : types) {
        ret.append(t.toString()).append(lineSep);
    }
    for (final XSDBaseNode e : elements) {
        ret.append(e.toString()).append(lineSep);
    }
    ret.append("</").append(getXsNSPrefix()).append("schema>").append(lineSep);
    return new Prettify(ret).toString();
}
Also used : XSDBaseNode(easik.xml.xsd.nodes.XSDBaseNode) XSDType(easik.xml.xsd.nodes.types.XSDType) Prettify(easik.xml.Prettify)

Example 2 with XSDBaseNode

use of easik.xml.xsd.nodes.XSDBaseNode in project fql by CategoricalData.

the class XSDAbstractCompositor method listToString.

/**
 * Helper method used by sequences to list elements.
 *
 * @return XML String of collection
 */
protected String listToString() {
    final StringBuilder ret = new StringBuilder(100);
    if ((null != elements) && (elements.size() > 0)) {
        ret.append('<').append(nsPrefix).append(':').append(getTagName()).append(' ').append(tagAttributeListToString()).append('>').append(lineSep);
        for (final XSDBaseNode elt : elements) {
            ret.append(elt.toString()).append(lineSep);
        }
        ret.append("</").append(nsPrefix).append(':').append(getTagName()).append('>');
    }
    return ret.toString();
}
Also used : XSDBaseNode(easik.xml.xsd.nodes.XSDBaseNode)

Aggregations

XSDBaseNode (easik.xml.xsd.nodes.XSDBaseNode)2 Prettify (easik.xml.Prettify)1 XSDType (easik.xml.xsd.nodes.types.XSDType)1