|
The WebCGM Profile defines a so-called fragment syntax that allows for navigation to or highlighting of a graphical object. Here you can find tools and code that will help you to find your way through the manifold variations of the fragment.
What is the fragment?
All resources on the Internet are identified by a URI (Uniform Resource Identifier). Common examples are
http://www.itedo.com/index.html http://www.w3.org
Thus it becomes possible to point to a web site or a specific page on that web site. Beyond that it is also possible to point to a paragraph of interest on an HTML page:
http://www.itedo.com/abc.html#para1
You can see that the name of the paragraph has been appended to the URL of the file, separated by the character #. This is called a fragment.
In CGM it is also possible to specify fragments for a similar purpose. The fragment is used to specify a graphical object inside the target CGM file. When the URL gets executed, the object will be moved into view or highlighted, depending on the fragment.
A typical example is
http://cgmopen.org/webcgm/engine.cgm#name(cooling)
In clear words this stands for:
- go to the website cgmopen.org
- open the file engine.cgm
- find a graphical object who's name attribute is equal to "cooling"
- if such an object exists, move it into view
There are several variants of the fragment allowing for highlighting or viewing of an object. There are also several addressing modes using the ID or the name attribute of the object. You can find the exact definition of the WebCGM fragment at http://www.w3.org/TR/REC-WebCGM/REC-03-CGM-IC.
WebCGM Fragment Parser
ITEDO Software has released the source code for a WebCGM fragment parser to the CGM community. The intent is to facilitate development of a fragment parser for a software vendor and to ensure proper parsing at the same time.
You can also download an executable version of the parser. You can run the parser from a command line, like
webcgmfragment.exe "abc.cgm#name(obj1)"
The tool will analyze the URL and write out the details it has found.
the source code
the executable program
|