Solved

XML and JSP Purchase Order Form

Posted on 2002-04-24
14
488 Views
Last Modified: 2008-03-06
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
0
Comment
Question by:trigabert
  • 8
  • 6
14 Comments
 
LVL 27

Expert Comment

by:BigRat
ID: 6965399
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?
0
 

Author Comment

by:trigabert
ID: 6965412
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

0
 
LVL 27

Expert Comment

by:BigRat
ID: 6965490
"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
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Author Comment

by:trigabert
ID: 6965640
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
0
 
LVL 27

Expert Comment

by:BigRat
ID: 6965673
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?
0
 

Author Comment

by:trigabert
ID: 6965723
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
0
 

Author Comment

by:trigabert
ID: 6965730
sorry.......my arthritis
0
 
LVL 27

Expert Comment

by:BigRat
ID: 6965764
OK. My paws are not what they used to be :)
0
 

Author Comment

by:trigabert
ID: 6965813
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
0
 
LVL 27

Accepted Solution

by:
BigRat earned 80 total points
ID: 6965947
Yes "accept comment as answer" and then follow the instructions would be OK.

I'd offer to help you get started, but not in 2 hours!

The first thing to do is to get the XML data out of the database. Once you have that writing a styleheet is confusing and difficult, but with a simple version to start off with you might be albe to learn quite quickly.

Again, you can always post further questions here.
0
 

Author Comment

by:trigabert
ID: 6965974
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
0
 

Author Comment

by:trigabert
ID: 6965981
where can i post the extra questions
0
 

Author Comment

by:trigabert
ID: 6965991
where can i post the extra questions
0
 
LVL 27

Expert Comment

by:BigRat
ID: 6966027
In the XML topic area!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question