devxlogo

Blocking Namespace Declarations in XSLT Transformation Results

Blocking Namespace Declarations in XSLT Transformation Results

Suppose you want to block a namespace declaration from appearing in your XSLT transformation results; for example, suppose you have the namespace declaration of a function/element extension. You’d have to use the exclude-result-prefixes attribute in the stylesheet element. The value of this attribute is a list of prefixes separated by spaces.

Here’s an example:

<?xml version="1.0" encoding="UTF-8"?>

In the above example, the myPrefix://just.for.fun/java.io.FileReader and xalan://java.io.BufferedReader declarations will not be copied.

devx-admin

Share the Post: