I met a problem when I try to create delete function,my current codes are:
Xquery:
declare variable $d as xs:string; declare variable $p as xs:string;
let $xp := saxon:evaluate(concat("doc('",$d,"')",$p))
return document {for $n in doc($d)/* return qsx10p8:delete($n, $xp)}
declare function qsx10p8:delete
($n as node(), $xp as node())
as node() {
if ($n[self::element()])
then element
{fn:local-name($n)}
{for $c in $n/(|@*)
return qsx10p8:delete($c, $xp),
if (some $x in $xp satisfies ($n is $x))
then ()
else ($n/text())}
else $n
};
if the input are: $d = C:/supplier.xml and $p= /Suppliers/Supplier/* the result is:
""
but i want the result to be "" Is ther anyway to edit my function codes to remove those necessary tags as well?
thank you