5 Replies Latest reply: Apr 22, 2011 7:55 AM by EJP RSS

    Integrate XML with HTML (from db)on server side

    777484
      Hello,

      I am currently retrieving an HTML from a CLOB in db.
      I also have user responses (for the same HTML) saved as an XML in another CLOB column.
      Now, after retrieving the HTML, I need to be able to manipulate the HTML tags in accordance with the saved data which comes from the XML.
      I am planning to do this on the server side itself. It would be great if you could give me some pointers on how I could go about achieving this.

      Rgds,
        • 1. Re: Integrate XML with HTML (from db)on server side
          EJP
          XSLT, but it sounds like a terrible design, an accident waiting to happen. HTML in the database? Please.
          • 2. Re: Integrate XML with HTML (from db)on server side
            777484
            Thanks for your reply EJP.

            XSLT ? Hmm, ok, I will take a shot at it, but the general consensus of the one who stubs the pay is that XSLT is not the right way, for whatever reasons.
            So the HTML is displayed as is for the user when s/he logs in for the first time and then if there are any changes, those are stored as XML and thence the need to integrate the XML changes into the HTML.

            I am still working on figuring out a way to see how I can retrieve the details/checkboxes/radiobuttons the user modifies. Is there any way I can dynamically generate a pojo that I can map the request parameters to ? .. or any other pointers on how this could be done ?

            Rgds,
            • 3. Re: Integrate XML with HTML (from db)on server side
              EJP
              but the general consensus of the one who stubs the pay is that XSLT is not the right way, for whatever reasons.
              I have no idea what 'the one who stubs the pay' means, or how 'one' can have a 'general consensus', but if someone has an objection to XSLT for this purpose let's hear it so we can discuss it. I'm not interested in a discussion along the lines of 'give me another answer' for unstated reasons.
              So the HTML is displayed as is for the user when s/he logs in for the first time and then if there are any changes, those are stored as XML and thence the need to integrate the XML changes into the HTML.
              Why? Still sounds like a lousy design. Possibly you aren't communicating it properly. What Web systems normally do is inject database values into XHTML templates and that is done via XSLT under the hood of the framework, for example JSF, Wicket, ... I don't know why you would be trying to do this kind of thing yourself. It's hard.
              • 4. Re: Integrate XML with HTML (from db)on server side
                777484
                EJP wrote:
                I have no idea what 'the one who stubs the pay' means, or how 'one' can have a 'general consensus', but if someone has an objection to XSLT for this purpose let's hear it so we can discuss it. I'm not interested in a discussion along the lines of 'give me another answer' for unstated reasons.
                I will keep your interests, as I keep gathering them through the forums, in mind when I post next :) It was a simple way of saying, what I am seeking help for is not my decision/choice.
                Why? Still sounds like a lousy design. Possibly you aren't communicating it properly. What Web systems normally do is inject database values into XHTML templates and that is done via XSLT under the hood of the framework, for example JSF, Wicket, ... I don't know why you would be trying to do this kind of thing yourself. It's hard.
                You got it. Swell. I am working on trying to fetch the XML values into related html tags as of now.
                The dynamic object was a pretty simple thing with request.getParameters(). Thanks for helping, btw.

                cheers,
                • 5. Re: Integrate XML with HTML (from db)on server side
                  EJP
                  what I am seeking help for is not my decision/choice.
                  So why haven't you been told how to do it then?

                  If this person/these people are so expert on how not to do it why aren't they telling you how to do it?

                  I would treat that situation with considerabe skepticism. You're the one with the responsibility for producing a working solution, and doing so in a cost-effective way. That cost includes your own time spent pointlessly looking for alternatives just because someone doesn't like or recognize the right answer when they see it. You're a professional, not a robot.

                  Or is this a school assignment?