|
next
|
 Subject: XQERY and Stylus Studio support of svg Author: Jack Tan Date: 12 Apr 2007 06:22 PM Originally Posted: 12 Apr 2007 03:35 PM
|
I am building a dynamically updated GUI for a stand-alone application. Being a newbie to building GUIs, I decided to use SVG and Batik and generate it dynamically. The GUI is a directed graph fully represented by an XMLfile; for example, a node is an ellipse with a name. Based on the external condition a color of the node is changed from say red to green. SVG of the graph is generated by GraphViz and looks almost fine.
In the Batik, I have to somehow bind XML name with Batik’s Graph2D internal representation that is accessible through a DOM. After some tries, since StylusStudio is not capable to browse through xml files with .svg extension, I changed a name of the gui.svg to gui.xml and was able to access all svg information from XQUERY (and Stylus Studio). Next, using XQUERY I was able to retrieve and query the svg DOM and find the necessary svg_id needed to use Batik’s document.getElementById(“svg_id”). In the prototype I simply change color fill attribute of an ellipse to the desired color. All is dynamic and almost automatically generated from XML.
Problem isalmost solved, but I am not sure that it is the best solution. In querying the svg data I have xmlns declaration which controls processing (if I understand it correctly) since I am only editing, can the namespace can be forced to be strictly local (skip svg definitions in xmlns)?
Questions:
1. How one can access file.svg using Stylus Studio without converting file’s type extension to file.xml? and extract attributes?
2. Any comments/references/samples about the use of svg files in Stylus Studio (I have 2006 XML Enterprise Edition and, to my best knowledge, it only display svg files)? XQUERY?
Perhaps it is a trivial problem but I couldn’t googled it ;-) and still have handling problem within the context of XQUERY.
Regards,
Jack
|
|
|