473,769 Members | 2,106 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XSLT transforms and complex parameter types

I am attempting to pass in an XmlDocument as a parameter to a transform:

from my sample ASPX page:

string BaseDir = "/cameron/Play/ComplexParam/";

XmlDocument XSL = new XmlDocument();
XSL.Load(HttpCo ntext.Current.S erver.MapPath(B aseDir + "xsl.xsl")) ;

XmlDocument Data = new XmlDocument();
Data.Load( HttpContext.Cur rent.Server.Map Path(BaseDir + "Data.xml") );

XmlDocument Betty = new XmlDocument();
Betty.LoadXml(" <betty>Betty text<whooo>" +
"Woo text</whooo><weee/></betty>");

StringWriter Results = new StringWriter();

XslTransform XSLT = new XslTransform();
XSLT.Load(XSL.D ocumentElement. CreateNavigator (),
new XmlUrlResolver( ),
Assembly.GetCal lingAssembly(). Evidence);

XsltArgumentLis t Args = new XsltArgumentLis t();
Args.AddParam(" InXML", "", Betty.DocumentE lement);
//Args.AddParam(" InXML", "", Betty);
//Args.AddParam(" InXML", "", (XmlNode)Betty. DocumentElement );

XSLT.Transform( Data.DocumentEl ement.CreateNav igator(),
Args, Results, (XmlResolver)nu ll);

HttpContext.Cur rent.Response.W rite("Transform = " +
Results.ToStrin g());

---------------------------------------------

Data.xml:
<?xml version="1.0" encoding="utf-8" ?>
<Data>
<SomeData>Dat a-here</SomeData>
</Data>

---------------------------------------------

xsl.xsl
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:styleshe et
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="ur n:schemas-microsoft-com:xslt"
xmlns:user="htt p://mycompany.com/mynamespace"
exclude-result-prefixes="msxsl user"
version="1.0">

<xsl:output method="xml" omit-xml-declaration="ye s"/>

<xsl:param name="InXML"/>

<xsl:template match="/">
got root
<xsl:if test="$InXML">
<p>InXml looks good to me!</p>

<p>whoo count <xsl:value-of select="count($ InXML/whooo)"/></p>
<p>weee count <xsl:value-of select="count($ InXML/weee)"/></p>
<p>text '<xsl:value-of select="$InXML/text()"/>'</p>
<xsl:for-each select="$InXML/whooo">
<p>have child</p>
</xsl:for-each>
</xsl:if>
</xsl:template>

</xsl:stylesheet>

---------------------------------------------

Output:
got root
InXml looks good to me!
whoo count 0
weee count 0
text ''

---------------------------------------------

I can do this in IE as a client-side transform without issue but not in
C#. Can anyone see what I am doing wrong?

Thanks

-Cam
Nov 16 '05 #1
1 2370
Hi Cameron,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that XSLTransform works incorrectly when the
parameter contains node. If there is any misunderstandin g, please feel free
to let me know.

Based on my research, this is a known issue in current .net framework.
Since IE uses MSXML to process xml data, it is working properly. This issue
will be fixed in the next version of .net framework. Currently, I think you
have to use MSXML to process with the xsl.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #2

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

Similar topics

3
1566
by: rush | last post by:
I have a DTD that defines new elements "mytextfield" and "mysn", and does it as an extension to XHTML. The idea is that my XML markup is actually valid XHTML according to my DTD. This all works just fine. After getting the DTD to work, I defined a XSL stylesheet that would transform my markup into XHTML that would display correctly in a browser. At first this meant that everywhere I encontered a "mytextfield" element in the markup, I...
22
2192
by: john bailo | last post by:
oh man, i've been working all month on c# and now I get a java project. finally. life is great !!! -- http://www.museum.tv/ETV/G/htmlG/greenacres/greenacres.htm
17
3168
by: Chris Travers | last post by:
Hi all; I just made an interesting discovery. Not sure if it is a good thing or not, and using it certainly breakes first normal form.... Not even sure if it really works. However, as I am able to CRASH the backend, there is a bug here somewhere... test=# select version(); version
2
3586
by: (PeteCresswell) | last post by:
Seems like the toolkit does not handle complex data types. But that seems like much of the real world - once you get past something like just looking up a SIC code or adding two numbers. I see something about the SOAP 2.0 toolkit... then I see that there's a SOAP 3.0... and then I see a note somewhere something like "Support for SOAP 3.0 will be discontinued on (sometime in 2005)".
2
12833
by: Dave Booker | last post by:
How are complex data types saved and restored when used as User-scoped Application Settings? For an example of what I'm trying to do that does not work, take the following: A project has a user-scoped Settings object called "TestStrings" which is of type "StringDictionary". The following code is run: if (Settings.Default.TestStrings == null) Settings.Default.TestStrings = new StringDictionary();...
0
1176
by: greg | last post by:
We have a set of .NET web services to provide access to our data. They use complex data types for both incoming data and return data. We are attempting to help another group access this web service from vbscript/ASP. Is this possible? I have found a few posts scattered around the internet saying complex data types aren't possible with vbscript. Is this true? Can I manually create my XML document in the vbscript, pass it to the web...
4
7127
by: sadc1986 | last post by:
How does one introduce multiple worksheets in a excel using Xslt Transforms my code... Please suggest <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel"> <xsl:output method="html" encoding="UTF-8"/>
10
5760
by: bbembi_de | last post by:
Hello everyone, is it possible to give a transformation a input parameter? I want to use this parameter as a variable in my transformation. thanks. bye bembi
0
1068
by: jjones7947 | last post by:
Trying to Interop a functionality from the Outside In API from Oracle. Have the following function: SCCERR EXOpenExport { VTHDOC hDoc, VTDWORD dwOutputId, VTDWORD dwSpecType, VTLPVOID pSpec, VTDWORD dwFlags, VTSYSPARAM dwReserved, VTLPVOID pCallbackFunc, VTSYSPARAM dwCallbackData, VTLPHEXPORT phExport); From the header files I reduced the parameters to: typedef VTSYSPARAM...
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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,...
0
10049
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9865
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8873
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...
0
6675
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();...
1
3965
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
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.