 |
Return to article.
Listing 8. resolve() recognizes x-source: URLs
public Source resolve(String href,String base)
{
if(href.endsWith(".xsl"))
{
File file = new File(rulesDir,href);
if(file.exists())
return new StreamSource(file);
}
else if(href.startsWith("x-source:") && docsDir != null)
{
File file = new File(docsDir,href.substring(9));
if(file.exists())
return new StreamSource(file);
else
return new StreamSource(new StringReader("<xm:NotAvailable xmlns:xm='http://www.ananas.org/2001/XM/Walk/Directory'/>"),"file:null");
}
return null;
}
|
Return to article.
|  |
|