I have an XHTML document with two namespaces. That’s because this XHTML document contains SVG tags and if the SVG namespace isn’t included in the XHTML document, the SVG won’t display on the webpage.
I created an XML Schema to validate this XHTML document. But when I ran an XQuery, I received several errors that focused on the namespaced SVG elements.
I researched this topic both on this website as well as the XML Schema book published by OReilly media. I also read through the Beginning XML book published by Wrox.
So far the tags XS:Any as well as the XS:annotation and XS:documentation elements have been suggested to solve these problems. But since I’ve never come across this problem before and I’ve never used these instructions, I didn’t know what the best approach to these problems would be. Here is my XHTML code:
<html xmlns="http://www.TedTheSpeedlearner.com" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TedTheSpeedlearner.com SVG_Bezier_Curve_Webpage_XML_Schema.xsd">
<head>
<title>SVG_Bezier_Curve</title>
<link rel="stylesheet" type="text/css" href="http://localhost:8080/exist/rest/db/apps/HTML_Student/SVG_Bezier_Curve.css"/>
<script language="javascript" src="https://localhost:8080/exist/rest/db/apps/HTML_Student/SVG_Bezier_Curve_2.js">
</script>
</head>
<body onload="Setup()">
<input type="button" id="Bezier_Curve_Button" value="Click Me!" onclick="Setup2()"/>
<svg:svg id="My_SVG" height="500" width="500">
<svg:path id="Bezier_Curve_1"/>
<svg:path id="Bezier_Curve_2"/>
</svg:svg>
</body>
Here is my XML Schema:
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:target="http://www.TedTheSpeedlearner.com" targetNamespace="http://www.TedTheSpeedlearner.com" elementFormDefault="qualified">
<complexType name="HeadType">
<sequence>
<element name="head" type="target:TitleType"/>
<element name="body" type="target:BodyType"/>
</sequence>
</complexType>
<complexType name="TitleType">
<sequence>
<element name="title" type="string"/>
<element name="link" type="target:LinkType"/>
<element name="script" type="target:ScriptType"/>
</sequence>
</complexType>
<complexType name="LinkType">
<attribute name="rel" type="string"/>
<attribute name="type" type="string"/>
<attribute name="href" type="string"/>
</complexType>
<complexType name="ScriptType">
<attribute name="language" type="string"/>
<attribute name="src" type="string"/>
</complexType>
<complexType name="BodyType">
<sequence>
<element name="input" type="target:InputType"/>
<element name="svg" type="target:SvgType"/>
</sequence>
<attribute name="onload" type="string"/>
</complexType>
<complexType name="SvgType">
<sequence>
<element name="path" type="PathType"/>
<element name="path" type="Path2Type"/>
</sequence>
<attribute name="id" type="string"/>
<attribute name="height" type="string"/>
<attribute name="width" type="string"/>
</complexType>
<complexType name="InputType">
<attribute name="type" type="string"/>
<attribute name="id" type="string"/>
<attribute name="value" type="string"/>
<attribute name="onclick" type="string"/>
</complexType>
<complexType name="PathType">
<attribute name="id" type="string"/>
</complexType>
<complexType name="Path2Type">
<attribute name="id" type="string"/>
</complexType>
<element name="html" type="target:HeadType"/>
And here are the errors that were generated:
enter image description here
What do you suggest?