title: outputting XML encapsulated literal using XSLT
body: <p>I want to convert the RDF/XML file into a table of 3 columns, namely "Subject" "Predicate" and "Object", these are known as RDF triples. </p>
  
  <p>the RDF/XML file is as shown below:</p>
  
  <pre><code>&lt;rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:h="http://www.w3.org/1999/xhtml"&gt;
    &lt;rdf:Description rdf:about="http://www.w3.org/TR/2004/REC-rdf-mt-20040210/"&gt;
      &lt;dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"&gt;RDF Semantics - W3C Recommendation 10 February 2004&lt;/dc:title&gt;
    &lt;/rdf:Description&gt;
    &lt;rdf:Description rdf:about="http://www.w3.org/TR/2004/REC-rdf-mt-20040210/"&gt;
      &lt;dc:creator rdf:resource="#a1" xmlns:dc="http://purl.org/dc/elements/1.1/" /&gt;
    &lt;/rdf:Description&gt;
    &lt;rdf:Description rdf:about="#a1"&gt;
      &lt;rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person" /&gt;
    &lt;/rdf:Description&gt;
    &lt;rdf:Description rdf:about="#a1"&gt;
      &lt;foaf:name xmlns:foaf="http://xmlns.com/foaf/0.1/"&gt;Patrick Hayes&lt;/foaf:name&gt;
    &lt;/rdf:Description&gt;
    &lt;rdf:Description rdf:about="#a1"&gt;
      &lt;foaf:homepage rdf:resource="http://www.ihmc.us/users/user.php?UserID=42" xmlns:foaf="http://xmlns.com/foaf/0.1/" /&gt;
    &lt;/rdf:Description&gt;
  &lt;/rdf:RDF&gt;
  </code></pre>
  
  <p>and the XSLT I have created:</p>
  
  
  
  <pre><code>&lt;xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" &gt;
  &lt;xsl:template match="/"&gt;
  &lt;html&gt;
  &lt;body&gt;
  
    &lt;table border="1"&gt;
      &lt;tr bgcolor="#5d7b9d" &gt;
        &lt;th style="color: white"&gt;Subject&lt;/th&gt;
        &lt;th style="color: white"&gt;Predicate&lt;/th&gt;
        &lt;th style="color: white"&gt;Object&lt;/th&gt; 
      &lt;/tr&gt;
  
  
      &lt;xsl:for-each select="rdf:RDF/rdf:Description"&gt;
      &lt;tr&gt;
  
        &lt;td&gt;&lt;xsl:value-of select="@rdf:about"/&gt;&lt;/td&gt;
  
   &lt;xsl:for-each select="*"&gt; 
    &lt;td&gt;&lt;xsl:value-of select="name()"/&gt;&lt;/td&gt;
    &lt;td&gt;&lt;xsl:value-of select="@rdf:resource"/&gt;
        &lt;xsl:value-of select="//*/rdf:Description"/&gt;
    &lt;/td&gt;
   &lt;/xsl:for-each&gt;
  
      &lt;/tr&gt;
      &lt;/xsl:for-each&gt;
    &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>via the XSLT, I was able to produce correct results for Subject, Predicate, but not for Object, because some objects are the literal encapsulated within XML elements. I tried using the xsl:value-of select="//*/rdf:Description"/ but it just returns all the literals of the document. Please help, thanks. </p>