Package org.apache.xmlbeans

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


        curs.toNextToken();
        curs.toNextToken();
        curs.toNextToken();
        if (curs.isNamespace())
        {
          curs.removeXml();
        }
      }
    }
    if ((itempLinks.sizeOfPartnerLinkArray() > 0) & (itempLinks != null))
    {
View Full Code Here


        curs.toNextToken();
        curs.toNextToken();
        curs.toNextToken();
        if (curs.isNamespace())
        {
          curs.removeXml();
        }
      }
    }
  }
}
View Full Code Here

                    }

                    if (attributes.getLength() == 0
                            && (cursor.getTextValue() == null || cursor.getTextValue().trim().length() == 0)
                            && XmlUtils.getFirstChildElement(elm) == null) {
                        if (cursor.removeXml()) {
                            removed = true;
                            flag = true;
                        }
                    }
                }
View Full Code Here

    public static void removeImports(XmlObject xmlObject) throws XmlException {
        XmlObject[] imports = xmlObject.selectPath("declare namespace s='" + Constants.XSD_NS + "' .//s:import");

        for (int c = 0; c < imports.length; c++) {
            XmlCursor cursor = imports[c].newCursor();
            cursor.removeXml();
            cursor.dispose();
        }

        XmlObject[] includes = xmlObject.selectPath("declare namespace s='" + Constants.XSD_NS + "' .//s:include");
View Full Code Here

        XmlObject[] includes = xmlObject.selectPath("declare namespace s='" + Constants.XSD_NS + "' .//s:include");

        for (int c = 0; c < includes.length; c++) {
            XmlCursor cursor = includes[c].newCursor();
            cursor.removeXml();
            cursor.dispose();
        }
    }

    public static boolean isInstanceOf(SchemaType schemaType, SchemaType baseType) {
View Full Code Here

        c.removeXmlContents();
        c.toFirstContentToken();
        c.beginElement(XOP_INCLUDE_QNAME);
        c.insertAttributeWithValue(XOP_HREF_QNAME, "cid:" + contentId);
        c.toNextSibling();
        c.removeXml();
        c.dispose();
    }

    private static Attachment buildMulitpartAttachment(Attachment[] attachments) {
        System.out.println("buildMulitpartAttachment(Attachment[] attachments) not implemented!");
View Full Code Here

              }
            }
            textPos++;
          }
          else if(o instanceof CTProofErr){
            c.removeXml();
          }
          else if(o instanceof CTRPr);
            //do nothing
          else
            candCharPos=0;
View Full Code Here

        XmlObject x = XmlObject.Factory.parse( "<foo/>" );
        XmlCursor c = x.newCursor();
        c.toNextToken();
        MyAnno a = new MyAnno();
        c.setBookmark( a );
        Assert.assertTrue( c.removeXml() );
        XmlCursor c2 = a.createCursor();
        Assert.assertTrue( c2 == null );
    }
   
    public void testAttrSetter ( )
View Full Code Here

        fc.setNil();
        Assert.assertTrue( fc.isNil() );
        Assert.assertTrue( x.xmlText().equals( "<canBeNil xsi:nil=\"true\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"/>" ) );
        c.toNextToken();
        Assert.assertTrue( c.isAttr() );
        c.removeXml();
        Assert.assertTrue( x.xmlText().equals( "<canBeNil/>" ) );
        Assert.assertTrue( ! fc.isNil() );
    }
   
   
View Full Code Here

        Assert.assertTrue( !x.validate() );

        c.toPrevSibling();

        c.removeXml();

        Assert.assertTrue( x.validate() );

        base.changeType( stl.findType( new QName( "derived" ) ) );
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.