Re: Still trying to validate an XML Schema

Ted Hickox <[email protected]> Sun, 23 Jun 2024 12:19:08 -0500
Newsgroups gmane.text.xml.exist
Message-ID <CAAsp6CYXCPvX-6_AajgmcfAREpF1fpoXXEgObpyq6t9JaZyqEA@mail.gmail.com>
I fixed the equals sign and now that code is error free.

I also attempted to make a couple of changes to my HTML code.  I tried to
add the following lines of code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

Then I saved my code just like you asked me to.  Finally I held down the
control button and pressed the letter r.  Everything refreshed as you
stated it should.  But the doctype code disappeared.  And once again I got
this when I ran the html code:

[image: image.png]

Why would I get this if my code now looks like this:

<html xmlns="http://www.w3.org/1999/xhtml" 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>

On Sun, Jun 23, 2024 at 11:38 AM Florian Schmitt <
[email protected]> wrote:

> Hi Ted,
>
> you'll see the XML source in the browser because Jetty sends the file
> with content-type=application/xml. To change the content type to
> xhthml+xml (which allows the browser to render the HTML as expected),
> open the HTML file in eXide, change the content-type combobox in eXide
> in the upper right corner from XML to HTML. Don't forget to save and
> reload using CTRL+R.
>
> The Javascript error is in fact a warning. It's triggered by line 10:
>
>      if (SVG_Data.readyState = 4) {
>
> I assume it should be double equation signs:
>
>      if (SVG_Data.readyState == 4) {
>
> With a single equation sign, you don't test for equality - instead
> you're trying to assing the value 4 to SVG_Data.readyState. That's a
> common bug so it has its own error message - doing an assignment in the
> conditional expression instead of a equation test is a bug in almost all
> cases. I assume the assignment fails, thus the bool value is false in
> every case, and the code inside the if clause is never executed.
>
> Regarding the "windows service" issue, sadly i can't help - i don't use
> eXist on Windows.
>
> Greetings,
> Florian
>
> Am 23.06.2024 um 17:39 schrieb Ted Hickox:
> > I wanted to thank everyone here who has tried to assist me so far with
> > my eXist database problems.  I will ignore the problem of the error
> > message that displays every time I open the eXist database and I've been
> > assured that in a future upgrade of the eXist database the file type
> > mismatch will be corrected as well.  But I still have two problems.  The
> > first is that when I shut down and then restarted the eXist database, I
> > was told that it will no longer run as a windows service.  How will this
> > impact my current project.  And then I tried to use this web address to
> > display my webpage:
> >
> > http://localhost:8080/exist/rest/db/apps/HTML_Student/SVG_Ellipse.html
> > <http://localhost:8080/exist/rest/db/apps/HTML_Student/SVG_Ellipse.html>
> All I saw when I did this is
> >
> > image.png
> >
> > Furthermore, this is my javascript code:
> >
> > var SVG_Data;
> > var Retrieved_Data;
> > var Attribute_List;
> > var Coordinate_List;
> > var Counter;
> > function Setup() {
> >       SVG_Data = new XMLHttpRequest();
> >
> >   SVG_Data.open("GET","
> http://localhost:8080/exist/rest/db/apps/HTML_Student/SVG_Ellipse.xq <
> http://localhost:8080/exist/rest/db/apps/HTML_Student/SVG_Ellipse.xq>",
> true);
> >       SVG_Data.onreadystatechange = function () {
> >           if (SVG_Data.readyState = 4) {
> >              Retrieved_Data = SVG_Data.responseText;
> >              Retrieved_Data = Retrieved_Data.split("*");
> >              Attribute_List = "";
> >              Coordinate_List = "";
> >              for (Counter = 0; Counter < 8; Counter++) {
> >        Attribute_List = Attribute_List + Retrieved_Data[Counter] + "*";
> >    Counter = Counter + 1;
> >    Coordinate_List = Coordinate_List + Retrieved_Data[Counter] + "*";}
> >    Attribute_List = Attribute_List.split("*");
> >        Coordinate_List = Coordinate_List.split("*");
> >        Coordinate = "<ellipse id = 'My_Ellipse'";
> >      for (Counter = 0; Counter < 4; Counter++) {
> >           Coordinate = Coordinate + " " + Attribute_List[Counter] + " =
> > '" + Coordinate_List[Counter] + "'";}
> >      Coordinate = Coordinate + ">";
> >       document.getElementById("Image_Box").innerHTML = Coordinate;
> >           }
> >       };
> > }
> >     SVG_Data.send();
> >
> > The error states that there is an assignment in the conditional
> > expression.  I have no idea what that error means.
> > *
> > *
> > *
> > *
> >
>
>
> _______________________________________________
> Exist-open mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/exist-open
>

_______________________________________________
Exist-open mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/exist-open
image.png (image/png, 197.8 KB) - not displayed