I am working on an XSL Stylsheet to view FOAF Files and wan't to show the names and (if available) pictures of the people a person knows.
Since they may change their picture or name I would like to get this information from their Profile instead of manually adding them to mine. As I gather, the document() function loads a xml file and allows to get information from there but whatever syntax I use, I don not seem to get any information.
I have included below several ways I tried to get the name of a contact, but none of these return any data (some return an error, as is noted in the comments)
<div id="contacts">
<ul>
<xsl:for-each select="rdf:RDF/foaf:Person/foaf:knows">
<xsl:choose>
<xsl:when test="foaf:Person/rdfs:seeAlso">
<li>
<xsl:variable name="url" select="foaf:Person/rdfs:seeAlso/@rdf:resource" /> <!--works!-->
<xsl:value-of select="$url"/> <!-- the url is correct-->
<xsl:copy-of select="document($url)" /> <!-- XML Parsing Error: no element found Location: http://www.someurl.com/me.rdf Line Number 1, Column 1:-->
<xsl:value-of select="document($url)/rdf:RDF/foaf:Person/foaf:name[@value=$value]"/> <!--no result-->
<xsl:value-of select="document($url)/rdf:RDF/foaf:Person/foaf:name"/> <!--no result-->
<xsl:value-of select="document(foaf:Person/rdfs:seeAlso/@rdf:resource)/rdf:RDF/foaf:Person/foaf:name"/><!--no result-->
<xsl:value-of select="document(foaf:Person/rdfs:seeAlso/@rdf:resource)/rdf:RDF/foaf:Person/foaf:name[@value=$value]"/><!--no result-->
<a>
<xsl:attribute name="href">
<xsl:value-of select="foaf:Person/rdfs:seeAlso/@rdf:resource"/></xsl:attribute><xsl:text>X</xsl:text>
<xsl:value-of select="document($url)/rdf:RDF/foaf:Person/foaf:name"/> <!--nor result-->
</a>
<!-- A link of an X is displayed, linking to the right foaf-profile-->
</li>
</xsl:when>
<xsl:otherwise>
<li><xsl:value-of select="foaf:Person/foaf:name"/></li>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</ul>
</div>
My theory is, that for security reasons one is not allowed to load data from other XML-Files on the net (these files are on some server somewhere on the net, not locally). If this is the case, is there a way to circumvent this and signal the system that it is allowed to load this file?
Thanks in advance for your help.