Package org.w3c.dom

Examples of org.w3c.dom.TypeInfo


        /**
         * Receive notification of the start of an element.
         */
        public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
            TypeInfo etype = provider.getElementTypeInfo();
            StringBuffer sb = new StringBuffer(100);
            for (int i=0; i<indent; i++) {
                sb.append("  ");
            }
            sb.append("Element " + qName);
            sb.append(" of type {" + etype.getTypeNamespace() + '}' + etype.getTypeName());
            System.out.println(sb.toString());
            for (int a=0; a<attributes.getLength(); a++) {
                TypeInfo atype = provider.getAttributeTypeInfo(a);
                boolean spec = provider.isSpecified(a);
                sb.setLength(0);
                for (int i=0; i<indent+2; i++) {
                    sb.append("  ");
                }
                sb.append("Attribute " + attributes.getQName(a) + (spec ? " (specified)" : (" (defaulted)")));
                if (atype == null) {
                    sb.append(" of unknown type");
                } else {
                    sb.append(" of type {" + atype.getTypeNamespace() + '}' + atype.getTypeName());
                }
                System.out.println(sb.toString());
            }
            indent++;
        }
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

        /**
         * Receive notification of the start of an element.
         */
        public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
            TypeInfo etype = provider.getElementTypeInfo();
            StringBuffer sb = new StringBuffer(100);
            for (int i=0; i<indent; i++) {
                sb.append("  ");
            }
            sb.append("Element " + qName);
            sb.append(" of type {" + etype.getTypeNamespace() + '}' + etype.getTypeName());
            System.out.println(sb.toString());
            for (int a=0; a<attributes.getLength(); a++) {
                TypeInfo atype = provider.getAttributeTypeInfo(a);
                boolean spec = provider.isSpecified(a);
                sb.setLength(0);
                for (int i=0; i<indent+2; i++) {
                    sb.append("  ");
                }
                sb.append("Attribute " + attributes.getQName(a) + (spec ? " (specified)" : (" (defaulted)")));
                sb.append(" of type {" + atype.getTypeNamespace() + '}' + atype.getTypeName());
                System.out.println(sb.toString());
            }
            indent++;
        }
View Full Code Here

         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

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.