This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: how to indent xml files with installscript
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 10, 2010
09:50 AM
how to indent xml files with installscript
hi,
i managed to write xml files successfully using this post here
unfortunately the result is one huge line with elements etc.
is it possible to use xmltextwriter... or something similar to format the file with linebreaks, spaces etc? how would i achieve this?
any brief installscript example would be helpful
mary
i managed to write xml files successfully using this post here
unfortunately the result is one huge line with elements etc.
is it possible to use xmltextwriter... or something similar to format the file with linebreaks, spaces etc? how would i achieve this?
any brief installscript example would be helpful
mary
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 10, 2010
12:29 PM
nobody any idea? :rolleyes:
mary
mary
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 10, 2010
12:53 PM
One idea would be to include a very small XSLT file with the xsl:output indent option set to yes in your setup. Then use a XML API to apply this XSLT file to your generated XML file to get the proper formatting.
You can probably find code samples of applying a XSLT to a XML document. And a sample of simple XSLT that you can use to correctly format the XML document.
Hope this helps,
Ajay
You can probably find code samples of applying a XSLT to a XML document. And a sample of simple XSLT that you can use to correctly format the XML document.
Hope this helps,
Ajay
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 11, 2010
01:47 AM
yes you're right -
but i don't want to write a temporary xslt file if i don't have to ...
any other suggestion?
mary
but i don't want to write a temporary xslt file if i don't have to ...
any other suggestion?
mary
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 02, 2012
10:01 AM
Dim xmlDocument
Dim pathToXmlFile
pathToXmlFile = Session.Property("INSTALLDIR") & "\InnovatorServerConfig.xml"
Set xmlDocument = CreateObject("Microsoft.XMLDOM")
xmlDocument.async = false
xmlDocument.load pathToXmlFile
Dim xslt
xslt = "" & vbcrlf
xslt = xslt & "" & vbcrlf
xslt = xslt & "" & vbcrlf
xslt = xslt & "" & vbcrlf
xslt = xslt & ""& vbcrlf
xslt = xslt & " "& vbcrlf
xslt = xslt & " "& vbcrlf
xslt = xslt & ""& vbcrlf
xslt = xslt & ""& vbcrlf
xslt = xslt & " "& vbcrlf
xslt = xslt & " "& vbcrlf
xslt = xslt & " "& vbcrlf
xslt = xslt & ""& vbcrlf
xslt = xslt & " "
set xsltDom = CreateObject("Microsoft.XMLDOM")
xsltDom.async = false
xsltDom.loadXML(xslt)
' Apply transformation
xmlDocument.transformNodeToObject xsltDom, xmlDocument
xmlDocument.Save pathToXmlFile
Dim pathToXmlFile
pathToXmlFile = Session.Property("INSTALLDIR") & "\InnovatorServerConfig.xml"
Set xmlDocument = CreateObject("Microsoft.XMLDOM")
xmlDocument.async = false
xmlDocument.load pathToXmlFile
Dim xslt
xslt = "" & vbcrlf
xslt = xslt & "
xslt = xslt & "" & vbcrlf
xslt = xslt & "" & vbcrlf
xslt = xslt & "
xslt = xslt & "
xslt = xslt & "
xslt = xslt & ""& vbcrlf
xslt = xslt & ""& vbcrlf
xslt = xslt & "
xslt = xslt & "
xslt = xslt & "
xslt = xslt & ""& vbcrlf
xslt = xslt & "
set xsltDom = CreateObject("Microsoft.XMLDOM")
xsltDom.async = false
xsltDom.loadXML(xslt)
' Apply transformation
xmlDocument.transformNodeToObject xsltDom, xmlDocument
xmlDocument.Save pathToXmlFile
![](/skins/images/D60DF682EA37BF37032955CE10F3F0BB/responsive_peak/images/icon_anonymous_message.png)