|
From: Joe W. <jo...@gm...> - 2024-06-24 02:45:26
|
eXide displays a warning icon next to the line where that variable is defined. eXide's linter - xqlint [1] - performs some static analysis of the query. With this warning message, it's just trying to be helpful and tell you that you've defined a variable that isn't used again. It's not an error, just a warning that you might've done something unintentionally. It's safe to ignore this warning. [1] https://github.com/wcandillon/xqlint On Sun, Jun 23, 2024 at 8:53 PM Ted Hickox <meg...@gm...> wrote: > I discovered something else. Here is my SVG_Ellipse.xq > > xquery version "3.0"; > declare default element namespace "http://www.TedTheSpeedlearner.com"; > declare option exist:serialize "method=text media-type=text/plain"; > let $header-addition := > response:set-header("Access-Control-Allow-Origin","*") > let $doc := doc("SVG_Ellipse.xml")/SVG_Data_Collection/ellipse > let $First_Data_Name := $doc/X_Center_Coordinate > let $Data := concat("cx*",$First_Data_Name, "*") > let $Second_Data_Name := $doc/Y_Center_Coordinate > let $Data := concat($Data, "cy*",$Second_Data_Name, "*") > let $Third_Data_Name := $doc/X_Radius_Coordinate > let $Data := concat($Data, "rx*",$Third_Data_Name, "*") > let $Fourth_Data_Name := $doc/Y_Radius_Coordinate > let $Data := concat($Data, "ry*",$Fourth_Data_Name) > return $Data > > What does it mean when eXide says that $header-addition is an unused > variable? > > On Sun, Jun 23, 2024 at 7:46 PM Ted Hickox <meg...@gm...> wrote: > >> I feel like such an idiot. Thanks for helping me validate my data. >> Since I know my data is valid, I know that there is something wrong with my >> Javascript. I'm not sure what that would be, but I will test various >> things. In case anyone is curious, here is my Javascript. >> >> 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", >> 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(); >> >> And here is my revised HTML >> >> <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 5:57 PM Florian Schmitt < >> ml-...@fl...> wrote: >> >>> Hi Ted, >>> >>> taka a close look to the validation result. Instead of "ellipse", >>> "Ellipse" is expected. You've defined in your schema that the element >>> name starts with an upper-case "E", which isn't the case in your XML. >>> >>> Thus, replace >>> >>> <ellipse> >>> <X_Center_Coordinate>100</X_Center_Coordinate> >>> <Y_Center_Coordinate>100</Y_Center_Coordinate> >>> <X_Radius_Coordinate>30</X_Radius_Coordinate> >>> <Y_Radius_Coordinate>70</Y_Radius_Coordinate> >>> </ellipse> >>> >>> with >>> >>> <Ellipse> >>> <X_Center_Coordinate>100</X_Center_Coordinate> >>> <Y_Center_Coordinate>100</Y_Center_Coordinate> >>> <X_Radius_Coordinate>30</X_Radius_Coordinate> >>> <Y_Radius_Coordinate>70</Y_Radius_Coordinate> >>> </Ellipse> >>> >>> HTH >>> Florian >>> >>> >>> Am 23.06.2024 um 23:24 schrieb Ted Hickox: >>> > Here is a little update. I attempted to validate my xml code. This >>> is >>> > the result I received: >>> > >>> > image.png >>> > >>> > I'm assuming that the problem is located in my xml code and not in my >>> > xml schema. Here are my xml and xml schema codes >>> ... >>> >>> >>> >>> >>> >>> >>> _______________________________________________ >>> Exist-open mailing list >>> Exi...@li... >>> https://lists.sourceforge.net/lists/listinfo/exist-open >>> >> _______________________________________________ > Exist-open mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-open > |