in reply to Re^2: Perl Script to populate Dropdown box from XML Attributes
in thread Perl Script to populate Dropdown box from XML Attributes

my $xp = XML::XPath->new(filename => 'State.xml');

I doubt that the file State.xml is available on the client, where the code runs.

Or even if that file is on the client, you will need to specify the full path to it, and even then I doubt that the Internet Explorer scripting sandbox will easily allow access to the file.

Replies are listed 'Best First'.
Re^4: Perl Script to populate Dropdown box from XML Attributes
by vikrammohan (Initiate) on Nov 23, 2016 at 16:58 UTC

    The file State.xml is present in the same folder as the HTML. I did change the path as below:

    my $xp = XML::XPATH->new(filename => 'D://New folder//State.xml');

    But it did not work. Can you help to do it?

      That's not how HTTP resources work. I recommend you learn about HTTP, HTML and how it matters where a script is run.

      I'm surprised anyone is trying to use PerlScript in production anymore. The documentation says:

      "Client-side Perlscript should only be used if you can control the configuration of the computers on which it will be run. If your goal is to build an application that will be used by a large number of users, server-side PerlScript is considerably more practical."