Link to home
Start Free TrialLog in
Avatar of trigabert
trigabert

asked on

XML and JSP Purchase Order Form

We need to retrieve records from a database using JSP code in our XML document which is a purchase order form, and display them on the XML PO form web page.
 
Our problem is the jsp code to display the stuff in the page and then write it to a text file or something.  Are there any examples on the web of how to do this so that we can try it out before writing our own.  we are not very good at jsp!? We have spent weeks trying to get this to work, please help!
(We are using an oracle database and have an ssl enabled apache server set up with Tomcat to handle servlets and JSPs.)
Thanks ypu
triga
Avatar of BigRat
BigRat
Flag of France image

What has the XML document go to do with retrieval? I would have thought that the select from the database gets you a record set and you would generate HTML out of it?

Or have you converted the record set to XML and now want to convert the XML into an HTML form?
Avatar of trigabert
trigabert

ASKER

We have no problems retrieving the record set and displaying it in the html version of our page.

We need to retrieve it and display it in the xml version.

Can we generate an xml page the same as a html page or do we have to input the fields into an already created xml form?  if so how do we know our xml form is right and what jsp code to use!?

Thanks for your help
triga

"We need to retrieve it and display it in the xml version"

Are we talking about an already partially designed system, an already avaliable form, or are we talking about doing something completely new?

One normally takes the RS and constructs an XML "document" (I use the term looasely because i is often just a string), and then one sends the document to the browser together with an XSL style-sheet. The sheet transforms the XML to HTML which then gets displayed. If the browser is not XML enabled one does the transform on the server and sends the resultant XML.

So, next question?

HTH
We have a partially designed system and we already have an xml form by creating an html page in frontpage and converted it to xml.  We are trying to get stuff from the database into it using JSP if this is possible?

Is it easier to automatically generate  the xml page with the records from oracle in it?

Thanks
Triga
The XML situation is such that the XML file/document/string contains only the naked data needing to be displayed. The formatting is done via an XSL style-sheet.
   I am not familiar with the Oracle API, but it does have a facility like MS SQL 2K to generate XML data of the form :-

<record>
   <field1>data1</field1>
   <field2>data2</field2>
   ....
</record>

An XSL style sheet would do soemthing like :-

<xsl:template match="/">
   <table>
   <xsl:for-each select="/record">
      <tr>
        <xsl:apply-templates select="."/>
      </tr>
   </xsl:for-each>
   </table>
</xsl:template>

<xsl:template match="field1">
   <td><xsl:value-of select=."></td>
</xsl:template>

and so on.

Get the picture?
We have a partially designed system and we already have an xml form by creating an html page in frontpage and converted it to xml.  We are trying to get stuff from the database into it using JSP if this is possible?

Is it easier to automatically generate  the xml page with the records from oracle in it?

Thanks
Triga
sorry.......my arthritis
OK. My paws are not what they used to be :)
i dont have a clue where to start with this stupid xml and jsp stuff.
AAAHGGhh.
is there any tutorial that is useful i need to learn it in like 2 hours!  i am severly confused.  Do you want to do it and email it me?????? hee hee only joking ( not really)

Thanks for your help.  how do i give you the points?  just click on Accept Comment as Answer beside your name.  Hope my arthritis doesnt cause the mouse to click something else!!!!!!

Triga
ASKER CERTIFIED SOLUTION
Avatar of BigRat
BigRat
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
can u send me a simple version to start us off?  PPPPLLLEEASSEE?  
I'd give you a zillion points  (if I had them)  We thought we had converted our HTML page to a XML page and spent 2 days at it only to find out its still a HTML page!  How do you convert it?

The records in the database aren't in XML form they are just normal.  All we want is to get the stuff out of the database and into the Purchase order form (which we can do through jsp)This isnt doing anything with XML.
  Then because the suppliers dont have our system installed we just want to convert the web page containing the records into a standard XML form and write it to a text file?

Is this easy or are we completely thick?

Thanks again
triga
where can i post the extra questions
where can i post the extra questions
In the XML topic area!