Pass HTMLpage code for XML DOM Parsing

Discussion in 'Javascript' started by Kabindra, Jan 18, 2010.

  1. Kabindra

    Kabindra Guest

    hello guys,

    I have been doing some ajax based works.

    For my works I have my basic HTML pages [parent] calling next HTML
    pages [child] using ajax. Since my child pages also contains form
    controls, I have been using XML Parser first to parse the child page
    code and create respective DOM output in parent page.

    Everything worked fine but my problem arouse while using & symbol and
    other basic symbols. So in confusion how to resolve that.

    My steps for my page processing:
    1.) opening of parent page
    2.) call js function
    a.) init ajax
    b.) call child page
    c.) call response handler
    3) response handler
    a.) feed resposne to XML parser
    b.) create DOM elements in parent page.

    Error occurs only if special XML charecters are present in child page
     
    Kabindra, Jan 18, 2010
    #1
    1. Advertising

  2. Kabindra wrote:

    > My steps for my page processing:
    > 1.) opening of parent page
    > 2.) call js function
    > a.) init ajax
    > b.) call child page
    > c.) call response handler
    > 3) response handler
    > a.) feed resposne to XML parser
    > b.) create DOM elements in parent page.
    >
    > Error occurs only if special XML charecters are present in child page


    If you want to use an XML parser then your markup has to comply with XML
    rules. If your markup is HTML tag soup and not well-formed XML then you
    are better off to feed it to the HTML tag soup parser (i.e. set
    innerHTML of a HTML DOM element or use methods like insertAdjacentHTML).

    --

    Martin Honnen
    http://msmvps.com/blogs/martin_honnen/
     
    Martin Honnen, Jan 18, 2010
    #2
    1. Advertising

  3. Kabindra

    Kabindra Guest

    Thnx martin... i have forgot abt innerHTML. It worked fine for me.

    On Jan 18, 4:28 pm, Martin Honnen <> wrote:
    > Kabindra wrote:
    > > My steps for my page processing:
    > > 1.) opening of parent page
    > > 2.) call js function
    > >    a.) init ajax
    > >    b.) call child page
    > >    c.) call response handler
    > > 3) response handler
    > >    a.) feed resposne to XML parser
    > >    b.) create DOM elements in parent page.

    >
    > > Error occurs only if special XML charecters are present in child page

    >
    > If you want to use an XML parser then your markup has to comply with XML
    > rules. If your markup is HTML tag soup and not well-formed XML then you
    > are better off to feed it to the HTML tag soup parser (i.e. set
    > innerHTML of a HTML DOM element or use methods like insertAdjacentHTML).
    >
    > --
    >
    >         Martin Honnen
    >        http://msmvps.com/blogs/martin_honnen/
     
    Kabindra, Jan 19, 2010
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Greg Wogan-Browne
    Replies:
    1
    Views:
    877
    Uche Ogbuji
    Jan 28, 2005
  2. graham.reeds
    Replies:
    9
    Views:
    1,134
    Pavel Lepin
    Feb 4, 2008
  3. Oliver Bleckmann

    how to format a $htmlpage without form feed

    Oliver Bleckmann, Jun 10, 2005, in forum: Perl Misc
    Replies:
    12
    Views:
    258
    Alan J. Flavell
    Jun 11, 2005
  4. Erik Wasser
    Replies:
    5
    Views:
    518
    Peter J. Holzer
    Mar 5, 2006
  5. ming
    Replies:
    2
    Views:
    233
Loading...

Share This Page