Author |
Topic  |
|
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
|
HuwR
Forum Admin
    
United Kingdom
20600 Posts |
|
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
Posted - 26 January 2006 : 19:35:46
|
Thanks, Huw.
Oh my, that is complicated. All I want to do is convert the Musicmoz dump (http://musicmoz.org/xml/) to an Access database so I can extract certain information and merge it into my own site database.
I've tried the Get External Data/Import XML feature in Access 2003 but it explodes with errors.  |
Bandlink.net - http://www.bandlink.net/ Bandlink Music Forums - http://www.bandlink.net/forum/ |
 |
|
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
|
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
|
dayve
Forum Moderator
    
USA
5820 Posts |
Posted - 30 January 2006 : 21:00:39
|
just parse the XML using ASP and insert it into a database. there is not going to be an easy way to tell Access how to import the data. |
|
 |
|
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
|
dayve
Forum Moderator
    
USA
5820 Posts |
Posted - 01 February 2006 : 00:16:21
|
quote: Originally posted by MarkJH
Okay, so this should help me, right?
kind of.... but you will need to use the XML HTTP Request because you are reading a remote file, but once you do that, reading the nodes is quite similar. |
|
 |
|
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
|
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
Posted - 01 February 2006 : 12:34:25
|
I've been studying up on XML... about time I got to grips with a different language.
It would seem that if I change the attributes such as:
<release type="album" name="American Life" date="2003" ref="Bands_and_Artists/M/Madonna/Discography/American_Life" />
into child elements such as:
<release>
<type>album</type>
<name>American Life</name>
<date>2003</date>
<ref>Bands_and_Artists/M/Madonna/Discography/American_Life</ref>
</release>
then I can easily import it into Access without the need of a parser. Either a bunch of find/replaces or maybe (doubtful) there is software that will convert attributes to child elements.
Am I over-complicating things for myself or does this make sense? |
Bandlink.net - http://www.bandlink.net/ Bandlink Music Forums - http://www.bandlink.net/forum/ |
Edited by - MarkJH on 01 February 2006 12:35:39 |
 |
|
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
Posted - 01 February 2006 : 19:40:13
|
Well, after learning XML on the fly, I've managed to come up with this XSL to lift the artist biographies out of the original dump:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body style="font-family:Arial,helvetica,sans-serif;font-size:10pt;
background-color:#EEEEEE">
<xsl:for-each select="musicmoz//item">
<xsl:if test="@type='biography'">
<xsl:if test="preceding-sibling::name">
<div style="background-color:red;color:white;padding:4px">
<span style="font-weight:bold;color:white">
<xsl:value-of select="preceding-sibling::name"/>
</span>
</div>
<div style="background-color:teal;color:white;padding:4px">
<span style="font-weight:bold;color:white">
<img src="{preceding-sibling::logo/@src}"/>
<xsl:value-of select="body"/>
</span>
</div>
<div style="margin-left:20px;margin-bottom:1em;font-size:8pt">
<span style="font-style:italic">
</span>
</div>
</xsl:if>
</xsl:if>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Now that I've got is sussed this far, I don't think I'll have too much of a problem extracting pretty much anything I like out of it. |
Bandlink.net - http://www.bandlink.net/ Bandlink Music Forums - http://www.bandlink.net/forum/ |
Edited by - MarkJH on 01 February 2006 19:54:29 |
 |
|
|
Topic  |
|