Thanks Arve, but I still have one problem. It turns out I need to do it
more than once:

declare option db:parser "html";
declare option db:htmlparser "nodefaults=true";
declare option output:doctype-public "-//W3C//DTD XHTML 1.0 Transitional//EN";
declare option output:doctype-system 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";;
copy $c := doc("/dev/stdin")
modify (
    delete nodes $c//*:span[@class="pipe"],





    BUT WAIT, I also want to add ALT tags to all IMG elements.

    This turns out to be not a single operation.

       insert node attribute alt {'BLA'} into $c//*:img

    won't work. So how can I squeeze in a

       for $i in $c//*:img
       return insert node attribute alt {'BLA'} into $i

    somewhere in my otherwise working basex 7.8 program?




)
return
 <html>
  <head>
    {$c//*:head/*:meta[@http-equiv="Content-Type"]}
    {$c//*:head/*:base}
    <style type="text/css">dl {{ border-bottom: thin solid;}}</style>
    <title>doing - raGii</title>
  </head>
  <body>
    {for $l in $c//*:dl return $l}
  </body>
</html>

Reply via email to