declare variable $pageSize := 100;
let $table := collection("xAce.dbo.singles")/singles
let $groupCount := xs:integer(fn:ceiling(count($table) div $pageSize))
for $g in 1 to $groupCount
let $group := $table[fn:position() gt ($g - 1) * $pageSize and fn:position() le $g * $pageSize]
return (ddtek:serialize-to-url(
{
for $singles1 in $group
return
{
for $Titles in collection("xAce.dbo.Title")/Title
where $Titles/autoID = $singles1/autoID
return
{
if( $Titles/TI ) then
{$Titles/TI/text()}
else
()
}
{
if( $Titles/FT ) then
{$Titles/FT/text()}
else
()
}
{
if( $Titles/Orig ) then
{$Titles/Orig/text()}
else
()
}
{
if( $Titles/Gister ) then
{$Titles/Gister/text()}
else ()
}
{
if( $Titles/Lambda ) then
{$Titles/Lambda/text()}
else ()
}
{
if( $Titles/Systran5 ) then
{$Titles/Systran5/text()}
else ()
}
{
if( $Titles/Sigma ) then
{$Titles/Sigma/text()}
else ()
}
}
{$singles1/ThesisType/text()}
{$singles1/PNS/text()}
{$singles1/SO/text()}
{$singles1/SE/text()}
{$singles1/PD/text()}
{$singles1/PY/text()}
{$singles1/PUBM/text()}
{$singles1/DA/text()}
{$singles1/DEP/text()}
{$singles1/EDAT/text()}
{$singles1/MHDA/text()}
{
for $PHST in collection("xAce.dbo.PHST")/PHST
where $PHST/autoID = $singles1/autoID
return
{$PHST/PHST/text()}
}
{$singles1/LR/text()}
{$singles1/PST/text()}
{$singles1/STAT/text()}
{$singles1/VL/text()}
{$singles1/IS/text()}
{$singles1/SU/text()}
{$singles1/SI/text()}
{$singles1/BP/text()}
{$singles1/EP/text()}
{$singles1/PS/text()}
{
for $Authors in collection("xAce.dbo.Authors")/Authors
where $singles1/autoID = $Authors/autoID
return
{
if( $Authors/AU ) then
{$Authors/AU/text()}
else
()
}
{
if( $Authors/AF ) then
{$Authors/AF/text()}
else
()
}
{
if( $Authors/BAU ) then
{$Authors/BAU/text()}
else
()
}
{
if( $Authors/C1 ) then
{$Authors/C1/text()}
else
()
}
{
if( $Authors/EM ) then
{$Authors/EM/text()}
else
()
}
}
{
for $IDOCAuthor in collection("xAce.dbo.IDOCAuthor")/IDOCAuthor
where $IDOCAuthor/autoID = $singles1/autoID
return
{$IDOCAuthor/Orig/text()}
{$IDOCAuthor/Gister/text()}
{$IDOCAuthor/Lambda/text()}
{$IDOCAuthor/Systran5/text()}
{$IDOCAuthor/Sigma/text()}
}
{
for $IDOCAdvisor in collection("xAce.dbo.IDOCAdvisor")/IDOCAdvisor
where $IDOCAdvisor/autoID = $singles1/autoID
return
{$IDOCAdvisor/Orig/text()}
{$IDOCAdvisor/Gister/text()}
{$IDOCAdvisor/Lambda/text()}
{$IDOCAdvisor/Systran5/text()}
{$IDOCAdvisor/Sigma/text()}
}
{
for $BA in collection("xAce.dbo.BA")/BA
where $BA/autoID = $singles1/autoID
return
{$BA/BA/text()}
}
{
for $BE in collection("xAce.dbo.BE")/BE
where $BE/autoID = $singles1/autoID
return
{$BE/BE/text()}
}
{$singles1/AD/text()}
{$singles1/University/text()}
{$singles1/UniversityAddress/text()}
{
for $CA in collection("xAce.dbo.CA")/CA
where $CA/autoID = $singles1/autoID
return
{$CA/CA/text()}
}
{$singles1/RP/text()}
{$singles1/OWN/text()}
{
for $SC in collection("xAce.dbo.SC")/SC
where $SC/autoID = $singles1/autoID
return
{$SC/SC/text()}
}
{
for $CC in collection("xAce.dbo.CC")/CC
where $CC/autoID = $singles1/autoID
return
{$CC/CC/text()}
}
{$singles1/SB/text()}
{
for $CH in collection("xAce.dbo.CH")/CH
where $CH/autoID = $singles1/autoID
return
{$CH/CH/text()}
}
{
for $DS in collection("xAce.dbo.DS")/DS
where $DS/autoID = $singles1/autoID
return
{$DS/DS/text()}
}
{
for $GE in collection("xAce.dbo.GE")/GE
where $GE/autoID = $singles1/autoID
return
{$GE/GE/text()}
}
{
for $MQ in collection("xAce.dbo.MQ")/MQ
where $MQ/autoID = $singles1/autoID
return
{$MQ/MQ/text()}
}
{
for $GN in collection("xAce.dbo.GN")/GN
where $GN/autoID = $singles1/autoID
return
{$GN/GN/text()}
}
{
for $TA in collection("xAce.dbo.TA")/TA
where $singles1/autoID = $TA/autoID
return
{$TA/TA/text()}
}
{
for $TM in collection("xAce.dbo.TM")/TM
where $singles1/autoID = $TM/autoID
return
{$TM/TM/text()}
}
{
for $MC in collection("xAce.dbo.MC")/MC
where $singles1/autoID = $MC/autoID
return
{$MC/MC/text()}
}
{
for $PR in collection("xAce.dbo.PR")/PR
where $PR/autoID = $singles1/autoID
return
{$PR/PR/text()}
}
{
for $SD in collection("xAce.dbo.SD")/SD
where $singles1/autoID = $SD/autoID
return
{$SD/SD/text()}
}
{
for $MH in collection("xAce.dbo.MH")/MH
where $MH/autoID = $singles1/autoID
return
{$MH/MH/text()}
}
{
for $DE in collection("xAce.dbo.DE")/DE
where $DE/autoID = $singles1/autoID
return
{$DE/DE/text()}
}
{
for $ID in collection("xAce.dbo.ID")/ID
where $ID/autoID = $singles1/autoID
return
{$ID/ID/text()}
}
{
for $IDOCKeyword in collection("xAce.dbo.IDOCKeyword")/IDOCKeyword
where $IDOCKeyword/autoID = $singles1/autoID
return
{$IDOCKeyword/Orig/text()}
{$IDOCKeyword/Gister/text()}
{$IDOCKeyword/Lambda/text()}
{$IDOCKeyword/Systran5/text()}
{$IDOCKeyword/Sigma/text()}
}
{
for $IDOCSubjectCategory in collection("xAce.dbo.IDOCSubjectCategory")/IDOCSubjectCategory
where $IDOCSubjectCategory/autoID = $singles1/autoID
return
{$IDOCSubjectCategory/Orig/text()}
{$IDOCSubjectCategory/Gister/text()}
{$IDOCSubjectCategory/Lambda/text()}
{$IDOCSubjectCategory/Systran5/text()}
{$IDOCSubjectCategory/Sigma/text()}
}
{$singles1/PN/text()}
{
for $Abstract in collection("xAce.dbo.Abstract")/Abstract
where $Abstract/autoID = $singles1/autoID
return
{
if( $Abstract/AB ) then
{$Abstract/AB/text()}
else
()
}
{
if( $Abstract/Orig ) then
{$Abstract/Orig/text()}
else
()
}
{
if( $Abstract/Gister ) then
{$Abstract/Gister/text()}
else
()
}
{
if( $Abstract/Lambda ) then
{$Abstract/Lambda/text()}
else
()
}
{
if( $Abstract/Systran5 ) then
{$Abstract/Systran5/text()}
else
()
}
{
if( $Abstract/Sigma ) then
{$Abstract/Sigma/text()}
else
()
}
}
{
for $IDOCAbstract in collection("xAce.dbo.IDOCAbstract")/IDOCAbstract
where $IDOCAbstract/autoID = $singles1/autoID
return
{$IDOCAbstract/Orig/text()}
{$IDOCAbstract/Gister/text()}
{$IDOCAbstract/Lambda/text()}
{$IDOCAbstract/Systran5/text()}
{$IDOCAbstract/Sigma/text()}
}
{
for $AE in collection("xAce.dbo.AE")/AE
where $AE/autoID = $singles1/autoID
return
{$AE/AE/text()}
}
{$singles1/DG/text()}
{$singles1/PC/text()}
{$singles1/PL/text()}
{
for $CR in collection("xAce.dbo.CR")/CR
where $CR/autoID = $singles1/autoID
return
{$CR/CR/text()}
}
{$singles1/NR/text()}
{$singles1/TC/text()}
{$singles1/LA/text()}
{
for $DT in collection("xAce.dbo.DT")/DT
where $DT/autoID = $singles1/autoID
return
{$DT/DT/text()}
}
{$singles1/LT/text()}
{$singles1/ME/text()}
{$singles1/PT/text()}
{$singles1/PU/text()}
{$singles1/PI/text()}
{$singles1/PA/text()}
{$singles1/CT/text()}
{$singles1/CL/text()}
{$singles1/CY/text()}
{
for $SP in collection("xAce.dbo.SP")/SP
where $singles1/autoID = $SP/autoID
return
{$SP/SP/text()}
}
{$singles1/J9/text()}
{$singles1/JI/text()}
{$singles1/JT/text()}
{$singles1/AR/text()}
{$singles1/DI/text()}
{$singles1/PG/text()}
{$singles1/FullTextHyper/text()}
{$singles1/GA/text()}
{$singles1/UT/text()}
{$singles1/AN/text()}
{
for $AID in collection("xAce.dbo.AID")/AID
where $AID/autoID = $singles1/autoID
return
{$AID/AID/text()}
}
{$singles1/SN/text()}
{$singles1/BN/text()}
{$singles1/JID/text()}
{$singles1/RN/text()}
{$singles1/IDOCID/text()}
{$singles1/sourcePath/text()}
{$singles1/sourceFile/text()}
{$singles1/sourceType/text()}
{$singles1/classification/text()}
}
,
concat("file:///G:/x/xml/ace/ace",$g,".xml"),"indent=yes"))
(: Stylus Studio meta-information - (c) 2004-2008. Progress Software Corporation. All rights reserved.
:)