Re: Form Validation Error

Michael Westbay <[email protected]> Wed, 13 Dec 2023 13:37:40 +0900
Newsgroups gmane.text.xml.exist
Message-ID <CAJ6MVuPk9gD5tFQRkvLyF4OWGb3WD5Th5kNurouP8R4Wajq35w@mail.gmail.com>
Hi Ted,

This is an easy one.

Function validation:validate-report() is not defined in module namespace:
> http://exist-db.org/xquery/validation [at line 5, column 36]


From this file:

xquery version "3.0";
> let $schema :=
> xs:anyURI('/db/apps/HTML_Student/SVG_Ellipse_Webpage_XML_Schema.xsd')
> let $instance :=
> xs:anyURI('/db/apps/HTML_Student/SVG_Ellipse_Webpage_XML.xml')
> return
> (*validation*:clear-grammar-cache(), *validation*:validate-report($instance,
> $schema))


You don't import the *validation* module anywhere. With no module for the
validation namespace to be bound to, there is no *clear-grammar-cache* nor
*validate-report* functions to call.

Hope this helps.

Take care.


2023年12月13日(水) 13:05 Ted Hickox <[email protected]>:

> I have the following documents:
>
> SVG_Ellipse_Webpage_XQuery_Validator.xq
>
> xquery version "3.0";
> let $schema :=
> xs:anyURI('/db/apps/HTML_Student/SVG_Ellipse_Webpage_XML_Schema.xsd')
> let $instance :=
> xs:anyURI('/db/apps/HTML_Student/SVG_Ellipse_Webpage_XML.xml')
> return
> (validation:clear-grammar-cache(), validation:validate-report($instance,
> $schema))
>
> HTML_Student/SVG_Ellipse_Webpage_XML_Schema.xsd
>
> <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="svg" type="target:SvgType"/>
>         </sequence>
>         <attribute name="onload" type="string"/>
>     </complexType>
>     <complexType name="SvgType">
>         <sequence>
>             <element name="ellipse" type="target:EllipseType"/>
>         </sequence>
>         <attribute name="id" type="string"/>
>     </complexType>
>     <complexType name="EllipseType">
>         <attribute name="id" type="string"/>
>     </complexType>
>     <element name="html" type="target:HeadType"/>
> </schema>
>
> SVG_Ellipse_Webpage_XML.xml
>
> <html xmlns="http://www.TedTheSpeedlearner.com" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
> http://www.TedTheSpeedlearner.com SVG_Ellipse_Webpage_XML_Schema.xsd">
>     <head>
>         <title>SVG Ellipse</title>
>         <link rel="stylesheet" type="text/css" href="
> http://localhost:8080/exist/rest/db/apps/HTML_Student/SVG_Ellipse.css"/>
>         <script language="javascript" src="
> http://localhost:8080/exist/rest/db/apps/HTML_Student/SVG_Ellipse.js"/>
>     </head>
>     <body onload="Setup()">
>         <svg id="Image_Box">
>             <ellipse id="My_Ellipse"/>
>         </svg>
>     </body>
> </html>
>
> When I loaded these documents into the eXist database, I received the
> following error:
>
> Function validation:validate-report() is not defined in module namespace:
> http://exist-db.org/xquery/validation [at line 5, column 36]  I don't
> know what I've done wrong so I don't know how to fix it.  Can someone
> please explain to me what I've done wrong and what I must do to fix this
> error? Function validation:validate-report() is not defined in module
> namespace:
> _______________________________________________
> Exist-open mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/exist-open
>


-- 
Michael Westbay
Writer/System Administrator
http://www.japanesebaseball.com/

_______________________________________________
Exist-open mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/exist-open