AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

XML Explorer
Goto page 1, 2, 3, 4  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Titan



Joined: 11 Aug 2004
Posts: 5382
Location: /b/

PostPosted: Sat May 20, 2006 8:46 pm    Post subject: XML Explorer Reply with quote

XML Explorer lets you create and modify XML documents. You can view the XML structure, edit contents and change attributes. Using a TreeView, a resizable window and an easy to use interface, this is the best tool for managing your files.

The zip download includes XMLWrite(), XMLRead(), Anchor and an experimental version of XMLQuery().

Screenshot:


Version: 1.8 (28th July 2006)

Download (9kb)
_________________



Last edited by Titan on Fri Jul 28, 2006 10:15 am; edited 8 times in total
Back to top
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Sat May 20, 2006 11:33 pm    Post subject: Reply with quote

Dear Titan, Very Happy

Amazing!

I just gave it a try.. and it is well done!

It would be great if you mimic the keyboard functionality of TreePad.

Like:

    Insert : Insert a Node
    Delete : Delete a Node
    F2 : Rename a node


Maybe you can consider this in your future versions.

I will post again later after trying it fully.

Regards. Smile
_________________
Back to top
View user's profile Send private message
Titan



Joined: 11 Aug 2004
Posts: 5382
Location: /b/

PostPosted: Sat May 20, 2006 11:50 pm    Post subject: Reply with quote

Thanks for the feedback Smile

You can already do the insert/delete thing by pressing Alt+A and Alt+D (notice the underlined letters in buttons). However your idea is great, I'll add more hotkeys and shortcuts in the next version when I add functionality for AutoText which you might have already found is not currently working. I'll also have to add support for different encodings (like HTML, Base64 and etc) so Atom files can be properly viewed.
_________________

Back to top
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Sun May 21, 2006 2:24 am    Post subject: Reply with quote

Very nice! You've bent the TreeView to your will to create what might be the perfect style of user interface for XML browsing.
Back to top
View user's profile Send private message Send e-mail
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Sun May 21, 2006 9:34 am    Post subject: Reply with quote

Funny, I was wondering how many time we will wait before seeing the new TreeView component used with XML documents...
We didn't waited too long!
I didn't tried it yet, but from the screen shot, it is already impressive.
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
Titan



Joined: 11 Aug 2004
Posts: 5382
Location: /b/

PostPosted: Sun May 21, 2006 12:25 pm    Post subject: Reply with quote

Thanks Chris and PhiLho Smile

I updated XML Explorer with more hotkeys, functionality for AutoText and a better interface. I wanted to include support for HTML but it's more difficult than I expected, so that'll have to come later.
_________________

Back to top
View user's profile Send private message Visit poster's website
RobOtter



Joined: 30 Jan 2005
Posts: 125
Location: Darmstadt, Germany

PostPosted: Mon May 22, 2006 7:59 am    Post subject: Reply with quote

Hi Titan,

thanks for this smart helper! Nevertheless, I have some requests and a bug report:

1) Could you add the possibility to resize the treeview? While resizing the whole window, the treeview width stays the same which is sometimes to small if you have a highly nested structure.

2) Could you add buttons for collapse / uncollapse all nodes?

3) It would be handy if the path would be a (read only) text field instead of a label so one can copy it to the clipboard.

4) The start screen labels the three buttons with "Yes", "No", "Cancel" (or their german equivalents) which is not very clear with respect to the question ("Do you wish to open an existing XML document or create one?").

5) Bug: I tested XML Explorer with a sample xml file and the structure was not shown correctly (see xml code below). The error occurs first at the closing tag of "phone" which is not recognized.
Code:
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <GetRecordsResponse xmlns:gml="http://www.opengis.net/gml" xmlns:iso19115="http://www.isotc211.org/iso19115/">
   <RequestId/>
   <SearchStatus status="complete" timestamp="2005-11-21T11:32:23"/>
   <SearchResults elementSet="full" numberOfRecordsMatched="1" numberOfRecordsReturned="1">
    <MD_Metadata>
     <contact>
      <CI_ResponsibleParty>
       <contactInfo>
        <CI_Contact>
         <phone>
          <CI_Telephone>
           <voice>
            <CharacterString>%2B49-155-255</CharacterString>
           </voice>
           <facsimile>
            <CharacterString>%2B49-155-259</CharacterString>
           </facsimile>
          </CI_Telephone>
         </phone>
         <address>
          <CI_Address>
           <country>
            <CharacterString>Germany</CharacterString>
           </country>
          </CI_Address>
         </address>
         <onlineResource>
          <CI_OnlineResource>
           <linkage>
            <URL>http%3A%2F%2Fwww.gistec-online.de</URL>
           </linkage>
          </CI_OnlineResource>
         </onlineResource>
        </CI_Contact>
       </contactInfo>
       <role>
        <CI_RoleCode codeList="http://www.tc211.org/ISO19139/resources/codeList.xml?CI_RoleCode" codeListValue="developer"/>
       </role>
      </CI_ResponsibleParty>
     </contact>
     <identificationInfo>
      <MD_DataIdentification>
       <citation>
        <CI_Citation>
         <CI_Date/>
         <CI_Series/>
        </CI_Citation>
       </citation>
       <resourceSpecificUsage>
        <MD_Usage/>
       </resourceSpecificUsage>
       <descriptiveKeywords>
        <MD_Keywords/>
       </descriptiveKeywords>
       <graphicOverview>
        <MD_BrowseGraphic/>
       </graphicOverview>
       <resourceConstraints>
        <MD_LegalConstraints/>
       </resourceConstraints>
       <resourceConstraints>
        <MD_SecurityConstraints/>
       </resourceConstraints>
       <resourceMaintenance>
        <MD_MaintenanceInformation/>
       </resourceMaintenance>
       <resourceFormat>
        <MD_Format/>
       </resourceFormat>
       <spatialResolution>
        <MD_Resolution/>
       </spatialResolution>
       <extent>
        <EX_Extent>
         <verticalElement>
          <EX_VerticalExtent/>
         </verticalElement>
         <temporalElement>
          <EX_TemporalExtent>
           <extent>
            <TM_Primitive xsi:type="gml:TimePeriodType">
             <gml:begin>
              <gml:TimeInstant>
               <gml:timePosition>2001-10-10T00%3A00%3A00-00%3A00</gml:timePosition>
              </gml:TimeInstant>
             </gml:begin>
             <gml:end>
              <gml:TimeInstant>
               <gml:timePosition>2003-08-14T00%3A00%3A00-00%3A00</gml:timePosition>
              </gml:TimeInstant>
             </gml:end>
            </TM_Primitive>
           </extent>
          </EX_TemporalExtent>
         </temporalElement>
         <geographicElement>
          <EX_GeographicDescription>
           <geographicIdentifier>
            <MD_Identifier>
             <code>
              <CharacterString>Hesse</CharacterString>
             </code>
            </MD_Identifier>
           </geographicIdentifier>
          </EX_GeographicDescription>
         </geographicElement>
         <geographicElement>
          <EX_GeographicBoundingBox/>
         </geographicElement>
        </EX_Extent>
       </extent>
      </MD_DataIdentification>
     </identificationInfo>
     <dataQualityInfo>
      <DQ_DataQuality>
       <scope>
        <DQ_Scope/>
       </scope>
       <lineage>
        <LI_Lineage/>
       </lineage>
       <report/>
      </DQ_DataQuality>
     </dataQualityInfo>
     <metadataMaintenance/>
     <spatialRepresentationInfo>
      <MD_VectorSpatialRepresentation>
       <geometricObjects/>
      </MD_VectorSpatialRepresentation>
     </spatialRepresentationInfo>
     <spatialRepresentationInfo>
      <MD_Georectified/>
     </spatialRepresentationInfo>
     <spatialRepresentationInfo>
      <MD_Georeferenceable/>
     </spatialRepresentationInfo>
     <referenceSystemInfo>
      <MD_CRS>
       <projectionParameters>
        <MD_ProjectionParameters>
         <obliqueLineAzimuthParameter>
          <MD_ObliqueLineAzimuth/>
         </obliqueLineAzimuthParameter>
         <obliqueLinePointParameter>
          <MD_ObliqueLinePoint/>
         </obliqueLinePointParameter>
        </MD_ProjectionParameters>
       </projectionParameters>
       <ellipsoidParameters>
        <MD_EllipsoidParameters/>
       </ellipsoidParameters>
      </MD_CRS>
     </referenceSystemInfo>
     <contentInfo>
      <MD_FeatureCatalogueDescription/>
     </contentInfo>
     <contentInfo>
      <MD_ImageDescription>
       <dimension>
        <MD_Band/>
       </dimension>
      </MD_ImageDescription>
     </contentInfo>
     <distributionInfo>
      <MD_Distribution/>
     </distributionInfo>
    </MD_Metadata>
   </SearchResults>
  </GetRecordsResponse>
 </soapenv:Body>
</soapenv:Envelope>
Back to top
View user's profile Send private message
Titan



Joined: 11 Aug 2004
Posts: 5382
Location: /b/

PostPosted: Mon May 22, 2006 9:32 am    Post subject: Reply with quote

RobOtter wrote:
1) Could you add the possibility to resize the treeview? While resizing the whole window, the treeview width stays the same which is sometimes to small if you have a highly nested structure.

Making the TreeView wider doesn't look good with small XML documents however I understand that the horizontal scrollbar can be annoying so I'll look into fixing this.

RobOtter wrote:
2) Could you add buttons for collapse / uncollapse all nodes?

That's not really necessary because you can uncollapse everything by clicking the minus buttons on all the top elements. I did once plan to add a whole load of control buttons like this so I'll have a re-think.

RobOtter wrote:
3) It would be handy if the path would be a (read only) text field instead of a label so one can copy it to the clipboard.

Good idea, I've made it a readonly edit control -- coming in the next update.

RobOtter wrote:
4) The start screen labels the three buttons with "Yes", "No", "Cancel" (or their german equivalents) which is not very clear with respect to the question ("Do you wish to open an existing XML document or create one?").

It should say 'Open', 'New' and 'Cancel':


I think I figured out why it might not be changing the buttons for you so I fixed it -- next update.

RobOtter wrote:
5) Bug: I tested XML Explorer with a sample xml file and the structure was not shown correctly (see xml code below). The error occurs first at the closing tag of "phone" which is not recognized.

This problem is due to the experimental XMLQuery(), I'll fix it for the next update.

Thanks for the reprt Smile
_________________

Back to top
View user's profile Send private message Visit poster's website
Ace_NoOne



Joined: 10 Oct 2005
Posts: 333
Location: Germany

PostPosted: Mon May 22, 2006 11:05 am    Post subject: Reply with quote

Oh my -! I really need to get more active (or rather, more passive... Rolling Eyes ) here again; I'd almost missed this!

Yet another great tool by The Titan...
Great job, buddy!
Back to top
View user's profile Send private message
RobOtter



Joined: 30 Jan 2005
Posts: 125
Location: Darmstadt, Germany

PostPosted: Mon May 22, 2006 11:39 am    Post subject: Reply with quote

Titan wrote:
RobOtter wrote:
1) Could you add the possibility to resize the treeview? While resizing the whole window, the treeview width stays the same which is sometimes to small if you have a highly nested structure.

Making the TreeView wider doesn't look good with small XML documents however I understand that the horizontal scrollbar can be annoying so I'll look into fixing this.


I remember there was this thread about a splitter bar control: http://www.autohotkey.com/forum/viewtopic.php?t=8746. Maybe you can adapt the technique?

Titan wrote:
RobOtter wrote:
2) Could you add buttons for collapse / uncollapse all nodes?

That's not really necessary because you can uncollapse everything by clicking the minus buttons on all the top elements. I did once plan to add a whole load of control buttons like this so I'll have a re-think.


Maybe we misunderstand each other or it is a bug especially for me Smile :
Collapsing all child nodes works perfectly here.
But to uncollapse (=open) all nodes, I have no choice but to click on the first plus icon (which opens only the child nodes of the very next level), then click the next one and also the next one... I would envision a button that opens all child nodes (and their childs recursively) from the currently chosen node at once.
Back to top
View user's profile Send private message
Titan



Joined: 11 Aug 2004
Posts: 5382
Location: /b/

PostPosted: Mon May 22, 2006 12:04 pm    Post subject: Reply with quote

In the update version 1.2 I fixed the few parsing errors and included support for XHTML/HTML encoding -- all (valid) XML documents are now compatable. I also made some enhancements to speed and shortcuts like doubleclicking and hotkeys.

RobOtter wrote:
I remember there was this thread about a splitter bar control: http://www.autohotkey.com/forum/viewtopic.php?t=8746. Maybe you can adapt the technique?
Thanks, I'll take a look.

RobOtter wrote:
I would envision a button that opens all child nodes (and their childs recursively) from the currently chosen node at once.
That would be useful, I just don't know where to fit it in the current GUI Razz If there are other functions that can be added like this I could probabily add a new tab page and group these together.
_________________

Back to top
View user's profile Send private message Visit poster's website
RobOtter



Joined: 30 Jan 2005
Posts: 125
Location: Darmstadt, Germany

PostPosted: Mon May 22, 2006 12:26 pm    Post subject: Reply with quote

Titan wrote:
In the update version 1.2 I fixed the few parsing errors and included support for XHTML/HTML encoding -- all (valid) XML documents are now compatable.

Hm... I´m pretty sure my above XML is valid but the structure that XML Explorer shows is still errorneous (although it is another error now Very Happy ): As you can see in the source code, there should be some content below the tag soapenv:Envelope.soapenv:Body.GetRecordsResponse.SearchResults.MD_Metadata.contact (like "CI_ResponsibleParty->contactInfo->CI_Contact->...) but now there is nothing.

Titan wrote:
RobOtter wrote:
I would envision a button that opens all child nodes (and their childs recursively) from the currently chosen node at once.
That would be useful, I just don't know where to fit it in the current GUI Razz If there are other functions that can be added like this I could probabily add a new tab page and group these together.


Ok, I see the problem. So, how about Shift-Click or Ctrl-Click on the plus icon to uncollapse all? No need for an extra button anymore then Smile
Back to top
View user's profile Send private message
Titan



Joined: 11 Aug 2004
Posts: 5382
Location: /b/

PostPosted: Mon May 22, 2006 11:04 pm    Post subject: Reply with quote

RobOtter wrote:
As you can see in the source code, there should be some content below the tag soapenv:Envelope.soapenv:Body.GetRecordsResponse.SearchResults.MD_Metadata.contact (like "CI_ResponsibleParty->contactInfo->CI_Contact->...) but now there is nothing.

That's strange, using the code for the XML document you gave in your previous post I see this under that tag (which seems to be correct):


Is there something wrong that I haven't noticed?

RobOtter wrote:
Ok, I see the problem. So, how about Shift-Click or Ctrl-Click on the plus icon to uncollapse all? No need for an extra button anymore then Smile

Another great idea! I'll have this feature included in the next update.

Edit: version 1.3 - press Alt++ to collapse all items and Alt+- to uncollapse all items when focused on the TreeView. I also added a StatusBar to remind you of your last action.
_________________

Back to top
View user's profile Send private message Visit poster's website
RobOtter



Joined: 30 Jan 2005
Posts: 125
Location: Darmstadt, Germany

PostPosted: Tue May 23, 2006 9:04 am    Post subject: Reply with quote

Thanks for the update!

Regarding my error about the xml structure, I must admit it was my fault Embarassed
I did not remember that I tried your app with a dynamically changing file, so it was obvious results must differ with time... I´m really sorry for that!

I saw that you are changing the labels of the buttons in the message box by using their original names:
Code:
ControlSetText, &Yes, &Open..., %msgt%
ControlSetText, &No, &New, %msgt%

If you would change it this way, using their classNN identifier, it will work with other languages than english also:
Code:
ControlSetText, Button1, &Open..., %msgt%
ControlSetText, Button2, &New, %msgt%


Best regards,
Rob
Back to top
View user's profile Send private message
Titan



Joined: 11 Aug 2004
Posts: 5382
Location: /b/

PostPosted: Tue May 23, 2006 10:23 am    Post subject: Reply with quote

RobOtter wrote:
If you would change it this way, using their classNN identifier, it will work with other languages than english also
Oh I see.. ok, I updated the script - I didn't change the version number for this however.

Thanks for the feedback Smile
_________________

Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group