<?php

$variable=$_POST['module']; 
$xmldoc = new DOMDocument();
        $xmldoc->load('info.xml');

        $xpathvar = new Domxpath($xmldoc);

        $queryResult = $xpathvar->query("testcase[substring-after(
        substring-after(script, '/'),
        '/'
    ) = '$variable' or
    substring-before(
        substring-after(
            substring-after(script, '/'),
            '/'
        ),
        '/'
    ) = '$variable']"); 

foreach($queryResult as $var)
        {
                echo $var->textContent;
                echo "\n";
        }   
?>

I have written this code to fetch those content of xml file where my given condition is satisifed.
Current my output is like -

DebugLogging_F_05._IPv4_RIP 970249 WIRED scripts/testSuite/hostAgentFeatures/debugLogging/debugLoggingFeatureTesting/Ipv4Rip.tcl This test case verifies that the Debug RIP messages are present in debug log. TCL STC OK 46371 NULL ALL BASELINE RIP ROUTING target:system:family:2510-24,target:system:family:2510-48,target:system:family:2510G,target:system:family:2610,target:system:family:2615,target:system:family:2620,target:system:family:2626,target:system:family:2650,target:system:family:2810,target:system:family:2824,target:system:family:2848,target:system:family:2900,target:system:family:2910,target:system:family:2915,target:system:family:2920,target:system:family:3500,target:system:family:3500jr,target:system:family:3500strk,target:system:family:3800,target:system:family:3800FIPS,target:system:family:4100,target:system:family:4200,target:system:family:5300,target:system:family:5400,target:system:family:5400FIPS,target:system:family:5400R,target:system:family:5400RFIPS,target:system:family:6100,target:system:family:6600,target:system:family:8200,target:system:family:8200FIPS,target:system:family:stack-AR,target:system:family:stack-TA DebugLogging_F_06._IPv4_FIB 987839 WIRED scripts/testSuite/hostAgentFeatures/debugLogging/debugLoggingFeatureTesting/DebugLoggingIPv4FIB.tcl The purpose of this test is to verify that when an FIB messages are generated, the DUT can capture the FIB entries and displays the events properly on debug destination. TCL STC OK 46399 NULL ALL BASELINE target:system:family:2510-24,target:system:family:2510-48,target:system:family:2510G,target:system:family:2610,target:system:family:2615,target:system:family:2620,target:system:family:2626,target:system:family:2650,target:system:family:2810,target:system:family:2824,target:system:family:2848,target:system:family:2900,target:system:family:2910,target:system:family:2915,target:system:family:2920,target:system:family:3500,target:system:family:3500jr,target:system:family:3500strk,target:system:family:4100,target:system:family:4200,target:system:family:5300,target:system:family:5400,target:system:family:5400FIPS,target:system:family:5400R,target:system:family:5400RFIPS,target:system:family:6100,target:system:family:6600,target:system:family:8200,target:system:family:8200FIPS,target:system:family:stack-AR DebugLogging_F_07._IPv6_Packet 1068980 WIRED scripts/testSuite/hostAgentFeatures/debugLogging/debugLoggingFeatureTesting/DebugLoggingIPv6Packet.tcl The purpose of this test is to verify that when ipv6 packet is enabled and there is no connection between the 2 switches, a fail in communication message is entered in the event log. Once there is connection between the 2 switches a communication flow message is entered in the event log that the packets are sent between the switches. TCL STC OK 46378 NULL ALL BASELINE target:system:family:2510-24,target:system:family:2510-48,target:system:family:2510G,target:system:family:2520,target:system:family:2520G,target:system:family:2530ya,target:system:family:2530ya3,target:system:family:2530yb,target:system:family:2610,target:system:family:2615,target:system:family:2620,target:system:family:2626,target:system:family:2650,target:system:family:2810,target:system:family:2824,target:system:family:2848,target:system:family:2900,target:system:family:2910,target:system:family:2915,target:system:family:2920,target:system:family:3400,target:system:family:3500,target:system:family:3500jr,target:system:family:3500strk,target:system:family:3800,target:system:family:3800FIPS,target:system:family:4100,target:system:family:4200,target:system:family:5300,target:system:family:5400,target:system:family:5400FIPS,target:system:family:5400R,target:system:family:5400RFIPS,target:system:family:6100,target:system:family:6400,target:system:family:6600,target:system:family:8200,target:system:family:8200FIPS,target:system:family:Mako,target:system:family:stack-AR,target:system:family:stack-TA DebugLogging_F_08._IPv6_DHCPv6_Client 130309 WIRED scripts/testSuite/hostAgentFeatures/debugLogging/DebugLoggingDebugTypes/ipv6Dhcpv6Client.tcl This test case will verify if DUT sends dhcpv6-client logs to debug destination session. TCL STC OK 46372 NULL ALL BASELINE PSR target:system:family:2520,target:system:family:2520G,target:system:family:2530ya,target:system:family:2530ya3,target:system:family:2530yb,target:system:family:2615,target:system:family:2620,target:system:family:2824,target:system:family:2848,target:system:family:2900,target:system:family:2910,target:system:family:2915,target:system:family:2920,target:system:family:3500,target:system:family:3500jr,target:system:family:3500strk,target:system:family:3800,target:system:family:3800FIPS,target:system:family:4100,target:system:family:5400,target:system:family:5400FIPS,target:system:family:5400R,target:system:family:5400RFIPS,target:system:family:6100,target:system:family:6600,target:system:family:8200,target:system:family:8200FIPS,target:system:family:stack-AR,target:system:family:stack-TA DebugLogging_F_09._IPv6_Neighbor_Discovery 1069183 WIRED scripts/testSuite/hostAgentFeatures/debugLogging/debugLoggingFeatureTesting/DebugLoggingIPv6NeighborDiscovery.tcl

but instead of this whole thing all i want is the string ending with .tcl ( like - DebugLoggingIPv6NeighborDiscovery.tcl)
I ams tuck with how to parse this output.

Guys pls help me..!!

someone pls help..!!
i am not able to proceed further :(

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.