RE: [xsl] Is it possible to rewrite part of an attribute value with XSL?

Subject: RE: [xsl] Is it possible to rewrite part of an attribute value with XSL?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 3 Jul 2009 19:25:41 +0100
> <path style="fill:none;stroke:black;stroke-width:1.55"/>
> 
> I am looking for a way to remove the "fill:none;stroke:black" 
> of the above, but to keep the "stroke-width:155" part of the 
> attribute.

It's very hard to derive a general rule from one example. Can you describe
the general form of the attribute value? Will it always contain fill,
stroke, and stroke-width, in this order? What should happen if it doesn't?
What if it contains other properties besides these three?

You've been given various solutions using regular expressions, but they are
all making guesses about your requirements, and if the guesses are wrong
then the code is wrong.

Regards,

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

Current Thread