Package org.apache.xmlbeans

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


        float schemaVersion = 0f;
        XmlCursor cursor = null;
        try {
            cursor = XmlBeansUtil.parse(originalSpecDD).newCursor();
            cursor.toStartDoc();
            cursor.toFirstChild();
            String nameSpaceURI = cursor.getName().getNamespaceURI();
            if (nameSpaceURI != null && nameSpaceURI.length() > 0) {
                String version = cursor.getAttributeText(new QName("", "version"));
                if (version != null) {
                    schemaVersion = Float.parseFloat(version);
View Full Code Here


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

            List result = new ArrayList();

            if (xc.toFirstChild())
            {
                // look for elements
                do
                {
                    assert xc.isContainer();
View Full Code Here

            if ("-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN".equals(publicId) ||
                    "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN".equals(publicId)) {
                XmlCursor moveable = xmlObject.newCursor();
                try {
                    moveable.toStartDoc();
                    moveable.toFirstChild();

                    SchemaConversionUtils.convertToSchema(cursor, SchemaConversionUtils.JAVAEE_NAMESPACE, schemaLocationURL, version);
                    cursor.toStartDoc();
                    cursor.toChild(SchemaConversionUtils.JAVAEE_NAMESPACE, "web-app");
                    cursor.toFirstChild();
View Full Code Here

        try {
            XmlObject xmlObject = XmlBeansUtil.parse(planFile);
            XmlCursor cursor = xmlObject.newCursor();
            try {
                cursor.toFirstChild();
                if (!SERVICE_QNAME.equals(cursor.getName())) {
                    return null;
                }
            } finally {
                cursor.dispose();
View Full Code Here

        Boolean booleanVal = Boolean.TRUE;

        XmlObject doc = XmlObject.Factory.parse(TEST);
        XmlCursor cursor = doc.newCursor();
        try {
            cursor.toFirstChild();
            doc = cursor.getObject();
        } finally {
            cursor.dispose();
        }
        environmentEntryBuilder.buildNaming(doc, null, null, null, null, componentContext);
View Full Code Here

                                                QName name )
    {
        List foundElems = new ArrayList();
        xBean = getRootElement( xBean );
        XmlCursor xCursor = xBean.newCursor();
        for ( boolean hasNext = xCursor.toFirstChild(); hasNext; hasNext = xCursor.toNextSibling() )
        {
            if ( ( name == null ) || getName( xCursor ).equals( name ) )
            {
                foundElems.add( xCursor.getObject() );
            }
View Full Code Here

    {
        XmlObject rootElemXBean;
        if ( isDocument( docXBean ) )
        {
            XmlCursor xCursor = docXBean.newCursor();
            if ( xCursor.toFirstChild() )
            {
                rootElemXBean = xCursor.getObject();
            }
            else
            {
View Full Code Here

                                 String value )
    {
        XmlCursor xCursor = xBean.newCursor();
        if ( xCursor.isStartdoc() )
        {
            xCursor.toFirstChild();
        }
        xCursor.setTextValue( value );
        xCursor.dispose();
    }
View Full Code Here

     */
    public static Map getXmlBeanAnyMap( XmlObject xmlObjectToSearch )
    {
        Map qnameToListMap = new HashMap();
        XmlCursor xCursor = xmlObjectToSearch.newCursor();
        for ( boolean hasNext = xCursor.toFirstChild(); hasNext; hasNext = xCursor.toNextSibling() )
        {
            XmlObject siblingXmlObject = xCursor.getObject();
            QName siblingXmlObjectQname = getName(siblingXmlObject);

            // TODO: should this be tested against the original bean
View Full Code Here

                                               QName name )
    {
        boolean succeeded = true;
        xBean = getRootElement( xBean );
        XmlCursor xCursor = xBean.newCursor();
        for ( boolean hasNext = xCursor.toFirstChild(); hasNext; hasNext = xCursor.toNextSibling() )
        {
            if ( name == null || getName( xCursor ).equals( name ) )
            {
                succeeded = succeeded && xCursor.removeXml();
            }
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.