Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Sat, 28 Jun 2008 20:30:20 -0700 (PDT),    group: microsoft.public.xml        back       


IXMLDOMDocument::Save() with line breaks and indenting?   
How do you use MSXML2::IXMLDOMDocument::save() to include line breaks
and indents?
date: Sat, 28 Jun 2008 20:30:20 -0700 (PDT)   author:   Cartoper

Re: IXMLDOMDocument::Save() with line breaks and indenting?   
Cartoper wrote:
> How do you use MSXML2::IXMLDOMDocument::save() to include line breaks
> and indents?

I don't think you can get the save method to indent. What you can do 
however is run an XSLT transformation to create an indentend document, 
then save that.
The XSLT stylesheet to do that is as easy as

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

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

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

</xsl:stylesheet>

Apply that with transformNodeToObject to transform the DOM document you 
have to a new DOM document, then call the save method on the result.


-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
date: Sun, 29 Jun 2008 13:20:45 +0200   author:   Martin Honnen

Re: IXMLDOMDocument::Save() with line breaks and indenting?   
A few months ago I asked a similar question and got a similar answer. I 
don't remember if there was more information in that thread but I know 
someone suggested use of a separate utility to reformat XML.


"Cartoper"  wrote in message 
news:ad25479e-b601-46a2-9826-0a169e7d150c@y38g2000hsy.googlegroups.com...
> How do you use MSXML2::IXMLDOMDocument::save() to include line breaks
> and indents?
>
date: Wed, 2 Jul 2008 03:50:58 -0700   author:   Sam Hobbs _change_social_to_socal

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us