Bugs item #2642135, was opened at 2009-02-26 18:25
Message generated for change (Comment added) made by shcheklein
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: Query Execution
>Group: Sedna (current)
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Dmitry A. Shaporenkov (dsha)
>Assigned to: Ivan Shcheklein (shcheklein)
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.



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

>Comment By: Ivan Shcheklein (shcheklein)
Date: 2009-02-26 20:14

Message:
I've tried to run:

local:get-text(<a>aaaaa</a>)

It works fine for me.

Possibly it crashes on certain $n value(s)?

Dmitry, could you provide us with $n value(s) to reproduce the issue?

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

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