Parameter for XML Refactoring tool that is a file

<oXygen/> general issues.
LeeHart
Posts: 3
Joined: Tue Oct 08, 2019 3:00 am

Parameter for XML Refactoring tool that is a file

Post by LeeHart » Mon Apr 26, 2021 1:56 am

Some of our XML files are related to each other, even though they are stored in different packages. I'd like to add a comment to elements in one package if the descriptions for the thing being described are overridden in another package. This would be useful as a reminder - if the description is being changed, the description for the override should probably also be updated. Currently the file path is just a text field, but it really would be helpful if the parameter was a file path and the user could use a UI to navigate to the target file.

Is there any way to have a parameter for a XML Refactoring tool be a file reference? Bonus points if I could specify an XPath-based constraint that the target file must meet.

Thanks,

Lee

Radu
Posts: 7464
Joined: Fri Jul 09, 2004 5:18 pm

Re: Parameter for XML Refactoring tool that is a file

Post by Radu » Mon Apr 26, 2021 2:02 pm

Hi Lee,

Please see some answers below:
Currently the file path is just a text field, but it really would be helpful if the parameter was a file path and the user could use a UI to navigate to the target file.
Is there any way to have a parameter for a XML Refactoring tool be a file reference?
I added an internal issue to consider this, in the meantime you can probably paste the path to the file in the parameter value text field. Or maybe somehow use the XSL collection function to locate that file directly from the XSLT?
Bonus points if I could specify an XPath-based constraint that the target file must meet.
You can probably set the parameter to have an XPath type:

Code: Select all

<parameter label="Name" name="param-name" type="XPATH" ...>
and use in the XSLT stylesheet "xsl:evaluate" to evaluate the xpath in a certain context:

Code: Select all

 <xsl:evaluate xpath="$attribute_xpath" as="attribute()*" context-item="/"/>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply