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

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


advertisement
 

Creating Custom Export Filters for StarOffice with XSLT : Page 2

Convert StarOffice documents to other formats using XSLT.


advertisement

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


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
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date