XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Go to previous topicPrev TopicGo to next topicNext Topic
Jack TanSubject: 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)?

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.



Alberto MassariSubject: XQERY and Stylus Studio support of svg
Author: Alberto Massari
Date: 13 Apr 2007 03:53 AM
Hi Jack,
you can instruct Stylus Studio to open non-standard extension using one of its editors; for instance, if you drag a .svg file (or open it explicitly in the dialog displayed by File | Open) you will see a dialog asking you which editor should be used. Once you select "XML Document" and check the "Always use this module for this file type" check box, the .svg extension will be recognize as a synonym for .xml.

Hope this helps,

Jack TanSubject: XQERY and Stylus Studio support of svg
Author: Jack Tan
Date: 15 Apr 2007 12:45 AM
Originally Posted: 13 Apr 2007 02:27 PM

Thanks for the hint, it worked.

Thanks for suggestions,


Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.