The source file contains
Hello World, this is a nice world
The output desired applying the XSLT to the input file:
<Hello_World message="this is a nice world"/>
I know I can use unparsed-text
in XSLT 2.0 easily, but I need do it with XSLT 1.0.
I browsed a while, and I can't find something useful.
Is it posible? I need to use Xalan XSLT processor.
I think this question is challenging.
If you can use XSLT 2.0 you could use unparsed-text() ... Text File (Do not use the text file as direct input to the XSLT.) ! ITEM_NAME Item value !
If you have been experiencing issues using the XSLT format for Positive Pay, that is because Microsoft deprecated the XSLT format as of March 14, 2022.
Web browsers: Safari, Chrome, Firefox, Opera and Internet Explorer all support XSLT 1.0 (only). Browsers can perform on-the-fly transformations of XML files and display the transformation output in the browser window.
Extensible Stylesheet Language Transformations (XSLT), better known as XSL transformations, is a language for transforming Extensible Markup Languague (XML) documents into other structured documents.
It is not possible for the input document to be plain text because the input to an XSLT 1.0 transformation must be well-formed XML.
Here are some alternative ways to access plain text in an XSLT transformation:
xsl:param
).Here's an example of the external entity technique:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wrapper [
<!ENTITY textFile SYSTEM "file.txt">
]>
<wrapper>&textFile;</wrapper>
(Note that this last option could be challenging given XSLT 1.0's limited string processing abilities, but for some data, it may be viable.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With