In "Add/Change attribute" refactoring, support value XPath expressions
Are you missing a feature? Request its implementation here.
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
In "Add/Change attribute" refactoring, support value XPath expressions
Post by chrispitude »
Let's say I have a table like this:
I would like each row to have an @id value equivalent to its first-column value, so it can be specifically referenced.
It would be great if the Add/Change attribute refactoring operation had a "Evaluate value as XPath" that would evaluate the given value using the XPath 3.0 xsl:evaluate() function. Then, I could run the refactoring operation to set the @id attribute, with the value specified as
Special characters could be handled, if needed:
In our actual DITA content, we have multiple such .dita topic files of error message tables, each with many (potentially hundreds) of rows. If the refactoring operation had such a feature, it would be trivial to process the entire set in one refactoring operation on the selected resources.
A sample DITA topic file is attached:
image.png
I would like each row to have an @id value equivalent to its first-column value, so it can be specifically referenced.
It would be great if the Add/Change attribute refactoring operation had a "Evaluate value as XPath" that would evaluate the given value using the XPath 3.0 xsl:evaluate() function. Then, I could run the refactoring operation to set the @id attribute, with the value specified as
Code: Select all
string(entry[1])
Code: Select all
string(entry[1]) => replace("[^-.A-Za-z0-9_:]+", "_")
A sample DITA topic file is attached:
error_messages.zip
You do not have the required permissions to view the files attached to this post.
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: In "Add/Change attribute" refactoring, support value XPath expressions
Post by chrispitude »
Here is the refactoring operation I used for now:
set-evaluated-attribute.zip
You do not have the required permissions to view the files attached to this post.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: In "Add/Change attribute" refactoring, support value XPath expressions
Hi Chris,
Makes sense, thanks for sharing your samples and the custom XML refactoring action you created.
I had a similar need when replying to an older forum thread:
post66324.html#p66324
So there is already this registered issue, I added your details to it:
EXM-50799 Add/change attribute value could be an xpath expression
Regards,
Radu
Makes sense, thanks for sharing your samples and the custom XML refactoring action you created.
I had a similar need when replying to an older forum thread:
post66324.html#p66324
So there is already this registered issue, I added your details to it:
EXM-50799 Add/change attribute value could be an xpath expression
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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