I am somewhat new to XML, but I have been unable to figure out these errors. This is my first time attempting to create "advanced" schemas, but I was uncertain about importing and how exactly to reference the "urlset" in the schema... These are the errors:
Ln 14 Col 7 - Document is invalid: no grammar found.
Ln 14 Col 7 - Document root element "sites", must match DOCTYPE root "null". 2 Errors
...
Ln 31 Col 98 - s4s-att-invalid-value: Invalid attribute value for 'ref' in element 'element'. Recorded reason: cvc-datatype-valid.1.2.1: 'http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd' is not a valid value for 'QName'. 1 Error
Here is the code:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:cc="http://example.com/weekendfunsnacks/sites/ns"
xmlns:sm="http://www.sitemaps.org/schemas/sitemap/0.9"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="http://www.sitemaps.org/schemas/sitemap/0.9"
schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" />
<xs:element name="sites">
<xs:complexType>
<xs:sequence>
<xs:element name="site" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="name"/>
<xs:element type="xs:byte" name="totalPages" />
<xs:element ref="http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<sites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:crs="http://example.com/weekendfunsnacks/sites/ns">
<site>
<name>Weekend Fun Snacks</name>
<totalPages>127</totalPages>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
<loc>http://example.com/weekendfunsnacks/?cat=58</loc>
</url>
<url>
<loc>http://example.com/weekendfunsnacks/?cat=2</loc>
<lastmod>2017-12-29T06:03:34+00:00</lastmod>
</url>
<url>
<loc>http://example.com/weekendfunsnacks/?cat=15</loc>
<lastmod>2017-12-29T05:24:04+00:00</lastmod>
</url>
<url>
<loc>http://example.com/weekendfunsnacks/?cat=93</loc>
</url>
<url>
<loc>http://example.com/weekendfunsnacks/?cat=55</loc>
</url>
</urlset>
</site>
<site>
<name>Paleo Snacks</name>
<totalPages>52</totalPages>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
<loc>http://example.com/primalsnacks/?cat=6</loc>
</url>
<url>
<loc>http://example.com/primalsnacks/?cat=18</loc>
<lastmod>2017-09-19T17:13:19+00:00</lastmod>
</url>
<url>
<loc>http://example.com/primalsnacks/?cat=54</loc>
<lastmod>2017-09-19T15:24:01+00:00</lastmod>
</url>
<url>
<loc>http://example.com/primalsnacks/?cat=52</loc>
<lastmod>2017-09-28T21:03:11+00:00</lastmod>
</url>
<url>
<loc>http://example.com/primalsnacks/?cat=201</loc>
<lastmod>2017-10-06T07:03:26+00:00</lastmod>
</url>
<url>
<loc>http://example.com/primalsnacks/?cat=11</loc>
</url>
</urlset>
</site>
<site>
<name>Veg Snacks</name>
<totalPages>17</totalPages>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
<loc>http://example.com/vegsnacks/?cat=102</loc>
</url>
<url>
<loc>http://example.com/vegsnacks/?cat=23</loc>
</url>
<url>
<loc>http://example.com/vegsnacks/?cat=1</loc>
</url>
<url>
<loc>http://example.com/vegsnacks/?cat=55</loc>
<lastmod>2017-06-12T08:05:32+00:00</lastmod>
</url>
<url>
<loc>http://example.com/vegsnacks/?cat=201</loc>
</url>
<url>
<loc>http://example.com/vegsnacks/?cat=87</loc>
</url>
</urlset>
</site>
</sites>
Any help or enlightenment would be greatly appreciated, thank you.