ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> visual-xslt-discuss
visual-xslt-discuss
Re: [Visual-XSLT-discuss] Formatting/pretty-printing xml/xsl in the editor
by Eric Promislow other posts by this author
Jan 7 2003 8:23PM messages near this date
view in the new Beta List Site
Re: [Visual-XSLT-discuss] Formatting/pretty-printing xml/xsl in the editor | RE: [Visual-XSLT-discuss] Formatting/pretty-printing xml/xsl in the editor
Hi, Taras,

Pretty-printing should work.  Simply select the XML or XSLT,
and run the Edit|Advanced|Format Selection (Ctrl-K Ctrl-F) command.
This only works in an XSLT edit window, not an XML edit window.
But it will work on any kind of XML text, not just XSLT.

One thing this command won't do is separate two contiguous tags
on the same line, as in

<element_1_with_lots_of_attributes a1='v1' ... a1000='v1000'> <element_2 ...>

For this, you need to do a search-and-replace of '\> \<' with
'> \n< with selection on before carrying out the Format command.
I think this could easily be automated with a macro to call the
two commands, something like:

Edit.Replace "\> \<", ">\n", /r, /sel
Edit.FormatSelection

- Eric

On Tue, Jan 07, 2003 at 08:54:51PM +0100, Taras Tielkes wrote:
>  Hi,
>  
>  Is it possible to auto-format (eg. pretty-print) xml (or xsl) in the
>  Visual XSLT 1.6 editor?
>  
>  Sometimes I paste (messy, unformated) program-generated xml into the
>  editor window, and it would really help to have such a command.
>  
>  Regards,
>  
>  tt
>  
>  _______________________________________________
>  Visual-XSLT-discuss mailing list
>  Visual-XSLT-discuss@[...].com
>  To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Taras Tielkes
Taras Tielkes
Taras Tielkes
Eric Promislow
Eric Promislow
Stuart Celarier

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved