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 Stuart Celarier other posts by this author
Jan 7 2003 11:10PM messages near this date
view in the new Beta List Site
Re: [Visual-XSLT-discuss] Formatting/pretty-printing xml/xsl in the editor | [Visual-XSLT-discuss] different result betwen Visual-XSLT and MSXSLT?
Taras,

One simple workaround to get XML into a human readable format is to use
XSLT. Here is a simple variation on the identity transform.

<xsl:transform version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 

 <xsl:output method="xml" indent="yes"/> 

 <xsl:template match="@*|node()"> 
  <xsl:copy> 
   <xsl:apply-templates match="@*|node()"/> 
  </xsl:copy> 
 </xsl:template> 

</xsl:transform> 

Run your XML through this transformation, save that to a file, and then
work with the reformatted XML. Or use a macro in VS.NET. This does have
its limitations, as noted in the XSLT spec regarding indent="yes" and
mixed content elements, but I find it pretty useful nonetheless.

Cheers,
Stuart
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