Tomsovi

  • Increase font size
  • Default font size
  • Decrease font size
XSLT

Porovnávání textů v XSLT

E-mail Print PDF
There are no translations available.

Níže uvedený postup je vhodný pro porovnání dvou textů, které se liší pouze v rámci jednotlivých řádků, avšak řádky v textu nepřibývají, neubývají ani se nikam nepřesouvají.

Šablona využívá rekurzi, což některým parserům nedělá dobře. Např. Saxon.

Funguje však např. s MSXML - vyzkoušeno.

XML

<?xml version='1.0' encoding='windows-1250'?>
<?xml-stylesheet type="text/xsl" href="compare.xsl"?>
<texts>
<text.old>Hello world!
This is a sample text.

Sample text continues.
This is the end.
That's all folks!
</text.old>
<text.new>Hello world!
This is different text.

Sample text continues.
This is the END.
That's all folks!
</text.new>
</texts>
Read more...