HTML in XML call?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fergus O'Shea

    #1

    HTML in XML call?

    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.
  • GIMME

    #2
    Re: HTML in XML call?

    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[color=blue]
    > signs.[/color]

    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 ?

    foshea@cnghotel s.com (Fergus O'Shea) wrote in message news:<b6236ae8. 0311210618.1a7d fd1a@posting.go ogle.com>...[color=blue]
    > 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.[/color]

    Comment

    • Fergus O'Shea

      #3
      Re: HTML in XML call?

      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.

      gimme_this_gimm e_that@yahoo.co m (GIMME) wrote in message news:<3f12b4fb. 0311241115.625d ec64@posting.go ogle.com>...[color=blue]
      > 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[color=green]
      > > signs.[/color]
      >
      > 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 ?
      >
      > foshea@cnghotel s.com (Fergus O'Shea) wrote in message news:<b6236ae8. 0311210618.1a7d fd1a@posting.go ogle.com>...[color=green]
      > > 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.[/color][/color]

      Comment

      • GIMME

        #4
        Re: HTML in XML call?

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

        Can the xml call be configured to store the html in a
        CDATA element so that it comes over as < instead of &lt; ?
        [color=blue]
        >
        > 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.
        >[/color]

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


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

        [color=blue]
        > Thanks again.
        >
        > gimme_this_gimm e_that@yahoo.co m (GIMME) wrote in message news:<3f12b4fb. 0311241115.625d ec64@posting.go ogle.com>...[color=green]
        > > 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[color=darkred]
        > > > signs.[/color]
        > >
        > > 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 ?
        > >
        > > foshea@cnghotel s.com (Fergus O'Shea) wrote in message news:<b6236ae8. 0311210618.1a7d fd1a@posting.go ogle.com>...[color=darkred]
        > > > 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.[/color][/color][/color]

        Comment

        • Fergus O'Shea

          #5
          Re: HTML in XML call?

          gimme_this_gimm e_that@yahoo.co m (GIMME) wrote in message news:<3f12b4fb. 0311251725.6448 ee83@posting.go ogle.com>...[color=blue][color=green]
          > >
          > > In the database it is being stored as <br>. It is only when the XML
          > > call is made that the < is changed to &lt; .[/color]
          >
          > Can the xml call be configured to store the html in a
          > CDATA element so that it comes over as < instead of &lt; ?
          >[/color]

          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.
          [color=blue][color=green]
          > >
          > > 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.
          > >[/color]
          >
          > Just for laughs and giggles this replace function might work for you
          > ...
          >
          >
          > function Html2St( st)
          > {
          > return String(st).repl ace('&lt;','<') .replace('&gt;' ,'>').replace(' &nbsp;','
          > ').replace('\\\ \','\\');
          > }
          >[/color]

          I'll send it on, Thanks.
          [color=blue]
          >[color=green]
          > > Thanks again.
          > >
          > > gimme_this_gimm e_that@yahoo.co m (GIMME) wrote in message news:<3f12b4fb. 0311241115.625d ec64@posting.go ogle.com>...[color=darkred]
          > > > 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 ?
          > > >
          > > > foshea@cnghotel s.com (Fergus O'Shea) wrote in message news:<b6236ae8. 0311210618.1a7d fd1a@posting.go ogle.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.[/color][/color][/color]

          Comment

          Working...