I'm using PHP xmlreader to validate and parse xml data. This xml is validated with some xsd schema from local file via XMLReader::setSchema function and remote xsd schema from http:// via xsd:import/include. Eveything work fine, but it fetch xsd schema from net and read from disk everytime when called.
So my questions is:
Is there a method for caching remote xsd schema in local RAM? For local schema files, I think tmpfs in Linux will work fine, but is there another way to cache local xsd schema files ?
Solution
Thank VolkerK for pointing out the xmlcatalog system. It work fine with libxml/php xmlreader. In Linux, just edit file /etc/xml/catalog (It come from xml-common when you are in Fedora) add some entries like (for example):
<rewriteURI uriStartString="http://schemas.xmlsoap.org/soap/envelope/" rewritePrefix="/etc/xml/SOAP-Envolope.xsd"/>
<rewriteURI uriStartString="http://schemas.xmlsoap.org/soap/encoding/" rewritePrefix="/etc/xml/SOAP-Encoding.xsd"/>
and manual download schema (e.g http://schemas.xmlsoap.org/soap/encoding/ -> /etc/xml/SOAP-Encoding.xsd) then php xmlreader work like expected when parsing SOAP Messages.