0

I am trying to parse an xml using jquery. The aim of my project is to create buttons dynamically by getting the no of tags. Eg:If I have two Scenario tags, i need to create 2 buttons at run time.

The problem is I dont know how to retrieve the images from their url and store them in a folder.

Also if there could be a way to store the xml locally as i have the link to xml, so that even if i do not have internet connection my application could take locally available data

P.S. I am using html and jquery.

My XML is as follows:

    <root>
<home src="images/pic1.jpg"/>
<Scenario value="Supply Chain Management">
<Scene value="Supply Chain Info Center">
<valProps src="http://10.52.49.152:8080/visiondemo/sample.jpg">Supply Chain Info Center Content1</valProps>
<valProps src="http://10.52.49.152:8080/visiondemo/sample.jpg">SPIC - Content2</valProps>
<valProps src="http://10.52.49.152:8080/visiondemo/sample.jpg">SPIC - COntent3</valProps>
</Scene>
<Scene value="SCPM">
<valProps src="http://10.52.49.152:8080/visiondemo/sample.jpg">SCPM_Content1</valProps>
<valProps src="http://10.52.49.152:8080/visiondemo/sample.jpg">SCPM_Content2</valProps>
</Scene>
</Scenario>
<Scenario value="Supply Chain Management2">
<Scene value = "Supply Chain"></Scene>
</Scenario>
</root>
4

1 に答える 1

0

これにはphp 関数を使用file_get_contentします。file_put_content

<?php
   $file = 'url_image_file';
   // Open the file to get existing content
   $current = file_get_contents($file);
   // Append image to the file
   $current .= "new_file_name";
   // Write the contents back to the file
   file_put_contents($file, $current);
?>
于 2013-02-25T06:30:53.167 に答える