help

Help
2009-06-18
2013-05-15
  • Hi,

    I have been using VTD for some time now and it is great.

    I have the following requirement for which I have not found a solution yet. I would be thankful for any help or hint.

    When I execute the following xpath it doesnt return any result
    //Rating/Form_Type[FILTER='']

    The XML is

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <Rating>
    <Form_Type>
    <PK_ID>803542</PK_ID>
    <CODE>BPP</CODE><DESCRIPTION>Building and Personal Property</DESCRIPTION>
    <FILTER/>
    </Form_Type>
    <Form_Type>
    <PK_ID>803541</PK_ID>
    <CODE>SP</CODE>
    <DESCRIPTION>Standard Property</DESCRIPTION>
    <FILTER/>
    </Form_Type>
    <Form_Type>
    <PK_ID>803543</PK_ID>
    <CODE>CO</CODE>
    <DESCRIPTION>Condo Unit Owners</DESCRIPTION>
    <FILTER>CONDO</FILTER>
    </Form_Type>
    <Form_Type>
    <PK_ID>803544</PK_ID>
    <CODE>CA</CODE>
    <DESCRIPTION>Condo Association</DESCRIPTION>
    <FILTER>CONDO</FILTER>
    </Form_Type>
    </Rating>

    Please let me know if you have any suggestion how to resolve this issue.

    Thanks
    -Mano

     
    • jimmy zhang
      jimmy zhang
      2009-06-18

      hi, will investigate and get back...

       
    • thanks

       
      • jimmy zhang
        jimmy zhang
        2009-06-19

        the problem is comfired and we are working to provide you with a fix asap..
        thanks so much for pointing that out!

         
    • Hi,

      Thank you for your prompt action
      -Mano

       
    • Hi,

      I found an alternate way to resolve this issue. but
      it would be better if you would provide a fix

      when I replace FILTER='' with FILTER[not(text())]
      it works fine.

      by the way, !='' also doesnt return any value

      Thanks
      -Mano

       
    • jimmy zhang
      jimmy zhang
      2009-06-21

      Can you go to CVS (the web interface) and check out BinaryExpr.java
      and compile it?
      the latest fix is in...

       
    • Hi,

      Thanks for the fix.
      Everything works fine now

      Thanks
      Mano

       
    • Hi,

      Thanks for the fix.
      Everything works fine now

      Thanks
      Mano

       
    • Hi,

      I would like to know where/how i can downlaod the jar file with this fix.This works fine in my machine but usually IT directly download jar(vtd-xml.jar) for deployment purpose.

      thanks
      mano

       
      • jimmy zhang
        jimmy zhang
        2009-06-23

        we have no problem making a jar for you... but the thing is whether I have to make it publicly available or not... so the question is when to do 2.6 ...

         
    • Hi,

      it seems that still there is an issue.
      //Rating/Form_Type[FILTER=''] returns all records.
      Please check.
      and also check for !=''

      thanks
      mano

       
    • jimmy zhang
      jimmy zhang
      2009-06-24

      Ok, check out binaryExpr.java and let me know what you think of it...
      more testing has been done on my end...

       
    • Hi,
      I am migrating an application which is in production from SAX parser to VTD-XML.
      we run 100's of xpath to calculate premium.
      After your last fix that xpath works fine but premium goes wrong. it was fine earlier.
      it seems this fix creates another issue.
      please take a look at your last fix.

      thanks
      mano

       
      • jimmy zhang
        jimmy zhang
        2009-06-24

        Can you be specific on the premium issue? you can talk to me directly
        on IM if that helps you to get a quick answer...
        my msn iM id: crackeur@comcast.net
        the same for skype I believe

         
    • Hi,

      Thanks fot your reply.
      I dont have skype in the office.I try to contact you
      from home.
      I dont know exactly which xpath return wrong results. but we execute about 500 xpath to calculate premium. when i put this latest java file
      premium becomes 0. earlier it was fine but that particular xpath was wrong.one or some of xpath doesnt return expected result.

      thanks
      mano

       
      • jimmy zhang
        jimmy zhang
        2009-06-24

        email me with the test case that you can come up with...
        crackeur@comcast.net

         
    • Hi,

      I dont know which xpath doesnt return expected results. there are more than 500 xpath.
      but after your last fix only this happens. if your last fix is only few lines, please double check
      before last fix
      //Rating/Form_Type[FILTER='']  returns all the records.
      after the fix
      //Rating/Form_Type[FILTER='']  returns expected results.
      but some other xpath doesnt return expected results.

      i dont know which xpath goes wrong if i know the xpath i would have sent it.

      Anyway i double check. At the same time please double check your last fix.

      thanks
      mano

       
      • jimmy zhang
        jimmy zhang
        2009-06-25

        r u sure the original results are correct and expected?

         
    • Hi,

      This is the issue.
      XML is
      <?xml version="1.0" encoding="utf-8"?>
      <TestXML>
        <Rating type="COMPONENT">
          <Rating_Rule type="COMPONENT">
            <RULENAME />
            <DESCRIPTION isdisplaycolumn="true">rateLOB</DESCRIPTION>
            <RULE>11813<RuleSetId>11813</RuleSetId></RULE>
            <EFFECTIVE_DATE />
            <EXPIRY_DATE>2009-03-31 00:00:00.0</EXPIRY_DATE>
          </Rating_Rule>
          <Rating_Rule type="COMPONENT">
            <RULENAME>rateLOB</RULENAME>
            <DESCRIPTION isdisplaycolumn="true">rateLOB</DESCRIPTION>
            <RULE>11814<RuleSetId>11814</RuleSetId></RULE>
            <EFFECTIVE_DATE>2009-04-01 00:00:00.0</EFFECTIVE_DATE>
            <EXPIRY_DATE />
          </Rating_Rule>
        </Rating>
      </TestXML>

      XPath is
      //Rating_Rule[RULENAME='rateLOB' and (EFFECTIVE_DATE='' or translate(substring-before(EFFECTIVE_DATE," "),'-','')<='20090627') and (EXPIRY_DATE='' or translate(substring-before(EXPIRY_DATE," "),'-','')>='20090627')]

      This xpath works fine in sax parser. but doesnt return any result when using vtd-xml.
      Please take a look.

      thanks
      mano

       
      • jimmy zhang
        jimmy zhang
        2009-06-28

        r u sure this is the right xpath?
        I think the following boolean expression always evaluate to false except for the value of 20090627, in other words (a>= b) and (a<=b) should evaluate to false except that a = b..

        (EFFECTIVE_DATE='' or translate(substring-before(EFFECTIVE_DATE," "),'-','')<='20090627')

        and

        (EXPIRY_DATE='' or translate(substring-before(EXPIRY_DATE," "),'-','')>='20090627')

         
    • jimmy zhang
      jimmy zhang
      2009-06-28

      ok... will get back asap

       
    • This is correct and
      it is like a>=b and c<=b
      one is EFFECTIVE_DATE and other one is EXPIRY_DATE.

      thanks
      mano

       
      • jimmy zhang
        jimmy zhang
        2009-06-29

        Just checked in UnionExpr.java and FuncExpr.java in
        com.ximpleware package, the fix works well on my end.

        pls confirm on your side asap

         
    • Hi,

      I take all latest classes and recompiled
      Everything works fine and i am doing some more test.
      thanks for the fix
      mano