私は FOAF ファイルを表示するために XSL Stylsheet に取り組んでおり、人が知っている人の名前と (利用可能な場合) 写真を表示したくありません。
彼らは自分の写真や名前を変更する可能性があるため、自分のプロフィールに手動で追加するのではなく、プロフィールからこの情報を取得したいと考えています。私が収集したように、document() 関数は xml ファイルをロードし、そこから情報を取得できますが、使用する構文に関係なく、情報を取得できないようです。
連絡先の名前を取得しようとしたいくつかの方法を以下に含めましたが、これらのいずれもデータを返しません (コメントに記載されているように、エラーを返すものもあります)
<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>
私の理論では、セキュリティ上の理由から、ネット上の他の XML ファイルからデータをロードすることは許可されていません (これらのファイルは、ローカルではなく、ネット上のどこかのサーバーにあります)。この場合、これを回避して、このファイルのロードが許可されていることをシステムに通知する方法はありますか?
よろしくお願いします。