Hi.

iuyoiuy oiuyiuyi:
> I'm performing an XSLT transform on a Document Node obtained from an
> SVGGraphics2D. My problem is that I can't seem to be able to match
> nodes without using local-name() in my XPATH expressions. Here's the
> Java:
> 
> SVGGraphics2D svg = createMySVG();
> Document doc = (Document)svg.getDOMFactory();
> Element root = doc.getDocumentElement();
> svg.getRoot(root);
> transformer.transform( new DOMSource(root.getOwnerDocument()), new 
> StreamResult(writer));
> 
> And that works, except that in my XSLT I can't say:
> 
> <xslt:template match="g">
> 
> ...instead I have to say:
> 
> <xslt:template match="*[local-name()='g']">
> 
> Naturally I've tried various namespace declarations without success, knowing that 
> the problem must be to do with my namespace declarations, which are:
> 
> <xslt:transform
>   version="1.0"
>   xmlns:xslt="http://www.w3.org/1999/XSL/Transform";
>   xmlns:xlink="http://www.w3.org/1999/xlink";
>   xmlns:svg="http://www.w3.org/2000/svg";>

You need to remember that in XSLT 1, the XPath expressions will not use
any default namespace.  You will need to explicitly mention the svg
namespace, with

  <xslt:stylesheet
    xmlns:svg="http://www.w3.org/2000/svg";
    ...>
    
    <xslt:template match="svg:g">
    </xslt:template>
    ...

Hope this helps,

Cameron

-- 
Cameron McCormack
|  Web: http://mcc.id.au/
|  ICQ: 26955922

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to