Globally Delete all 6 level Paragraphs
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 26
- Joined: Wed Apr 10, 2019 7:43 pm
Globally Delete all 6 level Paragraphs
I am using OxygenXML Editor. I have an XML file which has a lot of nested "procedural step" tags that drill down six paragraph levels down. However, the BREX allows a maximum of 5 paragraph levels. Does OxygenXML Editor have a toolset that will allow me to GLOBALLY select all the 6 Level Paragraphs in the XML document so I can delete them all with a single touch to the DELETE button? Or does OxygenXML have a toolset that will allow me to filter the entire XML so it only displays 6 Paragraph Level ProceduralStep tagged data? Any help will be greatly appreciated. Thank you for your time.
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: Globally Delete all 6 level Paragraphs
Post by chrispitude »
This should be straightforward. Could you post a minimal example with "before" and "after" XML content?
-
- Posts: 26
- Joined: Wed Apr 10, 2019 7:43 pm
Re: Globally Delete all 6 level Paragraphs
Chris, thank you for your post. Below are BEFORE and AFTER examples of the operation I am seeking OxygenXML Editor to perform. It involves targeting all proceduralStep para Level 6 tags within an XML file so that they can easily be deleted. Any advice you can offer will be greatly appreciated. Thank you for your time.
BEFORE proceduralStep para Level 6 tag Removal:
AFTER proceduralStep para Level 6 tag Removal:
BEFORE proceduralStep para Level 6 tag Removal:
Code: Select all
<proceduralStep Id="Para0001">
<para>Para Level 1</para>
<proceduralStep Id="Para0002">
<para>Para Level 2</para>
<proceduralStep Id="Para0003">
<para>Para Level 3</para>
<proceduralStep Id="Para0004">
<para>Para Level 4</para>
<proceduralStep Id="Para0005">
<para>Para Level 5</para>
<proceduralStep Id="Para0006">
<para>Para Level 6</para>
</proceduralStep>
</proceduralStep>
</proceduralStep>
</proceduralStep>
</proceduralStep>
</proceduralStep>
Code: Select all
<proceduralStep Id="Para0001">
<para>Para Level 1</para>
<proceduralStep Id="Para0002">
<para>Para Level 2</para>
<proceduralStep Id="Para0003">
<para>Para Level 3</para>
<proceduralStep Id="Para0004">
<para>Para Level 4</para>
<proceduralStep Id="Para0005">
<para>Para Level 5</para>
</proceduralStep>
</proceduralStep>
</proceduralStep>
</proceduralStep>
</proceduralStep>
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: Globally Delete all 6 level Paragraphs
Post by chrispitude »
Hi binar,
Try running the Delete Element refactoring operation (Tools > XML Refactoring). For the Element pattern, use this:
In the Scope and Filters dialog, set the scope to what you want. For example, to run on all .xml files in a particular directory, you would first select that directory in the Project view, then you would set the scope to Selected project resources and the Include files filter to *.xml.
This deletes the elements completely. You could also unwrap the elements and keep the content if you want, using a different refactoring operation.
- Chris
Try running the Delete Element refactoring operation (Tools > XML Refactoring). For the Element pattern, use this:
Code: Select all
proceduralStep[count(ancestor::proceduralStep) >= 5]
This deletes the elements completely. You could also unwrap the elements and keep the content if you want, using a different refactoring operation.
- Chris
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