Home All Groups Group Topic Archive Search About

Transforming Spaces into HTML file via XSL file

Author
10 Jan 2005 11:48 PM
John Bowman

Hi,

I'm not certain this is the best place to post this, but here it goes.

I'm trying to get spaces to work correctly when using the WebBrowser
control. Basically, I've got a valid XML document and valid XSL file that I
transform into an HTML file using .NET's XmlTransform object. This is all
fine except for 1 thing. The XSL has a string of " " codes inside that
looks something like:

<u><span>&#160;&#160;"&#160;"&#160;"&#160;</span></u>

The XSL file was apparently generated using Stylus Studio.

When the transform into the HTML file is performed, this string of
"&#160;"'s (as I understand it, this is supposed represent an &nbsp;) is
lost and it becomes empty spaces. When the WebBrowser control renders it, it
looks like an underlined capitalized "A" char w/ an accent over it. If I
manually put the &#160; string back into the HTML, it appears and prints
perfectly.

What do I need to do to get it to render (or transform) these char's as
underlines (& also therefore to print correctly). This needs to be done this
way because when printed the underlined part is supposed to be a place where
the user can physically enter information on the printed page such as a
name, date or their title.

TIA,

--
John Bowman
Verona, WI
jmb61***@charter.net
Author
11 Jan 2005 12:58 AM
clintonG
Go to Barnes & Noble at West Town and determine if they have Microsoft Press
"Programming Microsoft .NET" on the shelves or order it for review as there
is a good chapter on XML/XSLT that covers enough of these issues to enable
you to learn the big picture in a single sitting, take 'keyword' notes and
then do search to get documentation and articles from the web. There are
some 3-5 different issues you need to learn about with white space -- at
least -- and best to get that big picture out of a book.

For now try this manual replacement
<u><span><[CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]]</span></u>


--
<%= Clinton Gallagher
         METROmilwaukee "Regional Information Services"
         NET csgallagher AT metromilwaukee.com
         URL http://clintongallagher.metromilwaukee.com/



Show quoteHide quote
"John Bowman" <jmbow***@charter.net> wrote in message
news:eFxcg729EHA.3700@tk2msftngp13.phx.gbl...
> Hi,
>
> I'm not certain this is the best place to post this, but here it goes.
>
> I'm trying to get spaces to work correctly when using the WebBrowser
> control. Basically, I've got a valid XML document and valid XSL file that
I
> transform into an HTML file using .NET's XmlTransform object. This is all
> fine except for 1 thing. The XSL has a string of "&#160;" codes inside
that
> looks something like:
>
> <u><span>&#160;&#160;"&#160;"&#160;"&#160;</span></u>
>
> The XSL file was apparently generated using Stylus Studio.
>
> When the transform into the HTML file is performed, this string of
> "&#160;"'s (as I understand it, this is supposed represent an &nbsp;) is
> lost and it becomes empty spaces. When the WebBrowser control renders it,
it
> looks like an underlined capitalized "A" char w/ an accent over it. If I
> manually put the &#160; string back into the HTML, it appears and prints
> perfectly.
>
> What do I need to do to get it to render (or transform) these char's as
> underlines (& also therefore to print correctly). This needs to be done
this
> way because when printed the underlined part is supposed to be a place
where
> the user can physically enter information on the printed page such as a
> name, date or their title.
>
> TIA,
>
> --
> John Bowman
> Verona, WI
> jmb61***@charter.net
>
>
Author
11 Jan 2005 1:07 AM
John Bowman
Clinton,

Thanks for the info. It's nice to hear from a local <g>...

John


Show quoteHide quote
"clintonG" <csgallag***@REMOVETHISTEXTmetromilwaukee.com> wrote in message
news:eyP1ji39EHA.1264@TK2MSFTNGP12.phx.gbl...
> Go to Barnes & Noble at West Town and determine if they have Microsoft
> Press
> "Programming Microsoft .NET" on the shelves or order it for review as
> there
> is a good chapter on XML/XSLT that covers enough of these issues to enable
> you to learn the big picture in a single sitting, take 'keyword' notes and
> then do search to get documentation and articles from the web. There are
> some 3-5 different issues you need to learn about with white space -- at
> least -- and best to get that big picture out of a book.
>
> For now try this manual replacement
> <u><span><[CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]]</span></u>
>
>
> --
> <%= Clinton Gallagher
>         METROmilwaukee "Regional Information Services"
>         NET csgallagher AT metromilwaukee.com
>         URL http://clintongallagher.metromilwaukee.com/
>
>
>
> "John Bowman" <jmbow***@charter.net> wrote in message
> news:eFxcg729EHA.3700@tk2msftngp13.phx.gbl...
>> Hi,
>>
>> I'm not certain this is the best place to post this, but here it goes.
>>
>> I'm trying to get spaces to work correctly when using the WebBrowser
>> control. Basically, I've got a valid XML document and valid XSL file that
> I
>> transform into an HTML file using .NET's XmlTransform object. This is all
>> fine except for 1 thing. The XSL has a string of "&#160;" codes inside
> that
>> looks something like:
>>
>> <u><span>&#160;&#160;"&#160;"&#160;"&#160;</span></u>
>>
>> The XSL file was apparently generated using Stylus Studio.
>>
>> When the transform into the HTML file is performed, this string of
>> "&#160;"'s (as I understand it, this is supposed represent an &nbsp;) is
>> lost and it becomes empty spaces. When the WebBrowser control renders it,
> it
>> looks like an underlined capitalized "A" char w/ an accent over it. If I
>> manually put the &#160; string back into the HTML, it appears and prints
>> perfectly.
>>
>> What do I need to do to get it to render (or transform) these char's as
>> underlines (& also therefore to print correctly). This needs to be done
> this
>> way because when printed the underlined part is supposed to be a place
> where
>> the user can physically enter information on the printed page such as a
>> name, date or their title.
>>
>> TIA,
>>
>> --
>> John Bowman
>> Verona, WI
>> jmb61***@charter.net
>>
>>
>
>
Author
11 Jan 2005 9:23 AM
Oleg Tkachenko [MVP]
John Bowman wrote:
> <u><span>&#160;&#160;"&#160;"&#160;"&#160;</span></u>
>
> The XSL file was apparently generated using Stylus Studio.
>
> When the transform into the HTML file is performed, this string of
> "&#160;"'s (as I understand it, this is supposed represent an &nbsp;) is
> lost and it becomes empty spaces.

&#160; *is* a space character. Nonbreakable space actually. So after
transformation it becomes a single nonbreakable space character with
Unicode codepoint 160.

  When the WebBrowser control renders it, it
> looks like an underlined capitalized "A" char w/ an accent over it. If I
> manually put the &#160; string back into the HTML, it appears and prints
> perfectly.

Looks like you've got encoding issue. Seems like the output is UTF-16,
while you are treating it as UTF-8 or ASCII. How do you run XSLT
transformation?

--
Oleg Tkachenko [XML MVP, MCP]
http://blog.tkachenko.com
Author
12 Jan 2005 12:13 AM
John Bowman
Oleg,

Thanks for the repsonse I'm using the .NET XmlTransform object to perform
the transformation to generate the HTML file. I can't remember the UTF-8 or
16, ASCII it's trying to use. I'll have to look it up when I get back to the
office tomorrow.

John

Show quoteHide quote
"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> wrote in message
news:OAh93%2379EHA.2196@TK2MSFTNGP11.phx.gbl...
> John Bowman wrote:
>> <u><span>&#160;&#160;"&#160;"&#160;"&#160;</span></u>
>>
>> The XSL file was apparently generated using Stylus Studio.
>>
>> When the transform into the HTML file is performed, this string of
>> "&#160;"'s (as I understand it, this is supposed represent an &nbsp;) is
>> lost and it becomes empty spaces.
>
> &#160; *is* a space character. Nonbreakable space actually. So after
> transformation it becomes a single nonbreakable space character with
> Unicode codepoint 160.
>
>  When the WebBrowser control renders it, it
>> looks like an underlined capitalized "A" char w/ an accent over it. If I
>> manually put the &#160; string back into the HTML, it appears and prints
>> perfectly.
>
> Looks like you've got encoding issue. Seems like the output is UTF-16,
> while you are treating it as UTF-8 or ASCII. How do you run XSLT
> transformation?
>
> --
> Oleg Tkachenko [XML MVP, MCP]
> http://blog.tkachenko.com