473,396 Members | 1,826 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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:stylesheet 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="'string1,string2,string3,string4,string5,s tring6'" />
<xsl:param name="elm" select="substring-before($strArray,$coma)" />
<xsl:param name="pattern" select="$coma"/>

<xsl:template name="test" match="TenderAuthorization/Fields">
<xsl:call-template name="getNext">
<xsl:with-param name="string" select="$strArray" />
</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="substring-before($string,
$pattern)" />
</xsl:call-template>
<xsl:call-template name="getNext">
<xsl:with-param name="string" select="substring-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 1121

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

Similar topics

1
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...
6
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...
3
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>...
2
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...
3
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...
3
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...
0
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...
12
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)...
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.