Working with XSLT files

Extensible Stylesheet Language Transformations (XSLT) can be used to map custom metadata fields to ENPS wire fields, allowing ingested XML stories to be saved to the server as ENPS formatted XML files. This allows a wide range of agency feeds to be handled.

This section assumes a working knowledge of XSLT files.

Create Custom XSLT

To create a custom XSL transform:

  1. Copy a sample XSL transform file from the \NWP\XSL folder on the ENPS WORK drive.

  2. Rename the file appropriately - perhaps include the name of the wire being ingested.

  3. Use a text editor such as Notepad to modify the settings in the XSL transform file as determined by the wire format.

  4. Save the file.

  5. Open the \NWP\NWP.ini file in a text editor.

  6. Add the following to the [NWP] section:

    CustomXSLFiles=1
  7. Restart the News Wire Profiler (NWP).

  8. Create your new wire as explained in Wires Via FTP, making sure to:

    1. Select the XSL file that you just created from the Story Format menu.

    2. Set the Story Start and Story Stop codes to match the root tag of the XML file.

      The root tag is the first tag in the file after the <?xml ...> XML header.

      In the following example the Start Code is <NewsML and Story Stop code is /NewsML>. Exclude the close bracket > and open bracket < from the codes.

      <?xml version="1.0" encoding="utf-8"?>
      <NewsML Version="1.2">
          <NewsEnvelope>
              <TransmissionId>1025</TransmissionId>
              <DateAndTime>20090927T103318Z</DateAndTime>
           ...
      </NewsML>