Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Home » Tip Bank » XML » XSLT
Language: XML
Expertise: Advanced
Mar 4, 2008

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"?>
<xsl:stylesheet version="1.0"  
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
  xmlns:mc="http://www.airwings.org/register/"
  xmlns:informatii="http://www.airwings.org/info/"
  xmlns:FR="myPrefix://just.for.fun/java.io.FileReader"
  xmlns:BR="xalan://java.io.BufferedReader"
  exclude-result-prefixes="FR BR">
In the above example, the myPrefix://just.for.fun/java.io.FileReader and xalan://java.io.BufferedReader declarations will not be copied.

Leonard Anghel
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap