[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: RE: [cgmo-webcgm] ISSUE: regex APS addressing
Hello all, I have attached an html that will open an arbitrary WebCGM and will allow you to select an attribute and enter a regular expression. It will then produce a list of the application structures that match the regular expression. Please test this html using your favorite viewer and let me know (either to the list or privately) if it works correctly. I would like to make sure that we have at least two implementations that will work when we get to that stage. I have tested this on my circuit, tic-tac-toe, and a couple of images used in the test suite. If an attribute is unspecified it will show up in my list of nodes as NODEID (myattribue=""). I make no effort to consider inheritance and only search on the specified values of attributes. One thing that should be noted is that when you enter a regular expression into the text field you must hit the submit button and not a carriage return. For some reason a carriage return will cause a reload of the HTML and you will need to select a CGM image again. I am probably misunderstanding how things should work but I was having lots of problems trying to create/manipulate a webCGMNodeList. I went back to the simple cases in the test suite and they work, but all we do is a very simple add/delete test... It is not in the spec but I tried: var nl = new WebCGMNodeList(); It of course does not work... Do we have a need to have a way to create an empty list? If I am the only one to have tried this then the answer is probably no. I also tried: var nl = myFirstNode.toNodeList(); This creates a WebCGMNodeList but if I remove item(0) to make it empty or when I try to append the first APS I found it will toss an exception. The spec says that if you try to append an item that is already in a WebCGMNodeList it will remove it from the current location and append it onto the end. This is not tested in the test suite.. I finally got tired to trying to make WebCGMNodeList work the way I wanted to and just used a plain old vanilla javascript Array(). My original thought was that I would be able to get all of the APS in one call with something along the lines of: var allNodes = document.getElementsByTagName('*'); This gives me all of the HTML nodes... and var allNodes = picture.getAppStructuresByName('*'); doesn't work either. So I "lifted" a bit of code to walk the WebCGM DOM tree and add the nodes to an array. Even though the HTML is 100+ lines long the real "code" that does the regex comparison is just a javascript match within the processAttr() function. -- Stuart Galt SGML Resource Group stuart.a.galt@boeing.com (206) 544-3656Title: WebCGM 2.0 regex example
Select a CGM image... |
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]