Pretty Print (XML only - with line breaks) from DOS command line



  • I am using wget for windows to download a XML. After downloading, it is coming into a single line when opened in notepad++.

    XMLTools.dll Plugin is working fine in converting it into a well formatted XML, however, it has to be done from Notepad++ UI.

    Is there a way to use it from DOS command prompt? I am using the “Pretty Print (XML only - with line breaks)” feature.

    Could anyone please help me in getting it done?

    Thanks,
    Nishant



  • Hello @Nishant-Kansal,

    XMLTools can only be used within npp application, not from cmd shell.
    What could be done is (just out of my mind)

    a) starting npp from command line with file being the parameter and then let a recorded macro do its job.
    b) starting npp from command line with file being the parameter and then let nppexec script do the job
    c) starting npp from command line with file being the parameter and then let python(maybe lua as well) script do it
    d) start npp and run wget from within nppexec and afterwards let it manipulate xml
    e) don’t use npp at all and let a scripting language like python do it for you.

    Cheers
    Claudia



  • @Claudia-Frank said:

    start npp and run wget from within nppexec and afterwards let it manipulate xml

    Hello Claudia

    Thanks for sharing your thoughts. I liked “start npp and run wget from within nppexec and afterwards let it manipulate xml” and working towards it. I got to know about nppexec plugin. I am able to generate XML through nppexec, however, how to get the XMl formatted is still not happening. Any thoughts on this please?

    Thanks,
    Nishant



  • @Nishant-Kansal

    I assume, when using nppexec and wget, that retrieved xml document is opened in npp.

    Add the following line to the nppexec call of wget

    npp_menucommand Plugins\XML Tools\Pretty print (XML only - with line breaks)

    this will call the pretty print of xml tools.

    Cheers
    Claudia


Log in to reply