XML Refactoring: unwrap all spans with just a @lang attribute
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 14
- Joined: Sun Apr 01, 2012 1:17 pm
XML Refactoring: unwrap all spans with just a @lang attribute
I'm trying to unwrap all spans that just have an @lang attribute
in the XPath builder I'm using the following expression which works
`//span[@lang and count(@*) = 1]`
but when I try to use the same expression using XML Refactoring I get a "No resources were affected" message?
am I missing something?
in the XPath builder I'm using the following expression which works
`//span[@lang and count(@*) = 1]`
but when I try to use the same expression using XML Refactoring I get a "No resources were affected" message?
am I missing something?
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: XML Refactoring: unwrap all spans with just a @lang attribute
Hi,
The XML refactoring used by Oxygen uses some invisible attribute (attributes which are not serialized to the XML content) on each element in order to keep track of various information. So the Xpath selector "not(@*)" will never be true.
Maybe you can try this more complex xpath expression which skips over our "oxy_" specific attributes when counting:
We already have an internal issue to see what we can do about this on our side to try and make your original xpath expression work.
The XML refactoring used by Oxygen uses some invisible attribute (attributes which are not serialized to the XML content) on each element in order to keep track of various information. So the Xpath selector "not(@*)" will never be true.
Maybe you can try this more complex xpath expression which skips over our "oxy_" specific attributes when counting:
Code: Select all
count(@* except @*[starts-with(local-name(), 'oxy_')])
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