Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: RDF to HTML with XSLT

From: JasonBurr@-----------.---------.---
To: NULL
Date: 1/7/2005 10:59:00 AM
Ok esplain this to me por favor. I don't get it.

Using Msxml2.ServerXMLHTTP and retrieving the data then printing out the 
responseText it shows encoding as utf-8 (as supplied by the data provider). 

After loading the responseText into the Microsoft.XMLDOM via the loadXML() 
and printing out the .xml data it strips out the encoding type. 

Whats more puzzeling is that everything I have read seems to say that the 
dom will default to utf-8 so why would it have stripped the encoding and not 
work with it (the xsl)? 

Also for whatever reason I can not get resonpseXML to work in loading the 
dom only responseText. I tried Set oXML = oXHTTP.responseXML and oXML = 
oXHTTP.responseXML and loadXML(oXHTTP.responseXML) the list goes on to no 
avail. At best I get nothing (though there is clearly an error) and at worst 
it errors out. (where oXML is Microsoft.XMLDOM and oXHTTP is 
Msxml2.ServerXMLHTTP)

Why on gods green earth would the dom alter the contents of the xml loaded 
into it without some explicit declaration to do so? Further what can I do to 
avoid this. I realize that this has strayed off topic some but since it 
started here.....



"Jason Burr" wrote:

> I am trying to use an xsl page to transform an rdf result set from 
> musicbrainz and I can't get anything at all to return I have tried every way 
> I can think of to access the relevant nodes but nothing seems to work. I have 
> seen a couple of examples of xslt being used with an rdf rss news feed but 
> applying the same basic code I haven't been able to get it to work. I am 
> posting a snippet of the rdf/xml returned and some of the approaches I have 
> taken (again none of which have worked).
> 
> Here is the reduced rdf/xml
> <?xml version="1.0" encoding="UTF-8"?>
> <rdf:RDF 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#">
>   <mq:Result>
>     <mq:status>OK</mq:status>
>     <mm:artistList>
>       <rdf:Bag>
>         <rdf:li 
> rdf:resource="http://musicbrainz.org/artist/65314b12-0e08-43fa-ba33-baaa7b874c15"/>
>       </rdf:Bag>
>     </mm:artistList>
> 
>   </mq:Result>
>   <mm:Artist 
> rdf:about="http://musicbrainz.org/artist/65314b12-0e08-43fa-ba33-baaa7b874c15">
>     <dc:title>Leonard Cohen</dc:title>
>     <mm:sortName>Cohen, Leonard</mm:sortName>
>     <mm:albumList>
>       <rdf:Bag>
>         <rdf:li 
> rdf:resource="http://musicbrainz.org/album/19100fb3-2b9f-4322-a165-fa72c18301da"/>
>         <rdf:li 
> rdf:resource="http://musicbrainz.org/album/e1cbba89-c1f3-4dd4-9cce-8c05cd2f8ce8"/>
>        </rdf:Bag>
>     </mm:albumList>
>   </mm:Artist>
>   <mm:Album 
> rdf:about="http://musicbrainz.org/album/19100fb3-2b9f-4322-a165-fa72c18301da">
>     <dc:title>The Best of Leonard Cohen (disc 2)</dc:title>
>     <dc:creator 
> rdf:resource="http://musicbrainz.org/artist/65314b12-0e08-43fa-ba33-baaa7b874c15"/>
>     <mm:releaseType 
> rdf:resource="http://musicbrainz.org/mm/mm-2.1#TypeCompilation"/>
>     <mm:releaseStatus 
> rdf:resource="http://musicbrainz.org/mm/mm-2.1#StatusOfficial"/>
>     <az:Asin>B0000024TT</az:Asin>
>   </mm:Album>
> 
>   <mm:Album 
> rdf:about="http://musicbrainz.org/album/e1cbba89-c1f3-4dd4-9cce-8c05cd2f8ce8">
>     <dc:title>Diamonds in the Mine Field</dc:title>
>     <dc:creator 
> rdf:resource="http://musicbrainz.org/artist/65314b12-0e08-43fa-ba33-baaa7b874c15"/>
>     <mm:releaseType rdf:resource="http://musicbrainz.org/mm/mm-2.1#TypeLive"/>
>     <mm:releaseStatus 
> rdf:resource="http://musicbrainz.org/mm/mm-2.1#StatusBootleg"/>
>   </mm:Album>
> 
> </rdf:RDF>
> 
> Here are some of the approaches I have taken
> 
> <?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">
> 
>   <for-each select="mm:Album">
>     <value-of select="dc:title"/>
>   </for-each>
> 
> </xsl:template>
> </xsl:stylesheet>
> 
> I also tried without the exclude and with only getting rdf: namespace items 
> and with match on / and with select as "/rdf:RDF/mm:Album/dc:title" etc... ad 
> nausium.
> 
> Is there something I am missing here? Is this just not possible to do? 


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