XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
+ XSLT Help and Discussion (7625)
- XQuery Help and Discussion (2017)
-> + Issue with Processing Instruct... (2)
-> + problem converting json to XML... (2)
-> + Problem base64 decoding string... (3)
-> + Problems posting multipart for... (5)
-> + trouble with download of price... (2)
-> + Problem with http-post not bei... (3)
-> + path problem, xps_file:writeAl... (9)
-> + Xquery update support? (2)
-> + problem with Stylus studio try... (5)
-> + adding dtd reference to xml ou... (4)
-> + xquery escaping ambarsand when... (3)
-> + Whitespace problem when return... (5)
-> + Problem with namespace prefix ... (5)
-> - Sending via SFTP returns unexp... (1)
-> + Query and Sftp clent (4)
-> + xquery and try - catch (3)
-> + Query + ddtek:http-post optio... (5)
-> + Example files referenced in do... (3)
-> + Automatic Error Detection and ... (3)
-> + Working with result of ddtek:h... (2)
-- [1-20] [21-40] [41-60] Next
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
Santhosh ThottingalSubject: Selecting operator from XML to xquery
Author: Santhosh Thottingal
Date: 07 Nov 2006 11:22 AM
hi all,
I have an XML in the following form.
<evaluate oper="or">
<assert acrtreftype="prodattr" acrtidref="pa02" from="010" to="023"/>
<evaluate oper="and">
<assert acrtreftype="prodattr" acrtidref="pa02" from="001" to="005"/>
<assert acrtreftype="condition" acrtidref="c01" value="POST"/>
</evaluate>
<evaluate oper="and">
<assert acrtreftype="prodattr" acrtidref="pa02" value="006"/>
<assert acrtreftype="condition" acrtidref="c02" value="PRE"/>
</evaluate>
<assert>AIRPLANES WITH BENDIX BRAKES</assert>
</evaluate>

What I want to do is do this evaluation using xquery. Based on the oper attribute of evaluate , in xquery I need to do an and or or operations. Can some one suggest how to do this?
Thanks in advance
-santhosh

Postnext
Tony LavinioSubject: Selecting operator from XML to xquery
Author: Tony Lavinio
Date: 07 Nov 2006 11:05 PM
Our records don't show you as a Stylus Studio user, based on the
email address you used to register to this forum.
Which version are you using?
We offer free support to users of our product, but not users of all
products.

Postnext
Santhosh ThottingalSubject: Selecting operator from XML to xquery
Author: Santhosh Thottingal
Date: 07 Nov 2006 11:07 PM
Stylus Studio 2006 Release 3 XML Enterprise Edition, but not a registerd user

Postnext
(Deleted User) Subject: Selecting operator from XML to xquery
Author: (Deleted User)
Date: 08 Nov 2006 09:27 AM
Hi Santhosh,
it's not too clear to me what should be done with the content of the various "assert" elements, but this could be a starting point

declare function local:process_assert($node as element()) as xs:boolean
{
(: replace it with some processing of the "assert" node :)
true()
};

declare function local:process_evaluate($node as element()) as xs:boolean
{
let $operands := for $child in $node/*
return
if(node-name($child) = xs:QName("assert")) then xs:int(local:process_assert($child))
else
if(node-name($child) = xs:QName("evaluate")) then xs:int(local:process_evaluate($child))
else (),
$sum := sum($operands)
return
if($node/@oper = "or") then $sum > 0
else
if($node/@oper = "and") then $sum = count($operands)
else false()
};

Hope this helps,
Alberto

Posttop
Santhosh ThottingalSubject: Selecting operator from XML to xquery
Author: Santhosh Thottingal
Date: 09 Nov 2006 07:11 AM
Thanks a lot.
The assert statements will return boolean values, based on that evaluations will be done, the final output should be a boolean value. OR or AND operations will be applied to assert results.
I am new to XQuery and trying to learn for one of my project. And I am struggling to do the above descibed functionality.

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.