Hi all,

I am looking for the equivalent instruction of XSLT attribute @omit-xml-declaration in XQuery.

My input is :

<marc>
  <marc:record *xmlns:marc="http://www.loc.gov/MARC21/slim"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"*>
    <marc:leader>01321nam a22002772a 4500</marc:leader>
    <c level="item">
      <did>
        <unitid type="division">1808001595</unitid>
      </did>
    </c>
  </marc:record>
<marc>

My query is :

declare namespace marc="http://www.loc.gov/MARC21/slim";;

for $record in db:open('marcxml_full')/marc/marc:record
return
insert node $record/c into db:open('uk_parlement_ead')/dsc
The ouput is :

<c *xmlns:marc="http://www.loc.gov/MARC21/slim"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; *level="item">
      <did>
        <unitid type="division">1808001595</unitid>
      </did>
    </c>
As you can see, there are no marc: elements in this output, hence no need for the marc: namespace.
How to get rid of @xmlns:marc and xmlns:xsi ?

Thanks a lot for your help !

Regards

Yann

Reply via email to