Chris Wallace
2010-02-15 08:03:16 UTC
Via Dave Pawson, I've been using Jakub Vojtíšek 's XSLT for generating SVG
charts. (see http://kitwallace.posterous.com/svg-graphs-via-xslt-on-exist)
Here is one to generate pie charts:
http://www.cems.uwe.ac.uk/xmlwiki/graph2svg/xosgr2svg.xsl
(I had to modify Dave Pawson's version slightly because transform:transform
only passes string parameters)
These work fine when accessed with a database path:
/db/Wiki/graph2svg/example2.xq
but when accessed with a full URL they break :
http://www.cems.uwe.ac.uk/xmlwiki/graph2svg/example2-a.xq
The failing code is
declare option exist:serialize "method=xml media-type=image/svg+xml";
let $graph :=
doc("http://www.cems.uwe.ac.uk/xmlwiki/graph2svg/example2.xml")
let $ss := doc("http://www.cems.uwe.ac.uk/xmlwiki/graph2svg/xosgr2svg.xsl")
return
transform:transform ($graph,$ss,())
Other examples generate a minimal svg - I guess it's a namespace problem but
I can't see what's wrong
Chris
charts. (see http://kitwallace.posterous.com/svg-graphs-via-xslt-on-exist)
Here is one to generate pie charts:
http://www.cems.uwe.ac.uk/xmlwiki/graph2svg/xosgr2svg.xsl
(I had to modify Dave Pawson's version slightly because transform:transform
only passes string parameters)
These work fine when accessed with a database path:
/db/Wiki/graph2svg/example2.xq
but when accessed with a full URL they break :
http://www.cems.uwe.ac.uk/xmlwiki/graph2svg/example2-a.xq
The failing code is
declare option exist:serialize "method=xml media-type=image/svg+xml";
let $graph :=
doc("http://www.cems.uwe.ac.uk/xmlwiki/graph2svg/example2.xml")
let $ss := doc("http://www.cems.uwe.ac.uk/xmlwiki/graph2svg/xosgr2svg.xsl")
return
transform:transform ($graph,$ss,())
Other examples generate a minimal svg - I guess it's a namespace problem but
I can't see what's wrong
Chris
--
View this message in context: http://old.nabble.com/Problem-with-an-XSLT-tp27590462p27590462.html
Sent from the exist-open mailing list archive at Nabble.com.
View this message in context: http://old.nabble.com/Problem-with-an-XSLT-tp27590462p27590462.html
Sent from the exist-open mailing list archive at Nabble.com.