Package org.apache.xmlbeans

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


        {
          ByteArrayOutputStream data = Tools.readAll( attachment.getInputStream(), 0 );
          byte[] byteArray = data.toByteArray();

          XmlCursor cursor = include.newCursor();
          cursor.toParent();
          XmlObject parentXmlObject = cursor.getObject();
          cursor.dispose();

          SchemaType schemaType = parentXmlObject.schemaType();
          Node parentNode = elm.getParentNode();
View Full Code Here


              Attachment[] attachments = container.getAttachmentsForPart( contentId );
              if( attachments.length == 1 )
              {
                XmlCursor cur = cursor.newCursor();
                if( cur.toParent() )
                {
                  String contentType = getXmlMimeContentType( cur );
                  if( contentType != null && contentType.length() > 0 )
                    attachments[0].setContentType( contentType );
                }
View Full Code Here

    {
        XmlCursor cur = newCursor();
        if (cur == null)
            return false;

        boolean result = !cur.toParent();
        cur.dispose();
        return result;
    }

    /**
 
View Full Code Here

                XmlCursor cur = ((XmlObject)_obj).newCursor();
                if (cur != null)
                {
                    if (cur.currentTokenType() == XmlCursor.TokenType.ATTR)
                        cur.toParent();
                    try { return cur.namespaceForPrefix(prefix); }
                    finally { cur.dispose(); }
                }
            }
           
View Full Code Here

        Assert.assertTrue( c.getName().getLocalPart().equals( "x" ) );
        Assert.assertTrue( c.toPrevSibling() == false );
       
        c.toEndDoc();
        c.toPrevToken();
        Assert.assertTrue( c.toParent() == true );
        Assert.assertTrue( c.getName().getLocalPart().equals( "a" ) );
       
        c.toEndDoc();
        Assert.assertTrue( c.toParent() == true );
        Assert.assertTrue( c.currentTokenType().isStartdoc() );
View Full Code Here

        c.toPrevToken();
        Assert.assertTrue( c.toParent() == true );
        Assert.assertTrue( c.getName().getLocalPart().equals( "a" ) );
       
        c.toEndDoc();
        Assert.assertTrue( c.toParent() == true );
        Assert.assertTrue( c.currentTokenType().isStartdoc() );
       
        x = XmlObject.Factory.parse( "<a>moo<!---->foo</a>" );
        c = x.newCursor();
        c.toStartDoc();
View Full Code Here

        c = x.newCursor();
        c.toStartDoc();
        c.toNextToken();
        c.toNextToken();
        c.toNextToken();
        Assert.assertTrue( c.toParent() == true );
        Assert.assertTrue( c.getName().getLocalPart().equals( "a" ) );
       
        c.toStartDoc();
        c.toNextToken();
        c.toNextToken();
View Full Code Here

        c.toStartDoc();
        c.toNextToken();
        c.toNextToken();
        c.toNextToken();
        c.toNextToken();
        Assert.assertTrue( c.toParent() == true );
        Assert.assertTrue( c.getName().getLocalPart().equals( "a" ) );

        c.toStartDoc();
        c.toNextToken();
        c.toNextToken();
View Full Code Here

        c.toNextToken();
        c.toNextToken();
        c.toNextToken();
        c.toNextToken();
        c.toNextChar( 2 );
        Assert.assertTrue( c.toParent() == true );
        Assert.assertTrue( c.getName().getLocalPart().equals( "a" ) );
       
        x = XmlObject.Factory.parse( "<foo>early<bar>text<char>zap</char></bar></foo>" );
        c = x.newCursor();
        c.toNextToken();
View Full Code Here

     * @param cursor
     * @return
     */
    private boolean isCursorInHdrF(XmlCursor cursor) {
      XmlCursor verify = cursor.newCursor();
      verify.toParent();
      if(verify.getObject() == this.headerFooter){
        return true;
      }
      return false;
    }
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.