Subject:Stylus Studio has encountered a problem and needs to close!!! Author:kir sid Date:28 Apr 2006 04:59 AM
Have an XQUERY code - just a recursive function and its calling
declare function local:swizzle($n as node()) as node()
{
typeswitch($n)
case $pi as processing-instruction()
return processing-instruction {name($pi)} {$pi}
case $cm as comment ()
return comment {$cm}
case $t as text ()
return text {$t}
case $a as attribute()
return attribute {fn:name($a)} { fn:string($a) }
case $e as element()
return element
{ fn:local-name($e) }
{ for $c in $e/(* | @* | text() | comment() | processing-instruction()) return local:swizzle($c) }
case $d as document-node()
return document
{ for $dd in $d/(*| @* | text()| comment()| processing-instruction()) return local:swizzle($dd) }
default return $n
};
local:swizzle(fn:doc("D:\try.xml"))
and have a simple XML
<?xml version="1.0" encoding="UTF-8"?>
<m_action name="var"/>
Running of code written above with stylus studio 2006 Prof Edition (Build 501h) lead to fatal error with no diagnosis. Application just closed!!!! But if one change calling of local:swizzle to local:swizzle(fn:doc("D:\try.xml")/*), then no problem