Click here to Skip to main content
15,885,186 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have two xml documents named pages.xml and images.xml. here are they:
XML
<Pages>   
    <home category = "start"> 
    <title>something</title>
    <link>something</link>
    <description>Welcome to my official home page</description>  
    <content>bla bla bla</content> 
    <images ID = "ANOTHER">
      i want these images to be fetched from images.xml 
    </images> 
    </home >

    <about category = "start">   
    <images ID = "ANOTHER">
     i want these images to be fetched from images.xml 
    </images>  
    </about>  
</Pages>
And the images.xml:
XML
<images category = "start", ID = "ANOTHER">
    <IMG1 attribute = "name">path to this Image </IMG1>
    <IMG2 attribute = "name">path to this Image </IMG2>
    <IMG3 attribute = "name">path to this Image </IMG3>
    <IMG4 attribute = "name">path to this Image </IMG4>
</images>
My question is, is it possible to link both files from pages.xml, 
such that if i do this: 
PHP
//xpath select all tags under Pages/home/images 
$xml = funLoadxml("pages.xml");
$result = $xml->xpath("Pages/home/images[@start]/*")       //dont know if this is correct anyway
i will get the result of images in images.xml, which are not actually
present in pages.xml. in other words, can i link images.xml and pages.xml
and access images.xml from a single xpath query on pages.xml object ?
if so, please guide me. any help will be so much appreciated
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900