declare namespace a = "http://pcs.portinfolink.nl/ecscoprar"; declare option ddtek:serialize 'indent=yes,omit-xml-declaration=no'; (: : ----------------------------------------------------------------------------------------------------- : : Copyright: (c) 2009 Portbase All Rights Reserved. : : ----------------------------------------------------------------------------------------------------- : : Portbase * No part of this file may be reproduced or : : * transmitted in any form or by any means, : : Seattleweg 7 * electronic or mechanical, for the purpose, : : 3195 ND Rotterdam * without the express written permission of the : : The Netherlands * copyright holder. : : ----------------------------------------------------------------------------------------------------- : : title = "ECS_COPRAR" : : version = "$Id: ECS_COPRAR_M121.xquery 81098 2009-05-20 08:24:27Z r.vander.hoeven $" : : author = "Roel van der Hoeven" : : company = "Portbase" : : email = "r.vander.hoeven@portbase.com" : : ----------------------------------------------------------------------------------------------------- : :) let $input := ddtek:validate(/EDIFACT,'../dictionaries/applications/ecs/xsd/ECS_COPRAR_IN.xsd') return { let $RFF_VON := for $RFF in $input/EDIFACT/COPRAR/GROUP_1/RFF where $RFF/RFF0101/text() = 'VON' return $RFF/RFF0102/text() return if( string-length($RFF_VON) > 0 ) then $RFF_VON else $input/EDIFACT/COPRAR/GROUP_1/TDT/TDT02/text() } (: Stylus Studio meta-information - (c) 2004-2008. Progress Software Corporation. All rights reserved. :)