Xquery expect return found ;

When I run my current XHTML page, I get the following error:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>Retrieved_Data <?xml version="1.0" ?><exception><path>/db/apps/HTML_Student/SVG_Bezier_Curve.xq</path><message>exerr:ERROR org.exist.xquery.XPathException: err:XPST0003 expecting "return", found ';' [at line 4, column 79]</message></exception></code>
<code>Retrieved_Data <?xml version="1.0" ?><exception><path>/db/apps/HTML_Student/SVG_Bezier_Curve.xq</path><message>exerr:ERROR org.exist.xquery.XPathException: err:XPST0003 expecting "return", found ';' [at line 4, column 79]</message></exception></code>
Retrieved_Data <?xml version="1.0" ?><exception><path>/db/apps/HTML_Student/SVG_Bezier_Curve.xq</path><message>exerr:ERROR org.exist.xquery.XPathException: err:XPST0003 expecting "return", found ';' [at line 4, column 79]</message></exception>

Here is my XHTML code:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code><html xmlns="http://www.w3.org/1999/xhtml">
<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>
<input type="text" id="My_Text" value="I was here."/>
<input type="button" onclick="Setup2()"/>
<input type="button" onclick="Setup()"/>
<p id="My_Paragraph"/>
<svg xmlns="http://www.w3.org/2000/svg" id="My_SVG" height="500" width="500">
<path id="Bezier_Curve_1"/>
<path id="Bezier_Curve_2" d="M 300, 200 A 50, 50 0,0,1 400,200" stroke="red" stroke-width="3" fill="none">
</path>
</svg>
</body>
</html></code>
<code><html xmlns="http://www.w3.org/1999/xhtml"> <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> <input type="text" id="My_Text" value="I was here."/> <input type="button" onclick="Setup2()"/> <input type="button" onclick="Setup()"/> <p id="My_Paragraph"/> <svg xmlns="http://www.w3.org/2000/svg" id="My_SVG" height="500" width="500"> <path id="Bezier_Curve_1"/> <path id="Bezier_Curve_2" d="M 300, 200 A 50, 50 0,0,1 400,200" stroke="red" stroke-width="3" fill="none"> </path> </svg> </body> </html></code>
<html xmlns="http://www.w3.org/1999/xhtml">
    <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>
         <input type="text" id="My_Text" value="I was here."/>
         <input type="button" onclick="Setup2()"/>
         <input type="button" onclick="Setup()"/>
         <p id="My_Paragraph"/>
         <svg xmlns="http://www.w3.org/2000/svg" id="My_SVG" height="500" width="500">
         <path id="Bezier_Curve_1"/>
         <path id="Bezier_Curve_2" d="M 300, 200 A 50, 50 0,0,1 400,200" stroke="red" stroke-width="3" fill="none">
</path>
    </svg>
    </body>
</html>

Here is my Javascript code:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>function Setup() {
var Bezier_Curve_Identification;
var Attribute_Name;
var Attribute_Name_2;
var Coordinate;
var My_Properties;
document.getElementById("My_Text").value = "My Setup.";
Attribute_Name = "d";
Attribute_Name_2 = "style";
My_Properties = "stroke: blue; stroke-width: 3; fill: none;";
Coordinate = "M 300 200 A 20 20 0 0 0 400 200";
Bezier_Curve_Identification = document.getElementById('Bezier_Curve_1');
Bezier_Curve_Identification.setAttribute(Attribute_Name, Coordinate);
Bezier_Curve_Identification.setAttribute(Attribute_Name_2, My_Properties);
}
function Setup2() {
var SVG_Data;
var Retrieved_Data;
SVG_Data = new XMLHttpRequest();
SVG_Data.open("GET","http://localhost:8080/exist/rest/db/apps/HTML_Student/SVG_Bezier_Curve.xq", true);
SVG_Data.onreadystatechange = function () {
if (SVG_Data.readyState == 4) {
Retrieved_Data = SVG_Data.responseText;
document.getElementById("My_Text").value = "Retrieved_Data " + Retrieved_Data;}
};
SVG_Data.send();} </code>
<code>function Setup() { var Bezier_Curve_Identification; var Attribute_Name; var Attribute_Name_2; var Coordinate; var My_Properties; document.getElementById("My_Text").value = "My Setup."; Attribute_Name = "d"; Attribute_Name_2 = "style"; My_Properties = "stroke: blue; stroke-width: 3; fill: none;"; Coordinate = "M 300 200 A 20 20 0 0 0 400 200"; Bezier_Curve_Identification = document.getElementById('Bezier_Curve_1'); Bezier_Curve_Identification.setAttribute(Attribute_Name, Coordinate); Bezier_Curve_Identification.setAttribute(Attribute_Name_2, My_Properties); } function Setup2() { var SVG_Data; var Retrieved_Data; SVG_Data = new XMLHttpRequest(); SVG_Data.open("GET","http://localhost:8080/exist/rest/db/apps/HTML_Student/SVG_Bezier_Curve.xq", true); SVG_Data.onreadystatechange = function () { if (SVG_Data.readyState == 4) { Retrieved_Data = SVG_Data.responseText; document.getElementById("My_Text").value = "Retrieved_Data " + Retrieved_Data;} }; SVG_Data.send();} </code>
function Setup() {
    var Bezier_Curve_Identification;
    var Attribute_Name;
    var Attribute_Name_2;
    var Coordinate;
    var My_Properties;
    
    document.getElementById("My_Text").value = "My Setup.";
    Attribute_Name = "d";
    Attribute_Name_2 = "style";
    My_Properties = "stroke: blue; stroke-width: 3; fill: none;";
    Coordinate = "M 300 200 A 20 20 0 0 0 400 200";
    Bezier_Curve_Identification = document.getElementById('Bezier_Curve_1');
    Bezier_Curve_Identification.setAttribute(Attribute_Name, Coordinate);
    Bezier_Curve_Identification.setAttribute(Attribute_Name_2, My_Properties);
    
  
}
function Setup2() {
    
    var SVG_Data;
    var Retrieved_Data;
    
    SVG_Data = new XMLHttpRequest();
          SVG_Data.open("GET","http://localhost:8080/exist/rest/db/apps/HTML_Student/SVG_Bezier_Curve.xq", true);
          SVG_Data.onreadystatechange = function () {
              if (SVG_Data.readyState == 4) {
              Retrieved_Data = SVG_Data.responseText;
              document.getElementById("My_Text").value = "Retrieved_Data " + Retrieved_Data;}
          };
              
    SVG_Data.send();}  

Here is my XML:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code><SVG_Data_Collection xmlns="http://www.TedTheSpeedlearner.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TedTheSpeedlearner.com SVG_Bezier_Curve_Data_Schema.xsd">
<Bezier_Curve_1>
<Main_Attribute>d</Main_Attribute>
<Initial_Attribute>M</Initial_Attribute>
<Coordinate_Start>300 200</Coordinate_Start>
<Arc_Attribute>A</Arc_Attribute>
<Bezier_Arc>20 20 0 0 0</Bezier_Arc>
<Terminal_Coordinate>400 200</Terminal_Coordinate>
<Style_Attribute>style</Style_Attribute>
<Style_Color>stroke: red;</Style_Color>
<Style_Width>stroke-width: 3;</Style_Width>
<Style_Fill>fill: none;</Style_Fill>
</Bezier_Curve_1>
<Bezier_Curve_2>
<Main_Attribute>d</Main_Attribute>
<Initial_Attribute>M</Initial_Attribute>
<Coordinate_Start>300 200</Coordinate_Start>
<Arc_Attribute>A</Arc_Attribute>
<Bezier_Arc>20 20 0 0 0</Bezier_Arc>
<Terminal_Coordinate>400 200</Terminal_Coordinate>
<Style_Attribute>style</Style_Attribute>
<Style_Color>stroke: blue;</Style_Color>
<Style_Width>stroke-width: 3;</Style_Width>
<Style_Fill>fill: none;</Style_Fill>
</Bezier_Curve_2>
</SVG_Data_Collection>
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_Bezier_Curve_Data.xml")/SVG_Data_Collection/Bezier_Curve_1
let $First_Data_Name := $doc/Main_Attribute
let $Data := concat($First_Data_Name, "*")
let $Second_Data_Name := $doc/Initial_Attribute
let $Data := concat($Data, $Second_Data_Name, "-")
let $Third_Data_Name := $doc/Coordinate_Start;
let $Data := concat($Data, $Third_Data_Name, "-")
let $Fourth_Data_Name := $doc/Arc_Attribute
let $Data := concat($Data, $Fourth_Data_Name, "-")
let $Fifth_Data_Name := $doc/Bezier_Arc
let $Data := concat($Data, $Fifth_Data_Name, "-")
let $Sixth_Data_Name := $doc/Terminal_Coordinate
let $Data := concat($Data, $Sixth_Data_Name)
return $Data
</code>
<code><SVG_Data_Collection xmlns="http://www.TedTheSpeedlearner.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TedTheSpeedlearner.com SVG_Bezier_Curve_Data_Schema.xsd"> <Bezier_Curve_1> <Main_Attribute>d</Main_Attribute> <Initial_Attribute>M</Initial_Attribute> <Coordinate_Start>300 200</Coordinate_Start> <Arc_Attribute>A</Arc_Attribute> <Bezier_Arc>20 20 0 0 0</Bezier_Arc> <Terminal_Coordinate>400 200</Terminal_Coordinate> <Style_Attribute>style</Style_Attribute> <Style_Color>stroke: red;</Style_Color> <Style_Width>stroke-width: 3;</Style_Width> <Style_Fill>fill: none;</Style_Fill> </Bezier_Curve_1> <Bezier_Curve_2> <Main_Attribute>d</Main_Attribute> <Initial_Attribute>M</Initial_Attribute> <Coordinate_Start>300 200</Coordinate_Start> <Arc_Attribute>A</Arc_Attribute> <Bezier_Arc>20 20 0 0 0</Bezier_Arc> <Terminal_Coordinate>400 200</Terminal_Coordinate> <Style_Attribute>style</Style_Attribute> <Style_Color>stroke: blue;</Style_Color> <Style_Width>stroke-width: 3;</Style_Width> <Style_Fill>fill: none;</Style_Fill> </Bezier_Curve_2> </SVG_Data_Collection> 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_Bezier_Curve_Data.xml")/SVG_Data_Collection/Bezier_Curve_1 let $First_Data_Name := $doc/Main_Attribute let $Data := concat($First_Data_Name, "*") let $Second_Data_Name := $doc/Initial_Attribute let $Data := concat($Data, $Second_Data_Name, "-") let $Third_Data_Name := $doc/Coordinate_Start; let $Data := concat($Data, $Third_Data_Name, "-") let $Fourth_Data_Name := $doc/Arc_Attribute let $Data := concat($Data, $Fourth_Data_Name, "-") let $Fifth_Data_Name := $doc/Bezier_Arc let $Data := concat($Data, $Fifth_Data_Name, "-") let $Sixth_Data_Name := $doc/Terminal_Coordinate let $Data := concat($Data, $Sixth_Data_Name) return $Data </code>
<SVG_Data_Collection xmlns="http://www.TedTheSpeedlearner.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TedTheSpeedlearner.com SVG_Bezier_Curve_Data_Schema.xsd">
     <Bezier_Curve_1>
         <Main_Attribute>d</Main_Attribute>
         <Initial_Attribute>M</Initial_Attribute>
         <Coordinate_Start>300 200</Coordinate_Start>
         <Arc_Attribute>A</Arc_Attribute>
         <Bezier_Arc>20 20 0 0 0</Bezier_Arc>
         <Terminal_Coordinate>400 200</Terminal_Coordinate>
         <Style_Attribute>style</Style_Attribute>
         <Style_Color>stroke: red;</Style_Color>
         <Style_Width>stroke-width: 3;</Style_Width>
         <Style_Fill>fill: none;</Style_Fill>
     </Bezier_Curve_1>
     <Bezier_Curve_2>
        <Main_Attribute>d</Main_Attribute>
         <Initial_Attribute>M</Initial_Attribute>
         <Coordinate_Start>300 200</Coordinate_Start>
         <Arc_Attribute>A</Arc_Attribute>
         <Bezier_Arc>20 20 0 0 0</Bezier_Arc>
         <Terminal_Coordinate>400 200</Terminal_Coordinate>
         <Style_Attribute>style</Style_Attribute>
         <Style_Color>stroke: blue;</Style_Color>
         <Style_Width>stroke-width: 3;</Style_Width>
         <Style_Fill>fill: none;</Style_Fill>
     </Bezier_Curve_2>
</SVG_Data_Collection>


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_Bezier_Curve_Data.xml")/SVG_Data_Collection/Bezier_Curve_1
let $First_Data_Name := $doc/Main_Attribute
let $Data := concat($First_Data_Name, "*")
let $Second_Data_Name := $doc/Initial_Attribute
let $Data := concat($Data, $Second_Data_Name, "-")
let $Third_Data_Name := $doc/Coordinate_Start;
let $Data := concat($Data, $Third_Data_Name, "-")
let $Fourth_Data_Name := $doc/Arc_Attribute
let $Data := concat($Data, $Fourth_Data_Name, "-")
let $Fifth_Data_Name := $doc/Bezier_Arc
let $Data := concat($Data, $Fifth_Data_Name, "-")
let $Sixth_Data_Name := $doc/Terminal_Coordinate
let $Data := concat($Data, $Sixth_Data_Name)
return $Data

I would love to add my XQuery code, but this box won’t let me. I have a photo of my code, but you won’t let me post the photo without copying and pasting the code. How can I give you the code when this box won’t let me give you the code?

You need to terminate declarations with a semicolon i.e. try

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>declare default element namespace "http://www.TedTheSpeedlearner.com";
declare option exist:serialize "method=text media-type=text/plain";
</code>
<code>declare default element namespace "http://www.TedTheSpeedlearner.com"; declare option exist:serialize "method=text media-type=text/plain"; </code>
declare default element namespace "http://www.TedTheSpeedlearner.com";
declare option exist:serialize "method=text media-type=text/plain";

2

Thanks for all your assistance. I spent several hours examining each line of my code and I tested each line using the document.getElementById command. Through this command I discovered that I referenced several incorrect documents. You will notice this in the xml document. Carefully examine the $doc variable to see the before and after. I corrected several errors and for the most part my code actually works. Here is my corrected code starting with the HTML:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code><html xmlns="http://www.w3.org/1999/xhtml">
<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" onclick="Setup2()" value="Click Me!" position = "absolute" top = "100px"/>
<svg xmlns="http://www.w3.org/2000/svg" id="My_SVG" position = "absolute" top = "200px" height="500px" width="600px">
<path id="Bezier_Curve_1"/>
<path id="Bezier_Curve_2"/>
</svg>
</body>
</code>
<code><html xmlns="http://www.w3.org/1999/xhtml"> <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" onclick="Setup2()" value="Click Me!" position = "absolute" top = "100px"/> <svg xmlns="http://www.w3.org/2000/svg" id="My_SVG" position = "absolute" top = "200px" height="500px" width="600px"> <path id="Bezier_Curve_1"/> <path id="Bezier_Curve_2"/> </svg> </body> </code>
<html xmlns="http://www.w3.org/1999/xhtml">
<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" onclick="Setup2()" value="Click Me!" position = "absolute" top = "100px"/>
     <svg xmlns="http://www.w3.org/2000/svg" id="My_SVG" position = "absolute" top = "200px" height="500px" width="600px">
     <path id="Bezier_Curve_1"/>
     <path id="Bezier_Curve_2"/>
     </svg>
</body>

Here is my Javascript:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code> function Setup() {
var Bezier_Curve_Identification;
var Attribute_Name;
var Attribute_Name_2;
var Coordinate;
var My_Properties;
var Button_Identification;
Attribute_Name = "d";
Attribute_Name_2 = "style";
My_Properties = "stroke: blue; stroke-width: 3; fill: none;";
Coordinate = "M 375 200 A 50 50 0 0 1 475 200";
Button_Identification = document.getElementById('Bezier_Curve_Button');
Button_Identification.setAttribute = ("style", "top: 100px; height: 200px;");
Bezier_Curve_Identification = document.getElementById('Bezier_Curve_1');
Bezier_Curve_Identification.setAttribute(Attribute_Name, Coordinate);
Bezier_Curve_Identification.setAttribute(Attribute_Name_2, My_Properties);
}
function Setup2() {
var SVG_Data;
var Retrieved_Data;
var Bezier_Curve_1;
var Bezier_Curve_2;
var Counter;
var Coordinate_Attribute;
var Coordinate;
var Style_Attribute;
var Style_Details;
var Bezier_Curve_Identification;
SVG_Data = new XMLHttpRequest();
SVG_Data.open("GET","http://localhost:8080/exist/rest/db/apps/HTML_Student/SVG_Bezier_Curve.xq", true);
SVG_Data.onreadystatechange = function () {
if (SVG_Data.readyState == 4) {
Retrieved_Data = SVG_Data.responseText;
Retrieved_Data = Retrieved_Data.split("/");
Counter = 0;
Bezier_Curve_1 = Retrieved_Data[Counter];
Counter = Counter + 1;
Bezier_Curve_2 = Retrieved_Data[Counter];}
Bezier_Curve_1 = Bezier_Curve_1.split("*");
Counter = 0;
Coordinate_Attribute = Bezier_Curve_1[Counter];
Counter = Counter + 1;
Coordinate = Bezier_Curve_1[Counter];
Counter = Counter + 1;
Style_Attribute = Bezier_Curve_1[Counter];
Counter = Counter + 1;
Style_Details = Bezier_Curve_1[Counter];
Bezier_Curve_Identification = document.getElementById('Bezier_Curve_1');
Bezier_Curve_Identification.setAttribute(Coordinate_Attribute, Coordinate);
Bezier_Curve_Identification.setAttribute(Style_Attribute, Style_Details);
Bezier_Curve_2 = Bezier_Curve_2.split("*");
Counter = 0;
Coordinate_Attribute = Bezier_Curve_2[Counter];
Counter = Counter + 1;
Coordinate = Bezier_Curve_2[Counter];
Counter = Counter + 1;
Style_Attribute = Bezier_Curve_2[Counter];
Counter = Counter + 1;
Style_Details = Bezier_Curve_2[Counter];
Bezier_Curve_Identification = document.getElementById('Bezier_Curve_2');
Bezier_Curve_Identification.setAttribute(Coordinate_Attribute, Coordinate);
Bezier_Curve_Identification.setAttribute(Style_Attribute, Style_Details);
};
SVG_Data.send();}
</code>
<code> function Setup() { var Bezier_Curve_Identification; var Attribute_Name; var Attribute_Name_2; var Coordinate; var My_Properties; var Button_Identification; Attribute_Name = "d"; Attribute_Name_2 = "style"; My_Properties = "stroke: blue; stroke-width: 3; fill: none;"; Coordinate = "M 375 200 A 50 50 0 0 1 475 200"; Button_Identification = document.getElementById('Bezier_Curve_Button'); Button_Identification.setAttribute = ("style", "top: 100px; height: 200px;"); Bezier_Curve_Identification = document.getElementById('Bezier_Curve_1'); Bezier_Curve_Identification.setAttribute(Attribute_Name, Coordinate); Bezier_Curve_Identification.setAttribute(Attribute_Name_2, My_Properties); } function Setup2() { var SVG_Data; var Retrieved_Data; var Bezier_Curve_1; var Bezier_Curve_2; var Counter; var Coordinate_Attribute; var Coordinate; var Style_Attribute; var Style_Details; var Bezier_Curve_Identification; SVG_Data = new XMLHttpRequest(); SVG_Data.open("GET","http://localhost:8080/exist/rest/db/apps/HTML_Student/SVG_Bezier_Curve.xq", true); SVG_Data.onreadystatechange = function () { if (SVG_Data.readyState == 4) { Retrieved_Data = SVG_Data.responseText; Retrieved_Data = Retrieved_Data.split("/"); Counter = 0; Bezier_Curve_1 = Retrieved_Data[Counter]; Counter = Counter + 1; Bezier_Curve_2 = Retrieved_Data[Counter];} Bezier_Curve_1 = Bezier_Curve_1.split("*"); Counter = 0; Coordinate_Attribute = Bezier_Curve_1[Counter]; Counter = Counter + 1; Coordinate = Bezier_Curve_1[Counter]; Counter = Counter + 1; Style_Attribute = Bezier_Curve_1[Counter]; Counter = Counter + 1; Style_Details = Bezier_Curve_1[Counter]; Bezier_Curve_Identification = document.getElementById('Bezier_Curve_1'); Bezier_Curve_Identification.setAttribute(Coordinate_Attribute, Coordinate); Bezier_Curve_Identification.setAttribute(Style_Attribute, Style_Details); Bezier_Curve_2 = Bezier_Curve_2.split("*"); Counter = 0; Coordinate_Attribute = Bezier_Curve_2[Counter]; Counter = Counter + 1; Coordinate = Bezier_Curve_2[Counter]; Counter = Counter + 1; Style_Attribute = Bezier_Curve_2[Counter]; Counter = Counter + 1; Style_Details = Bezier_Curve_2[Counter]; Bezier_Curve_Identification = document.getElementById('Bezier_Curve_2'); Bezier_Curve_Identification.setAttribute(Coordinate_Attribute, Coordinate); Bezier_Curve_Identification.setAttribute(Style_Attribute, Style_Details); }; SVG_Data.send();} </code>
    function Setup() {
    var Bezier_Curve_Identification;
    var Attribute_Name;
    var Attribute_Name_2;
    var Coordinate;
    var My_Properties;
    var Button_Identification;
    
    
    
    Attribute_Name = "d";
    Attribute_Name_2 = "style";
    My_Properties = "stroke: blue; stroke-width: 3; fill: none;";
    Coordinate = "M 375 200 A 50 50 0 0 1 475 200";
    Button_Identification = document.getElementById('Bezier_Curve_Button');
    Button_Identification.setAttribute = ("style", "top: 100px; height: 200px;");
    Bezier_Curve_Identification = document.getElementById('Bezier_Curve_1');
    Bezier_Curve_Identification.setAttribute(Attribute_Name, Coordinate);
    Bezier_Curve_Identification.setAttribute(Attribute_Name_2, My_Properties);
    
    
  
}

function Setup2() {
    
    var SVG_Data;
    var Retrieved_Data;
    var Bezier_Curve_1;
    var Bezier_Curve_2;
    var Counter;
    var Coordinate_Attribute;
    var Coordinate;
    var Style_Attribute;
    var Style_Details;
    var Bezier_Curve_Identification;
    
    SVG_Data = new XMLHttpRequest();
          SVG_Data.open("GET","http://localhost:8080/exist/rest/db/apps/HTML_Student/SVG_Bezier_Curve.xq", true);
          SVG_Data.onreadystatechange = function () {
              if (SVG_Data.readyState == 4) {
              Retrieved_Data = SVG_Data.responseText;
              Retrieved_Data = Retrieved_Data.split("/");
              Counter = 0;
              Bezier_Curve_1 = Retrieved_Data[Counter];
              Counter = Counter + 1;
              Bezier_Curve_2 = Retrieved_Data[Counter];}
              Bezier_Curve_1 = Bezier_Curve_1.split("*");
              Counter = 0;
              Coordinate_Attribute = Bezier_Curve_1[Counter];
              Counter = Counter + 1;
              Coordinate = Bezier_Curve_1[Counter];
              Counter = Counter + 1;
              Style_Attribute = Bezier_Curve_1[Counter];
              Counter = Counter + 1;
              Style_Details = Bezier_Curve_1[Counter];
              Bezier_Curve_Identification = document.getElementById('Bezier_Curve_1');
              Bezier_Curve_Identification.setAttribute(Coordinate_Attribute, Coordinate);
              Bezier_Curve_Identification.setAttribute(Style_Attribute, Style_Details);
              Bezier_Curve_2 = Bezier_Curve_2.split("*");
              Counter = 0;
              Coordinate_Attribute = Bezier_Curve_2[Counter];
              Counter = Counter + 1;
              Coordinate = Bezier_Curve_2[Counter];
              Counter = Counter + 1;
              Style_Attribute = Bezier_Curve_2[Counter];
              Counter = Counter + 1;
              Style_Details = Bezier_Curve_2[Counter];
              Bezier_Curve_Identification = document.getElementById('Bezier_Curve_2');
              Bezier_Curve_Identification.setAttribute(Coordinate_Attribute, Coordinate);
              Bezier_Curve_Identification.setAttribute(Style_Attribute, Style_Details);
              
              };

SVG_Data.send();}

Here is my XML:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code> <SVG_Data_Collection xmlns="http://www.TedTheSpeedlearner.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TedTheSpeedlearner.com SVG_Bezier_Curve_Data_Schema.xsd">
<Bezier_Curve_1>
<Main_Attribute>d</Main_Attribute>
<Initial_Attribute>M </Initial_Attribute>
<Coordinate_Start>375 200 </Coordinate_Start>
<Arc_Attribute>A </Arc_Attribute>
<Bezier_Arc>50 50 0 0 1 </Bezier_Arc>
<Terminal_Coordinate>475 200</Terminal_Coordinate>
<Style_Attribute>style</Style_Attribute>
<Style_Color>stroke: red; </Style_Color>
<Style_Width>stroke-width: 3; </Style_Width>
<Style_Fill>fill: none;</Style_Fill>
</Bezier_Curve_1>
<Bezier_Curve_2>
<Main_Attribute>/d</Main_Attribute>
<Initial_Attribute>M</Initial_Attribute>
<Coordinate_Start>375 200 </Coordinate_Start>
<Arc_Attribute>A </Arc_Attribute>
<Bezier_Arc>50 50 0 0 0 </Bezier_Arc>
<Terminal_Coordinate>475 200</Terminal_Coordinate>
<Style_Attribute>style</Style_Attribute>
<Style_Color>stroke: blue;</Style_Color>
<Style_Width>stroke-width: 3;</Style_Width>
<Style_Fill>fill: none;</Style_Fill>
</Bezier_Curve_2>
</SVG_Data_Collection>
</code>
<code> <SVG_Data_Collection xmlns="http://www.TedTheSpeedlearner.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TedTheSpeedlearner.com SVG_Bezier_Curve_Data_Schema.xsd"> <Bezier_Curve_1> <Main_Attribute>d</Main_Attribute> <Initial_Attribute>M </Initial_Attribute> <Coordinate_Start>375 200 </Coordinate_Start> <Arc_Attribute>A </Arc_Attribute> <Bezier_Arc>50 50 0 0 1 </Bezier_Arc> <Terminal_Coordinate>475 200</Terminal_Coordinate> <Style_Attribute>style</Style_Attribute> <Style_Color>stroke: red; </Style_Color> <Style_Width>stroke-width: 3; </Style_Width> <Style_Fill>fill: none;</Style_Fill> </Bezier_Curve_1> <Bezier_Curve_2> <Main_Attribute>/d</Main_Attribute> <Initial_Attribute>M</Initial_Attribute> <Coordinate_Start>375 200 </Coordinate_Start> <Arc_Attribute>A </Arc_Attribute> <Bezier_Arc>50 50 0 0 0 </Bezier_Arc> <Terminal_Coordinate>475 200</Terminal_Coordinate> <Style_Attribute>style</Style_Attribute> <Style_Color>stroke: blue;</Style_Color> <Style_Width>stroke-width: 3;</Style_Width> <Style_Fill>fill: none;</Style_Fill> </Bezier_Curve_2> </SVG_Data_Collection> </code>
    <SVG_Data_Collection xmlns="http://www.TedTheSpeedlearner.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TedTheSpeedlearner.com SVG_Bezier_Curve_Data_Schema.xsd">
    <Bezier_Curve_1>
        <Main_Attribute>d</Main_Attribute>
        <Initial_Attribute>M </Initial_Attribute>
        <Coordinate_Start>375 200 </Coordinate_Start>
        <Arc_Attribute>A </Arc_Attribute>
        <Bezier_Arc>50 50 0 0 1  </Bezier_Arc>
        <Terminal_Coordinate>475 200</Terminal_Coordinate>
        <Style_Attribute>style</Style_Attribute>
        <Style_Color>stroke: red; </Style_Color>
        <Style_Width>stroke-width: 3; </Style_Width>
        <Style_Fill>fill: none;</Style_Fill>
    </Bezier_Curve_1>
    <Bezier_Curve_2>
        <Main_Attribute>/d</Main_Attribute>
         <Initial_Attribute>M</Initial_Attribute>
         <Coordinate_Start>375 200 </Coordinate_Start>
         <Arc_Attribute>A </Arc_Attribute>
         <Bezier_Arc>50 50 0 0 0 </Bezier_Arc>
         <Terminal_Coordinate>475 200</Terminal_Coordinate>
         <Style_Attribute>style</Style_Attribute>
         <Style_Color>stroke: blue;</Style_Color>
         <Style_Width>stroke-width: 3;</Style_Width>
         <Style_Fill>fill: none;</Style_Fill>
     </Bezier_Curve_2>
</SVG_Data_Collection>

And here is my Xquery:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code> 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_Bezier_Curve_Data.xml")/SVG_Data_Collection/Bezier_Curve_1
let $First_Data_Name := $doc/Main_Attribute
let $Data := concat($First_Data_Name, "*")
let $Second_Data_Name := $doc/Initial_Attribute
let $Data := concat($Data, $Second_Data_Name)
let $Third_Data_Name := $doc/Coordinate_Start
let $Data := concat($Data, $Third_Data_Name)
let $Fourth_Data_Name := $doc/Arc_Attribute
let $Data := concat($Data, $Fourth_Data_Name)
let $Fifth_Data_Name := $doc/Bezier_Arc
let $Data := concat($Data, $Fifth_Data_Name)
let $Sixth_Data_Name := $doc/Terminal_Coordinate
let $Data := concat($Data, $Sixth_Data_Name)
let $Seventh_Data_Name := $doc/Style_Attribute
let $Data := concat($Data, "*", $Seventh_Data_Name, "*")
let $Eighth_Data_Name := $doc/Style_Color
let $Data := concat($Data, $Eighth_Data_Name)
let $Ninth_Data_Name := $doc/Style_Width
let $Data := concat($Data, $Ninth_Data_Name)
let $Tenth_Data_Name := $doc/Style_Fill
let $Data := concat($Data, $Tenth_Data_Name)
let $doc := doc("SVG_Bezier_Curve_Data.xml")/SVG_Data_Collection/Bezier_Curve_2
let $First_Data_Name := $doc/Main_Attribute
let $Data2 := concat($First_Data_Name, "*")
let $Second_Data_Name := $doc/Initial_Attribute
let $Data2 := concat($Data2, $Second_Data_Name)
let $Third_Data_Name := $doc/Coordinate_Start
let $Data2 := concat($Data2, $Third_Data_Name)
let $Fourth_Data_Name := $doc/Arc_Attribute
let $Data2 := concat($Data2, $Fourth_Data_Name)
let $Fifth_Data_Name := $doc/Bezier_Arc
let $Data2 := concat($Data2, $Fifth_Data_Name)
let $Sixth_Data_Name := $doc/Terminal_Coordinate
let $Data2 := concat($Data2, $Sixth_Data_Name)
let $Seventh_Data_Name := $doc/Style_Attribute
let $Data2 := concat($Data2, "*", $Seventh_Data_Name, "*")
let $Eighth_Data_Name := $doc/Style_Color
let $Data2 := concat($Data2, $Eighth_Data_Name)
let $Ninth_Data_Name := $doc/Style_Width
let $Data2 := concat($Data2, $Ninth_Data_Name)
let $Tenth_Data_Name := $doc/Style_Fill
let $Data2 := concat($Data2, $Tenth_Data_Name)
return ($Data, $Data2)
</code>
<code> 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_Bezier_Curve_Data.xml")/SVG_Data_Collection/Bezier_Curve_1 let $First_Data_Name := $doc/Main_Attribute let $Data := concat($First_Data_Name, "*") let $Second_Data_Name := $doc/Initial_Attribute let $Data := concat($Data, $Second_Data_Name) let $Third_Data_Name := $doc/Coordinate_Start let $Data := concat($Data, $Third_Data_Name) let $Fourth_Data_Name := $doc/Arc_Attribute let $Data := concat($Data, $Fourth_Data_Name) let $Fifth_Data_Name := $doc/Bezier_Arc let $Data := concat($Data, $Fifth_Data_Name) let $Sixth_Data_Name := $doc/Terminal_Coordinate let $Data := concat($Data, $Sixth_Data_Name) let $Seventh_Data_Name := $doc/Style_Attribute let $Data := concat($Data, "*", $Seventh_Data_Name, "*") let $Eighth_Data_Name := $doc/Style_Color let $Data := concat($Data, $Eighth_Data_Name) let $Ninth_Data_Name := $doc/Style_Width let $Data := concat($Data, $Ninth_Data_Name) let $Tenth_Data_Name := $doc/Style_Fill let $Data := concat($Data, $Tenth_Data_Name) let $doc := doc("SVG_Bezier_Curve_Data.xml")/SVG_Data_Collection/Bezier_Curve_2 let $First_Data_Name := $doc/Main_Attribute let $Data2 := concat($First_Data_Name, "*") let $Second_Data_Name := $doc/Initial_Attribute let $Data2 := concat($Data2, $Second_Data_Name) let $Third_Data_Name := $doc/Coordinate_Start let $Data2 := concat($Data2, $Third_Data_Name) let $Fourth_Data_Name := $doc/Arc_Attribute let $Data2 := concat($Data2, $Fourth_Data_Name) let $Fifth_Data_Name := $doc/Bezier_Arc let $Data2 := concat($Data2, $Fifth_Data_Name) let $Sixth_Data_Name := $doc/Terminal_Coordinate let $Data2 := concat($Data2, $Sixth_Data_Name) let $Seventh_Data_Name := $doc/Style_Attribute let $Data2 := concat($Data2, "*", $Seventh_Data_Name, "*") let $Eighth_Data_Name := $doc/Style_Color let $Data2 := concat($Data2, $Eighth_Data_Name) let $Ninth_Data_Name := $doc/Style_Width let $Data2 := concat($Data2, $Ninth_Data_Name) let $Tenth_Data_Name := $doc/Style_Fill let $Data2 := concat($Data2, $Tenth_Data_Name) return ($Data, $Data2) </code>
    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_Bezier_Curve_Data.xml")/SVG_Data_Collection/Bezier_Curve_1
let $First_Data_Name := $doc/Main_Attribute
let $Data := concat($First_Data_Name, "*")
let $Second_Data_Name := $doc/Initial_Attribute
let $Data := concat($Data, $Second_Data_Name)
let $Third_Data_Name := $doc/Coordinate_Start
let $Data := concat($Data, $Third_Data_Name)
let $Fourth_Data_Name := $doc/Arc_Attribute
let $Data := concat($Data, $Fourth_Data_Name)
let $Fifth_Data_Name := $doc/Bezier_Arc
let $Data := concat($Data, $Fifth_Data_Name)
let $Sixth_Data_Name := $doc/Terminal_Coordinate
let $Data := concat($Data, $Sixth_Data_Name)
let $Seventh_Data_Name := $doc/Style_Attribute
let $Data := concat($Data, "*", $Seventh_Data_Name, "*")
let $Eighth_Data_Name := $doc/Style_Color
let $Data := concat($Data, $Eighth_Data_Name)
let $Ninth_Data_Name := $doc/Style_Width
let $Data := concat($Data, $Ninth_Data_Name)
let $Tenth_Data_Name := $doc/Style_Fill
let $Data := concat($Data, $Tenth_Data_Name)
let $doc := doc("SVG_Bezier_Curve_Data.xml")/SVG_Data_Collection/Bezier_Curve_2
let $First_Data_Name := $doc/Main_Attribute
let $Data2 := concat($First_Data_Name, "*")
let $Second_Data_Name := $doc/Initial_Attribute
let $Data2 := concat($Data2, $Second_Data_Name)
let $Third_Data_Name := $doc/Coordinate_Start
let $Data2 := concat($Data2, $Third_Data_Name)
let $Fourth_Data_Name := $doc/Arc_Attribute
let $Data2 := concat($Data2, $Fourth_Data_Name)
let $Fifth_Data_Name := $doc/Bezier_Arc
let $Data2 := concat($Data2, $Fifth_Data_Name)
let $Sixth_Data_Name := $doc/Terminal_Coordinate
let $Data2 := concat($Data2, $Sixth_Data_Name)
let $Seventh_Data_Name := $doc/Style_Attribute
let $Data2 := concat($Data2, "*", $Seventh_Data_Name, "*")
let $Eighth_Data_Name := $doc/Style_Color
let $Data2 := concat($Data2, $Eighth_Data_Name)
let $Ninth_Data_Name := $doc/Style_Width
let $Data2 := concat($Data2, $Ninth_Data_Name)
let $Tenth_Data_Name := $doc/Style_Fill
let $Data2 := concat($Data2, $Tenth_Data_Name)
return ($Data, $Data2)

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật