Using XSLT how do I get resource links from XML, in a bootstrap loading way?



I want to do something similar to what a browser does when it loads a web page. I want the client to be able to request a XML page. The client then receives the XML page, saves it, and then reads the file to see if it needs any more files/resources... etc... until all the resources required for that XML page are on the client machine.


The client is running Java. I want to do as much processing of the XML with XSLT as possible. The Java will handle file opening, saving, and http requests.


An example. The Client receives this XML file



<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="optimus.xsl"?>

<Bus name="happy fun">
<Picture image="red.gif"/>
</Bus>


So I want the client to then process the file, realise it needs to request from the server the files optimus.xsl and red.gif. Which the java will do.


I can get the Picture/@image attributes out with XSLT. But I cannot read the "xml-stylesheet" with XSLT. Is there something better for this?


No comments:

Post a Comment