Hi,
below is a question from a college of mine. I have checked the
archives for both DOTNET and ADVANCED-DOTNET and found nothing of help.
The code being used is simply:
XmlDocument m_xmlDoc;
m_xmlDoc = new XmlDocument();
m_xmlDoc.Load( fileName );
XslTransform m_xsltProcessor;
m_xsltProcessor = new XslTransform();
m_xsltProcessor.Load( transformFileName );
XsltArgumentList xal = new XsltArgumentList();
xal.AddParam( "hiliteColour", "", "%23FFFFFF" );
xal.AddParam( "onTagClick","", "myOnTagClick" );
xal.AddParam( "backgroundFill","", "darkcyan" );
xal.AddParam( "tooltipFontsize","", "17" );
TextWriter tw = File.CreateText( outputXmlFile );
m_xsltProcessor.Transform( m_xmlDoc, xal, tw);
We have tried compiling this at version 1.1 of the SDK and seem to get
the same results ( apart from a note to the effect that this particular
overload of the transform method is obsolete ).
Many Thanks,
Leon Parsons
Technical Consultant
______________________________
Aveva Consulting,
High Cross, Madingley Road,
Cambridge CB3 0HB UK
Direct Dial +44 (0)1223 556733
Switchboard +44 (0)1223 556633
Mobile +44 (0)7968 449471
Fax +44 (0)1223 556666
[EMAIL PROTECTED]
www.avevaconsulting.com
An AVEVA Group plc Company
-----Original Message-----
From: Michael Toomey
Subject: dot net XslTransform bug?
I have been using MSXML4 for a while but have migrated some stuff to
.NET and have been getting different results! I have boiled the problem
down and attach examples for comment ;-) Looks like a serious bug to me!
Michael Toomey
Source
----------
<svg xmlns="http://www.w3.org/2000/svg">
<defs>
<g id="defsg"/>
</defs>
<g id="g1"/>
<g id="g2"/>
<g id="g3"/>
<g id="g4"/>
</svg>
XSLT
-------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:svg="http://www.w3.org/2000/svg">
<xsl:strip-space elements="*"/>
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="svg:svg/svg:g[position()=1]">
<xsl:comment>match="svg:svg/svg:g[position()=1]"</xsl:comment>
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="svg:svg/svg:g[position()=last()]">
<xsl:comment>match="svg:svg/svg:g[position()=last()]"</xsl:comment>
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
MSXML result
--------------------
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg">
<defs>
<g id="defsg">
</g>
</defs>
<!--match="svg:svg/svg:g[position()=1]"-->
<g id="g1">
</g>
<g id="g2">
</g>
<g id="g3">
</g>
<!--match="svg:svg/svg:g[position()=last()]"-->
<g id="g4">
</g>
</svg>
.NET XslTransform result
------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg">
<defs>
<g id="defsg">
</g>
</defs>
<!--match="svg:svg/svg:g[position()=last()]"-->
<g id="g1">
</g>
<g id="g2">
</g>
<g id="g3">
</g>
<g id="g4">
</g>
</svg>
_____________________________________________________________________
The information contained in this message, together with any attachments, may be
legally privileged or confidential and is intended only for the use of the
individual(s) or entity named above. If you are not the intended recipient, you are
notified that any dissemination, distribution or copying of this message is strictly
prohibited. If you have received this message in error, please notify us immediately
before deleting it.
This message has been checked for all known viruses through MessageLabs Virus Control
Centre, for and on behalf of the AVEVA Group. Although no viruses were found it is the
recipient�s responsibility to ensure that this message is safe for use on their system.
You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.