Lars Skj?rlund wrote:
> I'm trying to add a template to XXE - following the instructions in the
> 'Configure' manual.
> 
> I've found a schema for RSS 2.0 on the net, as I'd like to use XXE for
> creating RSS news files.
> 
> The schema file validates fine, however, when I try to open the
> template, I get the error 'Element type not found [cvc-type.1]'.
> 
> I'm not able to figure out what this message means - would it be that
> the free version of XXE doesn't support this kind of operations?


The RSS 2.0 schema I've found on the net starts with:

---
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema version="1.1.0"
   targetNamespace="http://blogs.law.harvard.edu/RSS20.xsd";
   xmlns="http://blogs.law.harvard.edu/RSS20.xsd";
   xmlns:xs="http://www.w3.org/2001/XMLSchema";>
---

The RSS 2.0 document instance I've found on the net starts with:

---
<?xml version="1.0"?>
<rss version="2.0">
    <channel>
       <title>Liftoff News</title>
       <link>http://liftoff.msfc.nasa.gov/</link>
       <description>Liftoff to Space Exploration.</description>
---

xsdvalid, which is the validator used in XXE, says:

---
$ xsdvalid -s RSS20.xsd  rss2sample.xml
file:/home/hussein/tmp/rss2sample.xml:E:2:1: element type not found 
[cvc-type.1]
---

which is *right*, due to the way the RSS schema is written:

* The schema validates documents having 
{http://blogs.law.harvard.edu/RSS20.xsd}rss as their root elements.

* The instance has a {}rss root element.

* And "rss" without a namespace ({}rss) is a totally different name from 
"rss" in namespace "http://blogs.law.harvard.edu/RSS20.xsd"; 
({http://blogs.law.harvard.edu/RSS20.xsd}rss).

You can either:

[A] remove 'targetNamespace="http://blogs.law.harvard.edu/RSS20.xsd";
xmlns="http://blogs.law.harvard.edu/RSS20.xsd";' from the schema

[B] OR, on the contrary, add 
xmlns="http://blogs.law.harvard.edu/RSS20.xsd"; to the root element of 
the document instance

to make it work.

(I'm not an RSS specialist but [A] seems to be the correct approach in 
the case of RSS.)

---
PS: After doing this, XXE Standard Edition (but not xsdvalid and not XXE 
Professional Edition) will give you a very clear error message about its 
restricted support of W3C XML Schemas.

Yes, I'm sorry to say that, but in all cases, XXE Standard Edition will 
lead you to a dead end with this RSS 2.0 schema.

Well, there's a workaround. See 
http://www.xmlmind.com/xmleditor/user_faq.html#try_pro_edition


Reply via email to