This project is read-only.

False Positives using RSS 2.0 xml-schema for validation

Jan 25, 2008 at 7:16 PM
Title: xml-schema for rss

Message:

Where do I find your latest xml-schema for rss? The one I found seems to validate the following rss ok. Is that <xs:choice> really ok?

<?xml version="1.0" encoding="UTF-8"?>
 
<rss version="2.0" xsi:noNamespaceSchemaLocation=" http://www.thearchitect.co.uk/schemas/rss-2_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 
       <channel>
               <title>String</title>
               <title>String</title>
               <title>String</title>
               <item>
                       <title>String</title>
                       <title>String</title>
                       <title>String</title>
               </item>
               <item>
                       <title>String</title>
                       <title>String</title>
                       <title>String</title>
               </item>
               <item>
                       <title>String</title>
                       <title>String</title>
                       <title>String</title>
               </item>
       </channel>
</rss>

//Tommy
May 27, 2008 at 5:54 PM

This is caused by limitations in the ability of XML Schema language to express the cardinality and flexible element ordering requirements defined in the original RSS 2.0 specification which required a sequence of xsd:choice schema elements to represent faithfully.

I think the only real answer here is to define a profile of the RSS 2.0 spec with a defined ordering of element, which would allow proper cardinality constraints to be applied.
I'll need to work on that one some more.

Sep 7, 2008 at 6:48 PM
Logged as work item 11188
http://www.codeplex.com/rss2schema/WorkItem/View.aspx?WorkItemId=11188
Apr 29, 2009 at 4:51 AM
this schema has been really handy... thanks so much for providing it!

I've found however that it doesn't appear to catch the 'requiredness' of channel elements.
channel.title for example is required as per the spec I believe but if I use this xsd against an XML with that element missing I do not get a validation error (at least with XML spy :-))

I'm assuming this is the same issue that allows multiple titles... the fact that a mix of variable cardinality and random order is not supported by XSD? If that's the case I'm off to ad-hoc validation, writing code... yikes! ;-)

cheers

- Kurt