Package org.apache.xmlbeans

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


        try {
            if (SchemaConversionUtils.findNestedElement(rawCursor, "web-app")) {
                XmlObject webPlan = rawCursor.getObject().copy();

                XmlCursor cursor = webPlan.newCursor();
                cursor.push();
                if (cursor.toChild(GENERIC_CONFIG_QNAME)) {
                    XmlCursor source = cursor.newCursor();
                    cursor.push();
                    cursor.toEndToken();
                    cursor.toNextToken();
View Full Code Here


  }

  public Content validate( Context context ) throws XmlException
  {
    XmlCursor cursor = context.getCursor();
    cursor.push();
    if( cursor.toParent() && cursor.toFirstChild() )
    {
      // Element has children
      cursor.pop();
      return new SequenceContent( schema, completed );
View Full Code Here

    // Find element order
    List<QName> orderSet = new ArrayList<QName>();
    List<QName> orderList = new ArrayList<QName>();
    if( !cursor.isEnd() )
    {
      cursor.push();
      do
      {
        QName qname = cursor.getName();
        if( qname == null )
          break;
View Full Code Here

    if( validateOrder( context, orderSet ) && validateOccurances( context, orderList ) )
    {
      // Validate elements
      for( QName item : orderList )
      {
        cursor.push();
        particles.get( item ).validate( context );
        cursor.pop();
        cursor.toNextSibling();
      }
    }
View Full Code Here

  public Type validate( Context context ) throws XmlException
  {
    XmlCursor cursor = context.getCursor();
    List<QName> seen = new ArrayList<QName>();
    cursor.push();
    if( !mixed && isMixed( context ) )
    {
      // TODO: Check with ConflictHandler
      mixed = true;
    }
View Full Code Here

    {
      // TODO: Check with ConflictHandler
      mixed = true;
    }
    cursor.pop();
    cursor.push();
    if( cursor.toFirstAttribute() )
    {
      do
      {
        QName qname = cursor.getName();
View Full Code Here

    public ReferencePatterns getReferences(XmlObject xmlObject, DeploymentContext context, AbstractName parentName, ClassLoader classLoader) throws DeploymentException {
        List<GBeanData> uses = new ArrayList<GBeanData>();
        GerLoginConfigType loginConfig = (GerLoginConfigType) xmlObject.copy().changeType(GerLoginConfigType.type);
        XmlCursor xmlCursor = loginConfig.newCursor();
        xmlCursor.push();
        try {
            //munge xml
            if (xmlCursor.toChild(LOGIN_MODULE_QNAME)) {
                do {
                    xmlCursor.removeAttribute(SERVER_SIDE_QNAME);
View Full Code Here

                    moveable.toCursor(cursor);
                    cursor.toFirstChild();
                    cursor.beginElement("outbound-resourceadapter", SchemaConversionUtils.J2EE_NAMESPACE);
                    cursor.beginElement("connection-definition", SchemaConversionUtils.J2EE_NAMESPACE);
                    moveable.toChild(SchemaConversionUtils.J2EE_NAMESPACE, "managedconnectionfactory-class");
                    moveable.push();
                    //from moveable to cursor
                    moveable.moveXml(cursor);
                    while (moveable.toNextSibling(SchemaConversionUtils.J2EE_NAMESPACE, "config-property")) {
                        moveable.moveXml(cursor);
                    }
View Full Code Here

    public void testCursorStack ( )
        throws Exception
    {
        XmlObject x = XmlObject.Factory.parse( "<foo x='y'/>" );
        XmlCursor c = x.newCursor();
        c.push();
        c.toNextToken();
        c.push();
        c.toNextToken();
        Assert.assertTrue( c.isAttr() );
        c.pop();
View Full Code Here

    {
        XmlObject x = XmlObject.Factory.parse( "<foo x='y'/>" );
        XmlCursor c = x.newCursor();
        c.push();
        c.toNextToken();
        c.push();
        c.toNextToken();
        Assert.assertTrue( c.isAttr() );
        c.pop();
        Assert.assertTrue( c.isStart() );
        c.pop();
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.