Find all/ Replace all particular attributes only
Questions about XML that are not covered by the other forums should go here.
Find all/ Replace all particular attributes only
Hi Guys,
So, I have a bunch of XML files, where the label size is a bit small, so, I want to change only the height, which is the fourth element of the layout attribute, while the other factors remain the same, so, the text is not cut-off. How can I do that at once, using for eg, Find all in Oxygen. Here is an example of a line present in all scripts. I am able to find them all at once, using find all, but cannot replace them all without modifying all the elements.
<BoundLabel layout="370.0,225.0,50.0,10.0" font="bold 11.0pt Tahoma" foreground="green" halign="left" mouseOver="highlight">
In the above line, I want to change 10 to 25, while other elements retain their values.
So, I have a bunch of XML files, where the label size is a bit small, so, I want to change only the height, which is the fourth element of the layout attribute, while the other factors remain the same, so, the text is not cut-off. How can I do that at once, using for eg, Find all in Oxygen. Here is an example of a line present in all scripts. I am able to find them all at once, using find all, but cannot replace them all without modifying all the elements.
<BoundLabel layout="370.0,225.0,50.0,10.0" font="bold 11.0pt Tahoma" foreground="green" halign="left" mouseOver="highlight">
In the above line, I want to change 10 to 25, while other elements retain their values.
Re: Find all/ Replace all particular attributes only
Hi,
Oxygen's Find/Replace dialog has an "Xpath" field which you can set to //BoundLabel/@layout in order to limit the search.
Then enable the "Regular Expression" checkbox and search for:
replace with:
Basically I'm matching all four numbers and replacing keeping the first, second and fourth unmodified but with a custom value for the third one.
Another way to do this if you are comfortable with writing XSLT or XQuery would be to write a custom XSLT stylesheet and use it in an XML refactoring operation.
https://www.oxygenxml.com/doc/versions/ ... tools.html
Regards,
Radu
Oxygen's Find/Replace dialog has an "Xpath" field which you can set to //BoundLabel/@layout in order to limit the search.
Then enable the "Regular Expression" checkbox and search for:
Code: Select all
(\d*\.\d),(\d*\.\d),(\d*\.\d),(\d*\.\d)
Code: Select all
\1,\2,60.0,\4
Another way to do this if you are comfortable with writing XSLT or XQuery would be to write a custom XSLT stylesheet and use it in an XML refactoring operation.
https://www.oxygenxml.com/doc/versions/ ... tools.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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