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
Neal  WaltersSubject: Xquery to find sample data file for testing
Author: Neal Walters
Date: 29 Jun 2005 10:42 AM
In a previous post entitled "XQuery on all XML Files in a Directory?",<br> Ivan helped me use Xquery to read all files in a directory. <br> <br> Today, I'm tring to find a sample Amazon order that has more one line line item. The following code works, but I have two questions: <br> <br> declare namespace ext = "FileUtils";<br> declare function ext:listFiles($path as xs:string) as xs:string* external;<br> declare variable $dirname as xs:string := "file:///c:/Odimo/Amazon/FileDrop/WorldOfWatches/Order__89/Doc_Original_Backup/";<br> <OrderReport><br> {<br> for $filename in fn:tokenize(ext:listFiles($dirname), ",")<br> [fn:matches(., ".xml")]<br> , $rootel in doc(fn:concat($dirname, "/", $filename))<br> return<br> <filename name='{$filename}'><br> <OrderID>{$rootel//Message/OrderReport/AmazonOrderID}</OrderID><br> <ItemCount>{count($rootel//Message/OrderReport/Item)}</ItemCount><br> </filename><br> }<br> </OrderReport><br> <br> Question 1: <br> Is there a way to limit the output to only those files (orders) that have a count >= 2 {count($rootel//Message/OrderReport/Item)? <br> <br> Question 2: <br> if I don't put two slashes here: <br> <OrderID>{$rootel//Message/OrderReport/AmazonOrderID}</OrderID> <br> I don't get anything. Why doesn't one slash work between $rootel and Message? From Stylus Studio, I can open a source doc, go to tree view, <br> and generate the following xpath: <br> /AmazonEnvelope/Message[1]/OrderReport[1]/AmazonOrderID[1] <br> <br> Thanks! <br> Neal Walters <br> <a href="http://Biztalk-Training.com">http://Biztalk-Training.com</a> <br> <br> <br> <br> <br>

Postnext
Neal  WaltersSubject: Xquery to find sample data file for testing
Author: Neal Walters
Date: 29 Jun 2005 10:47 AM
Wow - I clicked on "Edit" to change a typo in the previous message,
and it totally destroyed the format of my message. That was a shock? Are there tricks to watch out for when using "Edit" in the forum?

Sorry - perfectly spelled words have their cost.
Neal

Postnext
(Deleted User) Subject: Xquery to find sample data file for testing
Author: (Deleted User)
Date: 29 Jun 2005 10:51 AM
Hi Neal,
unfortunately the board software has problems editing a message (it converts the newlines into <br>). As for the question you are asking, I answered it in the original thread a couple of days ago (see http://www.stylusstudio.com/SSDN/default.asp?action=9&read=3819&fid=57)

Alberto

Posttop
Neal  WaltersSubject: Xquery to find sample data file for testing
Author: Neal Walters
Date: 29 Jun 2005 11:19 AM
Wow - I clicked on "Edit" to change a typo in the previous message,
and it totally destroyed the format of my message. That was a shock? Are there tricks to watch out for when using "Edit" in the forum?

Sorry - perfectly spelled words have their cost.
Neal

   
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.