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
Show tree view Topic
Go to previous topicPrev TopicGo to next topicNext Topic
Wilhelm BeckSubject: Figured Out Issues From Last Post, BUT Processing Time On Full Job Takes Forever
Author: Wilhelm Beck
Date: 25 Jul 2012 11:59 PM

Ok, so the long post didn't go over too well with anybody, fortunately I've figured out A solution on my own... Ish. Ivan (or someone!) if you could give me a nudge in the right direction I'd be eternally grateful! If anyone wants to look at the structure of what I'm dealing with, it's in my previous post from a few days ago.

So the following

let $doc := .
for $v in $doc//root/Row,
$t in $doc//root/Row/tracknumber/text()
where matches($t, 'THIS IS THE UPC-01')
and $v/tracknumber/text() = $t
return $v/UPC/text()

Will do what I want. If I make a single field that combines the UPC and track number that will work as a unique identifier, and can be done in bulk in source spreadsheet. It will return the value if the field exists, and nothing if it doesn't. I even figured out a way to have it generate the XML tags around the value in the eventuality that the track exists via

let $doc := .
for $v in $doc//root/Row,
$t in $doc//root/Row/tracknumber/text()
where matches($t, 'THIS IS THE UPC-01')
and $v/tracknumber/text() = $t

I can't get it to leave the < and > in doing it that way, but a simple find/replace fixes that right up. If there's a way to keep the brackets it would be cool to know though :)

In any event, I've basically solved all my issues for generating a complete valid XML doc with only fields that need to exist.

Except when I run it on my full Spreadsheet converted to XML it chokes. Works great on a test source doc with 3 albums, does it in 1.6 seconds. However when I have the full 3000+ song XML doc I never let it run long enough to finish, as overnight seemed like more than enough time to generate a single albums worth of XML.

I've noticed that processing time seems to go up exponentially as the number of tracks goes up

At ~400 it's 188 seconds, at ~800 it's 677 seconds, etc. It would seem to me this SHOULD be a linear increase in processing time. Like 3000 tracks being processed SHOULD be about 145 seconds judging from my test setup.

I'm sure it's some nuance of the code and how Xquery processes things. So if someone could show me a way to set this up where it will be able to run through things a bit faster that would be amazing. Otherwise I'm going to need to create several shorted source documents to run the query on, which will be a bit of a nusance... And I'd just like to figure out why I'm having the problem for future reference.

Thank you in advance for your help!!!

Ivan PedruzziSubject: Figured Out Issues From Last Post, BUT Processing Time On Full Job Takes Forever
Author: Ivan Pedruzzi
Date: 27 Jul 2012 04:14 PM

Try replacing $doc//root with $doc/root and see if the performance improve

Ivan Pedruzzi
Stylus Studio Team

Go to previous topicPrev TopicGo to next topicNext Topic
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!  

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.