Sunday, June 16, 2013

Power of notepad++

Hello Guys,

I hope you tried short cuts from my last post.Today I am going to tell you some more tricks to play with XML in Notepad++.Webservice is in fashion now a days.So whoever is working on web service must has to fight with XML always.So here Notepad++ can help you a little bit.You may know there are so many plugins are available over the internet which make your Notepad++ more powerful and handy.XML tool is one of them.For installing any plugin go to Plugins >Plugin Manager > Show Plugin Manager.Your screen will be looking similar to below.


Find XML Tool plugin in Available Tab,select it and click Install.Now this plugins will be available in Installed Tab.Close Plugin Manager and restart your notepad.

Now let's start having fun.I have one string like below and I want to change it to XML.


Select the string and go to Plugins > XML Tools(now it will be available there) > Convert Selection Text to XML and your string will be changed into XML.


So you have got your XML but it's not well formed XML.For doing it in well form select the XML and go to Plugins > XML Tools > Pretty Print(XML Only- with line breaks) or there is a short cut for it.Press CTRL+ALT+SHIFT+B.Your XML will be looking like this.


You can check for syntax in your XML.Go to Plugins > XML Tools > Check XML Syntax now.It will tell if there is any syntax error.



So finally you have your XML in well formed without any syntax error.Just for your knowledge you can change your file type also.Go to Language and select XML.
Now suppose you want to get the XPath for a node called "fppCode".Select the node and go to Plugins > XML Tools > Current XML Path. You will get the xpath for the node.This functionality is very useful when there is a very big XML and you want xpath of a node.Obviously you can do it other way also but it's gonna take time.

Now if you have a XML and you want to evaluate one XPath from this XML.Go to Plugins > XML Tools > Evaluate Xpath Expression.You will get the a screen looking like below.Just give Xpath you want to evaluate and Press "Evaluate" button.it's will you value of that XPath if it is correct.


It's very common to comment and uncomment tags or nodes in XML for that there is short cut.For comment press CTRL+ALT+SHIFT+C and for uncomment press CTRL+ALT+SHIFT+R.



I hope this will help you in fighting with XML little bit once you are in habit to use these short cuts.Dont try to mug up them just start using them.After some times your hand will be running over key borad by themselves.There are some other functions available in this plugin you can try by yourselves.

1 comment: