XML Section Index | Page 20
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
What is the most efficient way to create XML documents from Java objects and vice versa?
There is not AN afficient way, it depends on different parameters, because efficiency is not only how fast you parse but also how easily you do it.
Here are some examples and guidelines.
Parsing...more
Why would XML be a better solution than a typical delimited text file for B2B (business to business applications), or representing data in general? I can take a flatfile, I can parse it and extract data, and then present that data in different ways using java such as HTML or WML. So, why would I want to complicate things with DTDs, parsers, and APIs needed to extract and display data?
There are many possible answers; XML can be used, as ASCII text files, in many ways. In fact it is also called the ASCII of the future (even if ASCII an XML define two different things).
In B2B th...more
Can I get an example that works on documents which are not DTD-specific but generic?
The xBeans project
includes many examples of Java code that works on documents of any DTD.
Such code requires you to essentially interpret the DOM representation of
the document and not depend o...more
Is there an easier way to create a DTD file? Are there tools that can help me do so?
(From Egil Ølberg)
Yes, the tool I use can be downloaded at:
IBM AlphaWorks
(From Benoit Xhenseval)
Yes there are. It is also recommended to use some tools as the DTDs will evolve into X...more
Can I use WML (wireless markup language) from a Java Server Page?
Follow these steps for using WML instead of HTML from within JSP.
1) Make sure that the following is added to your MIME types file of your web server and restart it:
File Extension = .wml
MIME Ty...more
Could you describe the architecture behind jGuru.com: JSP, Servlets, database, servers, transactions etc...?
[Updated Nov 20, 2002 to remove old description and point at some articles. TJP]
jGuru.com Case-Study.
Little Nybbles of Development Wisdom.more
How does one decide when to use an attribute or an element for representing data?
How does one decide when to use an attribute or an element for representing data?
For example, it is possible represent an order as
<ORDER ITEM="XXXX" QTY=10 UNIT="PC" />...more
How is XML better than prior languages such as DHTML?
(From Mathew Cobby) XML is purely "data about data". i.e. there is no concept of HOW something should look, it might not even have a visual representation. XML is about shoving data arou...more
What is XSLT?
XSLT is the part of XSL used to transform XML documents to HTML, PDF etc. or other XML documents. It can help you publish an XML document in a variety of formats. For instance, it can be used to c...more
Is there any other way to declare a schema for XML other than DTD's ?
There are many proposals for describing xml schema but none have reached the point that they are in products.
A good point to start is the
XML schema primer.
The technical notes include:
XML...more
How can I prevent text that contains "" or ">" from interfering with parsing. Are there other characters I need to be concerned about?
A simple XML "encode" should do the trick.
/**
* Escape the "special" characters as required for inclusion in XML elements
* Replaces all incidences of
* & wit...more