[done] Xml code browser

Request Features and Feature Changes

[done] Xml code browser

Postby rudi » Sun Jan 18, 2009 1:03 pm

Hi,

I think it would be useful to handle xml in the code browser and I've almost implemented one (of course it works for html too) along the lines of the other *tags.
I can send you the patches as soon as I fix mismatched tags handling (I'm trying to complete some naif but reasonable strategy to recover from unbalanced tags) but I have a doubt about the Code object extension. I am using a custom Scope object (a Node, that is an xml tag) for every document node, that overrides GetElements so that nodes are not sorted alphabetically.
"Problem" is that I think it would be better to override the icon too (silk icon set has a tag icon, with opening/closing bracket) but this involves putting the custom node into the main code browser modules. Should I do that? Or should I keep the default scope icon?

thanks,

rudi pettazzi
rudi
User
 
Posts: 23
Joined: Sat Jan 10, 2009 10:04 pm

Re: Xml code browser

Postby cody » Sun Jan 18, 2009 3:42 pm

Cool,

Yea I can add another icon no problem. Using a tag icon makes more sense for these than the current scope icons and could be useful for other code types as well. So feel free to send the icon with and I will add it to the codebrowser display.


Thanks,

Cody
User avatar
cody
Site Admin
 
Posts: 1315
Joined: Mon Oct 09, 2006 2:49 am
Location: United States

Re: Xml code browser

Postby cody » Fri Jan 23, 2009 1:37 am

I added 3 new tag icons today. They will be automatically shown in the view if you set your Tag object type to one of the following.

'tag_red'
'tag_green'
'tag_blue'

Each one corresponds to a different tag icon red, green, and blue.


cody
User avatar
cody
Site Admin
 
Posts: 1315
Joined: Mon Oct 09, 2006 2:49 am
Location: United States

Re: Xml code browser

Postby rudi » Fri Jan 23, 2009 9:12 pm

Thanks. Actually the icon I saw was this http://www.famfamfam.com/lab/icons/silk/icons/tag.png but it is not that important :-)
Here's the patch. The browser shows only the tags so I used the blue icon only.
After some thought I rewrote the initial (unforgiving) approach I was using to handle broken DOMs. I think that the browser, being a navigation helper, should try to show every single node (somehow).
So a few heuristics are employed to attach to the DOM end-tags with no start-tag and viceversa. Aside from a few corner cases (see the comments and the tests) the navigator will always shows every single tag.
Attachments
xmlcb.patch
(24.55 KiB) Downloaded 197 times
rudi
User
 
Posts: 23
Joined: Sat Jan 10, 2009 10:04 pm

Re: Xml code browser

Postby cody » Sat Jan 24, 2009 2:06 am

Thanks,

Checked in and will be part of next release.

Double thanks for the unittest file!


Cody
User avatar
cody
Site Admin
 
Posts: 1315
Joined: Mon Oct 09, 2006 2:49 am
Location: United States


Return to Feature Requests

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron