Hi there,

I stumbled across this XML UDF topic and tried to get it working with some namespace additions.

Sadly enough the "new" line did not show up within the XML and I have no idea why.

Can someone help me out?

Chris


 Code:
;XMLFormatOutput() - Formats the output style of an XMLDOM object to the standard
Function XMLFormatOutput($objXMLDOM)

	Dim $,$strXSL,$objXSL

	$strXSL = "<?xml version=" + chr(34) + "1.0" + chr(34) + " encoding=" +
		chr(34) + "UTF-8" + chr(34) + "?>" + @CRLF
        ;new line
  	$strXSL = $strXSL + "<inv:inventory xmlns:invtest=" + Chr(34) + 
  		"urn:com.test.www/test/inv" + Chr(34) + ">" + @CRLF
        ;end of new line
  	$strXSL = $strXSL + "<xsl:stylesheet version=" + chr(34) + "1.0" + chr(34) +
  		" xmlns:xsl=" + chr(34) + "http://www.w3.org/1999/XSL/Transform" +
  		chr(34) + ">" + @CRLF
  	$strXSL = $strXSL + "<xsl:output method=" + chr(34) + "xml" + chr(34) +
  		" version=" + chr(34) + "1.0" + chr(34) + " encoding=" + chr(34) +
  		"UTF-8" + chr(34) + " indent=" + chr(34) + "yes" + chr(34) + "/>" + @CRLF
  	$strXSL =  $strXSL + "<xsl:template match=" + chr(34) + "/ | @@* | node()" +
  		chr(34) + ">" + @CRLF
  	$strXSL = $strXSL + "<xsl:copy>"+ @CRLF
  	$strXSL = $strXSL + "<xsl:apply-templates select=" + chr(34) +
  		"@@* | node()" + chr(34) + " />"+ @CRLF
  	$strXSL = $strXSL + "</xsl:copy>"+ @CRLF
  	$strXSL = $strXSL + "</xsl:template>"+ @CRLF
  	$strXSL = $strXSL + "</xsl:stylesheet>" + @CRLF
  	$strXSL = $strXSL + "</inv:inventory>"

	;? "XLM Stylesheet: " + @CRLF + $strXSL

	$objXSL = CreateObject("Microsoft.XMLDOM")
	$objXSL.async = false
	$=$objXSL.LoadXML($strXSL)

	;Transform file
	$objXMLDOM.TransformNodeToObject ($objXSL, $objXMLDOM)
	$XMLFormatOutput = $objXMLDOM
EndFunction