0

Have a plain text file with terms and conditions mentioned in it. Have to read it in XSL. How can this be done?

  • Do you have to do this with XSLT? Maybe at least a pre-processing step to transform the input into XML? What do you need to do with the input file? Just copy/include verbatim or process somehow? – Thilo May 05 '16 at 11:48
  • I Just need to display the file as it is. The reason input is taken as a file is so that the file can be easily modified. – Mufaria Razak May 05 '16 at 11:50
  • I already have a XML file which is generated by the system. But the requirement is not to include the contents in the XML. Instead, take it from an input text file. – Mufaria Razak May 05 '16 at 11:53
  • Yes have to do it with XSLT. – Mufaria Razak May 05 '16 at 12:00
  • 1
    Possible duplicate of [Regular text file to XML using XSLT](http://stackoverflow.com/questions/5675889/regular-text-file-to-xml-using-xslt) – kjhughes May 05 '16 at 13:16

1 Answers1

0

Providing you are using an XSLT 2.0 (or later) processor such as XmlPrime or Saxon 9, you can use the unparsed-text function. Quoting the specification:

"The fn:unparsed-text function reads an external resource (for example, a file) and returns a string representation of the resource."

Tim Mills
  • 46
  • 1