XML to OPML

Questions about XML that are not covered by the other forums should go here.
epm
Posts: 1
Joined: Fri Jan 27, 2012 4:43 pm

XML to OPML

Post by epm »

New at the XML and transformation game, but hoping I can be pointed in the right direction by this forum.

I am looking to export an XML rendition of a standard medical terminology into OPML for ontology modelling.

<Heading0>Chronic rheumatic heart diseases</Heading0>
<Heading1></Heading1>
<Heading2></Heading2>
<Heading3></Heading3>
<Heading4></Heading4>
<Heading5></Heading5>
<Heading6></Heading6>
<Heading7></Heading7>
<Heading8></Heading8>


<Heading0></Heading0>
<Heading1>Rheumatic mitral valve diseases</Heading1>
<Heading2></Heading2>
<Heading3></Heading3>
<Heading4></Heading4>
<Heading5></Heading5>
<Heading6></Heading6>
<Heading7></Heading7>
<Heading8></Heading8>


<Heading0></Heading0>
<Heading1></Heading1>
<Heading2>Mitral stenosis</Heading2>
<Heading3></Heading3>
<Heading4></Heading4>
<Heading5></Heading5>
<Heading6></Heading6>
<Heading7></Heading7>
<Heading8></Heading8>

From what I gather, this transformation to OPML is fairly straight forward using XSLT. Wondering if people here have preformed similar transformations in the past, if they have a snippet source I could look at, and any pointers to how this would be accomplished in Oxygen.

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

Re: XML to OPML

Post by adrian »

Hi,

If you already have your data in XML format(in your sample it looks like a raw data import to XML) you need a custom XML Stylesheet(XSLT) that transforms your specific XML document to OPML. To write such a stylesheet you would need some XML knowledge and also a clear specification of the structure of the source XML document and the destination OPML format.

To apply an XML transformation in Oxygen, you have to create and associate a transformation scenario with the current file(Document -> Transformation -> Configure Transformation Scenario, New). Set the XSL URL to the appropriate stylesheet and press the Transform now button.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply