Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: RDF to HTML with XSLT

From: "Joris Gillis" <roac@-------.-->
To: NULL
Date: 1/7/2005 9:54:00 AM
> Thanks for the reply but if you are suggesting that the rdf/document should
> contain that namespace I have no ability to make that happen and frankly not
> sure why that would even be required as I have never seen it need in an xml
> document before.
>
> If you mean my xslt then look again I have the xsl namespace on the third
> line being the first namespace declared.

I didn't say you forgot to declare the namespace, I said you omitted the 'xsl' prefix where needed.

> I did try the example that you
> listed before posting and it did not work. Did you manage to make it work for
> you or posted without trying it?

Sure I did (I always do) and it worked.
Given your XML document and the following stylesheet:

<?xml version='1.0' encoding="ISO-8859-1"?>
<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#"

xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:mq="http://musicbrainz.org/mm/mq-1.1#"
xmlns:mm="http://musicbrainz.org/mm/mm-2.1#"
xmlns:az="http://www.amazon.com/gp/aws/landing.html#"
exclude-result-prefixes="rdf dc mq mm az">

<xsl:output omit-xml-declaration="yes" method="html"/>
<xsl:template match="rdf:RDF">

   <xsl:for-each select="mm:Album">
     <xsl:value-of select="dc:title"/>
   </xsl:for-each>

</xsl:template>
</xsl:stylesheet>

The output looks like:
The Best of Leonard Cohen (disc 2) Diamonds in the Mine Field

That's what you want isn't it?

(
You could also add
xmlns="http://www.w3.org/1999/XSL/Transform" (Notice the difference with 'xmlns:xsl=...')
to your original stylesheet but that's a rather unusual thing to do.
)

regards,
-- 
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041)
"Quot capita, tot sententiae"  - Terentius , Phormio 454


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent