I've found a sample on http://msdn2.microsoft.com/en-us/library/ms766561.aspx
to filter a .XML
ex.
<?xml version="1.0"?>
<COLLECTION dateCreated="01-04-2000">
<BOOK>
<TITLE>Splish Splash</TITLE>
<AUTHOR>Paula Thurman</AUTHOR>
<PUBLISHER>Scootney</PUBLISHER>
<PRICE>250</PRICE>
</BOOK>
<BOOK>
<TITLE Editor="Hoepli">Lover Birds2</TITLE>
<AUTHOR>Cynthia Randall</AUTHOR>
<PUBLISHER>Lucerne Publishing</PUBLISHER>
<PRICE>200</PRICE>
</BOOK>
<BOOK>
<TITLE>The Sundered Grail</TITLE>
<AUTHOR>Eva Corets</AUTHOR>
<PUBLISHER>Lucerne Publishing</PUBLISHER>
<PRICE>100</PRICE>
</BOOK>
</COLLECTION>
file .xsl
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/ Transform"> <xsl:template match="/"> <LowPriceBooks> <xsl:for-each select="//COLLECTION/BOOK[not(PRICE >'220')]"> <xsl:copy> <xsl:apply-templates select="*"/> </xsl:copy> </xsl:for-each> </LowPriceBooks> </xsl:template> <xsl:template match="*"> <xsl:copy> <xsl:apply-templates /> </xsl:copy> </xsl:template> </xsl:stylesheet>
the essential part on VB
' Parse results into a result DOM Document.
Source.transformNodeToObject stylesheet, result
where Source is not filtred .XML and stylesheet is .xsl file where result is .XML processed (filtred) with PRICE > 220
considering I don't know very well XML,
All work fine but after the processing the node
<TITLE Editor="Hoepli">Lover Birds2</TITLE>
the property Editor="Hoepli" is lost !!
can I change the .xls file to copy also properties ?
I hope someone can help me ..
mtugnoli
to filter a .XML
ex.
<?xml version="1.0"?>
<COLLECTION dateCreated="01-04-2000">
<BOOK>
<TITLE>Splish Splash</TITLE>
<AUTHOR>Paula Thurman</AUTHOR>
<PUBLISHER>Scootney</PUBLISHER>
<PRICE>250</PRICE>
</BOOK>
<BOOK>
<TITLE Editor="Hoepli">Lover Birds2</TITLE>
<AUTHOR>Cynthia Randall</AUTHOR>
<PUBLISHER>Lucerne Publishing</PUBLISHER>
<PRICE>200</PRICE>
</BOOK>
<BOOK>
<TITLE>The Sundered Grail</TITLE>
<AUTHOR>Eva Corets</AUTHOR>
<PUBLISHER>Lucerne Publishing</PUBLISHER>
<PRICE>100</PRICE>
</BOOK>
</COLLECTION>
file .xsl
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/ Transform"> <xsl:template match="/"> <LowPriceBooks> <xsl:for-each select="//COLLECTION/BOOK[not(PRICE >'220')]"> <xsl:copy> <xsl:apply-templates select="*"/> </xsl:copy> </xsl:for-each> </LowPriceBooks> </xsl:template> <xsl:template match="*"> <xsl:copy> <xsl:apply-templates /> </xsl:copy> </xsl:template> </xsl:stylesheet>
the essential part on VB
' Parse results into a result DOM Document.
Source.transformNodeToObject stylesheet, result
where Source is not filtred .XML and stylesheet is .xsl file where result is .XML processed (filtred) with PRICE > 220
considering I don't know very well XML,
All work fine but after the processing the node
<TITLE Editor="Hoepli">Lover Birds2</TITLE>
the property Editor="Hoepli" is lost !!
can I change the .xls file to copy also properties ?
I hope someone can help me ..
mtugnoli