[Bug 1469] New: [FO] fn:insert-before: allow empty sequence for position

http://www.w3.org/Bugs/Public/show_bug.cgi?id=1469

           Summary: [FO] fn:insert-before: allow empty sequence for position
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Functions and Operators
        AssignedTo: ashok.malhotra@oracle.com
        ReportedBy: mrys@microsoft.com
         QAContact: public-qt-comments@w3.org
 BugsThisDependsOn: 1467


position should be allowed to be empty. Often this value is  
being calculated and the static type of the calculation will result in an 
optionally empty type. Proposed rewording:

fn:insert-before( $target  as item()*, 
$position  as xs:integer?, 
$inserts  as item()*) as item()* 

Summary: Returns a new sequence constructed from the value of $target with the 
value of $inserts inserted at the position specified by the value of 
$position. (The value of $target is not affected by the sequence construction.)

If $target is the empty sequence, $inserts is returned. If $inserts is the 
empty sequence, $target is returned. If $position is the empty sequence, the 
error FORG--99 is being raised.

The value returned by the function consists of all items of $target whose 
index is less than $position, followed by all items of $inserts, followed by 
the remaining elements of $target, in that sequence.

If $position is less than one (1), the first position, the effective value of 
$position is one (1). If $position is greater than the number of items in 
$target, then the effective value of $position is equal to the number of items 
in $target plus 1.

Add FORG--99 as:
Invalid position has been passed to fn:substring, fn:insert-before, fn:remove 
or fn:subsequence.

Received on Thursday, 19 May 2005 20:06:42 UTC