Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > HTML in XML call?

Reply
Thread Tools

HTML in XML call?

 
 
Fergus O'Shea
Guest
Posts: n/a
 
      11-21-2003
I have some text that appears in a Database. This text includes
HTML(e.g. <br> tags).

I also have a Webpage that makes an XML call to that database. But
when the text is displayed on the page, the HTML isn't used, just
printed out as normal text.

Is there some way I can change the text in the Database, so that when
it is called in the XML call, that it displays as HTML?

p.s. I'm not in charge of the Webpage so can't do anything fancy
dynamically. I am only in charge of the Text. Please confine any
answers to that area, thanks.
 
Reply With Quote
 
 
 
 
GIMME
Guest
Posts: n/a
 
      11-24-2003
First examine the data in the database.

If the data looks like

&lt;html&gt;
&lt;body&gt;

instead of
<html>
<body>

Then indeed the data stored in the database needs tweaking to
get it to render. In that case you need to either examine how
that data is getting stored, so it stores <html>, or else
you need some sort of query that will substitute out the < and
> signs.


If the database has
<html>
<body>

Then see if there is a way in your "xmlcall" to fetch the html
as a CDATA element.

Since, as you described, your options are limited. You may have
to load the html into a gigantic javascript variable, do the
substitution in javascript, and then write the html from javascript.

BTW, there isn't a standard SQL function that changes the &lt;
it < and excetra. I'm stretching even thinking of a sql query
that would do it. Anyone ?

http://www.velocityreviews.com/forums/(E-Mail Removed) (Fergus O'Shea) wrote in message news:<(E-Mail Removed). com>...
> I have some text that appears in a Database. This text includes
> HTML(e.g. <br> tags).
>
> I also have a Webpage that makes an XML call to that database. But
> when the text is displayed on the page, the HTML isn't used, just
> printed out as normal text.
>
> Is there some way I can change the text in the Database, so that when
> it is called in the XML call, that it displays as HTML?
>
> p.s. I'm not in charge of the Webpage so can't do anything fancy
> dynamically. I am only in charge of the Text. Please confine any
> answers to that area, thanks.

 
Reply With Quote
 
 
 
 
Fergus O'Shea
Guest
Posts: n/a
 
      11-25-2003
Thanks for the input.

In the database it is being stored as <br>. It is only when the XML
call is made that the < is changed to &lt; .

We are playing with the idea of having a Replace function is the front
end to change &lt; to <. This option wasn't previously open to me, but
does seem to solve the problem even though it won't be pretty. I'll
still welcome other suggestions.

Thanks again.

(E-Mail Removed) (GIMME) wrote in message news:<(E-Mail Removed). com>...
> First examine the data in the database.
>
> If the data looks like
>
> &lt;html&gt;
> &lt;body&gt;
>
> instead of
> <html>
> <body>
>
> Then indeed the data stored in the database needs tweaking to
> get it to render. In that case you need to either examine how
> that data is getting stored, so it stores <html>, or else
> you need some sort of query that will substitute out the < and
> > signs.

>
> If the database has
> <html>
> <body>
>
> Then see if there is a way in your "xmlcall" to fetch the html
> as a CDATA element.
>
> Since, as you described, your options are limited. You may have
> to load the html into a gigantic javascript variable, do the
> substitution in javascript, and then write the html from javascript.
>
> BTW, there isn't a standard SQL function that changes the &lt;
> it < and excetra. I'm stretching even thinking of a sql query
> that would do it. Anyone ?
>
> (E-Mail Removed) (Fergus O'Shea) wrote in message news:<(E-Mail Removed). com>...
> > I have some text that appears in a Database. This text includes
> > HTML(e.g. <br> tags).
> >
> > I also have a Webpage that makes an XML call to that database. But
> > when the text is displayed on the page, the HTML isn't used, just
> > printed out as normal text.
> >
> > Is there some way I can change the text in the Database, so that when
> > it is called in the XML call, that it displays as HTML?
> >
> > p.s. I'm not in charge of the Webpage so can't do anything fancy
> > dynamically. I am only in charge of the Text. Please confine any
> > answers to that area, thanks.

 
Reply With Quote
 
GIMME
Guest
Posts: n/a
 
      11-26-2003
>
> In the database it is being stored as <br>. It is only when the XML
> call is made that the < is changed to &lt; .


Can the xml call be configured to store the html in a
CDATA element so that it comes over as < instead of &lt; ?

>
> We are playing with the idea of having a Replace function is the front
> end to change &lt; to <. This option wasn't previously open to me, but
> does seem to solve the problem even though it won't be pretty. I'll
> still welcome other suggestions.
>


Just for laughs and giggles this replace function might work for you
....


function Html2St( st)
{
return String(st).replace('&lt;','<').replace('&gt;','>') .replace('&nbsp;','
').replace('\\\\','\\');
}


> Thanks again.
>
> (E-Mail Removed) (GIMME) wrote in message news:<(E-Mail Removed). com>...
> > First examine the data in the database.
> >
> > If the data looks like
> >
> > &lt;html&gt;
> > &lt;body&gt;
> >
> > instead of
> > <html>
> > <body>
> >
> > Then indeed the data stored in the database needs tweaking to
> > get it to render. In that case you need to either examine how
> > that data is getting stored, so it stores <html>, or else
> > you need some sort of query that will substitute out the < and
> > > signs.

> >
> > If the database has
> > <html>
> > <body>
> >
> > Then see if there is a way in your "xmlcall" to fetch the html
> > as a CDATA element.
> >
> > Since, as you described, your options are limited. You may have
> > to load the html into a gigantic javascript variable, do the
> > substitution in javascript, and then write the html from javascript.
> >
> > BTW, there isn't a standard SQL function that changes the &lt;
> > it < and excetra. I'm stretching even thinking of a sql query
> > that would do it. Anyone ?
> >
> > (E-Mail Removed) (Fergus O'Shea) wrote in message news:<(E-Mail Removed). com>...
> > > I have some text that appears in a Database. This text includes
> > > HTML(e.g. <br> tags).
> > >
> > > I also have a Webpage that makes an XML call to that database. But
> > > when the text is displayed on the page, the HTML isn't used, just
> > > printed out as normal text.
> > >
> > > Is there some way I can change the text in the Database, so that when
> > > it is called in the XML call, that it displays as HTML?
> > >
> > > p.s. I'm not in charge of the Webpage so can't do anything fancy
> > > dynamically. I am only in charge of the Text. Please confine any
> > > answers to that area, thanks.

 
Reply With Quote
 
Fergus O'Shea
Guest
Posts: n/a
 
      11-26-2003
(E-Mail Removed) (GIMME) wrote in message news:<(E-Mail Removed). com>...
> >
> > In the database it is being stored as <br>. It is only when the XML
> > call is made that the < is changed to &lt; .

>
> Can the xml call be configured to store the html in a
> CDATA element so that it comes over as < instead of &lt; ?
>


Well the XML goes to more than one location, some of which we don't
have any control of, so that could break the systems of those other
locations.

> >
> > We are playing with the idea of having a Replace function is the front
> > end to change &lt; to <. This option wasn't previously open to me, but
> > does seem to solve the problem even though it won't be pretty. I'll
> > still welcome other suggestions.
> >

>
> Just for laughs and giggles this replace function might work for you
> ...
>
>
> function Html2St( st)
> {
> return String(st).replace('&lt;','<').replace('&gt;','>') .replace('&nbsp;','
> ').replace('\\\\','\\');
> }
>


I'll send it on, Thanks.

>
> > Thanks again.
> >
> > (E-Mail Removed) (GIMME) wrote in message news:<(E-Mail Removed). com>...
> > > First examine the data in the database.
> > >
> > > If the data looks like
> > >
> > > &lt;html&gt;
> > > &lt;body&gt;
> > >
> > > instead of
> > > <html>
> > > <body>
> > >
> > > Then indeed the data stored in the database needs tweaking to
> > > get it to render. In that case you need to either examine how
> > > that data is getting stored, so it stores <html>, or else
> > > you need some sort of query that will substitute out the < and
> > > > signs.
> > >
> > > If the database has
> > > <html>
> > > <body>
> > >
> > > Then see if there is a way in your "xmlcall" to fetch the html
> > > as a CDATA element.
> > >
> > > Since, as you described, your options are limited. You may have
> > > to load the html into a gigantic javascript variable, do the
> > > substitution in javascript, and then write the html from javascript.
> > >
> > > BTW, there isn't a standard SQL function that changes the &lt;
> > > it < and excetra. I'm stretching even thinking of a sql query
> > > that would do it. Anyone ?
> > >
> > > (E-Mail Removed) (Fergus O'Shea) wrote in message news:<(E-Mail Removed). com>...
> > > > I have some text that appears in a Database. This text includes
> > > > HTML(e.g. <br> tags).
> > > >
> > > > I also have a Webpage that makes an XML call to that database. But
> > > > when the text is displayed on the page, the HTML isn't used, just
> > > > printed out as normal text.
> > > >
> > > > Is there some way I can change the text in the Database, so that when
> > > > it is called in the XML call, that it displays as HTML?
> > > >
> > > > p.s. I'm not in charge of the Webpage so can't do anything fancy
> > > > dynamically. I am only in charge of the Text. Please confine any
> > > > answers to that area, thanks.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
firefox html, my downloaded html and firebug html different? Adam Akhtar Ruby 9 08-16-2008 07:55 PM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
RE: Convert HTML to XML or Paser HTML Steven Cheng[MSFT] ASP .Net 3 02-12-2004 07:15 PM
Re: Convert HTML to XML or Paser HTML Q.Z ASP .Net 0 01-13-2004 04:20 PM
Re: Convert HTML to XML or Paser HTML Joerg Jooss ASP .Net 0 01-11-2004 12:23 AM



Advertisments