c# - Combining XSLT & msxsl with structs -
i've been digging xslt more , more these days issue has me scratching head past few hours now.
i have following xslt script, used within server environment receive , process part of 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 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, part of it. long , boring post in full. now, can see have prepared msxsl block, have no clue how proceed.
in short, want achieve current output:
helloworld|clientdata|username|myvalue$helloworld|clientdata|password|myvalue
and further processing, done inside xslt script. split on $ character, each item in array, split on | , fill struct:
param(string cmd, string class, string var, string val);
how can return param object (my custom c# struct) instead of plain text? hints me right direction?
also, how custom prefix work? can leave url empty in declaration?
update:
this xml still have left soap envelope after processing 2 other scripts remove soap elements it.
<helloworld> <clientdata> <username>test</username> <password>test</password> <clientdata>
i should have included start, appologies!
Comments
Post a Comment