From: Ted H. <meg...@gm...> - 2015-08-29 14:27:18
|
I used the windows copy and paste command. I copied all the code you sent me. Once again I wasn't able to retrieve any of the numbers in my xml document. Once again I don't know why. On Sat, Aug 29, 2015 at 8:37 AM, Joe Wicentowski <jo...@gm...> wrote: > Ted, > > Based on your responses to Alasdair, it seems you might not have seen my > instructions on declaring a namespace. See below. > > Joe > > Sent from my iPhone > > Begin forwarded message: > > *From:* Joe Wicentowski <jo...@gm...> > *Date:* August 28, 2015 at 3:25:39 PM EDT > *To:* Ted Hickox <meg...@gm...> > *Cc:* eXist open Mailinglist <exi...@li...> > *Subject:* *Re: [Exist-open] eXist can't find my data* > > Hi Ted, > > Your query assumes the elements are in the empty namespace. > > Try this variant: > > xquery version "3.0"; > > declare namespace ted = "http://www.TedTheSpeedlearner.com"; > > let $doc := doc("/db/SVG_Ellipse.xml") > let $svg-data := $doc/ted:SVG_Data_Collection > let $First_Data_Name := $svg-data/ted:X_Center_Coordinate > let $Data := concat("cx = ",$First_Data_Name, " ") > let $Second_Data_Name := $svg-data/ted:Y_Center_Coordinate > let $Data := concat($Data, "cy = ",$Second_Data_Name, " ") > let $Third_Data_Name := $svg-data/ted:X_Radius_Coordinate > let $Data := concat($Data, "rx = ",$Third_Data_Name, " ") > let $Fourth_Data_Name := $svg-data/ted:Y_Radius_Coordinate > let $Data := concat($Data, "ry = ",$Fourth_Data_Name, " ") > return (validation:clear-grammar-cache(), $Data) > > The changes: > > - declare the "ted" namespace > - use the "ted" namespace prefix in XPaths that select data in this > namespace > - select the document once, refer to it via $doc variable > - provide a full path to the document, starting from /db > > Joe > > On Fri, Aug 28, 2015 at 2:27 PM, Ted Hickox <meg...@gm...> wrote: > >> This is 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.xsd"> >> <X_Center_Coordinate>100</X_Center_Coordinate> >> <Y_Center_Coordinate>100</Y_Center_Coordinate> >> <X_Radius_Coordinate>40</X_Radius_Coordinate> >> <Y_Radius_Coordinate>40</Y_Radius_Coordinate> >> </SVG_Data_Collection> >> >> This is SVG_Ellipse.xq >> >> xquery version "3.0"; >> let $header-addition := >> response:set-header("Access-Control-Allow-Origin","*") >> let $First_Data_Name := >> doc("SVG_Ellipse.xml")/SVG_Data_Collection/X_Center_Coordinate >> let $Data := concat("cx = ",$First_Data_Name, " ") >> let $Second_Data_Name := >> doc("SVG_Ellipse.xml")/SVG_Data_Collection/Y_Center_Coordinate >> let $Data := concat($Data, "cy = ",$Second_Data_Name, " ") >> let $Third_Data_Name := >> doc("SVG_Ellipse.xml")/SVG_Data_Collection/X_Radius_Coordinate >> let $Data := concat($Data, "rx = ",$Third_Data_Name, " ") >> let $Fourth_Data_Name := >> doc("SVG_Ellipse.xml")/SVG_Data_Collection/Y_Radius_Coordinate >> let $Data := concat($Data, "ry = ",$Fourth_Data_Name, " ") >> return (validation:clear-grammar-cache(), $Data) >> >> The computer returns cx = cy = rx = ry = It never returns the numbers >> between the center and radius coordinate elements of SVG_Ellipse.xml. I >> have no idea why. I hope you can assist me. >> > > > |