How do I delete attributes? (and just the attribute, not the node)
Motivation: I have a db where 20% of the attributes is the same, 'title', which is never used. Deleting it could decrease the size of the db.
/William
________________________________
Please consider the environment before printing.
</pre>
<div style="FONT-FAMILY: arial;color:#525759;font-size:9pt; margin-top:15px">This e-mail and any attachments are intended only for the named recipient(s) and may contain information that is legally privileged, confidential, or exempt from disclosure under applicable law. This message may be logged for archival purposes, may be reviewed by parties at Deltek other than those named in the message header, and may not necessarily constitute an official representation of Deltek. If you have received this message in error, or are not the named recipient(s), you may not retain copy or use this e-mail or any attachment for any purpose or disclose all or any part of the contents to any other person. Any such dissemination, distribution or copying of this e-mail or its attachments is strictly prohibited. Please immediately notify the sender and permanently delete this e-mail and any attachment from your computer.</div>
Attributes are nodes, too [1]. Perhaps, you meant "and just the attribute, not the _element_". If so, the following query should do the job:
delete nodes //@title
Don't forget, that if you really want to shrink the database files, you need to execute OPTIMIZE ALL [2].
[1] http://www.w3.org/TR/2006/CR-xpath-datamodel-20060711/#dt-node [2] http://docs.basex.org/wiki/Commands#OPTIMIZE
Regards, Dimitar
Am Freitag, 16. März 2012, 15:00:12 schrieb William P. Heise:
How do I delete attributes? (and just the attribute, not the node)
Motivation: I have a db where 20% of the attributes is the same, ‘title’, which is never used. Deleting it could decrease the size of the db.
/William
Please consider the environment before printing.
This e-mail and any attachments are intended only for the named recipient(s) and may contain information that is legally privileged, confidential, or exempt from disclosure under applicable law. This message may be logged for archival purposes, may be reviewed by parties at Deltek other than those named in the message header, and may not necessarily constitute an official representation of Deltek. If you have received this message in error, or are not the named recipient(s), you may not retain copy or use this e-mail or any attachment for any purpose or disclose all or any part of the contents to any other person. Any such dissemination, distribution or copying of this e-mail or its attachments is strictly prohibited. Please immediately notify the sender and permanently delete this e-mail and any attachment from your computer.
Thanks
When I first typed it, it just started without showing any progress other than the OS busy cursor. After a couple of minutes I assumed that I had made a typo. It took 37 minutes.
/William
[cid:image001.png@01CC745B.AFAA47C0]
Wiliam P. Heise Software Developer WilliamHeise@deltek.commailto:WilliamHeise@deltek.com www.deltek.comhttp://www.deltek.com/
+45 35272369
From: Dimitar Popov [mailto:Dimitar.Popov@uni-konstanz.de] Sent: 16. marts 2012 16:23 To: basex-talk@mailman.uni-konstanz.de Cc: William P. Heise Subject: Re: [basex-talk] Delete attributes
Attributes are nodes, too [1]. Perhaps, you meant "and just the attribute, not the _element_". If so, the following query should do the job:
delete nodes //@title
Don't forget, that if you really want to shrink the database files, you need to execute OPTIMIZE ALL [2].
[1] http://www.w3.org/TR/2006/CR-xpath-datamodel-20060711/#dt-node
[2] http://docs.basex.org/wiki/Commands#OPTIMIZE
Regards,
Dimitar
Am Freitag, 16. März 2012, 15:00:12 schrieb William P. Heise:
How do I delete attributes? (and just the attribute, not the node)
Motivation:
I have a db where 20% of the attributes is the same, ‘title’, which is never used.
Deleting it could decrease the size of the db.
/William
________________________________
Please consider the environment before printing.
This e-mail and any attachments are intended only for the named recipient(s) and may contain information that is legally privileged, confidential, or exempt from disclosure under applicable law. This message may be logged for archival purposes, may be reviewed by parties at Deltek other than those named in the message header, and may not necessarily constitute an official representation of Deltek. If you have received this message in error, or are not the named recipient(s), you may not retain copy or use this e-mail or any attachment for any purpose or disclose all or any part of the contents to any other person. Any such dissemination, distribution or copying of this e-mail or its attachments is strictly prohibited. Please immediately notify the sender and permanently delete this e-mail and any attachment from your computer.
</pre>
<div style="FONT-FAMILY: arial;color:#525759;font-size:9pt; margin-top:15px">This e-mail and any attachments are intended only for the named recipient(s) and may contain information that is legally privileged, confidential, or exempt from disclosure under applicable law. This message may be logged for archival purposes, may be reviewed by parties at Deltek other than those named in the message header, and may not necessarily constitute an official representation of Deltek. If you have received this message in error, or are not the named recipient(s), you may not retain copy or use this e-mail or any attachment for any purpose or disclose all or any part of the contents to any other person. Any such dissemination, distribution or copying of this e-mail or its attachments is strictly prohibited. Please immediately notify the sender and permanently delete this e-mail and any attachment from your computer.</div>
basex-talk@mailman.uni-konstanz.de