Marcos Hercules Santos
2006-05-28 14:31:13 UTC
Hello people,
This is my first time in this group, and in the start I want to
congratulate for creating this group.
Well, I have an XML called storage and another called tools, in which
there's a
simple operation through a XSL used to compare both XMLs (by the ID
number).
see a piece from my XSL,
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" encoding="ISO-8859-1"
doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN" />
<xsl:variable name="tools" select="//tool" />
<xsl:param name="compare-file-name" select="'tools.xml'"/>
<xsl:variable name="second" select="document($compare-file-name)"/>
<xsl:key name="by-model" match="reference" use="id" />
<xsl:template match="/">
Now, I'm doing this through VBA (Excel 2003).
I'm trying on to apply transformNodeToObject in a way to pass another
DOMDocument object for holding the results, with no sucess.
Would anyone point me how XSLT in VBA can pass parameter to tools.xml
and give me a comparation results in my sheet. I' don't know how xsl
load an external xml in this case.
This is my VBA code
Public Sub compare2()
Dim SourceXSL As New MSXML2.DOMDocument40
Dim StorageML As New MSXML2.DOMDocument40
Dim toolXML As New MSXML2.DOMDocument40
Dim GenericXML As New MSXML2.DOMDocument40
'Load the XMLSpreadsheet file into a DOMDocument object.
StorageXML.Load "C:\storage.xml"
tool.Load "C:\tools.xml"
'Load the XSLStyleSheet file into a DOMDocument object.
SourceXSL.Load "C:\comparation.xsl"
'Apply the XSL style sheet to the XML spreadsheet file and send
it
'to the GenericXML DOMDocument object.
'storageXML.transformNodeToObject Stylesheet:=SourceXSL, _
'OutputObject:=GenericXML
StorageXML.transformNodeToObject SourceXSL, GenericXML
'Save the generic XML file as C:\GenericXMLFile.xls
GenericXML.Save ("C:\GenericXMLFile2.xls")
End Sub
What's it's viewed in my sheet? only the XML format from my
Storage.xml file
Any sample is apreciatte
thanx
Marcos Hercules dos Santos
This is my first time in this group, and in the start I want to
congratulate for creating this group.
Well, I have an XML called storage and another called tools, in which
there's a
simple operation through a XSL used to compare both XMLs (by the ID
number).
see a piece from my XSL,
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" encoding="ISO-8859-1"
doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN" />
<xsl:variable name="tools" select="//tool" />
<xsl:param name="compare-file-name" select="'tools.xml'"/>
<xsl:variable name="second" select="document($compare-file-name)"/>
<xsl:key name="by-model" match="reference" use="id" />
<xsl:template match="/">
Now, I'm doing this through VBA (Excel 2003).
I'm trying on to apply transformNodeToObject in a way to pass another
DOMDocument object for holding the results, with no sucess.
Would anyone point me how XSLT in VBA can pass parameter to tools.xml
and give me a comparation results in my sheet. I' don't know how xsl
load an external xml in this case.
This is my VBA code
Public Sub compare2()
Dim SourceXSL As New MSXML2.DOMDocument40
Dim StorageML As New MSXML2.DOMDocument40
Dim toolXML As New MSXML2.DOMDocument40
Dim GenericXML As New MSXML2.DOMDocument40
'Load the XMLSpreadsheet file into a DOMDocument object.
StorageXML.Load "C:\storage.xml"
tool.Load "C:\tools.xml"
'Load the XSLStyleSheet file into a DOMDocument object.
SourceXSL.Load "C:\comparation.xsl"
'Apply the XSL style sheet to the XML spreadsheet file and send
it
'to the GenericXML DOMDocument object.
'storageXML.transformNodeToObject Stylesheet:=SourceXSL, _
'OutputObject:=GenericXML
StorageXML.transformNodeToObject SourceXSL, GenericXML
'Save the generic XML file as C:\GenericXMLFile.xls
GenericXML.Save ("C:\GenericXMLFile2.xls")
End Sub
What's it's viewed in my sheet? only the XML format from my
Storage.xml file
Any sample is apreciatte
thanx
Marcos Hercules dos Santos