473,657 Members | 2,516 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TRansform from XML document to string

I have a XMl document that needs to transform to string. What I need is to
get all of each value from each xml node and separate each value by coma. To
do this, I created a XML document and xsl file. I get results as what I
needed if I validate xml document using the xsl file with IE 6.0. However, if
I do this in VB.net, I can not get coma or any other charactors to separate
value. Any one can help?

Here is the XSL code:
<?xml version='1.0'?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">

<xsl:output method="text" />
<xsl:variable name="coma" select="','" />
<xsl:param name="strArray"
select="'string 1,string2,strin g3,string4,stri ng5,string6'" />
<xsl:param name="elm" select="substri ng-before($strArra y,$coma)" />
<xsl:param name="pattern" select="$coma"/>

<xsl:template name="test" match="TenderAu thorization/Fields">
<xsl:call-template name="getNext">
<xsl:with-param name="string" select="$strArr ay" />
</xsl:call-template>
</xsl:template>

<xsl:template name="getNext">
<xsl:param name="string" />
<xsl:if test="$string" >
<xsl:call-template name="getMatch" >
<xsl:with-param name="nodeName" select="substri ng-before($string,
$pattern)" />
</xsl:call-template>
<xsl:call-template name="getNext">
<xsl:with-param name="string" select="substri ng-after($string, $pattern)"
/>
</xsl:call-template>
</xsl:if>
</xsl:template>

<xsl:template name="getMatch" >
<xsl:param name="nodeName"/>
<xsl:for-each select="child:: node()">
<xsl:if test="name(.)=$ nodeName">
<xsl:value-of select="." />
<xsl:value-of select="$coma" />
</xsl:if>
</xsl:for-each>
</xsl:template>

</xsl:stylesheet>

Thanks in advance

John
Jul 21 '05 #1
0 1133

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1650
by: Daniel | last post by:
in C# how do i transform an xml document with an xsl document when my xml document is a string and my xsl document is a string? the msdn examples only show how to do it with steams and files. in my case i have everything in string
6
2482
by: Stephen Cook | last post by:
Having worked through the problems around enabling the document function using an XmlUrlResolver I started work on building a useful class to hide the intricacies. Trying to generalise the process I've hit a snag. How do I resolve multiple external references? The transform method on a stylesheet only takes one resolver, not an array Stephen
3
1950
by: b0yce | last post by:
Hi Group, I think I have found a problem with the <xsl:element> when being transformed by the .NET xmlTransform class. When using XmlSpy for development and debugging, the <xsl:number> subsitutes the position of the node correctly as I expected. This is fine with MSXML 3.0 & MSXML 4.0 plus the XmlSpy internal engine. I have been able to reproduce using a simpler Xml and Xsl to demonstrate; XML
2
1184
by: K riley | last post by:
Hi. I am using the transform method to create an HTML file using an existing XML Document and an XLST. I need to use XPath to extract a node from my XML Document and my XLST document will format the node into something readable to my users. My code works, however, I will be having multiple users calling my routines at the same time. So I don't want to create a "hard" copy of my html file and place on my server. Because every time a...
3
2130
by: Andy | last post by:
Hi all, I'm having a problem doing an Xslt transform in code. I've done it before, so I'm not really sure why its not working. The problem is that the result of the transform is an empty string. I expected the xml to be transformed into a plain text document. Everything works fine when i transform using XmlPad. Here's the code (which does generate the Xml properly): Sample XML:
3
1795
by: Daniel | last post by:
in C# how do i transform an xml document with an xsl document when my xml document is a string and my xsl document is a string? the msdn examples only show how to do it with steams and files. in my case i have everything in string
0
317
by: John | last post by:
I have a XMl document that needs to transform to string. What I need is to get all of each value from each xml node and separate each value by coma. To do this, I created a XML document and xsl file. I get results as what I needed if I validate xml document using the xsl file with IE 6.0. However, if I do this in VB.net, I can not get coma or any other charactors to separate value. Any one can help? Here is the XSL code: <?xml...
12
10095
by: InvalidLastName | last post by:
We have been used XslTransform. .NET 1.1, for transform XML document, Dataset with xsl to HTML. Some of these html contents contain javascript and links. For example: // javascript if (a &gt; b) ..... // xsl contents abc.aspx?p1=v1&amp;p2=<xsl:value-of select="$v2" />
1
1073
by: sudhaMurugesan | last post by:
Hi all, I am using VS2003. I am new to VS2003. I cannot transform an xml file into a string output in my windows application. But the same function works well with VS2005. it also asks for xmlresolver in the transform() function. I provided Nothing as 4th parameter, eventhough it doesnt work. anybody can help me?. I dont know where i am wrong. I need to create html files with this xml data. Public Shared Function CreateHtmlFile(ByVal...
0
8324
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8516
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7353
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.