|
From: Ted H. <meg...@gm...> - 2024-08-06 19:25:26
|
Currently I have a project with the following HTML: <?xml version="1.0" encoding="utf-8"?> <xs:html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xs="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/1999/xhtml 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=" http://localhost:8080/exist/rest/db/apps/HTML_Student/SVG_Bezier_Curve_2.js "/> </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> </xs:html> And I have a XML Schema that looks like this: <xs:schema xmlns:web="http://www.w3.org/1999/xhtml" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:svg = "http://www.w3.org/2000/svg" xmlns:target="http://www.w3.org/1999/xhtml" targetNamespace="http://www.w3.org/1999/xhtml" elementFormDefault="qualified"> <xs:import namespace="http://www.w3.org/2000/svg"/> <xs:complexType name="HeadType"> <xs:sequence> <xs:element name="head" type="target:TitleType"/> <xs:element name="body" type="target:BodyType"/> </xs:sequence> </xs:complexType> <xs:complexType name="TitleType"> <xs:sequence> <xs:element name="title" type="xs:string"/> <xs:element name="link" type="target:LinkType"/> <xs:element name="script" type="target:ScriptType"/> </xs:sequence> </xs:complexType> <xs:complexType name="LinkType"> <xs:attribute name="rel" type="xs:string"/> <xs:attribute name="type" type="xs:string"/> <xs:attribute name="href" type="xs:string"/> </xs:complexType> <xs:complexType name="ScriptType"> <xs:attribute name="language" type="xs:string"/> <xs:attribute name="src" type="xs:string"/> </xs:complexType> <xs:complexType name="BodyType"> <xs:sequence> <xs:element name="input" type="target:InputType"/> <xs:element name="svg" type="target:SvgType"/> </xs:sequence> <xs:attribute name="onload" type="xs:string"/> </xs:complexType> <xs:complexType name="InputType"> <xs:attribute name="type" type="xs:string"/> <xs:attribute name="id" type="xs:string"/> <xs:attribute name="value" type="xs:string"/> <xs:attribute name="onclick" type="xs:string"/> </xs:complexType> <xs:complexType name="SvgType"> <xs:sequence> <xs:element name="path" type="target:PathType"/> <xs:element name="path" type="target:PathType"/> </xs:sequence> <xs:attribute name="id" type="xs:string"/> <xs:attribute name="height" type="xs:string"/> <xs:attribute name="width" type="xs:string"/> </xs:complexType> <xs:complexType name="PathType"> <xs:attribute name="id" type="xs:string"/> </xs:complexType> <xs:element name="html" type="target:HeadType"/> </xs:schema> Because the SVG elements in the HTML document are in a different namespace, I'm generating a validation error. Can I create a XML Schema for the SVG tags in my HTML and import that schema into the schema I have now? Would this finally validate my svg tags in my HTML code? |