Mega Code Archive

 
Categories / XML Tutorial / XSLT StyleSheet
 

Output element with default namespace

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.rntsoft.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.rntsoft.com/msg">You can use literal result elements in stylesheets.</msg>