xslt on apple mac

Apple Mac

1. How to run XT on a Mac
2. Viewing XSLT output on the Mac
3. Mac special characters?
4. XSLT on mac.

1.

How to run XT on a Mac

Chuck White

I finally figured out how to run XT on a Mac (non OSX, which
is a non-issue), and thought I'd share it with the group.

As you know, running XT or FOP requires a command line
interface, which of course the Mac doesn't have unless
you're using OSX. I have tried this before, to no avail, but
the MRJ (the Apple Java runtime) was updated so I downloaded
it, and perhaps that is why XT now runs. I don't know the
answer.


Anyway, here are the instructions:

First, you need to have JBindery, which I believe comes with
the MRJSDK (I don't think it's part of the
runtime). You can find the MRJ 2.1 SDK (the Apple Java
software development kit) at
http://developer.apple.com/java/text/download.html.

Then comes the fun part: trying to build command lines using
a GUI. It will help if you refer to the following command
line structure James Clark has on his XT page:

java -Dcom.jclark.xsl.sax.parser=your-sax-driver
com.jclark.xsl.sax.Driver source stylesheet result

The directions below will compare the GUI stuff with the
corresponding commands one would normally use in a command
line environment.

1. When you launch JBindery, you're presented with a
screen with six icons on the left and a series of text
fields on the right. Clicking on the top icon reveals the
fields you use to create your "command line"
setup. The top-most field is called "Class
name". Here you should input
'com.jclark.xsl.sax.Driver'. This corresponds to the
command of the same name above, and is the name of the main
class file. The field below that is called "Optional
parameters". Here, you should input the file names at
the end of the above command line: "source stylesheet
result". I input stuff based on the XT sample files:
"slidesTest.xml slides2.xsl slidesOut.xml".  Below
the "optional parameters" fields are a redirect
stdout drop down menu and a redirect stdin drop down menu. I
left the redirect stdin alone, but for the redirect stdout I
named a file called "test.out". This text file will
troubleshoot any problems you're having, and should be
empty if all is well. This first set of fields also has a
"Save Settings" option, which is of course a good
idea.

2. Next, set up the class path (I guess this is normally a
first step, but, hey, I'm on a Mac), which you access
with the next icon on the left, the classpath icon. This is
actually pretty easy in JBindery. You just use the dialog
box that is revealed on the right when the classpath icon is
clicked to browse for any jar files you think you'll be
using. I put in all the jar files I anticipate using,
including XP, SAX, and even FOP, since I know I want to use
this later. I put the XT jar files in the same folder as
JBindery so as not to deal with any other classpath issues
for now.

3. The next icon on the left is the properties icon. This is
sort of a confusing interface, but your goal is to mimic the
properties shown first in the XT command line I listed
previously:
"-Dcom.jclark.xsl.sax.parser=your-sax-driver". You'll
see three fields on the right hand side of the dialog box
after clicking the properties icon.  Ignore the top
field. It will fill in automatically when you fill in the
two fields below it. In the left field I input
"jclark.xsl.sax.parser". In the right field, I input
"com.jclark.xml.sax.Driver". You can put whatever
SAX driver you want, of course.

I should mention that the slides.xsl example included with
the XT build doesn't work with these settings. I'm
thinking it's just cuz I'm using an older SAX
driver, though, and need to try a different one. I had to
make a simpler xsl file, which I was able to output
successfully.

If there is interest and/or need, I'd be happy to post
some GIF files showing how the screens should look for
JBindery. If anyone tries this and can't get it working,
feel free to e-mail me and I'll try to help.

            

2.

Viewing XSLT output on the Mac

Jeremy Quinn



I have XT/XP/SAX running on >Apple's MRJ SDK 2.1.4.
The tests run, my own scripts run (from my win32 >xt.exe
development), but the output is giving me the wrong line
breaks >such that I can only open the resulting files on
UNIX, that dread ^M pops >up everywehre so nothing will
open these files (BBedit, all my old >faithfuls, and the
Mac finder calls the .xml files graphics . . . go
>figure-- Microsoft isn't the only hokey file
response feedback sometimes).

It sounds like you need to re-build your desktop after
having assigned the .xml (and .xsl) suffixes to BBedit in
the Internet CP. (There are also droplets that will batch
set file type/creator for you).

BBEdit opens, views, edits and saves files with any line
ending, no problem.  It also handles MacRoman (obviously :)
and Unicode, but not Latin1 unfortunately.

            

3.

Mac special characters?

Ronald Boettcher


>
>>In my hex editor, the text at line 27 is not
>> 
>>RESTO éà
>>
>>but
>>
>>RESTO ?? !"
>>
>>or in hex
>>
>>52 45 53 54 4F 20 8E 88 20 21 22
>>
>>The characters 8E and 88 have no defined meaning in iso-8859-1, they
>>certainly don't represent e acute and a grave.
>>    
>>
>
>These are indeed MacRoman. 
>The IANA-approved names to use are "macintosh" or
>"csMacintosh" or "mac", 
>e.g. <?xml version='1.0' encoding='macintosh'?>.
>Good luck finding an XML parser that will decode it, though.
>

The Oracle parser will do this (with JRE 1.3.1 international version or 1.4.x), but you have to specify the encoding with the Java encoding names: "MacRoman" or "MacCentralEurope".

Of course, you can use Saxon as the XSLT processor furthermore:

java -cp \
/usr/local/java/saxon/saxon.jar: \
/usr/local/java/oracle_xml/lib/xmlparserv2.jar 
com.icl.saxon.StyleSheet -x oracle.xml.parser.v2.SAXParser ...

Notice: for production use you need a proper license or support agreement to use the Oracle XDK ;-).

4.

XSLT on mac.

Marc Liyanage

I wrote a free developer's tool for learning/using XSLT and XSL-FO which runs on Mac OS X. It uses the FOP engine and Apple's native Quartz PDF rendering to provide instant feedback. It is used extensively in-house by our software engineers, and by many people all over the net.

You can view a few screenshots at http://www.entropy.ch/software/macosx/#testxslt .

It also has these niceties:

- 4 different XSLT processors to check deviations between implementations (has happened before...)
- in-application rendering of HTML output using Apple's WebKit HTML engine.
- in-application rendering of XSL-FO output using FOP
- smart tag completion
- useful example data in the form of the application's readme file.

This tool might also be of interest for the DocBook Mac OS section. I=20 use DocBook myself and the tool is able to handle DocBook=20 transformation using the Libxslt processor.

Hope this information is useful to you.