Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for $it in $input
- return
- <Logic>
- {
- for $x in $it/Shipment
- return
- <Shipment>
- <ShipmentHeader>
- {
- let $head := $x/ShipmentHeader
- return data($head)
- }
- </ShipmentHeader>
- <Data>
- {
- let $date := $x/Date
- let $day := substring(data($date),1,2)
- let $month := substring(data($date),4,2)
- let $year := substring(data($date),7,4)
- let $subString := concat($year, $month, $day)
- return $subString
- }
- </Data>
- <ShipmentNumber>
- {
- let $num := $x/ShipmentNumber
- return data($num)
- }
- </ShipmentNumber>
- </Shipment>
- }
- <Shipper>
- {
- let $shipper := $it/Shipper/*
- return $shipper
- }
- </Shipper>
- <Position>
- <Amount>
- {
- let $head := ($it/Position/Amount)
- return sum(data($head))
- }
- </Amount>
- <Weight>
- {
- let $head := ($it/Position/Weight)
- return sum(data($head))
- }
- </Weight>
- <Length>
- {
- let $head := ($it/Position/Length)
- return sum(data($head))
- }
- </Length>
- <Width>
- {
- let $head := ($it/Position/Width)
- return sum(data($head))
- }
- </Width>
- <Height>
- {
- let $head := ($it/Position/Height)
- return sum(data($head))
- }
- </Height>
- </Position>
- </Logic>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement