Einzelnen Beitrag anzeigen

blackfin
(Gast)

n/a Beiträge
 
#5

Re: XMLDOMDocument formatiert abspeichern

  Alt 2. Jun 2010, 14:39
Wegen dem formatieren, vielleicht hilft dir das ja?:

Zitat:
...What you can do 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
xmlnssl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xslutput 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.
Das heisst, du transformierst dein XMLDoc erstmal mit einem XSL stylesheet wie oben beschrieben und speicherst dann das.
Das sollte dann die Einrückungen haben.
  Mit Zitat antworten Zitat