File: Data.xml
<?xml version="1.0"?>
<message>You can use literal result elements in stylesheets.</message>
File: Transform.xslt
<stylesheet version="1.0"
xmlns="http://www.w3.org/1999/XSL/Transform">
<output method="xml" indent="yes" />
<template match="/">
<msg xmlns="http://www.java2java.com/msg">
<apply-templates
xmlns="http://www.w3.org/1999/XSL/Transform" />
</msg>
</template>
</stylesheet>
Output:
<?xml version="1.0" encoding="UTF-8"?>
<msg xmlns="http://www.java2java.com/msg">You can use literal result elements in stylesheets.</msg>
|