Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Reading xml files including other xml files using xpath

This is a discussion on Reading xml files including other xml files using xpath within the PERL forums, part of the Web Development category; Hi, I have an xml file (file1.xml) that includes another xml file (file2.xml). file2.xml has tag with name and value attributes, where name is a string and value is path ...

Go Back   Geeks Talk > Web Development > PERL
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read

PERL PERL Scripts - Tips, Tricks, Issues, Latest News, PERL Resource and PERL related topics can be discussed in this forum.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-27-2009
Junior Member
 
Join Date: May 2008
Location: India
Posts: 26
Thanks: 1
Thanked 1 Time in 1 Post
sajithkutty is on a distinguished road
Reading xml files including other xml files using xpath

Hi,

I have an xml file (file1.xml) that includes another xml file (file2.xml). file2.xml has tag with name and value attributes, where name is a string and value is path to a directory.
file1.xml has tags with script and inputfile attributes, where script is a command to run and inputfile is the input argument to the command. inputfile is in the form of

${//dir[@name='mypath']/@value}/myfile

where mypath is the "name" in one of the dir tags in file2.xml whose value is /ROOTDIRECTORY/MYDIRECTORY

I need to read the value of "inputfile" attribute from file1.xml, using xpath in perl in such a way that it returns
/ROOTDIRECTORY/MYDIRECTORY/myfile.

The code I have written now gives me
${//dir[@name='mypath']/@value}/myfile.

Can someone help please?

Thanks in advance.
Sajith
Reply With Quote
Sponsored Links
Reply

  Geeks Talk > Web Development > PERL

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
related to files lipusipu44 C and C++ 0 12-14-2008 02:48 PM
rename the files sarathi trichy Windows 1 12-14-2007 10:09 AM
novaPDF Lite allows you to create PDF files from any printable document, including em JobHelper Geeks Lounge 0 09-17-2007 03:40 PM
East-Tec Backup 2007 backs up and protects the files and data you care about (files, JobHelper Geeks Lounge 0 09-03-2007 01:20 PM
Zip files in telnet Manojks Windows 1 02-06-2007 04:39 AM


All times are GMT -4. The time now is 03:17 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved