|
-
Sep 11th, 2003, 08:00 AM
#1
Thread Starter
Fanatic Member
What is .NET equiv of MSXML4 transformNode
Hi,
I have an xml file and an xslt file. I want to be able to select the xml node in VB.NET and transform only that node while still having a reference to the rest of the document from within the xslt. This is so that I can use any references to other parts of the document. In VB6, this was easy, you simply select the node of choice and use the transformNode function. In .NET however, I cannot find an equivalent function. I have tried creating an XPathNavigator from the node and passing that into the transformation, but it still processes the entire document. What can I do to get the xslt processor to process only the selected node?
XML
---
<doc>
<paragraph id="1">
<line>Here is line 1,1</line>
<line>Here is line 1,2</line>
<line>Here is line 1,3</line>
<line>Here is line 1,4</line>
</paragraph>
<paragraph id="2">
<line>Here is line 2,1</line>
<line>Here is line 2,2</line>
<line>Here is line 2,3</line>
<line>Here is line 2,4</line>
</paragraph>
<paragraph id="3">
<line>Here is line 3,1</line>
<line>Here is line 3,2</line>
<line>Here is line 3,3</line>
<line>Here is line 3,4</line>
</paragraph>
</doc>
XSLT
----
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl utput method="text" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="paragraph">
<xsl:for-each select="line">
<xsl:value-of select="."/>
<xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
VB6 output [when paragraph id=1 is selected] <- desired output
----------
Here is line 1,1
Here is line 1,2
Here is line 1,3
Here is line 1,4
VB.NET output [when paragraph id=1 is selected]
-------------
Here is line 1,1
Here is line 1,2
Here is line 1,3
Here is line 1,4
Here is line 2,1
Here is line 2,2
Here is line 2,3
Here is line 2,4
Here is line 3,1
Here is line 3,2
Here is line 3,3
Here is line 3,4
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|