Is transforming an XML snippet supported?

Oxygen general issues.
<thomas/>
Posts: 3
Joined: Thu Jan 27, 2011 7:15 pm

Is transforming an XML snippet supported?

Post by <thomas/> »

Dear <oXygen/> support,

Is transforming an XML snippet, more precisely a selection containing a tree fragment from an XML document, supported?

What I'm looking for is roughly this:
I have an XML file open in the XML Editor which contains some XML markup that I want to transform in-place into some other XML markup. As an example, the following:

Code: Select all

<snippet>
<title>Some name</title>
<data something="foo" thing="bar">some useful data</data>
</snippet>
...should be transformed into:

Code: Select all

<person>
<name>Some name</name>
<fact key="foo"/>
<fact key="bar"/>
</person>
(Just as an example.)

I'm not that familiar with <oXygen/> yet, but from what I understand, a "transformation scenario" could be the right tool, since the above would actually only need some XSLT.
However, I would like to apply the transformation in-place, i.e., I'm imagining the following work-flow:
1) select the XML snippet in the XML Editor
2) invoke the transformation which directly replaces the selected snippet in the currently edited file

(I deliberately wrote "transformation" instead of "transformation scenario," since it seems to me that this kind of work-flow could also be called a "refactoring.")

Is something like this supported by <oXygen/>, applying some XSLT to a selection?
Or is there some other means to easily achieve what I'm intending to do that I haven't found yet?

Thomas.
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: Is transforming an XML snippet supported?

Post by adrian »

Hello,

Unfortunately this selected snippet transformation behavior isn't supported by Oxygen. Oxygen only performs XSLT/XQuery transformation at file/resource(URL) level.

I believe an Oxygen extension/plugin that does this could be implemented, but this requires some Java development knowledge. I don't think this qualifies as simple means to achieve the desired result.

If you are willing to attempt this, the necessary SDK can be found here(OxygenPluginsDevelopmentKit.zip):
http://www.oxygenxml.com/developer.html ... er_Plugins

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<thomas/>
Posts: 3
Joined: Thu Jan 27, 2011 7:15 pm

Re: Is transforming an XML snippet supported?

Post by <thomas/> »

Hello Adrian,

Thank you for your quick reply.

I agree, writing an Oxygen plugin doesn't qualify as a simple means...

Nevertheless, thanks for the pointer to the SDK. I will have a look into it.

Best regards,
Thomas.
Post Reply