Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8317217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:32:33+00:00 2026-06-08T21:32:33+00:00

i have a problem with XSLT… <xsl:text>&#160;</xsl:text> Then after generation, for some reason the

  • 0

i have a problem with XSLT…

<xsl:text>&#160;</xsl:text>

Then after generation, for some reason the resulting JSP file produces a ‘?’ instead. What’s wrong?

My recent system changes:
I changed Java5 -> Java6
Weblogic -> Weblogic12
Eclipse Ganymede -> Oracle Pack Eclipse

EDIT 1: <xsl:output method="xml"/>, encoding=UTF-8

The original XSL:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:include href="common.xsl"/>

    <xsl:output method="xml"/>

    ...

    <xsl:template name="makeLink">
        <xsl:variable name="fieldtype" select="name()"/>

        <xsl:variable name="currentNode"><xsl:value-of select="generate-id()"/></xsl:variable>

        <xsl:variable name="appendSpace">
            <xsl:for-each select="ancestor::ButtonList[position() = 1]/descendant::Button">
                <xsl:if test="generate-id() = $currentNode and position() &gt; 1">true</xsl:if>
            </xsl:for-each>
        </xsl:variable>

<a href="{$url}">
            <xsl:attribute name="id">btn_<xsl:value-of select="Action"/></xsl:attribute>
            <xsl:call-template name="populateAttributes">
                <xsl:with-param name="fieldtype">
                    <xsl:value-of select="$fieldtype"/>
                </xsl:with-param>
            </xsl:call-template>

            <xsl:copy-of select="@class"/>
            <xsl:copy-of select="@style"/>

            <xsl:text>&lt;span&gt;&lt;span&gt;</xsl:text><xsl:value-of select="$buffer"/><xsl:text>&lt;/span&gt;&lt;/span&gt;</xsl:text>
</a>
        <xsl:if test="not(@omitWhiteSpace)">
            <xsl:text>&#160;</xsl:text>
        </xsl:if>
        <xsl:if test="ReadOnly and ReadOnly != 'someReadOnlyMethod'
            and ReadOnly != 'someReadyOnlyMethod'
            and ReadOnly != ''">
            <xsl:text>&lt;/c:if&gt;</xsl:text>
        </xsl:if>
</xsl:template>
....

Transformed (after XSLT), and resulting JSP page:

<%@ page contentType = "text/html;charset=GBK"%>
<%@ page isELIgnored = "false"%>
<%@ page language="java" 
import=" my.controller.*, my.core.config.*, my.core.datastructure.*, my.core.error.*, my.core.util.*,
my.service.Constants, my.service.modulesvr.ModuleBean, myW.sn.*, java.util.Locale, java.util.Map"%>
<%@ taglib uri="http://www.mycompany.com/my/tags/htmltag-10" prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%MySn mySession = (MySn) session.getValue("MySn"); QuickSearchController mb = (mySession == null) ? null : (QuickSearchController)
mySession.getModuleBean(); String sessionToken = mySession.getSessionToken(); String htmlCharSet = mySession.getEncoding();
MyUsr user = mySession.getMyUsr(); String[] result; Object o;%>

.........

<a href="#" id="btn_NEWPROP" onclick="submitForm('/xxx/xxx/NEWPROP','theForm');    return (false);" class="actionBtn"><span><span>NEW PROP</span></span></a> </c:if>

EDIT 2: it seems like if i use <xsl:text>&amp;#160;</xsl:text> instead of <xsl:text>&#160;</xsl:text>…the problem seems to have gone away. In the JSP, it will appear as &#160 and on the browser, it is seen as a no-break space, which is expected.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T21:32:34+00:00Added an answer on June 8, 2026 at 9:32 pm

    That often happens if your encoding is wrong. What encoding are you writing your output in? How are you serving up the page? Possibly you are serializing in UTF-8 but trying to display in ISO-8859-1 (or Windows-1252), or vice-versa.

    Check to see if the default encoding somewhere has changed.

    Just because you say <xsl:output method="xml" encoding="UTF-8"/> doesn’t mean that the program will honor it. Is the XSLT embedded in a piece of Java? Does the Java control the streams/readers/writers?

    If you can save a portion of the file and dump it in HEX, you should quickly be able to find out. If you see 0xC2 0xA0 then your file is indeed in UTF-8. However, if you just see 0xA0 alone, then you are in ISO-8859-1 or one of its close relations.

    It’s also possible that the page is being rendered properly, but the page is being served up with the wrong encoding. Can you look at the headers returned, perhaps by using Firebug in Firefox or in Chrome “Web Developer->Information->View Response Headers” or by using the IE debug tools.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some experience with XSLT but now i've got myself a problem: I
I have next problem with Firefox. Using some xslt transformations leave no other choice,
I am new to XML & XSLT but have got this problem. I have
I have problem with repopulating form_upload after validation. Other input fields or selectboxes are
I have a problem. I get the data from xml then transform it with
I am new in xslt. I have the following problem. I need within an
I have run into a problem with XSLT transformation. I have input XML as
I have a problem with XML and XSLT. I have one XML file with
I want to implement carriage return within xslt. The problem is I have a
I have an XSLT that is transformed to an XML using System.Xml.Xsl.XslCompiledTransform . The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.