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>&</xsl:otherwise></xsl:choose><xsl :value-
of select="substri ng-before(., '=')" disable-output-escaping="yes"/
>=<xsl:call-template name="url-encode"><xsl:wi th-paramname="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[ --> ]]><![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>' ;</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(.,'='),
'"', $single_quote), '
', '¶'), '
', '¶')"/><!
[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