Skip to content

Running stix2html in saxon

mattcoarr edited this page Nov 15, 2013 · 1 revision

Here are the steps I followed:

Initial Setup

  1. Get the current release of stix_to_html

  2. make the directory c:\stix (windows) or ~/stix (mac and linux)

  3. "cd c:\stix" (windows) or "cd ~/stix" (mac/linux)

  4. run "git clone https://github.com/STIXProject/Tools.git"

  5. cd Tools

  6. run "git checkout stix_to_html-v1.0b2a"

  7. If you don't already have a copy of the saxon jar (the open source HE version or the commercial PE and EE versions will work), download it from http://saxon.sourceforge.net/

  8. Place the saxon jar file in a directory, I'll refer to that directory as %SAXON_HOME% (windows) or $SAXON_HOME (mac, linux)

  9. Open a command prompt (or terminal) window and cd to the directory where you cloned the stix tools repository:

  • mac/linux: cd ~/stix/Tools/stix_to_html
  • windows: cd c:\stix\stix_to_html
  1. Process a single file or a whole directory of files:
  • single file

    • mac/linux:
      • java -cp $SAXON_HOME/saxon9he.jar net.sf.saxon.Transform -s:examples/STIX_Phishing_Indicator.xml -xsl:stix_to_html.xsl -o:examples/STIX_Phishing_Indicator.html
    • windows:
      • java -cp %SAXON_HOME%\saxon9he.jar net.sf.saxon.Transform -s:examples\STIX_Phishing_Indicator.xml -xsl:stix_to_html.xsl -o:examples\STIX_Phishing_Indicator.html
  • whole directory of files

    • first go into Tools/stix_to_html/examples, "mkdir input output", and copy the two xml files from examples into examples/input.
    • mac/linux:
      • java -cp $SAXON_HOME/saxon9he.jar net.sf.saxon.Transform -s:examples/input -xsl:stix_to_html.xsl -o:examples/output
    • windows:
      • java -cp %SAXON_HOME%\saxon9he.jar net.sf.saxon.Transform -s:examples\input -xsl:stix_to_html.xsl -o:examples\output