Package org.apache.xmlbeans

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


        x = XmlObject.Factory.parse( "<a xmlns='foo'/>" );

        XmlCursor c = x.newCursor();

        c.toFirstContentToken();
        c.toFirstContentToken();

        c.insertElement( "b" );
        c.toPrevSibling();
        Assert.assertTrue( c.getName().getLocalPart().equals( "b" ) );
        Assert.assertTrue( c.getName().getNamespaceURI().length() == 0 );
View Full Code Here


       
        x = XmlObject.Factory.parse( x.xmlText() );
       
        c = x.newCursor();
       
        c.toFirstContentToken();
        c.toFirstContentToken();

        Assert.assertTrue( c.getName().getLocalPart().equals( "b" ) );
        Assert.assertTrue( c.getName().getNamespaceURI().length() == 0 );
    }
View Full Code Here

        x = XmlObject.Factory.parse( x.xmlText() );
       
        c = x.newCursor();
       
        c.toFirstContentToken();
        c.toFirstContentToken();

        Assert.assertTrue( c.getName().getLocalPart().equals( "b" ) );
        Assert.assertTrue( c.getName().getNamespaceURI().length() == 0 );
    }
View Full Code Here

                }
            }
        }
        // Copy the content into the XmlAttributeType
        XmlCursor loginCursor = lcDoc.newCursor();
        loginCursor.toFirstContentToken();
        XmlCursor destination = config.newCursor();
        destination.toNextToken();
        loginCursor.moveXml(destination);
        loginCursor.dispose();
        destination.dispose();
View Full Code Here

                }
            }
        }
        // Copy the content into the XmlAttributeType
        XmlCursor loginCursor = lcDoc.newCursor();
        loginCursor.toFirstContentToken();
        XmlCursor destination = config.newCursor();
        destination.toNextToken();
        loginCursor.moveXml(destination);
        loginCursor.dispose();
        destination.dispose();
View Full Code Here

        if (errors.size() != 0) {
            throw new XmlException(errors.toArray().toString());
        }
        XmlCursor cursor = parsed.newCursor();
        try {
            cursor.toFirstContentToken();
            for (Iterator namespaces = namespaceMap.entrySet().iterator(); namespaces.hasNext();) {
                Map.Entry entry = (Map.Entry) namespaces.next();
                cursor.insertNamespace((String) entry.getKey(), (String) entry.getValue());
            }
        } finally {
View Full Code Here

    */
   public static void setValue( XmlAnySimpleType xSimpleType,
                                String           value )
   {
      XmlCursor xCursor = xSimpleType.newCursor(  );
      if ( !xCursor.toFirstContentToken(  ).isStart(  ) )
      {
         throw new IllegalStateException( "Specified XmlAnySimpleType does not contain an element." );
      }

      xCursor.toNextToken(  );
View Full Code Here

      {
         xSimpleType = XmlAnySimpleType.Factory.newInstance(  );
      }

      XmlCursor xCursor = xSimpleType.newCursor(  );
      xCursor.toFirstContentToken(  );
      xCursor.insertElementWithText( elemName, value );
      xCursor.dispose(  );
      return xSimpleType;
   }
View Full Code Here

    private void doTest(String text) throws XmlException, DeploymentException {
        LoginConfigBuilder builder = new LoginConfigBuilder(new Jsr77Naming(), null);
        XmlObject xmlObject = XmlBeansUtil.parse(text);
        XmlCursor cursor = xmlObject.newCursor();
        cursor.toFirstContentToken();
        xmlObject = cursor.getObject();
        DeploymentContext context = new DeploymentContext(new File("."), null, new Environment(Artifact.create("test/foo/1.0/car")), null, ConfigurationModuleType.SERVICE, new Jsr77Naming(), new MockConfigurationManager(), Collections.emptySet());
        AbstractName parentName = new AbstractName(URI.create("test/foo/1.0/car?name=parent,j2eeType=foo"));
        builder.getReferences(xmlObject, context, parentName, getClass().getClassLoader());
    }
View Full Code Here

        if (errors.size() != 0) {
            throw new XmlException(errors.toArray().toString());
        }
        XmlCursor cursor = parsed.newCursor();
        try {
            cursor.toFirstContentToken();
            for (Iterator namespaces = namespaceMap.entrySet().iterator(); namespaces.hasNext();) {
                Map.Entry entry = (Map.Entry) namespaces.next();
                cursor.insertNamespace((String) entry.getKey(), (String) entry.getValue());
            }
        } finally {
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.