Hi, ok I'm going to start from the beginning. I have a php script that lists all of the xml files in a directory by filename. I am wondering if there is a way instead of it listing by filename to get a fields data in the xml file and display it by that. so instead of getting filename.xml it would get for example <field>Title Name</field> and display Title Name. Hope this question makes sense lol. Thanks in advance
Hi, ok I'm going to start from the beginning. I have a php script that lists all of the xml files in a directory by filename. I am wondering if there is a way instead of it listing by filename to get a fields data in the xml file and display it by that. so instead of getting filename.xml it would get for example <field>Title Name</field> and display Title Name. Hope this question makes sense lol. Thanks in advance
'Title Name' field is in a separate xml or exists in each xml file from that directory?
You have multiple solution in both cases but you need to build or get the pair filename - title name someway
Thanks for the reply. There are multiple xml files in the directory, not a specific amount it's sort of a contact directory, anyone can add their information to it so theres no specific amount of people. Each xml file has a name field and I would rather just so it looks pretty have the link name be the persons name that is specified in the xml file instead of the name of the xml file. For example instead of "thisfile.xml" would have "Juan Johnson" or whatever
Thanks for the reply. There are multiple xml files in the directory, not a specific amount it's sort of a contact directory, anyone can add their information to it so theres no specific amount of people. Each xml file has a name field and I would rather just so it looks pretty have the link name be the persons name that is specified in the xml file instead of the name of the xml file. For example instead of "thisfile.xml" would have "Juan Johnson" or whatever
based on what you have done until now, you can use the file list from your script to open each xml file, read the field and build a hash array with keys filename and values the value of the field for each filename.
if you post the code you have I guess I could say where and what to modify.
First off let me appologize I feel like I'm being a pain, but I can't seem to get this to work. You have been a big help so far and I can't thank you enough. Hopefully I will understand this stuff eventually, reading and trying but for now most of it doesn't make sense Anyways heres what the xml files look like:
First off let me appologize I feel like I'm being a pain, but I can't seem to get this to work. You have been a big help so far and I can't thank you enough. Hopefully I will understand this stuff eventually, reading and trying but for now most of it doesn't make sense
it's no problem,
to extract field name with value "Some Guy", xpath expression is /info/name