Discussion:
[Exist-open] Problem with an XSLT
Chris Wallace
2010-02-15 08:03:16 UTC
Permalink
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
--
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.
Chris Wallace
2010-02-15 08:05:10 UTC
Permalink
Sorry the working example path got messed up

http://www.cems.uwe.ac.uk/xmlwiki/graph2svg/example2.xq
--
View this message in context: http://old.nabble.com/Problem-with-an-XSLT-tp27590462p27590463.html
Sent from the exist-open mailing list archive at Nabble.com.
Dmitriy Shabanov
2010-02-15 08:54:29 UTC
Permalink
I this problems:
SystemId Unknown; Line #0; Column #0; A relative location path was
expected following the '/' or '//' token.
SystemId Unknown; Line #0; Column #0; Extra illegal tokens: '(', '*',
'|', 'text', '(', ')', ')'
SystemId Unknown; Line #0; Column #0; Could not find function: if
SystemId Unknown; Line #0; Column #0; Extra illegal tokens: 'then',
'60', 'else', '100'
SystemId Unknown; Line #0; Column #0; function token not found.
--
Cheers,

Dmitriy Shabanov
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)
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)
/db/Wiki/graph2svg/example2.xq
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
Wolfgang Meier
2010-02-15 09:05:33 UTC
Permalink
Post by Dmitriy Shabanov
SystemId Unknown; Line #0; Column #0; Could not find function: if
Looks like you need an XSLT 2.0 processor.

Wolfgang
claud108
2010-02-15 09:11:43 UTC
Permalink
Yes, Wolfgang is right.

graph2svg works very fine within eXist with xslt 2.0.

You have only to pay attention to source examples, as osgr examples do not
have the appropriate namespace.

On the other hand, for better rendering in browser, one can use SVGweb (I am
making myself some tests now); also, Alain (
http://www.agencexml.com/xsltforms.htm XSLTForms ) is working now to
integrate SVGweb with XSLTForms.



-----
Claudius Teodorescu
http://kuberam.ro
--
View this message in context: http://old.nabble.com/Problem-with-an-XSLT-tp27590462p27591079.html
Sent from the exist-open mailing list archive at Nabble.com.
Chris Wallace
2010-02-15 10:21:52 UTC
Permalink
I've got an xslt2.0 processor - thats why the example where the stylesheet
is accessed with a database path works fine

http://www.cems.uwe.ac.uk/xmlwiki/graph2svg/example2.xq

but I'm trying to run it using a full URL - that's when it breaks
Post by claud108
Yes, Wolfgang is right.
graph2svg works very fine within eXist with xslt 2.0.
You have only to pay attention to source examples, as osgr examples do not
have the appropriate namespace.
On the other hand, for better rendering in browser, one can use SVGweb (I
am making myself some tests now); also, Alain (
http://www.agencexml.com/xsltforms.htm XSLTForms ) is working now to
integrate SVGweb with XSLTForms.
--
View this message in context: http://old.nabble.com/Problem-with-an-XSLT-tp27590462p27591163.html
Sent from the exist-open mailing list archive at Nabble.com.
Loading...