java-rdfa
java-rdfa copied to clipboard
XML Literal is going very wrong for some reason.
Simpleparse and web service both produce nonsense:
<html xmlns:rdfs= "http://www.w3.org/2000/01/rdf-schema#" xmlns="http://www.w3.org/1999/xhtml">
<body>
<p id='#xy' about='#xy' property='rdfs:label'>
<em rel='skos:subject' resource='[dbpc:Software]'>THIS</em>
is my SW-label
</p>
</body>
</html>
I strongly suspect an xml library issue.
First <fake ..> removal is broken.
Second, it's caused by the lack of a namespace context.
If I hack in the evalcontext tests fail since it doesn't change once an xml literal is collected (rdfa parsing stops).
Needs some thought...
I could make a fake one, and set the requisite bits? If I see {svg uri}svg I can set the svg prefix, since I'm passed that too (iirc)
Aha, it seems that the unprefixed rel is the issue. I'm getting no namespace uri for it, and that seems to be the problem. The outputter is trying to set default namespace to "" as a result. Chaos!
Feels like it might be a bug in the xml library?
Moved web service to use woodstox.
Tempted to close with 'use woodstox', but I'm sure there must be a better way...
Is there a fix for this? We're using java-rdfa-0.4.1.jar and are experiencing the same problem. 0.4.1 was apparently created 2010-06-30 so shouldn't that fix this issue (basing this on your previous comment that was posted 2010-06-21)?
As a recap, here's the problem:
java-rdfa parses this as: <foo:xml_description rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral">xmlns=""><span xmlns="http://www.w3.org/1999/xhtml">This is example.</span>/fn:xml_description
NOTE: Valid namespaces etc. were removed from the above-mentioned examples for the sake of simplicity.
Any suggestions?
Thanks!
Are you using woodstox? I've found StAX output varied depending on the library. Drives me batty :-(
I wasn't (I assumed newest java-rdfa would have used it automagically... of course, this wasn't the case, because I had not included woodstox jars in classpath).
Indeed, woodstox solves the problem. I guess I'm then adding (yet again) a couple of new libraries into the application. It's crazy how differently all the "standard compliant" XML/XSL/SAX etc. libraries operate. And how one solves issues just by adding a stack of jars within your application (and not touching your code at all). o_O
I was first planning to solve this "manually" by iterating the statements of the output Jena-model, and modified the XmlLiteral values... but I guess I'll stick with woodstox for now.
Thanks, again, for your insight!