Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Is Vtd-xml supports for 32 OS?

2010-12-27
2013-05-15
  • Vinaya Kumar
    Vinaya Kumar
    2010-12-27

    Does Vtd-xml supports for 32 bit process.?Give brief description how it stores for 32 bit ?

     
  • jimmy zhang
    jimmy zhang
    2010-12-28

    it does and it should.. why? you don't worry about it because you just deal with data structures.

     
  • Vinaya Kumar
    Vinaya Kumar
    2010-12-29

    Thanks for ur reply , I  have another query

    How to handle Malformed- XML 's  in VTD-XML?

     
  • jimmy zhang
    jimmy zhang
    2010-12-29

    it will throw an exception and stop parsing… like every other conformant parser

     
  • Vinaya Kumar
    Vinaya Kumar
    2010-12-30

    Thanks for response, But i am unable parse Malformed XML with VTD_XML, Even it is  not throwing any exception, Please could u send a sample code to handle Malformed XML file.

    When i use Xerces2 with the same xml file it throws MalformedException.

     
  • jimmy zhang
    jimmy zhang
    2010-12-31

    could you post the vtd code? I can't say it isn't a bug, but vtd-xml is quite stable in detecting malformed documents…

     
  • Vinaya Kumar
    Vinaya Kumar
    2011-01-04

    Thanks for u r help , i got solution and wrote programthat  throws Parse Exception..  I was new to vtd-xml programing so i hear that vtd-xml follows internally buffer concept for fast execution.so  i have another doubt regarding Buffer concept followed by vtd-xml, If i take 1000 or more xml files to modify or delete action , if it reaches its buffer size of vtd-xml  what happens . could u explain in detail…

     
  • Vinaya Kumar
    Vinaya Kumar
    2011-01-05

    Hello Jzhang, I am sending the code where i did mistake could u say once ,

    VTDGen vgi = new VTDGen();
    VTDNav vn;
    AutoPilot autopilotinsert;
    int i;
    ByteArrayOutputStream bos =new ByteArrayOutputStream();
    //  this is the method …
    public OutputStream insertBeforeElement(InputStream xmlFile,String xpathExpr,String element)throws IOException{
    try{
    BufferedInputStream bufferedinptstream=new BufferedInputStream(xmlFile);
    i =bufferedinptstream.available();
    bytebdi=new byte_;
    xmlFile.read(bdi);
    vgi.setDoc(bdi); // assign the buffer to VTDGen
        vgi.parse(true); // parse with namespace awareness turned off
         //manual navigation
    VTDNav vn = vgi.getNav();  // get the navigator
    XMLModifier xm = new XMLModifier(vn);
    autopilotinsert=new AutoPilot(vn);
    autopilotinsert.selectXPath(xpathExpr);
    while((autopilotinsert.evalXPath())!=-1){
    // xm.remove();
    xm.insertBeforeElement(element+"\n");
    }
    xm.output(bos);
    bos.flush();
    vgi.clear();
                }
    catch(ParseException ie){
    System.out.print(ie.getMessage());
    }
      catch(Exception e){
      System.out.print(e.getMessage());
      }  
      return bos;
    }  // end of insertBeforeEle………….

    i am passing 1000files from other class , it appends the files , could  u say why it is ?…

    _

     
  • Vinaya Kumar
    Vinaya Kumar
    2011-01-05

    first i passed the file of 119kb file and it creates 119kb and then 238kb ,576kb files so on…

     
  • jimmy zhang
    jimmy zhang
    2011-01-05

    did you reset the bytearrayoutputstream?