Re: [xsl] Specifying the XHTML XMLNS

Subject: Re: [xsl] Specifying the XHTML XMLNS
From: knocte <knocte@xxxxxxxxx>
Date: Wed, 28 Sep 2005 17:24:07 +0200
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="";><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&
, String& local)
   at System.Xml.Xsl.ElementAction.CreateElementQName(String name, String
 InputScopeManager manager)
   at System.Xml.Xsl.ElementAction.Execute(Processor processor, ActionFrame
   at System.Xml.Xsl.ActionFrame.Execute(Processor processor)
   at System.Xml.Xsl.Processor.Execute()
   at System.Xml.Xsl.XslTransform.Transform(IXPathNavigable input,
ist args, XmlWriter output, XmlResolver resolver)
   at XsltTestcases.ClassMain.Main(String[] args) in c:\documents and
ndres.psm\mis documentos\visual studio projects\xslttestcases\class1.cs:line

Do you know if now is there something wrong with the following part of
my stylesheet?:

<div id="divContent">
  <xsl:apply-templates select="content/*" />

Thanks again!

  Andrew    [ knocte ]


Current Thread