[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: exclude-result-prefixes

Subject: RE: exclude-result-prefixes
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 24 Apr 2006 09:36:22 +0100
f view xmlns
The output you want is not namespace-well-formed, and therefore cannot be
produced using XSLT (unless you handle all the serialization yourself, by
using disable-output-escaping or otherwise).

exclude-result-prefixes allows you to eliminate namespaces that are not used
for element and attributes, but the namespaces actually used in your element
and attribute names will be declared whether you like it or not.

I would suggest that the best way to produce output which is neither HTML
nor XML is to write your own serializer with its own output method name -
perhaps by subclassing the serializer that comes with your XSLT processor.
The way you do that, of course, is product-dependent.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Arulraj [mailto:p_arulraj@xxxxxxxxx] 
> Sent: 24 April 2006 08:08
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  exclude-result-prefixes
> 
> Hi,
> 
> I have following XSL,
> 
> <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="2.0" xmlns:f="http://java.sun.com/jsf/core"
> xmlns:h="http://java.sun.com/jsf/html"
> exclude-result-prefixes="h f">
>     <xsl:variable name="JSFHeadertxt"
> select="document('../../../config/jsfheader.xml')"/>
>     <xsl:output method="html"
> doctype-public="-//W3C//DTD HTML 4.01
> Transitional//EN"/>
>     <xsl:template match="/">
>     <xsl:call-template name="JSFHeader"/>
>         <f:view>
>             <h:form id="H2WLogin">
>                 test
>             </h:form>
>         </f:view>
>     </xsl:template>   
>     <xsl:template name="JSFHeader">
>         <xsl:value-of select="$JSFHeadertxt"
> disable-output-escaping="yes"/>
>     </xsl:template>
> </xsl:stylesheet>
> 
> I got the following output:
> 
> <!DOCTYPE html
>   PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> 
> 
> 	<%@ page
> contentType="text/html;charset=windows-1252"%>
> 	<%@ taglib uri="http://java.sun.com/jsf/core"
> prefix="f"%>
> 	<%@ taglib uri="http://java.sun.com/jsf/html"
> prefix="h"%>
> 
> <f:view xmlns:f="http://java.sun.com/jsf/core">
>    <h:form xmlns:h="http://java.sun.com/jsf/html"
> id="H2WLogin">
>       test
>       
>    </h:form>
> </f:view>
> 
> but i need the following output:
> <!DOCTYPE html
>   PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> 
> 
> 	<%@ page
> contentType="text/html;charset=windows-1252"%>
> 	<%@ taglib uri="http://java.sun.com/jsf/core"
> prefix="f"%>
> 	<%@ taglib uri="http://java.sun.com/jsf/html"
> prefix="h"%>
> 
> <f:view>
>    <h:form id="H2WLogin">
>       test
>   </h:form>
> </f:view>
> 
> How to suppress the namespace of f and h in the result tree?
> 
> regards,
> Raj
> 
> 
> 		
> __________________________________________________________
> Yahoo! India Matrimony: Find your partner now. Go to 
> http://yahoo.shaadi.com

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.