Re: [docbook-apps] Graphs in docbook?
Dave, Sal Mangano has a section on this in his O'Reilly book XSLT Cookbook. Its in the XML to SVG section. His style is take an existing SVG file and make it have variable data. He also take it further and makes generic components. So concepts like what he has done make work here. Regards, Dean Nelson In a message dated 07/21/09 22:50:17 Pacific Daylight Time, da...@dpawson.co.uk writes: On 07/22/2009 06:26 AM, DeanNelson wrote: Yes, Dave, I have had the same thoughts. I wonder if there is an XML based graph and chart thingy that could handle something like graph type=line title Profits /title data x30/x x40/x x50/x y10/y y20/y y30/y /data /graph I wonder if this could be translated into SVG Basics are: Title (if 'formal') Axis labelling (I'd accept something very simple to start with). Then as you have, the pairs of values (X,Y). Not sure if anything else is wanted? I've done it before, just as an exercise. Scaling might be an issue though. http://www.dpawson.co.uk/xsl/sect4/svg.html Suggest: data pt x30/x y40/y /pt /data though, just to keep it clean? regards -- Dave Pawson XSLT XSL-FO FAQ. http://www.dpawson.co.uk - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] Graphs in docbook?
Seems to me that this is part of the point of using namespaces. There is no reason why DocBook per se has to support this; if there is a well-defined charting XML namespace, a custom stylesheet can easily import both the DocBook stylesheets and a stylesheet for handling charting. ~Chris -- Chris Maden, text nerd URL: http://crism.maden.org/ “All I ask of living is to have no chains on me, And all I ask of dying is to go naturally.” — Laura Nyro GnuPG Fingerprint: C6E4 E2A9 C9F8 71AC 9724 CAA3 19F8 6677 0077 C319 - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] Graphs in docbook?
DeanNelson wrote: I wonder if this could be translated into SVG http://code.google.com/p/graph2svg/ -- -- Jirka Kosek e-mail: ji...@kosek.cz http://xmlguru.cz -- Professional XML consulting and training services DocBook customization, custom XSLT/XSL-FO document processing -- OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member -- signature.asc Description: OpenPGP digital signature
Re: [docbook-apps] Graphs in docbook?
On 07/22/2009 07:10 AM, Christopher R. Maden wrote: Seems to me that this is part of the point of using namespaces. There is no reason why DocBook per se has to support this; if there is a well-defined charting XML namespace, a custom stylesheet can easily import both the DocBook stylesheets and a stylesheet for handling charting. ~Chris Fair comment Chris. I'll go look. I'd guess that it's such a personal thing (bit like a docbook front cover?) that there is unlikely to be anything 'standard', even for a simple line graph. regards -- Dave Pawson XSLT XSL-FO FAQ. http://www.dpawson.co.uk - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] Graphs in docbook?
On 07/22/2009 07:55 AM, Jirka Kosek wrote: DeanNelson wrote: I wonder if this could be translated into SVG http://code.google.com/p/graph2svg/ Drat, beat me to it again! grin/ Jiri isn't it Jirka? I'm just playing with it. Looks quite sophisticated! Lots of examples, various types of graphs Just that we need Jirka and friends to translate the documentation into English! Tks Jirka. regards -- Dave Pawson XSLT XSL-FO FAQ. http://www.dpawson.co.uk - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] Graphs in docbook?
Dave Pawson wrote: grin/ Jiri isn't it Jirka? Yes. Jiří is official form, but I tend to use more informal Jirka which doesn't use those funny characters. It was problem to transmit those characters 15 years ego. Lots of examples, various types of graphs Just that we need Jirka and friends to translate the documentation into English! Sorry, it is bachelor thesis of my former student. Try to look at samples and if you have problem e-mail author of package and put me on copy. Jirka -- -- Jirka Kosek e-mail: ji...@kosek.cz http://xmlguru.cz -- Professional XML consulting and training services DocBook customization, custom XSLT/XSL-FO document processing -- OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member -- signature.asc Description: OpenPGP digital signature
Re: [docbook-apps] Graphs in docbook?
?xml version=1.0 encoding=UTF-8? !DOCTYPE xygr SYSTEM xygr.dtd xygr xmlns=http://graph2svg.googlecode.com; titleFrequency, By date/title curve color=yellow point x=5 y=11 color=black pointType=point/ point x=6 y=14 color=black pointType=point/ point x=7 y=13 color=black pointType=point/ point x=8 y=16 color=black pointType=point/ point x=9 y=17 color=black pointType=point/ point x=10 y=16 color=black pointType=point/ point x=11 y=13 color=black pointType=point/ point x=12 y=11 color=black pointType=point/ point x=13 y=21 color=black pointType=point/ point x=14 y=14 color=black pointType=point/ point x=15 y=14 color=black pointType=point/ point x=16 y=15 color=black pointType=point/ point x=17 y=14 color=black pointType=point/ point x=18 y=14 color=black pointType=point/ point x=19 y=11 color=black pointType=point/ point x=20 y=15 color=black pointType=point/ point x=21 y=8 color=black pointType=point/ /curve /xygr Does it for me! The output SVG is really good. Attached, if it gets through I'll pick that up as a customization. Jirka, how does this idea fit with 'extending' docbook, vs incorporation via a namespace vs incorporating into docbook processing? Any thoughts? regards -- Dave Pawson XSLT XSL-FO FAQ. http://www.dpawson.co.uk attachment: op.svg- To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] Graphs in docbook?
Dave Pawson wrote: Jirka, how does this idea fit with 'extending' docbook, vs incorporation via a namespace vs incorporating into docbook processing? There are many possibilities, depends on your usage scenario, for example. 1) Incorporate graph2svg markup directly into DocBook 2) Keep graph2svg markup in separate files, turn them into SVG by external process and then include them as figures on DocBook level 3) Do some more advanced things, like have a DocBook table with special role assigned and then tweak stylesheets to generate graph2svg markup from DocBook table, then use graph2svg stylesheet to get SVG from this and include this resulting SVG into FO/XHTML generated by DocBook stylesheets, everything in single transformation But be careful when integrating graph2svg into DocBook stylesheets. Library requires XSLT 2.0, so you have to use Saxon9 and some things are still not working in Saxon9 (for example chunking, but there is partial patch for this scheduled for 1.76.0 sitting on my filesystem). Jirka -- -- Jirka Kosek e-mail: ji...@kosek.cz http://xmlguru.cz -- Professional XML consulting and training services DocBook customization, custom XSLT/XSL-FO document processing -- OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member -- signature.asc Description: OpenPGP digital signature
Re: [docbook-apps] Graphs in docbook?
On 07/22/2009 09:14 AM, Jirka Kosek wrote: Dave Pawson wrote: Jirka, how does this idea fit with 'extending' docbook, vs incorporation via a namespace vs incorporating into docbook processing? There are many possibilities, depends on your usage scenario, for example. 1) Incorporate graph2svg markup directly into DocBook 2) Keep graph2svg markup in separate files, turn them into SVG by external process and then include them as figures on DocBook level 3) Do some more advanced things, like have a DocBook table with special role assigned and then tweak stylesheets to generate graph2svg markup from DocBook table, then use graph2svg stylesheet to get SVG from this and include this resulting SVG into FO/XHTML generated by DocBook stylesheets, everything in single transformation But be careful when integrating graph2svg into DocBook stylesheets. Library requires XSLT 2.0, so you have to use Saxon9 and some things are still not working in Saxon9 (for example chunking, but there is partial patch for this scheduled for 1.76.0 sitting on my filesystem). Ah! The killer! Yes, it's XSLT 2.0 Immediate reaction, I would prefer the 'graph' markup to using a standard table. There are too many differences between the graph and a docbook table. It would look like a kludge. So for the short term, process the graph outside docbook, then include the resulting file as 'normal' within docbook. In the long term, I like Chris's idea. Consider it 'another namespace' content and process it as ... an extension? But that will have to wait until the XSLT 2.0 docbook stylesheets I guess. Have any principles been worked out for doing this more generally? I've not heard anything. E.g. I want to incorporate xmlns= what should I do for validation and processing? More NVDL I guess. btw Jirka, the namespace isn't declared in the DTD, on the root element? regards -- Dave Pawson XSLT XSL-FO FAQ. http://www.dpawson.co.uk - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] Graphs in docbook?
Dave Pawson wrote: btw Jirka, the namespace isn't declared in the DTD, on the root element? That's bug. graph2svg was added into namespace in the last stage and Jakub probably forgot to update DTDs. But you don't need to reference DTDs from your graph2svg files. -- -- Jirka Kosek e-mail: ji...@kosek.cz http://xmlguru.cz -- Professional XML consulting and training services DocBook customization, custom XSLT/XSL-FO document processing -- OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member -- signature.asc Description: OpenPGP digital signature
Re: [docbook-apps] Graphs in docbook?
On 07/22/2009 04:22 AM, Dave Pawson wrote: In the long term, I like Chris's idea. Consider it 'another namespace' content and process it as ... an extension? But that will have to wait until the XSLT 2.0 docbook stylesheets I guess. Not having looked closely at it, I wonder if an alternative backend for SVG generation would be graphviz ? It should be fairly straight forward to map any agreed-upon extension vocabulary for graphics to the graphviz 'dot' language, from which the 'dot' tool then could generate SVG. The (probably more powerful) graph2svg tool could then be used whenever XSLT 2.0 is available. For avoidance of doubt, I also agree this ought to go into an extension namespace. (I have been meaning to suggest a couple of other extension vocabularies, but got trapped in other work.) Thanks, Stefan -- ...ich hab' noch einen Koffer in Berlin... - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] Graphs in docbook?
And using a macrodef with ant, it's easy to generate n svg files. !-- = -- !-- Macro definition to run xslt 2, n times-- !-- == -- macrodef name=call-xslt2 backtrace=true attribute name=source/ attribute name=output/ sequential java classname=${xslt2_processor} fork=yes dir=${basedir} failonerror=true classpath refid=xslt2.processor.classpath / jvmarg line=-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration/ jvmarg line=-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl/ jvmarg line=-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl/ arg value=-l/ arg value=-o/ arg value=@{output}/ arg line=-x org.apache.xml.resolver.tools.ResolvingXMLReader/ arg line=-y org.apache.xml.resolver.tools.ResolvingXMLReader/ arg line=-r org.apache.xml.resolver.tools.CatalogResolver / arg line=${basedir}/@{source} ${use_xygr2svg_xsl} / /java /sequential /macrodef !-- -- !-- Process XML through to SVG -- !-- -- target name=genSVG echoGenerate SVG from 4 XML files./echo !-- Now run the xslt script to generate the SVG, using http://code.google.com/p/graph2svg/ -- !-- Currently there are 4 separate xml source files. aprilbm.xml maybm.xml junebm.xml julybm.xml -- !-- For each one, the docbook source needs to accommodate it as in mediaobject imageobject imagedata fileref=graphics/xxx.1.svg format=SVG contentwidth=150mm/ /imageobject textobject phraseAlt text description/phrase/textobject captionparaGraph title/para/caption /mediaobject /mediaobject -- !-- Call up the macro as needed-- echoGenerate aprilbm.svg/echo call-xslt2 source=aprilbm.xml output=aprilbm.svg/ echoGenerate maybm.svg/echo call-xslt2 source=maybm.xml output=maybm.svg/ echoGenerate junebm.svg/echo call-xslt2 source=junebm.xml output=junebm.svg/ echoGenerate julybm.svg/echo call-xslt2 source=julybm.xml output=julybm.svg/ /target Nice solution! regards -- Dave Pawson XSLT XSL-FO FAQ. http://www.dpawson.co.uk - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] Re: ANNOUNCE: DocBook XSL XSL-NS Stylesheets 1.75.2 released
Am Dienstag, den 21.07.2009, 16:19 -0700 schrieb Keith Fahlgren: On Mon, Jul 20, 2009 at 8:00 PM, Keith Fahlgrenabdela...@gmail.com wrote: Version 1.75.2 of the DocBook XSL XSL-NS Stylesheets, for processing DocBook 4 and namespaced (DocBook 5) documents, is now available: https://sourceforge.net/projects/docbook/files/ Some files were mispackaged, so this release has been updated at Sourceforge. If you've already downloaded these files, please update your copies. Sorry to be the one telling you the bad news :), but the reference PDF file in docbook-xsl-doc is empty (0 byte). Regards, Daniel - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] Re: ANNOUNCE: DocBook XSL XSL-NS Stylesheets 1.75.2 released
On Wed, Jul 22, 2009 at 12:35 PM, Daniel Leidertdaniel.leidert.s...@gmx.net wrote: Sorry to be the one telling you the bad news :), but the reference PDF file in docbook-xsl-doc is empty (0 byte). Thanks for the report. I've confirmed this and will see if the packages can be updated. Keith - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] Re: ANNOUNCE: DocBook XSL XSL-NS Stylesheets 1.75.2 released
On Wed, Jul 22, 2009 at 1:51 PM, Keith Fahlgrenabdela...@gmail.com wrote: On Wed, Jul 22, 2009 at 12:35 PM, Daniel Leidertdaniel.leidert.s...@gmx.net wrote: Sorry to be the one telling you the bad news :), but the reference PDF file in docbook-xsl-doc is empty (0 byte). Thanks for the report. I've confirmed this and will see if the packages can be updated. Deliciously, it seems that Sourceforge has updated their release management interface. I hope that I just uploaded new docbook-xsl-doc packages Keith - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org