bpearce4827

Greenhorn
+ Follow
since Jun 29, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by bpearce4827

If you already know Java, I would suggest "Java and XML" by Brett McLaughlin from O'Reilly (ISBN - 0-596-00016-2). It really starts with the basics of XML (the what and why) and moves into some useful applications of the various aspects. The chapter on Transforming XML helped me quite a bit with XSL.
The Wrox press "Java Server Programming" has a chapter or two on XML, but the book inludes a lot of other things you may not care about. It also deals mainly with parsing and not much with transformation.
Good luck,
Bill
I looked around for some good tutorials when I first started researching XML and found that the tutorial on the IBM site helped me the most:
http://www-4.ibm.com/software/developer/education/xmljava/
It does require some knowledge of Java, and in order to repeat the examples you will need the JDK (or other environment).
I don't think anyone will be replacing their enterprise datbases with XML files anytime soon. I think XML is "universal data" when talking about the need for data exchange between different systems or different companies with different systems.
Meaning that you might be using Oracle and I might be using Informix, and we decide we need to exchange some data with each other through an automated process (HTTP, FTP, etc). If we agree on a set of tags to use in an XML file, we each can develop software in our language of choice that will create or process the document based on our particular database platform and schema. That way, even if I change over to SQL Server, the way you and I exchange data does not change.
The name of this forum has apparently changed, making it difficult to reply to some postings.
In my reseaching XML and related technologies, I see two areas where it can be a tremendous benefit: (1)Data exchange between different systems or companies with different systems, and (2)Dynamic presentation generation using XSL.
If your company and a busines partner or customer want to automate order processing, billing, etc., but don't know anything about each other's systems, you can simply agree to exchange data using XML. Once you agree upon the schema of the documents and the method of transfer (HTTP, FTP, email attachment), then all you need is a way to process the XML documents (or generate them). Now you can exchange data all you want without regard to what type of database your customer is using. They can even change their database vendor, and since you are simply exchanging XML, nothing you have written has to change.
XML also is very powerful when it comes to dynamic content generation. My company (or rather my marketing department) is big on branding portions of our web site for partners or large customers. With CGI scripts or static HTML files, this is an administration nightmare. It also limits just how much you can customize the pages.
Using if our content is in XML, we can dynamically generate the required HTML by selecting which XSL stylesheet to use (based on URL parameters, etc). The custom pages can look *entirely* different from one another, even though the content is the same. Change something in your XML file, and all your clients see it immediately. This can be extended even further, to support differnt types of content type. For example, if you are using XML and XSL, making your web site WAP enabled is simply creating a new style sheet that returns WAP/WML to the client, from your XML document.
Hope this helps,
Bill
Hi all,
It took me a while to find the right way of doing this, and I thought I would share it since it has saved me quite a lot of time and effort. To transform XML to HTML using XSL using a servlet is surprisingly simple. (You need xalan.jar in your path):
(1) import org.apache.xalan.xslt.*;
(2) In your service method:
String sheet = "myStyleSheet.xsl";
String doc = "myXML.xml";
XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
processor.process(new XSLTInputSource(new FileInputStream(doc)), new XSLTInputSource(new FileInputStream(sheet)), new XSLTResultTarget(res.getOutputStream()));
I have left out the try/catch block to save space. This example processes a XML file and stylesheet which are both files, but you can just as easily process using InputStreams from a URL, or some other source. In my application, I call a URL of another servelt on the same server, which returns back a dynamic XML document each time, based un URL parameters.
Have fun!
Bill
You probably found the answer you were looking for by now, but perhaps this will help someone. In order to include form elements and assign them a name or value dynaically from the XML source, you must use the xsl:element tag, then assign attributes to that element. This should generate an HTML form element of type checkbox with the name "employeeId" with the value of the "employee_id" found in the XML document:
<xsl:element name="input">
<xsl:attribute name="type">checkbox</xsl:attribute>
<xsl:attribute name="name">employeeId</xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="employee_id" />
</xsl:attribute>
</xsl:element>

Hope this helps!
Bill
If you already know the basics of what XML is and want to know the difference between SAX and DOM (and what to do woth them), check out this tutorial from the IBM site (you have to register, but it's free):
http://www-4.ibm.com/software/developer/education/xmljava/
The tutorial takes you through simple examples on parsing with SAX and DOM, when to use each, and goes into specifics on the implementations and methods of both. Hope some find it helpful like I did.
Bill
Hi all,
I am attempting to include a table control in my applet, and naturally am having trouble doing it with AWT. I have seen several postings on SUN's message site in which people say they have gotten swing to work by including the swing classes (either all of them or just the ones they need) in the jar file which contains their applet to be downloaded. We want to avoid the browser plugin as this will be for external customer use. Here is what I have tried:
I have unpacked the swingall.jar file into a directory. Placed my applet class (source below) in the root directory. Made a new JAR with the com and javax folders, and my applet class. All I am trying to do is add a JLabel.
import javax.swing.*;
import java.applet.*;
import java.awt.*;
public class MyApplet extends Applet {
public void init() {
JLabel j = new JLabel("Hello from swing");
TextField t = new TextField("Hello from AWT");
add(j);
add(t);
}
public void paint(Graphics g) {

}
}
What i get when I run this (in Netscape, IE4 and IE5) is the error below. If anyone can help me, I would surely appreciate it.
Thanks in advance,
Bill
com.ms.security.SecurityExceptionEx[javax/swing/plaf/metal/DefaultMetalTheme.<init>]: Unable to access system property: swing.plaf.metal.controlFont
at com/ms/security/permissions/PropertyPermission.check (PropertyPermission.java)
at com/ms/security/PolicyEngine.shallowCheck (PolicyEngine.java)
at com/ms/security/PolicyEngine.checkCallersPermission (PolicyEngine.java)
at com/ms/security/StandardSecurityManager.chk (StandardSecurityManager.java)
at com/ms/security/StandardSecurityManager.checkPropertyAccess (StandardSecurityManager.java)
at java/awt/Font.getFont (Font.java)
at javax/swing/plaf/metal/DefaultMetalTheme.<init> (DefaultMetalTheme.java:59)
at javax/swing/plaf/metal/MetalLookAndFeel.createDefaultTheme (MetalLookAndFeel.java:709)
at javax/swing/plaf/metal/MetalLookAndFeel.getDefaults (MetalLookAndFeel.java:714)
at javax/swing/UIManager.setLookAndFeel (UIManager.java:363)
at javax/swing/UIManager.setLookAndFeel (UIManager.java:383)
at javax/swing/UIManager.initializeDefaultLAF (UIManager.java:848)
at javax/swing/UIManager.initialize (UIManager.java:927)
at javax/swing/UIManager.maybeInitialize (UIManager.java:945)
at javax/swing/UIManager.getUI (UIManager.java:560)
at javax/swing/text/JTextComponent.updateUI (JTextComponent.java:396)
at javax/swing/text/JTextComponent.<init> (JTextComponent.java:356)
at javax/swing/JTextField.<init> (JTextField.java:204)
at javax/swing/JTextField.<init> (JTextField.java:185)
at MyApplet.init (MyApplet.java:9)
at com/ms/applet/AppletPanel.securedCall0 (AppletPanel.java)
at com/ms/applet/AppletPanel.securedCall (AppletPanel.java)
at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)
at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)
at com/ms/applet/AppletPanel.run (AppletPanel.java)
at java/lang/Thread.run (Thread.java)
23 years ago