Package org.geotools.xml

Examples of org.geotools.xml.AttributeInstance


            // validation should fail, this is being side stepped for now until
            // a good way of handling the namespace attributes on the root
            // element, for now we just ignore attributes we dont find in the
            // schema
            if (decl != null) {
                AttributeInstance att = new AttributeImpl(decl);
                att.setNamespace(decl.getTargetNamespace());
                att.setName(decl.getName());
                att.setText(attributes.getValue(i));

                atts.add(att);
            } else {
                parser.getLogger().warning("Could not find attribute declaration: " + attQName);
            }
        }

        //create the element
        element = new ElementImpl(content);
        element.setNamespace(qName.getNamespaceURI());
        element.setName(qName.getLocalPart());
        element.setAttributes((AttributeInstance[]) atts.toArray(new AttributeInstance[atts.size()]));

        //create the parse tree for the node
        node = new NodeImpl(element);

        //parse the attributes
        for (int i = 0; i < element.getAttributes().length; i++) {
            AttributeInstance attribute = element.getAttributes()[i];
            ParseExecutor executor = new ParseExecutor(attribute, null, parent.getContext(), parser);

            parser.getBindingWalker()
                  .walk(attribute.getAttributeDeclaration(), executor, parent.getContext());

            Object parsed = executor.getValue();
            node.addAttribute(new NodeImpl(attribute, parsed));
        }
View Full Code Here


        XSDAttributeDeclaration declaration = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
        declaration.setName(name);
        declaration.setTargetNamespace(namespace);
        declaration.setTypeDefinition((XSDSimpleTypeDefinition) findTypeDefinition(schema, type));

        AttributeInstance attribute = new AttributeImpl(declaration);
        attribute.setName(name);
        attribute.setNamespace(namespace);
        attribute.setText(text);

        return attribute;
    }
View Full Code Here

TOP

Related Classes of org.geotools.xml.AttributeInstance

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.