[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: [xsl] Suppressing xmlns attribute (XSL and JSP)
Subject: Re: [xsl] Suppressing xmlns attribute (XSL and JSP) From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx> Date: Tue, 27 Feb 2001 09:30:19 +0000 |
Hi Dale, > (Yes, it is just that short for this example. :) ) jspview is a a > custom tag library that my servlet container knows about. However, > there is no declaration in the document for the namespace (it's done > from the <%@ taglib uri="..." prefix="..." %> element) in the source > document. So the document that you want to produce is: <%@ taglib uri="..." prefix="..." %> <jspview:result> </jspview:result> Right? As far as XSLT is concerned, that's not an XML document. Even if you take out the weird first line, the element uses an undeclared prefix. There's no way for XSLT to generate a node tree that contains an element that has a qualified name for which there is no namespace node. And if it can't create a node tree for a document, then it can't give you the document. So the only way around it is to produce the thing as text. It's pretty horrific. Rather than: <jspview:result> </jspview:result> you have to use: <![CDATA[ <jspview:result> </jspview:result> ]]> or: <jspview:result> </jspview:result> and set your output to text with: <xsl:output method="text" /> It means you can't use all the wonderful element and attribute-creating stuff that XSLT gives you. And it'll make your stylesheet really messy too. I don't know whether you can do this, but you could get around it if you could create a document that was: <%@ taglib uri="..." prefix="..." %> <result> </result> As far as the XSLT is concerned, the 'result' element here is in the null namespace - if you don't put a jspview namespace declaration in the stylesheet, you can produce the above as normal. That would be the cleanest option if it's possible for you to declare default (i.e. unprefixed) namespaces with the taglib 'element'. If not, in your position, I'd be tempted to either change your DTD to include the namespace declaration, or to post-process the file to remove the undesirable namespace declaration. I hope that helps, Jeni --- Jeni Tennison http://www.jenitennison.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Suppressing xmlns attribute (, Dale Sedivec | Thread | Re: [xsl] Suppressing xmlns attribu, David Carlisle |
Re: [xsl] [exsl] Draft 0.1 - call f, Jeni Tennison | Date | Re: [xsl] apply-import and named te, Jeni Tennison |
Month |