instead of actual value get strange charachers on dispaying the XML tag via ASPX web page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,
I have got XML tag <fo:block font-weight="bold" font-size="13pt"><![CDATA[ ?
845]]></fo:block>. Problem is when
i gives xmlURL from c# to InputStreamReader in J# code with the aspx web
page as XML which contain tag.
When i try to display output on PDF, it'll get the value from the tag
<![CDATA[ ? 845]]> some thing like a~,^ 845 strange charachers instead of
Euro sign. Also where ever i have qoute in text data in XML tags it displays
strange charachers.

J# code:
String xmlURL = "http://localhost/PDFXml1/PDFXml.aspx";
URL theUrl = new URL(xmlURL);
InputStreamReader reader = new InputStreamReader(
theUrl.openStream());

I think problem occures when xmlURL is readed by InputStreamReader in J# or
something is miss with tag <![CDATA[ ? 845]]>

hoping feavourable reply

Cheers

Sa
 
I have got XML tag <fo:block font-weight="bold" font-size="13pt"><![CDATA[ ?
845]]></fo:block>. Problem is when
i gives xmlURL from c# to InputStreamReader in J# code with the aspx web
page as XML which contain tag.
When i try to display output on PDF, it'll get the value from the tag
<![CDATA[ ? 845]]> some thing like a~,^ 845 strange charachers instead of
Euro sign. Also where ever i have qoute in text data in XML tags it displays
strange charachers.

J# code:
String xmlURL = "http://localhost/PDFXml1/PDFXml.aspx";
URL theUrl = new URL(xmlURL);
InputStreamReader reader = new InputStreamReader(
theUrl.openStream());

I think problem occures when xmlURL is readed by InputStreamReader in J# or
something is miss with tag <![CDATA[ ? 845]]>

Well, what is the ? here? My guess is that it was in your original
post, but I'm not seeing it due to an encoding mismatch. The same thing
could be what's wrong with your XML - what encoding is the file in, and
what is it declared to be at the start of the XML itself?
 
Hi Jon,
Thanks for your replay, ? in tag <![CDATA[ ? 845]]> is euro currency sign, i
dont no why it is convert into " ? " when you see it my email.
encoding is
<!--sample XML fragment-->
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
are the root elements of my XML file

Waiting for ur reply

Cheers

Sa

Jon Skeet said:
I have got XML tag <fo:block font-weight="bold" font-size="13pt"><![CDATA[ ?
845]]></fo:block>. Problem is when
i gives xmlURL from c# to InputStreamReader in J# code with the aspx web
page as XML which contain tag.
When i try to display output on PDF, it'll get the value from the tag
<![CDATA[ ? 845]]> some thing like a~,^ 845 strange charachers instead of
Euro sign. Also where ever i have qoute in text data in XML tags it displays
strange charachers.

J# code:
String xmlURL = "http://localhost/PDFXml1/PDFXml.aspx";
URL theUrl = new URL(xmlURL);
InputStreamReader reader = new InputStreamReader(
theUrl.openStream());

I think problem occures when xmlURL is readed by InputStreamReader in J# or
something is miss with tag <![CDATA[ ? 845]]>

Well, what is the ? here? My guess is that it was in your original
post, but I'm not seeing it due to an encoding mismatch. The same thing
could be what's wrong with your XML - what encoding is the file in, and
what is it declared to be at the start of the XML itself?
 
Hi Jon,
Thanks for your replay, ? in tag <![CDATA[ ? 845]]> is euro currency sign, i
dont no why it is convert into " ? " when you see it my email.

Well, it entirely depends on what encoding your newsreader is using. It
hasn't *specified* an encoding, so it's pretty unlikely that things
will get through properly.
encoding is
<!--sample XML fragment-->
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
are the root elements of my XML file

Waiting for ur reply

Do you not have a

<?xml ... ?>

declaration *before* your root element? If so, you should have one for
good measure, and it should declare what the encoding of the file is.
 
i used this <?xml version="1.0" encoding="utf-16"?> tag as StartDocument.
But it still have no effect. Do think i have to change encoding attribute
till i get real vaues

cheers,

Sa



Jon Skeet said:
Hi Jon,
Thanks for your replay, ? in tag <![CDATA[ ? 845]]> is euro currency sign, i
dont no why it is convert into " ? " when you see it my email.

Well, it entirely depends on what encoding your newsreader is using. It
hasn't *specified* an encoding, so it's pretty unlikely that things
will get through properly.
encoding is
<!--sample XML fragment-->
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
are the root elements of my XML file

Waiting for ur reply

Do you not have a

<?xml ... ?>

declaration *before* your root element? If so, you should have one for
good measure, and it should declare what the encoding of the file is.
 
i used this <?xml version="1.0" encoding="utf-16"?> tag as StartDocument.
But it still have no effect. Do think i have to change encoding attribute
till i get real vaues

You certainly shouldn't just try different things until it works. You
should find out what the encoding of your file actually *is*, and use
that.
 
but i don;t have xml file. I have aspx web page as XML on server.

Ah. I've just looked back at your first post, and you're using
InputStreamReader, but not specifying an encoding to use.

(I'm not entirely sure why you're posting this here rather than a J#
newsgroup to start with, to be honest.)
 
Back
Top