Examples of toFirstAttribute()


Examples of org.apache.xmlbeans.XmlCursor.toFirstAttribute()

            // TODO: Cover the case *::name
            if (name.localName().equals("*"))
            {
                // Delete all attributes.
                if (curs.toFirstAttribute())
                {
                    while (curs.currentTokenType().isAttr())
                    {
                        curs.removeXml();
                    }
View Full Code Here

Examples of org.apache.xmlbeans.XmlCursor.toFirstAttribute()

                        return this;
                    }

                    // Check the attributes
                    cursor.push();
                    boolean hasNext = cursor.toFirstAttribute();
                    while(hasNext)
                    {
                        n = NamespaceHelper.getNamespace(lib, cursor, inScopeNS);
                        if(nsURI.equals(n.uri()) &&
                           (nsPrefix == null ||
View Full Code Here

Examples of org.apache.xmlbeans.XmlCursor.toFirstAttribute()

    {
        XmlObject x = XmlObject.Factory.parse( "<a><x/><y/><z/></a>" );
        XmlCursor c = x.newCursor();
        Assert.assertTrue( c.toNextSibling() == false );
        Assert.assertTrue( c.toPrevSibling() == false );
        Assert.assertTrue( c.toFirstAttribute() == false );
        Assert.assertTrue( c.toLastAttribute() == false );
        c.toNextToken();
        c.toNextToken();
        Assert.assertTrue( c.toNextSibling() == true );
        Assert.assertTrue( c.getName().getLocalPart().equals( "y" ) );
View Full Code Here

Examples of org.apache.xmlbeans.XmlCursor.toFirstAttribute()

        try
        {
            if (!xc.isContainer())
                return null;

            if (xc.toFirstAttribute())
            {
                //look for attributes
                do
                {
                    if (xc.getName().equals(attributeName))
View Full Code Here

Examples of org.apache.xmlbeans.XmlCursor.toFirstAttribute()

            if (!xc.isContainer())
                return EMPTY_RESULT;

            List result = new ArrayList();

            if (xc.toFirstAttribute())
            {
                //look for attributes
                do
                {
                    if (attributeNameSet.contains(xc.getName()))
View Full Code Here

Examples of org.apache.xmlbeans.XmlCursor.toFirstAttribute()

            // TODO: Check with ConflictHandler
            mixed = true;
        }
        cursor.pop();
        cursor.push();
        if (cursor.toFirstAttribute()) {
            do {
                QName qname = cursor.getName();
                if (attributes.containsKey(qname)) {
                    attributes.get(qname).validate(context);
                } else if (qname.getNamespaceURI().equals(Settings.xsins)) {
View Full Code Here

Examples of org.apache.xmlbeans.XmlCursor.toFirstAttribute()

        this.schema = schema;
    }

    public Type validate(Context context) throws XmlException {
        XmlCursor cursor = context.getCursor();
        if (!cursor.isAttr() && (cursor.toFirstAttribute() || cursor.toFirstChild())) {
            // Element has attributes or children, must be complexType
            ComplexType newType = new ComplexType(schema, context.getName(), completed);
            newType.setContent(empty);
            return newType;
        }
View Full Code Here

Examples of org.apache.xmlbeans.XmlCursor.toFirstAttribute()

        return xml;
    }

    public Type validate(Context context) throws XmlException {
        XmlCursor cursor = context.getCursor();
        if (!cursor.isAttr() && (cursor.toFirstAttribute() || cursor.toFirstChild())) {
            // Element with complex content
            return new ComplexType(schema, context.getName(), completed);
        } else if (!context.getAttribute("nil").equals("true")) {
            String value = "";
            cursor.toFirstContentToken();
View Full Code Here

Examples of org.apache.xmlbeans.XmlCursor.toFirstAttribute()

                QName attrName = null;

                XmlCursor c = createCursor();

                if (c.toFirstAttribute() && !c.toNextAttribute())
                    attrName = c.getName();

                c.dispose();

                if (attrName != null)
View Full Code Here

Examples of org.apache.xmlbeans.XmlCursor.toFirstAttribute()

        try
        {
            StringBuffer sb = null;

            if (!c.toFirstAttribute() || c.toNextAttribute())
            {
                sb = new StringBuffer();

                sb.append( "The document is not a " );
                sb.append( QNameHelper.pretty( attrName ) );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.