I've been digging into XSLT more and more these days but this issue has me scratching my head for the past few hours now.
I have the following XSLT script, it is used within a server environment to receive and help process part of a SOAP envelope.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:test="" exclude-result-prefixes="msxsl test">
<xsl:output method="xml" omit-xml-declaration="yes" indent="no"/>
<msxsl:script implements-prefix="test" language="C#">
public Param GetParam()
{
// Code here
}
</msxsl:script>
<xsl:template match="/">
<xsl:choose>
<xsl:comment>Used by IT_E items</xsl:comment>
<xsl:when test="helloworld">
<xsl:text>helloworld|clientdata|username|</xsl:text>
<xsl:value-of select="helloworld/clientdata/username"/>
<xsl:text>$helloworld|clientdata|password|</xsl:text>
<xsl:value-of select="helloworld/clientdata/password"/>
</xsl:when>
Yes, only part of it. It would be too long and boring to post in full. Now, as you can see I have already prepared an msxsl block, however I have no clue how to proceed.
In short, what I want to achieve is to get my current output:
helloworld|clientdata|username|myvalue$helloworld|clientdata|password|myvalue
And then further processing, all done inside the XSLT script. Basically I would split on the $ character, then for each item in the array, split on | and fill a struct:
Param(string cmd, string class, string var, string val);
How can I return the Param object (my custom C# struct) instead of the plain text? Any hints to get me into the right direction?
Also, how does the custom prefix work? Can I just leave the URL empty in the declaration?
Update:
This is the XML I still have left from the SOAP envelope after processing by two other scripts that remove all SOAP elements from it.
<helloworld>
<clientdata>
<username>test</username>
<password>test</password>
<clientdata>
I should have included this from the start, my appologies!