473,854 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XslCompiledTran sform.Load() fails sometimes

Basically the issue is, when the XSL style sheet is loaded by URI it
is cool but when the exact same style sheet loaded by it's contents
the load fails (for this particular style sheet). Because our sheets
are kept in a DB, loading by content is preferable.

Content based load code:

Stream xslStream = new MemoryStream(xs lString);
XmlReader xslTextReader = XmlReader.Creat e(xslStream);
compliedXsl.Loa d(xslTextReader );

URI based load code:
compliedXsl.Loa d(xslUri);
The error states that there in an invalid character for the encoding
at line 2140 position 365.

Here is the problematic template from the style sheet (sorry it's so
long i could not include the entire thing, but The line below that
starts with "select="transl ate(translate(t ranslate(substr ing-
after(..." is line 2140.):

<xsl:template match="IFRAME">
<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="0" WIDTH="100%">
<TR>
<TD/>
</TR>
<TR>
<TD ALIGN="CENTER">
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="100%"
ALIGN="CENTER">
<TR>
<xsl:choose>
<xsl:when test="../IMAGES/GRAPHIC/FILENAME[. != '']">
<TD ALIGN="CENTER">
<IMG NAME="frameimg" ID="frameimg" CLASS="frame">
<xsl:attribut e name="SRC"><xsl :value-of select="/DEFAULT/
LINK/IMAGES/GRAPHIC/FILENAME"/></xsl:attribute>
<xsl:if test="/DEFAULT/LINK/IMAGES/GRAPHIC/HEIGHT[. != '']">
<xsl:attribut e name="HEIGHT">< xsl:value-of select="/DEFAULT/
LINK/IMAGES/GRAPHIC/HEIGHT"/></xsl:attribute>
</xsl:if>
<xsl:if test="/DEFAULT/LINK/IMAGES/GRAPHIC/WIDTH[. != '']">
<xsl:attribut e name="WIDTH"><x sl:value-of select="/DEFAULT/
LINK/IMAGES/GRAPHIC/WIDTH"/></xsl:attribute>
</xsl:if>
<xsl:if test="SHOWBORDE R[. = 'True']">
<xsl:attribut e name="BORDER">1 </xsl:attribute>
</xsl:if>
<xsl:attribut e name="ALT"><xsl :value-of select="/DEFAULT/
LINK/IMAGES/GRAPHIC/CAPTION"/></xsl:attribute>
<xsl:attribut e name="TITLE"><x sl:value-of select="/DEFAULT/
LINK/IMAGES/GRAPHIC/CAPTION"/></xsl:attribute>
</IMG>
</TD>
</xsl:when>
<xsl:otherwis e>
<TD ALIGN="CENTER">
<IFRAME ID="Frame1" NAME="Frame1" WIDTH="99%" FRAMEBORDER="0"
MARGINHEIGHT="1 " MARGINWIDTH="1"
ONLOAD="javascr ipt:scrollParen tTop();">
<xsl:choose>
<xsl:when test="/DEFAULT/LINK/ID[. != $reglink]">
<xsl:attribut e name="SRC"><xsl :value-of select="/DEFAULT/
LINK/URL"/>
<xsl:for-each select="/DEFAULT/GENERAL/REQUEST/
QUERYSTRINGPARA METER[not(starts-with(.,'L=')) and not(starts-
with(.,'l=')) and not(starts-with(.,'nav='))]">
<xsl:choose><xs l:when test="position( ) = 1 and
not(contains(/DEFAULT/LINK/URL, '?'))">?</
xsl:when><xsl:o therwise>&amp;</xsl:otherwise></xsl:choose><xsl :value-
of select="substri ng-before(., '=')" disable-output-escaping="yes"/
>=<xsl:call-template name="url-encode"><xsl:wi th-param
name="str"><xsl :value-of select="substri ng-after(., '=')" disable-
output-escaping="yes"/></xsl:with-param></xsl:call-template></xsl:for-
each></xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:attribut e name="HEIGHT">< xsl:value-of select="HEIGHT"/
></xsl:attribute>
<xsl:if test="SHOWSCROL LBAR[. = 'False']">
<xsl:attribut e name="SCROLLING ">No</xsl:attribute>
</xsl:if>
<xsl:if test="SHOWBORDE R[. = 'True']">
<xsl:attribut e name="STYLE">bo rder:solid <xsl:value-of
select="BORDERC OLOR"/1px</xsl:attribute>
</xsl:if>
<xsl:comment> <![CDATA[ -->&nbsp;]]><![CDATA[<!-- ]]></
xsl:comment>
</IFRAME>
<SCRIPT LANGUAGE="JavaS cript1.1">
<xsl:comment> <![CDATA[
if (document.layer s){
document.write( "<img name='spacer' src='/images/static/gfx/
pxl_trans.gif' border=0 width=1 height=]]><xsl:value-of
select="HEIGHT"/><![CDATA[>");
document.close( );
}
//]]></xsl:comment>
</SCRIPT>
<xsl:if test="/DEFAULT/LINK/ID[. = $reglink]">
<IFRAME id="spinner" SCROLLING="0" FRAMEBORDER="0"
MARGINHEIGHT="0 " MARGINWIDTH="0" ALIGN="CENTER" STYLE="LEFT: 300px;
WIDTH: 300px; POSITION: absolute; TOP: 250px; BGCOLOR: #CC0000; Z-
INDEX: 0" SRC="/global/images/pm/loading.gif"/>
</xsl:if>
</TD>
</xsl:otherwise>
</xsl:choose>
</TR>
<xsl:if test="((../IMAGES/GRAPHIC/CAPTION) or (../WINDOW/
SHOWDATE[. = 'True']))">
<TR>
<TD ALIGN="CENTER">
<FONT>
<xsl:attribut e name="FACE"><xs l:value-of select="/DEFAULT/
GENERAL/STYLE/FONTS/FONT19/FACE"/></xsl:attribute>
<xsl:attribut e name="SIZE"><xs l:value-of select="/DEFAULT/
GENERAL/STYLE/FONTS/FONT19/SIZE"/></xsl:attribute>
<xsl:choose>
<xsl:when test="($linklay out != '0') and ($linklayout !=
'1')">
<xsl:attribut e name="COLOR"><x sl:value-of select="/DEFAULT/
LINK/WINDOW/TEXTCOLOR"/></xsl:attribute>
</xsl:when>
<xsl:otherwis e>
<xsl:attribut e name="COLOR"><x sl:value-of select="/DEFAULT/
GENERAL/STYLE/FONTS/FONT8/COLOR"/></xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="../IMAGES/GRAPHIC/CAPTION">
<xsl:value-of select="../IMAGES/GRAPHIC/CAPTION"/>
</xsl:if>
<xsl:if test="../WINDOW/SHOWDATE[. = 'True']">
<xsl:value-of select="$whites pace" disable-output-
escaping="yes"/>
<xsl:value-of select="/DEFAULT/GENERAL/DAYDATE"/>
</xsl:if>
</FONT>
<BR/>
</TD>
</TR>
</xsl:if>
<xsl:if test="../PAGEREFRESH[SHOWREFRESHBUTT ON = 'True' or
SHOWREFRESHTEXT = 'True' ]">
<TR>
<TD ALIGN="CENTER">
<BR/>
<FORM NAME="RefreshFo rm">
<xsl:if test="../PAGEREFRESH[SHOWREFRESHBUTT ON = 'True']">
<INPUT NAME="RefreshBt n" TYPE="Button" VALUE="Refresh" >
<xsl:attribut e name="OnClick"> <![CDATA[refreshFrame();
return false]]></xsl:attribute>
</INPUT>
</xsl:if>
<xsl:if test="../PAGEREFRESH[SHOWREFRESHTEXT = 'True']">
<BR/>
<FONT>
<xsl:if test="/DEFAULT/GENERAL/STYLE/FONTS/FONT19/FACE[. !=
'Default']">
<xsl:attribut e name="FACE"><xs l:value-of select="/DEFAULT/
GENERAL/STYLE/FONTS/FONT19/FACE"/></xsl:attribute>
</xsl:if>
<xsl:attribut e name="SIZE"><xs l:value-of select="/DEFAULT/
GENERAL/STYLE/FONTS/FONT19/SIZE"/></xsl:attribute>
<xsl:choose>
<xsl:when test="($linklay out != '0') and ($linklayout !=
'1')">
<xsl:attribut e name="COLOR"><x sl:value-of select="/
DEFAULT/LINK/WINDOW/TEXTCOLOR"/></xsl:attribute>
</xsl:when>
<xsl:otherwis e>
<xsl:attribut e name="COLOR"><x sl:value-of select="/
DEFAULT/GENERAL/STYLE/FONTS/FONT8/COLOR"/></xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="../PAGEREFRESH/REFRESHTEXT"/>
</FONT>
</xsl:if>
</FORM>
</TD>
</TR>
</xsl:if>
</TABLE>
</TD>
</TR>
</TABLE>
<DIV ID="quickformdi v" STYLE="position : absolute; top: 0; left: 0px;
width: 0; height: 0; visibility: hidden;">
<FORM NAME="qform" TARGET="Frame1" ACTION="/global/pm/
registration.as p">
<SCRIPT LANGUAGE="JavaS cript">
<xsl:comment> <![CDATA[

var formname = new Array();
var formval = new Array();]]><xsl:for-each select="/DEFAULT/GENERAL/
REQUEST/FORMVARIABLE">
<xsl:variable name="formname" >
<xsl:value-of select="substri ng-before(normaliz e-space(.),'=')"/
>
</xsl:variable>
<xsl:variable name="formname_ clean">
<xsl:choose>
<xsl:when test="starts-with($formname, '_')">
<xsl:value-of select="substri ng-after($formname ,'_')"/>
</xsl:when>
<xsl:otherwis e>
<xsl:value-of select="$formna me"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="single_qu ote">
<xsl:text>&#x27 ;</xsl:text>
</xsl:variable>
<xsl:variable name="new_line" >
<xsl:text/>
</xsl:variable>
<xsl:variable name="carriage_ return">
<xsl:text/>
</xsl:variable><![CDATA[formname]]>[<xsl:value-of
select="normali ze-space(position( ))"/>]<![CDATA[= "]]><xsl:value-of
select="$formna me_clean"/><![CDATA[";]]><![CDATA[formval]]>[<xsl:value-
of select="normali ze-space(position( ))"/>]<![CDATA[= "]]><xsl:value-of
select="transla te(translate(tr anslate(substri ng-after(.,'='),
'&#x22;', $single_quote), '&#xD;', '¶'), '&#xA;', '¶')"/><!
[CDATA[";]]></xsl:for-each><![CDATA[
var currentLinkID = ]]><xsl:value-of select="/DEFAULT/LINK/ID"/><!
[CDATA[;
var regLinkID = ]]><xsl:value-of select="/DEFAULT/GENERAL/REGISTRATION/
LINKNO"/><![CDATA[;
var qf_args = new Object();
var qf_query = document.locati on.search;
var qf_pairs1 = qf_query.split( "?");
var qf_pairs = qf_pairs1[1].split("&");

for(i=0; i < qf_pairs.length ; i++) {
var qf_pos = qf_pairs[i].indexOf('=');
if (qf_pos == -1) {
continue;
}
var qf_argname = qf_pairs[i].substring(0,qf _pos);
var qf_value = qf_pairs[i].substring(qf_p os+1);
qf_args[qf_argname] = unescape(qf_val ue);
}

if (document.getEl ementById("Fram e1") != null) {
var qf_frame1 = document.getEle mentById("Frame 1");
var qf_frame1_src = qf_frame1.src;
}

var qf_method = qf_args["method"];

if (currentLinkID == regLinkID) {
if (qf_method == "post") {
writeQFormElems 2();
}
else {
writeQFormElems ();
}
}
//]]></xsl:comment>
</SCRIPT>
</FORM>
</DIV>
<SCRIPT LANGUAGE="JavaS cript">

if (currentLinkID == regLinkID) {

if (qf_method == "post") {
document.qform. method = "POST";

}
document.qform. action += "?function= " + qf_args["function"];
document.qform. target = "Frame1";
document.qform. submit();
}
</SCRIPT>
</xsl:template>

Any ideas?

-CJ

Mar 27 '07 #1
0 3272

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

Similar topics

3
4232
by: Eckhard Schwabe | last post by:
when switching from the old "XslTransform " to "XslCompiledTransform" I notice a difference in the handling of whitespace. I need to transform a XML file which contain tabs (\t), and which remain untouched when I use XslTransform to do the transformation. But after switching to XslCompiledTransform the tabs are transformed to a single space in the result file, which leads to problems later on the the program. what I found was:...
1
2624
by: Steve | last post by:
Using VB.NET 2.0 I have a simple routine that attempts transforms an XmlDocument with an XSLT stylesheet into HTML. Under the old 1.1 framework with XslTransform, everything worked fine. Now using XslCompiledTransform, the Transform method hangs. My code: Function TransformXML(ByRef FacXML As Xml.XmlDocument, ByVal XslFile As String) As String Dim xslt As New System.Xml.Xsl.XslCompiledTransform Dim xmlFile As String = <code to name...
6
8124
by: W. Jordan | last post by:
Hello there, Are there anybody who is using the XslCompiledTransform that comes with .net framework, which was said to be a replacement of the XslTransform class? I found that the class has some issues when the xsl file contains scripts. The XslCompiledTransform uses the CodeDom to compile the scripts within the xsl file into .net assembly and load them into the current
4
9628
by: andrewcw | last post by:
I am moving some code forward from .NET 1.1. I was able to load the XSL file and perform the transform. The MSDN documentation looks like it should be easy. But I get a compile error. Ideas ? How can I share my XSLT ( there are 2 helper stylesheets, and I check that they are also available... the loaded xsl makes reference to the helper xsl files. Where should I start looking ? // Load the stylesheet. errBefore =...
12
10129
by: InvalidLastName | last post by:
We have been used XslTransform. .NET 1.1, for transform XML document, Dataset with xsl to HTML. Some of these html contents contain javascript and links. For example: // javascript if (a &gt; b) ..... // xsl contents abc.aspx?p1=v1&amp;p2=<xsl:value-of select="$v2" />
1
1805
by: Hans Kesting | last post by:
Hi, In our ASP.Net webapplications, we use xslt a lot. For 1.1 developing was "easy": start up the website and go to the page where the xslt was used. Change the xslt (save it) and refresh the page: the new results are visible. Now we are transferring to 2.0 and XslCompiledTransform. The xslt's still work
1
1661
by: Mark | last post by:
I'm getting the error "The URI scheme is too long." in the code below. What is URI in this context? The XSL or the XML being transformed? Thanks! -Mark StringBuilder sb = new StringBuilder(); //Create the XslCompiledTransform and Load it with the xsltDocument XslCompiledTransform xslCompiledTransform = new XslCompiledTransform();
3
5493
by: Andy Fish | last post by:
Hi, From reading the documentation, I get the impression that XslCompiledTransform should be faster than XslTransform on my test with a large complex document and a large complex XSLT, the transform took 4 minutes with XslTransform but 7 minutes with XslCompiledTransform. However, with the same stylesheet on another large complex document, the
1
1656
by: =?Utf-8?B?Vmlub2Q=?= | last post by:
Hi, I am having a problem doing the transform. Actually i am migrating the code from XslTranform class into XslCompiledTransform class. Here is the code that i am using in .net 1.1 private void DoTransform(ref XslTransform arrTransformations, ref XmlDocument objSource,
0
11024
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10672
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...
1
10740
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10362
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
9510
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...
1
7909
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5738
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4149
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3182
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.