Re: Still trying to validate an XML Schema
Ted Hickox <[email protected]> Sun, 23 Jun 2024 16:24:22 -0500
| Newsgroups | gmane.text.xml.exist |
|---|---|
| Message-ID | <CAAsp6CaPrrL=qXKw_5J6jX3b0HfDiSa4jwudeZ88bwuxpPvRdg@mail.gmail.com> |
Here is a little update. I attempted to validate my xml code. This is the
result I received:
[image: 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.
<SVG_Data_Collection xmlns="http://www.TedTheSpeedlearner.com" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.TedTheSpeedlearner.com SVG_Ellipse_Data_Schema.xsd">
<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>
</SVG_Data_Collection>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:target="
http://www.TedTheSpeedlearner.com" targetNamespace="
http://www.TedTheSpeedlearner.com" elementFormDefault="qualified">
<complexType name="Ellipse_Type">
<sequence>
<element name="X_Center_Coordinate" type="string"/>
<element name="Y_Center_Coordinate" type="string"/>
<element name="X_Radius_Coordinate" type="string"/>
<element name="Y_Radius_Coordinate" type="string"/>
</sequence>
</complexType>
<element name="SVG_Data_Collection">
<complexType>
<sequence>
<element name="Ellipse" type="target:Ellipse_Type"/>
</sequence>
</complexType>
</element>
</schema>
On Sun, Jun 23, 2024 at 4:10 PM Ted Hickox <[email protected]> wrote:
> The manage and renaming features of eXist worked perfectly. I didn't know
> I could do any of this. Thanks for your advice on that one. I guess the
> first thing you might suggest is running an xQuery on the xml that my
> Javascript is using. I have an xml schema that can do this task. I will
> just have to write an xQuery to test the xml code.
>
> In the meantime, in case I may need additional help, here is my javascript
> code and my xml code. I will let you know when I run my xQuery.
>
> SVG_Ellipse.js
>
> 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();
>
> 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
>
> SVG_Ellipse.xml
>
> <SVG_Data_Collection xmlns="http://www.TedTheSpeedlearner.com" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
> http://www.TedTheSpeedlearner.com SVG_Ellipse_Data_Schema.xsd">
> <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>
> </SVG_Data_Collection>
>
> On Sun, Jun 23, 2024 at 3:41 PM Florian Schmitt <
> [email protected]> wrote:
>
>> Hi Ted,
>>
>> for renaming a resource in eXide, select "Manage" from the File menu,
>> left-click the file to rename and hit the rename button (file symbol
>> with pencil).
>>
>> Blank screen: Check the browser console for Javascript errors. As far as
>> i remember, your HTML page is initially empty. If it stays empty,
>> there's an issue with your Javascriupt of Xquery code.
>>
>> Greetings,
>> Florian
>>
>> Am 23.06.2024 um 21:12 schrieb Ted Hickox:
>> > I became innovative. I copied and pasted the document then I saved it
>> > as an xhtml file. When I tried to open the new file, all I got was a
>> > blank screen. Why would I get a blank screen?
>> >
>>
>>
>> _______________________________________________
>> 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, 131.7 KB) - not displayed