xsl:output xml containing &#160

Posted on 2003-03-15
Medium Priority
Last Modified: 2008-03-06
I have a sample xml below with  

  <p>this is a test</p>
  <p>this is &#160;&#160;&#160;&#160; a test</p>

If the xsl:output method="html", then &#160 is converted correctly to &nbsp; and the html output is displayed ccorrectly.

However, I need to have an xhtml output so it is xsl:output method="xml".  The reason I need to do this is because I need to render to a new xml file and then this xml file is applied to another xsl to get the final html output.

My issue is when I apply the above sample xml using method="xml", the &#160; is converted to a space character (a blanks space).  Thus, when this new xml is applied to the xsl with html output, I get invalid character (the invalid Â)
I guess in oder to resolve this, is there anyway when I have xml output, it doesnt convert &#160; but pass-thru directly to the xml output (&#160;) then this will be converted correctly to &nbsp when applied again with html output.
If my 1st xml output converts the &#160, then I will end up with invalid character Â.

Thanks to everyone for helping out.
Question by:kenshiro24
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 14

Accepted Solution

avner earned 200 total points
ID: 8146049
I have never had this problem, but there are few suggestion you can with :
1. instead of &#160; use your own tag say :
<SPACE/> , in the first processing use xsl:copy-of for this element, and only in the next xml convert this to &nbsp; or whatever you need it to be.

2. Try to put it inside CDATA

LVL 27

Expert Comment

ID: 8150871
Whose transformer are you using? How did you determine that the XML output converted the character? You could try setting the output method to xhtml and the encoding to utf-8, since the mS parser does not recognize that.

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question