perl xpath based

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • saran3b2
    New Member
    • Aug 2007
    • 19

    perl xpath based

    Hi all

    I have doubt in perl script within XML.


    This is XML data:

    [CODE=xml]<float id="1" type="box"><flo at id="2" type="need"><float id="3" type="new">Alth ough there are a number of commercial sites that have free legal information, FindLaw (<uri km="Bm.Ap.A_1.A _URL.A.URL" xlink:href="htt p://www.findlaw.com ">www.findlaw.c om</uri>)</float></float><float type="web">(<ur i km="Bm.Ap.A_1.A _URL.A.URL" xlink:href="htt p://www.findlaw.com ">www.findlaw.c om</uri>)</float></float>

    <fig id="1" type="box"><fig id="2" type="need"><fig id="3" type="new">Alth ough there are a number of commercial sites that have free legal information, FindLaw (<sum km="Bm.Ap.A_1.A _URL.A.URL" xlink:href="htt p://www.findlaw.com ">www.findlaw.c om</sum>)</fig></fig><fig type="web">(<ur i km="Bm.Ap.A_1.A _URL.A.URL" xlink:href="htt p://www.findlaw.com ">www.findlaw.c om</uri>)</fig></fig>[/CODE]


    I want to select the content from the above sample for xml, only if the node with attribute value type is equal to "need" (type="need") with related closing tag. I cant specified any tag, attribute only specified.

    or any module is there.

    Pls advice

    thanks in adv

    ragards

    saran
    Last edited by eWish; Mar 13 '08, 12:55 PM. Reason: Please use [code][/code] tags
  • nithinpes
    Recognized Expert Contributor
    • Dec 2007
    • 410

    #2
    For reading the contents from your XML file, you can use either XML::Simple or XML::Parser

    Comment

    Working...