Next in thread → Next in month →

Re: [docbook-apps] Prefixed tags not matched ?

From
Kirka Losek
Date
2004-03-25T08:28:42+00:00
ID
Thread
Re: [docbook-apps] Prefixed tags not matched ?
Nicolas Pillot wrote:

> I have written a XSL stylesheet to extract mathml and svg from docbook for
> external processing. I just saw i made a mistake because i did not prefix those
> elements with mml:, and svg:. The stylesheet worked well : it was looking for
> imageobject[child::svg] and equation[child:math]. Now that i have prefixed them,
> these templates find no match. I tried imageobject[svg:svg] and
> equation[mml:math], but i get the following error :
> 
> javax.xml.transform.TransformerException: Le pr嶨ixe doit se r廥oudre en nom
> d'espace : svg (the prefix should resolve to a namespace would be a possible
> translation i think)
> 
> I start the opening tag mml:math like this
>   <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML">
> And the opening svg:svg is
>   <svg:svg xmlns:svg="http://www.w3.org/2000/svg"
>              xmlns:xlink="http://www.w3.org/1999/xlink">
> So i think the namespaces are specified !

You must also declare namespaces in your XSLT stylesheet in order to use 
them in XPath expressions and patterns. Something like:

<xsl:stylesheet xmlns:xsl="...."
                 version="1.0"
	        xmlns:mml="..."
                 xmlns:svg="...">

-- 
-----------------------------------------------------------------
   Jirka Kosek  	
   e-mail: 
   http://www.kosek.cz
Next in thread → Next in month →