This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Problem using Muenchian method (apply-templates or key) with MSXML 3.0 & 4.0


Good catch.  I just figured this one out about the same time you did...

The problem was that when IE sends an XML data island to a receiving object,
it only sends the contents (everything within the <XML> tags, but not the
tags themselves).  I was using a copy of the output XML to debug which
included the <XML> tags, so when I ran the transform previously, it always
worked in the browser.  So when my object looked at the input XML, the paths
were different, and therefore the apply-templates and key functions would
always fail.

Thanks for your help!

-Jeremy

-----Original Message-----
From: Kirk Allen Evans [mailto:kaevans@xmlandasp.net]
Sent: Monday, May 20, 2002 10:02 AM
To: xsl-list@lists.mulberrytech.com
Subject: RE: [xsl] Problem using Muenchian method (apply-templates or
key) with MSXML 3.0 & 4.0


-----Original Message-----
From: owner-xsl-list@lists.mulberrytech.com
[mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Saldate,
DanielX
Sent: Monday, May 20, 2002 11:36 AM
To: XSL List (E-mail)
Subject: [xsl] Problem using Muenchian method (apply-templates or key)
with MSXML 3.0 & 4.0

> I've run into an interesting problem with MSXML 3.0 SP2 and 4.0 SP1.  This
> seems to be related to invoking either of these parsers from code, but I'm
> not absolutely sure yet.

> I have an XML data island embedded into a web page that looks somewhat
like
> the XML pasted below.



Remove the XML node in your stylesheet's XPath statements.  Using the
following code,

	<html>
	<xml id="XMLData">
		<foo>
			<bar>test</bar>
		</foo>
	</xml>

	<script language="javascript">
		function myfunc()
		{
			var doc = new ActiveXObject("Microsoft.XMLHTTP");
			xmlHTTP.Open ("POST", "MyPage.asp", false);
			xmlHTTP.Send (XMLData.xml);
		}
	</script>

	<body onload="javascript:myfunc()">
	</body>
	</html>

Only the elements "foo" and "bar" and the child text node are transmitted:
the "xml" tag is a client-side identifier and is not part of the XML
structure.  So, the document node is being matched, giving you the HTML
result in the root template match, but none of the other XML data can be
matched because there is no "XML" node in the document.


Kirk Allen Evans
"XML and ASP.NET", New Riders Publishing
Available at Amazon.com
http://www.amazon.com/exec/obidos/ASIN/073571200X



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]