Refactoring: comment out elements
Are you missing a feature? Request its implementation here.
-
- Posts: 93
- Joined: Fri Mar 08, 2013 8:58 am
Refactoring: comment out elements
There have been times when I've wanted to temporarily disable a whole class of elements. It would be nice, in the Refactoring options, to allow users to choose via XPath one or more elements to comment out.
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Refactoring: comment out elements
Hello,
I've logged a feature request on our issue tracking tool to implement this in a future version. We will notify this thread when this is implemented.
Meanwhile, you could make use of an XQuery Update script that does this. You have to enable XQuery Update in Options > Preferences, XML / XSLT-FO-XQuery / XQuery / Saxon-HE/PE/EE, Enable XQuery Update and make sure you use the Saxon-EE XQuery engine.
where myfile.xml is the file to update and myelement the element to comment. Alternatively, you can adjust the XPath after doc() as required.
Regards,
Adrian
I've logged a feature request on our issue tracking tool to implement this in a future version. We will notify this thread when this is implemented.
Meanwhile, you could make use of an XQuery Update script that does this. You have to enable XQuery Update in Options > Preferences, XML / XSLT-FO-XQuery / XQuery / Saxon-HE/PE/EE, Enable XQuery Update and make sure you use the Saxon-EE XQuery engine.
Code: Select all
let $params :=
<output:serialization-parameters xmlns:output="http://www.w3.org/2010/xslt-xquery-serialization">
<output:omit-xml-declaration value="yes"/>
</output:serialization-parameters>
for $par in doc("myfile.xml")//*:myelement return
replace node $par with comment {serialize($par, $params)}
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 125
- Joined: Mon Jun 09, 2003 6:02 pm
- Location: Charlottesville, Virginia USA
Re: Refactoring: comment out elements
I would also be interested in having this feature added to XML Refactoring. It is an operation that I perform fairly often. In the meantime thanks for the XQuery Update alternative!
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