tags:

views:

63

answers:

1

I'm trying to convert last.fm xml data into rdf using xslt and am getting this error: ERROR [http-8080-1] (RDFDefaultErrorHandler.java:40) - (line 3 column 24): {E202} Expecting XML start or end element(s). String data "Joseph Arthur" not allowed. Maybe a striping error.

Can anyone explain to me what a striping error is, or in general what I'm doing wrong.

The xslt code is here:

    <xsl:for-each select="/lfm/artists/artist">
        <lfm:name><xsl:value-of select="name"/></lfm:name>
    </xsl:for-each>

Here's the xml location: http://ws.audioscrobbler.com/2.0/?method=library.getartists&amp;api_key=b25b959554ed76058ac220b7b2e0a026&amp;user=joanofarctan

Thanks.

+2  A: 

It would really help to see the full xml produced by this, or at least the full xslt and input xml (which doesn't mention 'Joseph Arthur').

So setting all that aside, the rdf/xml you are producing is breaking an important feature called 'striping'. Dan Brickley wrote a useful explanation, but here's a very brief summary: when presented with rdf/xml

<a>
  <b>
    <c>
      <d>

you know that the odd tags (a, c) correspond to nodes in the rdf graph, whereas the even tags (c, d) represent edges, or properties. The syntax 'stripes' nodes and properties.

In addition, if an element contains text it must be a property (nodes elements only ever contain other elements, or nothing).

So the parser thought it was at a node, hence expected more elements, found text, and suggests you were using a property in the wrong place. My guess is your rdf looks like:

<rdf:RDF ...>
  <lfm:name>Joseph Arthur</lfm:name>
  ....

You've said something has the property name with value 'Joseph Arthur', but you haven't included a subject node, so we don't know what has this name.

You nailed it. Thanks a lot for the help.
Mattk