Bugs item #2642135, was opened at 2009-02-26 15:25
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=713730&aid=2642135&group_id=129076

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Parser
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Dmitry A. Shaporenkov (dsha)
Assigned to: Nobody/Anonymous (nobody)
Summary: Typeswitch statement with "$var as" clauses causes crash

Initial Comment:
The following function crashes Sedna when it gets into the second (element()) 
branch:

declare function local:get-text ($n as node ()) as xs:string {
  typeswitch ($n) 
    case $t as text () return string ($t)
    case $e as element() return (
      let $child-text := (for $c in $e/child::node() return local:get-text($c))
      return 
              if (name ($e) = "link") then (  
                      if (exists ($e/child::node())) 
                      then string-join ($child-text, "")
                      else $e/@label
              ) else 
                      string-join ($child-text, "")
    )
    default return "unknown"
};

If I rewrite it using a simplified typeswitch (without "var as" clauses), it 
works just fine.



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=713730&aid=2642135&group_id=129076

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Sedna-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sedna-discussion

Reply via email to