Package org.w3c.dom

Examples of org.w3c.dom.TypeInfo


         Element element = (Element)object;

         String namespace = element.getNamespaceURI();
         if (XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(namespace))
         {
            final TypeInfo type = element.getSchemaTypeInfo();
            String typeName = type.getTypeName();
            if (typeName == null)
            {
               // try to determine the type name based on the tag name
               // tag name will have prefix so that we need to remove it
               String tagName = element.getTagName();
View Full Code Here


         tagName = prefixEnd == -1 ? tagName : tagName.substring(prefixEnd + 1);

         // attempt to convert to simple datatype value
         if (XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(namespace))
         {
            final TypeInfo type = element.getSchemaTypeInfo();
            String typeName = type.getTypeName();

            if (typeName == null)
            {
               // try to determine the type name based on the tag name
               typeName = tagName;
View Full Code Here

    {
        checkAttributeNameMatch(element, attributeName, child);

        for (final ChildType childrenType : childrenTypes)
        {
            final TypeInfo typeInfo = (TypeInfo) child;

            if (((childrenType.ns.equals(typeInfo.getTypeNamespace()) && childrenType.name.equals(typeInfo.getTypeName())))
                || typeInfo.isDerivedFrom(childrenType.ns, childrenType.name, TypeInfo.DERIVATION_EXTENSION))
            {

                throw new CheckExclusiveAttributesAndChildrenException(
                    "Element " + SpringXMLUtils.elementToString(element) + " can't contain child of type "
                                    + childrenType + " because it defines attribute " + attributeName);
View Full Code Here

    public String getAttributeType(int i) {
        Attr attr = getAttribute(i);
        if (attr.isId()) {
            return "ID";
        }
        TypeInfo schemaType = null;
        try {
            schemaType = attr.getSchemaTypeInfo();
        } catch (Throwable t) {
            //DOM level 2?
            schemaType = null;
        }
        return (schemaType == null) ? "CDATA"
            : schemaType.getTypeName() == null ? "CDATA" : schemaType.getTypeName();
    }
View Full Code Here

    public String getAttributeType(int i) {
        Attr attr = getAttribute(i);
        if (attr.isId()) {
            return "ID";
        }
        TypeInfo schemaType = null;
        try {
            schemaType = attr.getSchemaTypeInfo();
        } catch (Throwable t) {
            //DOM level 2?
            schemaType = null;
        }
        return (schemaType == null) ? "CDATA"
            : schemaType.getTypeName() == null ? "CDATA" : schemaType.getTypeName();
    }
View Full Code Here

   
    /** Start element. */
    public void startElement(String uri, String localName, String qname,
                             Attributes attributes) throws SAXException {

        TypeInfo type;
        printIndent();
        fOut.print("startElement(");
        fOut.print("name=");
        printQName(uri, localName);
        fOut.print(',');
        fOut.print("type=");
        if (fTypeInfoProvider != null && (type = fTypeInfoProvider.getElementTypeInfo()) != null) {
            printQName(type.getTypeNamespace(), type.getTypeName());
        }
        else {
            fOut.print("null");
        }
        fOut.print(',');
        fOut.print("attributes=");
        if (attributes == null) {
            fOut.println("null");
        }
        else {
            fOut.print('{');
            int length = attributes.getLength();
            for (int i = 0; i < length; i++) {
                if (i > 0) {
                    fOut.print(',');
                }
                String attrURI = attributes.getURI(i);
                String attrLocalName = attributes.getLocalName(i);
                fOut.print('{');
                fOut.print("name=");
                printQName(attrURI, attrLocalName);
                fOut.print(',');
                fOut.print("type=");
                if (fTypeInfoProvider != null && (type = fTypeInfoProvider.getAttributeTypeInfo(i)) != null) {
                    printQName(type.getTypeNamespace(), type.getTypeName());
                }
                else {
                    fOut.print("null");
                }
                fOut.print(',');
View Full Code Here

    public String getAttributeType(int i) {
        Attr attr = getAttribute(i);
        if (attr.isId()) {
            return "ID";
        }
        TypeInfo schemaType = null;
        try {
            schemaType = attr.getSchemaTypeInfo();
        } catch (Throwable t) {
            //DOM level 2?
            schemaType = null;
        }
        return (schemaType == null) ? "CDATA"
            : schemaType.getTypeName() == null ? "CDATA" : schemaType.getTypeName();
    }
View Full Code Here

    public String getAttributeType(int i) {
        Attr attr = getAttribute(i);
        if (attr.isId()) {
            return "ID";
        }
        TypeInfo schemaType = null;
        try {
            schemaType = attr.getSchemaTypeInfo();
        } catch (Throwable t) {
            //DOM level 2?
            schemaType = null;
        }
        return (schemaType == null) ? "CDATA"
            : schemaType.getTypeName() == null ? "CDATA" : schemaType.getTypeName();
    }
View Full Code Here

    public String getAttributeType(int i) {
        Attr attr = getAttribute(i);
        if (attr.isId()) {
            return "ID";
        }
        TypeInfo schemaType = null;
        try {
            schemaType = attr.getSchemaTypeInfo();
        } catch (Throwable t) {
            //DOM level 2?
            schemaType = null;
        }
        return (schemaType == null) ? "CDATA"
            : schemaType.getTypeName() == null ? "CDATA" : schemaType.getTypeName();
    }
View Full Code Here

   
    /** Start element. */
    public void startElement(String uri, String localName, String qname,
                             Attributes attributes) throws SAXException {

        TypeInfo type;
        printIndent();
        fOut.print("startElement(");
        fOut.print("name=");
        printQName(uri, localName);
        fOut.print(',');
        fOut.print("type=");
        if (fTypeInfoProvider != null && (type = fTypeInfoProvider.getElementTypeInfo()) != null) {
            printQName(type.getTypeNamespace(), type.getTypeName());
        }
        else {
            fOut.print("null");
        }
        fOut.print(',');
        fOut.print("attributes=");
        if (attributes == null) {
            fOut.println("null");
        }
        else {
            fOut.print('{');
            int length = attributes.getLength();
            for (int i = 0; i < length; i++) {
                if (i > 0) {
                    fOut.print(',');
                }
                String attrURI = attributes.getURI(i);
                String attrLocalName = attributes.getLocalName(i);
                fOut.print('{');
                fOut.print("name=");
                printQName(attrURI, attrLocalName);
                fOut.print(',');
                fOut.print("type=");
                if (fTypeInfoProvider != null && (type = fTypeInfoProvider.getAttributeTypeInfo(i)) != null) {
                    printQName(type.getTypeNamespace(), type.getTypeName());
                }
                else {
                    fOut.print("null");
                }
                fOut.print(',');
View Full Code Here

TOP

Related Classes of org.w3c.dom.TypeInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.