Web Services FAQ Section Index | Page 23
After generating an XML file dynamically from a Java program I want the generated file to be displayed on the client's browser. How can I do that?
IBM's XML parser for Java provides a TXDocument class in which there is a method printWithFormat(writer). Give the servletResponseWriter to this argument so that the document will be displayed on ...more
How can I "serialize" Swing user interfaces as XML documents?
There is an article at The Swing Connection that explains this process:
http://java.sun.com/products/jfc/tsc/articles/persistence/index.html
more
I have code in which I'm using XLinks. I'm not getting any error but the XLink is not working. I am using IE5. What is the reason for this?
IE 5 does not support XLink or XPointers at the moment.
A reason for this might be that XLink is still a "working draft" at W3.org.
A way to work around this for the time being might be ...more
I am generating an XML file dynamically from a Java program and I want the same to display to the browser with the help of XSL file. I want to select the XSL file dynamically. How can I do that?
In order for the browser (IE 5 is the only shipping browser at this time to support XML and XSL) to know which XSL you want it to use you have to have to header that looks something like this:
&l...more
I am in a project in which I want to display the data fetched from a data base. I use a java bean to get the data and pass it to a JSP. From that I want to make use of XML technology to print the data to the user browser. I am using an XSL file. After getting the data from the data base how can I manage that into an XML file? Do I have to create an XML file dynamically? If so should I have to store it on the disk? And how can I bind an XML file to a XSL file? I want to change the style sheet (XSL) each time.
1. Data from database to XML:
Depends on the complexity of your data. A simple table is easily convert like:
<fieldname1>data</fieldname1>
<fieldname2>data</fieldname2>
et...more
What is the best way to convert HTML to XML, separating the content(data) from presentation in HTML? Are there any Java API's that we can make use of?
Try Cocoon and ECS, or JetSpeed from the Apache group (java.apache.org).
Thijs Stalenhoef adds:
There aren't re...more
What is RSS (Rich Site Summary)?
Originally known as "RDF Site Summary", RSS, the Rich
Site Summary format is the de facto standard meta-data
format for news headlines over the web.
WebReference's RSS page contains a n...more
I am currently using an XSLT processor to render XML (into HTML) generated from an EJB. However I also want some of my HTML to include HTML forms (input boxes, selection boxes etc). Does anyone have any examples where they are doing something similar?? How do you handle the POSTs and GETs??
The first part of this question was answered by M.Kumar Sankar here.
How you handle your POSTs and GETs will depend entirely on how your system works. You can define the form action to be whateve...more
What is WML?
WML is a markup language based on XML and is
intended for use in specifying content and user interface for narrowband devices, including cellular phones and pagers.
Can I design a form which consists of textboxes, submit button, reset button, dropdown list using XML?
Certainly you can. But for that you need to use XSL technology. Include an XSL stylesheet at the begining of your XML with a processing instruction. In the XSL file you can provide form and text b...more
Has anyone parsed an XML dtd to create a DOM object? I don't know if that is possible or not, if it isn't how could I get an object containing all the attributes allowed for a given element?
You might want to have a look at the Oracle XML class generator. This neat little Java API allows you to load a DTD and have each element generated as .java class files. In a second step you can u...more
How can I map data from a DB2 UDB for AS/400 into an XML document and the associated DTD ?
Since V4R2 of the OS400 IBM has released two Java packages the JT400.jar and DB2_CLASSES.zip. With these you have access to almost all the funcionality of the AS400 system (program calls, dataqueu...more
I am attempting to use the XML parser provided by sun jaxp1.0. When I try to get an instance of DocumentBuilderFactory using the static method newInstance(), it throws a FactoryConfigurationError exception at runtime. How can i do to overcome this?
You have to include the following class in the import section and set the classpath to that directory.
import com.sun.xml.parser.DocumentBuilderFactoryImpl;
What are XML namespaces? Please include some examples.
XML namespaces are simple way to give unique names to elements
and attributes used in XML document.
Namespaces enables the programmers to select the XML tags for
processing depending upon...more
How do you print the contents of an XML document using the DOM, i.e. using the org.w3c.dom.* interfaces?
The org.w3c.dom.* package provides a Node interface which defines methods
such as "getNodeName()" ,"getNodeType()", "getNodeValue()"
for getting the information abou...more