Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Creating Custom Export Filters for StarOffice with XSLT : Page 2

Convert StarOffice documents to other formats using XSLT.


advertisement

Adding an XML Filter Entry

When you've created your stylesheet, you need to add it to StarOffice's list of XML filters. Select "Tools - XML Filter Settings" from the menu and click "New" to display the "New Filter" dialog. Fill in the information about your filter. The field for the filename of your stylesheet is on the Transformation tab. When you're done, click OK. Figure 4 shows the output HTML.

Running the Transformation

Now you're ready to export your StarOffice file to another format using XSLT. Select "File - Export" from the menu. You should see your new file type (for example, "Poems By Date") in the dropdown list.

But What About Testing?

Exporting again and again is not the most efficient way to test your code. It's better to test your stylesheet in an XML editor, if you can. I loaded my stylesheet, along with a copy of content.xml, into XMLSpy. In XMLSpy, you can easily assign a stylesheet to an XML file and press F10 to test the transformation (see Figure 5).




Figure 4. Output HTML from XML Filter: The name you enter in the "Name of File Type" field is the name that will be displayed in the "File - Export" dialog.
 
Figure 5. Testing the Stylesheet: A good XML editor should provide some way of testing your XSL stylesheet.

The example stylesheet I've included with this article is a bit simpler than the ones I actually used for my project, but it's a starting point.



Rose Kelleher is a freelance writer.
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap