RE: [xsl] Specifying the XHTML XMLNS

Subject: RE: [xsl] Specifying the XHTML XMLNS
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 28 Sep 2005 17:09:58 +0100
I think an "uncatched exception" deserves three bug reports: one for the
exception, one for not catching it, and one for abuse of the English
language.

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

> -----Original Message-----
> From: knocte [mailto:knocte@xxxxxxxxx] 
> Sent: 28 September 2005 16:24
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re: [xsl] Specifying the XHTML XMLNS
> 
> Thanks for your responses, David and Robert.
> 
> > You probably want a default template that renames elements, 
> giving thenm
> > the same name but the xhtml namespace, which would be
> >
> >   <xsl:template match="node()">
> >     <xsl:element name="{local-name()}">
> >       <xsl:copy-of select="@*"/>
> >       <xsl:apply-templates/>
> >     </xsl:element>
> >   </xsl:template>
> >
> > which will make elements in the xhtml namespace if that is 
> the current
> > default.
> 
> Now, either with your solution or with the one from Robert, my XSLT
> engine begins transforming but it suddendly aborts in the middle of
> the execution with an exception:
> 
> 
> <html xml:lang="es"
> xmlns="http://www.w3.org/1999/xhtml";><head><title>Main app title - My
> specific title</title><meta name="author" content="knocte" /><script
> type="text/javascript" src="./js/general/amuse.js"></script><script
> type="text/javascript" src="./js/general/general.js"></script><link
> rel="stylesheet" href="./css/general/site.css" type="text/css" /><link
> rel="stylesheet" href="./css/login.css" type="text/css"></link><script
> type="text/javascript" src="./js/login.js"></script></head><body><div
> id="divHeader">This is my header</div><div id="divContent"
> Uncatched exception: System.Xml.Xsl.XsltException: '' is an 
> invalid QName.
> 
>    at System.Xml.Xsl.PrefixQName.ParseNCName(String qname, 
> Int32& position)
>    at System.Xml.Xsl.PrefixQName.ParseQualifiedName(String 
> qname, String& prefix
> , String& local)
>    at System.Xml.Xsl.ElementAction.CreateElementQName(String 
> name, String nsUri,
>  InputScopeManager manager)
>    at System.Xml.Xsl.ElementAction.Execute(Processor 
> processor, ActionFrame fram
> e)
>    at System.Xml.Xsl.ActionFrame.Execute(Processor processor)
>    at System.Xml.Xsl.Processor.Execute()
>    at System.Xml.Xsl.XslTransform.Transform(IXPathNavigable 
> input, XsltArgumentL
> ist args, XmlWriter output, XmlResolver resolver)
>    at XsltTestcases.ClassMain.Main(String[] args) in 
> c:\documents and settings\a
> ndres.psm\mis documentos\visual studio 
> projects\xslttestcases\class1.cs:line 39
> 
> Do you know if now is there something wrong with the following part of
> my stylesheet?:
> 
> <div id="divContent">
>   <xsl:apply-templates select="content/*" />
> </div>
> 
> 
> Thanks again!
> 
>   Andrew    [ knocte ]
> 
> --

Current Thread