XML n00b- need to delete a large number of tags
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 1
- Joined: Thu May 07, 2009 4:13 pm
XML n00b- need to delete a large number of tags
Hi there,
I need to delete a lot of tags from a large XML file. The thing is, they all have different text in them. This is part of the file:
<c id="ref8427" level="file">
<did>
<unittitle>The History of Arrowroot Production in Barbados and the Chalky Mount Arrowroot Growers' Association: A Peasant Marketing Experiment that Failed</unittitle>
<unitid>RISM 20047</unitid>
<container type="item">20047</container>
<physdesc>
<extent>p. 131-152.</extent>
</physdesc>
<unitdate normal="1965/1965">November 1965</unitdate>
<physloc id="ref8429" label="Location note"></physloc>
<origination label="creator">
<persname source="ingest">Handler, Jerome S.</persname>
</origination>
</did>
<odd id="ref8428">
<head>General note</head>
<p>Original marc record data: MARC Leader: 00455nam ref9200109u 4500 100-1- a: Handler, Jerome S. 245-1-4a: The History of arrowroot production in Barbados and the Chalky Mount Arrowroot Growers' Association: b: a peasant marketing experiment that failed. 300- - a: p. 131-152. 650- -4a: Arrowroot z: Barbados. 730-4-1a: The Journal of the Barbados Museum and Historical Society, n: vol. 31, no. 3, November 1965. 852- - h: VF p: 20047 961-W-Lt: 36 u: February 2000 </p>
</odd>
<controlaccess>
<subject source="ingest">Arrowroot</subject>
<subject source="ingest">Barbados</subject>
</controlaccess>
</c>
I need the <unitid> tag deleted. Any idea on how to do this?
Thanks!!
I need to delete a lot of tags from a large XML file. The thing is, they all have different text in them. This is part of the file:
<c id="ref8427" level="file">
<did>
<unittitle>The History of Arrowroot Production in Barbados and the Chalky Mount Arrowroot Growers' Association: A Peasant Marketing Experiment that Failed</unittitle>
<unitid>RISM 20047</unitid>
<container type="item">20047</container>
<physdesc>
<extent>p. 131-152.</extent>
</physdesc>
<unitdate normal="1965/1965">November 1965</unitdate>
<physloc id="ref8429" label="Location note"></physloc>
<origination label="creator">
<persname source="ingest">Handler, Jerome S.</persname>
</origination>
</did>
<odd id="ref8428">
<head>General note</head>
<p>Original marc record data: MARC Leader: 00455nam ref9200109u 4500 100-1- a: Handler, Jerome S. 245-1-4a: The History of arrowroot production in Barbados and the Chalky Mount Arrowroot Growers' Association: b: a peasant marketing experiment that failed. 300- - a: p. 131-152. 650- -4a: Arrowroot z: Barbados. 730-4-1a: The Journal of the Barbados Museum and Historical Society, n: vol. 31, no. 3, November 1965. 852- - h: VF p: 20047 961-W-Lt: 36 u: February 2000 </p>
</odd>
<controlaccess>
<subject source="ingest">Arrowroot</subject>
<subject source="ingest">Barbados</subject>
</controlaccess>
</c>
I need the <unitid> tag deleted. Any idea on how to do this?
Thanks!!
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: XML n00b- need to delete a large number of tags
Post by sorin_ristache »
Hello,
You have to find a common feature of all the elements that you want to remove from the XML file. When you have this rule you can write an XSLT stylesheet that removes all the elements that match your rule.
Regards,
Sorin
You have to find a common feature of all the elements that you want to remove from the XML file. When you have this rule you can write an XSLT stylesheet that removes all the elements that match your rule.
Regards,
Sorin
Return to “General XML Questions”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service