Re: Cannot find declaration of element 'rdf:RDF'
Adam Fisk <[email protected]>
| Newsgroups | gmane.network.syndication.rss.devel |
|---|---|
| Message-ID | <[email protected]> |
I should note that all feed readers I've tried read the RSS below
successfully. So, my question is really whether or not most extant
feeds are valid XML given they make no reference to the schema. If
they're not valid XML, what's the recommended course of action for
writing valid feeds? Thanks everyone.
-Adam
Adam Fisk wrote:
>
>This is more of a user question than a development question, so I
>apologize in advance. If there's somewhere else to post a question
>like this that would be more appropriate, please just yell at me.
>
>I'm trying to write well-formed RSS 1.0, largely following example
>feeds from places like Creative Commons. Here's my current test feed:
>
><?xml version="1.0" encoding="UTF-8"?>
>
><rdf:RDF xmlns="http://purl.org/rss/1.0/"
>xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>xmlns:dc="http://purl.org/dc/elements/1.1/">
> <channel rdf:about="http://test.org">
> <title>Resource Listing</title>
> <items>
> <rdf:Seq>
> <rdf:li resource="urn:sha1:7389UOIU7439REIOE"/>
> </rdf:Seq>
> </items>
> </channel>
> <item rdf:about="urn:sha1:7389UOIU7439REIOE">
> <title>test</title>
> </item>
></rdf:RDF>
>
>
>Looks generally fine, right? When I try to validate this against the
>schema, however, I get the exception listed below. Am I supposed to
>declare the schema somewhere? Are most feeds out there just
>malformed? Again, don't be afraid to tell me to go away, just please
>tell me where to go! Thanks very much.
>
>-Adam
>
>
>org.dom4j.DocumentException: Error on line 2 of document : cvc-elt.1:
>Cannot find the declaration of element 'rdf:RDF'. Nested exception:
>cvc-elt.1: Cannot find the declaration of element 'rdf:RDF'.
> at org.dom4j.io.SAXReader.read(SAXReader.java:350)
> at
>org.lastbamboo.shoot.rss.Rss10ResourceVisitorTest.validateDoc(Rss10ResourceVisitorTest.java:77)
> at
>org.lastbamboo.shoot.rss.Rss10ResourceVisitorTest.testVisitFileResource(Rss10ResourceVisitorTest.java:50)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at junit.framework.TestCase.runBare(TestCase.java:127)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:118)
> at junit.framework.TestSuite.runTest(TestSuite.java:208)
> at junit.framework.TestSuite.run(TestSuite.java:203)
> at
>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
> at
>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
> at
>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)
>Nested exception:
>org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration
>of element 'rdf:RDF'.
> at
>org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
>Source)
> at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> at
>org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown
>Source)
> at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown
>Source)
> at
>org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
>Source)
> at
>org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown
>Source)
> at
>org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
>Source)
> at
>org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
>Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> at org.dom4j.io.SAXReader.read(SAXReader.java:334)
> at
>org.lastbamboo.shoot.rss.Rss10ResourceVisitorTest.validateDoc(Rss10ResourceVisitorTest.java:77)
> at
>org.lastbamboo.shoot.rss.Rss10ResourceVisitorTest.testVisitFileResource(Rss10ResourceVisitorTest.java:50)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at junit.framework.TestCase.runBare(TestCase.java:127)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:118)
> at junit.framework.TestSuite.runTest(TestSuite.java:208)
> at junit.framework.TestSuite.run(TestSuite.java:203)
> at
>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
> at
>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
> at
>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)
>
>
>
>
>
>
>
>
>
>
>
>Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/rss-dev/
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/