XML refactoring preview highlights namespace declarations
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 71
- Joined: Sat Jan 07, 2017 1:23 am
XML refactoring preview highlights namespace declarations
I'm exploring the XML Refactoring tool, and I decided to try making a simple change: sec/title => sec/label
In the 'Rename element' dialog box, I specified this:
https://www.dropbox.com/s/rpiojvn5odi47 ... 1.png?dl=0
But the preview showed this, highlighting namespace declaration changes that I didn't request:
https://www.dropbox.com/s/byhwjdlxy95yd ... 2.png?dl=0
It turns out the preview also showed the changes I wanted, but I had to scroll past a number of namespace declaration changes to find them. When I clicked Finish, the changes I wanted were made, but all the highlighted namespace declarations had been deleted as well.
Shouldn't the refactoring tool make only the requested changes?
In the 'Rename element' dialog box, I specified this:
https://www.dropbox.com/s/rpiojvn5odi47 ... 1.png?dl=0
But the preview showed this, highlighting namespace declaration changes that I didn't request:
https://www.dropbox.com/s/byhwjdlxy95yd ... 2.png?dl=0
It turns out the preview also showed the changes I wanted, but I had to scroll past a number of namespace declaration changes to find them. When I clicked Finish, the changes I wanted were made, but all the highlighted namespace declarations had been deleted as well.
Shouldn't the refactoring tool make only the requested changes?
-
- Site Admin
- Posts: 275
- Joined: Thu Dec 24, 2009 11:21 am
Re: XML refactoring preview highlights namespace declarations
Hello,
I was able to obtain a similar situation using the XML document listed below:
As you can see, in my case, the namespace declaration is redundant as it appears once on the root element and once on the <other> element.
Is this also true for your documents? If not, please send us a sample to reproduce the problem.
Although these changes may be unwanted and they may clutter the preview dialog, the resulted document is XML-equivalent with the original one from the namespaces context point of view. The XML Refactoring processor tries to limit the amount of changes performed on the input documents but it is not 100% accurate. Under the hood an XML Refactoring operation is in fact an XQuery Update or XSLT transformation performed with some tweaks and restrictions in order to minimize unwanted changes. In the case I have described above, the namespaces declarations are optimized by the XQuery Update / XSLT processor which triggers the removal of the redundant declarations.
You can read more about how an XML Refactoring operation is applied on a document here: https://www.oxygenxml.com/doc/versions/ ... tools.html
Regards,
Alin
I was able to obtain a similar situation using the XML document listed below:
Code: Select all
<root xmlns:ns="my-ns">
<other
xmlns:ns="my-ns"
ns:attr="value"/>
<sec>
<title>My Title</title>
</sec>
</root>
Is this also true for your documents? If not, please send us a sample to reproduce the problem.
Although these changes may be unwanted and they may clutter the preview dialog, the resulted document is XML-equivalent with the original one from the namespaces context point of view. The XML Refactoring processor tries to limit the amount of changes performed on the input documents but it is not 100% accurate. Under the hood an XML Refactoring operation is in fact an XQuery Update or XSLT transformation performed with some tweaks and restrictions in order to minimize unwanted changes. In the case I have described above, the namespaces declarations are optimized by the XQuery Update / XSLT processor which triggers the removal of the redundant declarations.
You can read more about how an XML Refactoring operation is applied on a document here: https://www.oxygenxml.com/doc/versions/ ... tools.html
Regards,
Alin
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 71
- Joined: Sat Jan 07, 2017 1:23 am
Re: XML refactoring preview highlights namespace declarations
Hi Alin,
Yes, the 'xlink' namespace is also defined on the root element of my document. I don't know why the redundant declaration occurs, but unfortunately I have no control over the files I'm given to work with.
It would be convenient if there were an 'Ignore namespaces' option, as there is in the Diff tool.
Yes, the 'xlink' namespace is also defined on the root element of my document. I don't know why the redundant declaration occurs, but unfortunately I have no control over the files I'm given to work with.
It would be convenient if there were an 'Ignore namespaces' option, as there is in the Diff tool.
-
- Site Admin
- Posts: 275
- Joined: Thu Dec 24, 2009 11:21 am
Re: XML refactoring preview highlights namespace declarations
Hello,
Thank you for your feedback! I have logged your request in our issue tracking tool.
Regards,
Alin
Thank you for your feedback! I have logged your request in our issue tracking tool.
Regards,
Alin
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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