 |
 |
 |
 |
 |
 |
Tip: Documenting style sheets using RDF
Uche Ogbuji shows how to use Resource Description Framework (RDF) to document your XSLT style sheets and discusses some of the powerful applications that can be made of this structured documentation. This tip assumes that you already have a basic knowledge of XSLT and RDF.
|
 |
Articles |
 |
01 Feb 2001 |
|
| |
Tip: Validation and the SAX ErrorHandler interface
In this tip, Brett McLaughlin explores SAX's validation capabilities and explains how to turn XML document validation on and off. He also covers the ErrorHandler interface, which enables you to receive notification of errors in your applications and act on that notification. Code samples demonstrate how to request validation and how to create and register an error handler in SAX.
|
 |
Articles |
 |
01 Jun 2001 |
|
| |
Tip: Using an entity resolver
Brett McLaughlin discusses how to use external entity references to include external content in an XML document, and how to use the SAX EntityResolver interface. Code samples illustrate the interface, document its use, and demonstrate how to register the entity resolver in your parser.
|
 |
Articles |
 |
01 Jun 2001 |
|
| |
Web services tip: Use polymorphism as an alternative to xsd:choice
xsd:choice is not always the most optimal XML schema construct. For instance, a type containing xsd:choice does not map to a user-friendly Java class using a JAX-RPC code generator. In this article, you learn about a functional equivalent to xsd:choice: polymorphism.
|
 |
Articles |
 |
20 Sep 2005 |
|
| |
Tip: Converting from JDOM
Learning to work with JDOM? Well, no API is an island, and in this tip you'll learn how to convert with ease from JDOM to SAX and DOM for fluent programming of XML applications that use all three APIs. The code samples provide examples of converting from JDOM to SAX and from JDOM to DOM.
|
 |
Articles |
 |
01 Apr 2001 |
|
| |
Tip: Achieving vendor independence with SAX
While newer XML developers are learning to achieve vendor independence with JAXP, SAX veterans have been vendor neutral for years. This tip explains how to use SAX and a SAX helper class to achieve vendor independence in your SAX-based applications.
|
 |
Articles |
 |
01 Mar 2001 |
|
| |
Tip: Convert from HTML to XML with HTML Tidy
This tip demonstrates how to convert HTML documents to XML (or more specifically, XHTML) with a simple, open source tool, HTML Tidy. This conversion is useful for webmasters who are migrating to XML. It can also help XML converts who have to interface with legacy HTML tools.
|
 |
Articles |
 |
18 Sep 2003 |
|
| |
Tip: Moving DOM nodes
This tip takes a look at a common exception that occurs when you attempt to move DOM nodes. Here you'll learn the causes of this exception and, most important, how to avoid it when doing DOM programming. The code listings demonstrate how to move nodes from one document to another, what the code that generates the dreaded Wrong document exception looks like, and how to write correct code that doesn't present this problem. This tip assumes that you already know the basics about how to work with the DOM."
|
 |
Articles |
 |
01 Mar 2001 |
|
| |
Tip: Converting from DOM
In this tip, you'll learn how to convert DOM structures to SAX and JDOM to allow communication with applications that do not use DOM. The code listings demonstrate how to convert from DOM to an output stream for use by SAX, and how to convert from DOM to JDOM.
|
 |
Articles |
 |
01 Apr 2001 |
|
| |
Tip: Converting from SAX
Brett McLaughlin explains how to use SAX to communicate with applications that require DOM and JDOM inputs. It's a useful technique: With the flurry of XML APIs available, developers now have to be able to easily move from one to another, and then on to another. The sample code provides a concrete example of converting from SAX to JDOM.
|
 |
Articles |
 |
01 Apr 2001 |
|
| |
Tip: Send and receive SOAP messages with JAX-RPC
In this tip, IBM developer Russell Butek takes a look at JAX-RPC, a Java API that allows an application to communicate with a Web service without knowing details about the SOAP messaging protocol.
|
 |
Articles |
 |
02 Sep 2003 |
|
| |
Tip: Javadoc as XML
A lot of value is locked up in your Java code: all your classes and interfaces, as well as their instance variables and methods. You can use these data to create documentation, to build code generators, or to provide metrics for project reporting.
|
 |
Articles |
 |
14 Apr 2005 |
|
| |
Tip: Rescue terrible HTML with TagSoup
XHTML is a friendly enough format for parsing and screen-scraping, but the Web still has a lot of messy HTML out there. In this tip Uche Ogbuji demonstrates the use of TagSoup to turn just about any HTML into neat XHTML.
|
 |
Articles |
 |
04 May 2006 |
|
| |
Tip: Migrating from JBoss 4 to JBoss 5
Trying to migrate your EJB code to JBoss 5? Can't get the code to deploy and run? If so, this tip is for you. Or, are you new to JBoss 5 but you want to get a feel for the EJB 3 environment? This tip details the required XML deployment files to build, deploy, and run EJB3 code on JBoss5.
|
 |
Articles |
 |
21 Jul 2009 |
|
| |
Tip: Twisting XML with XSLT 2.0
The XML story has two sides: data creators and data consumers. XSL typically falls on the consumer side of the equation, and all too often the format of the data is fixed well before a template gets to it. Take a list of books, for example. You might have an XML file with a list sorted by title, but what if you want the list to be sorted by author, or you just want to display the distinct author names? Can XSL do that?
|
 |
Articles |
 |
31 Mar 2005 |
|
| |
Tip: Implement implicit and explicit SOAP headers
You can define SOAP headers in a WSDL definition using what are commonly called explicit and implicit headers. Learn the difference between these two styles and how these differences might impact you when developing with JAX-RPC.
|
 |
Articles |
 |
15 Feb 2005 |
|
| |
Tip: Remove sensitive content from your XML samples with XSLT
Do you need to share samples of your XML code, but can't disclose the data? For example, you might need to post a sample of your XML code with a question to get some advice with a problem. In this tip, Uche Ogbuji shows how to use XSLT to remove sensitive content and retain the basic XML structure.
|
 |
Articles |
 |
11 Apr 2006 |
|
| |
Tip: Use the Unicode database to find characters for XML documents
The Unicode consortium is dedicated to maintaining a character set that allows computers to deal with the vast array of human writing systems. When you think of computers that manage such a large and complex data set, you think databases, and this is precisely what the consortium provides for computer access to versions of the Unicode standard. The Unicode Character Database comprises files that present detailed information for each character and class of character. The strong tie between XML and Unicode means this database is very valuable to XML developers and authors. In this article Uche Ogbuji introduces the Unicode Character Database and shows how XML developers can put it to use.
|
 |
Articles |
 |
07 Mar 2006 |
|
| |
Tip: Use data URIs to include media in XML
There are many ways to link to non-XML content within XML, including binary content. Sometimes you need to roll all such external content directly into the XML. Data scheme URIs are one way to specify a full resource within a URI, which you can then use in XML constructs. In this tip, Uche Ogbuji shows how to use this to bundle related media into a single file.
|
 |
Articles |
 |
15 Feb 2006 |
|
| |
Tip: Using JDOM and XSLT
In this tip, Brett McLaughlin tells how to avoid a common pitfall when working with XSLT and the JDOM API for XML developers working in Java. You'll learn how to take a JDOM document representation, transform it using the Apache Xalan processor, and obtain the resulting XML as another JDOM document. Transforming a document using XSLT is a common task, and JDOM makes the transformation go quite easily once you know how to avoid the missteps. The code demonstrates how to use JDOM with the new Apache Xalan 2 processor (for Java).
|
 |
Articles |
 |
01 Mar 2001 |
|
| |
Tip: xsd:any: A cautionary tale
xsd:any is a popular feature for people designing XML schema. But it's often more trouble than it's worth. Explore some of the shortcomings of xsd:any, both in XML itself and in the JAX-RPC Java language binding, so that, even if you decide to use xsd:any, you will be more prepared to deal appropriately with it.
|
 |
Articles |
 |
13 Dec 2005 |
|
| |
Tip: Use the right pattern for simple text in RELAX NG
The RELAX NG XML schema language allows you to say "permit some text here" in a variety of ways. Whether you're writing patterns for elements or attributes, it is important to understand the nuances between the different patterns for character data. In this tip, Uche Ogbuji discusses the basic foundations for text in RELAX NG.
|
 |
Articles |
 |
28 Oct 2005 |
|
| |
Tip: How not to design an XML format
This tip investigates an XML format that demonstrates a number of common mistakes and design flaws, and explains how you can correct these issues and improve the format.
|
 |
Articles |
 |
04 Nov 2005 |
|
| |
Web services tip: Representations of null in XML Schema
Represent a null value in the XML-equivalent of a field when you map a null Java bean field to XML. This tip explores and compares a number of ways to do so.
|
 |
Articles |
 |
09 Aug 2005 |
|
| |
Tip: Bring Scalable Vector Graphics to life with built-in animation elements
Scalable Vector Graphics (SVG) is an XML-based language for drawing two-dimensional graphics. Sound dull? Far from it. SVG has many exciting features available to it such as transformations, alpha masks, filter effects, and animation. This tip provides working examples to show you how to apply the five flavours of SVG animations to your SVG documents.
|
 |
Articles |
 |
18 Jun 2003 |
|
| |
Tip: Use XSL-FO for page breaks and tables
The XSL Formatting Objects (XSL-FO) standard offers powerful properties for controlling the layout of printed documents. This tip shows you how to control the insertion of page breaks for better-looking documents. I'll present a standard method that works with commercial XSL-FO renderers, and a workaround so you can apply the same technique with the open source FOP.
|
 |
Articles |
 |
11 Jun 2003 |
|
| |
Tip: Divide and conquer large XML documents
Occasionally, you get an XML file that is too large to publish as is. The solution is to use your XSLT processor to break the file into smaller documents. This tip demonstrates how to break up documents with popular XSLT processors.
|
 |
Articles |
 |
05 Jun 2003 |
|
| |
Tip: How to combine documents with XSLT
This tip explains how to write XSLT style sheets that process several documents. This is useful, among other things, for combining book chapters, merging a letter template and a list of addresses, creating tables of content that span several files, or -- following the tip example -- reusing photo descriptions in different galleries.
|
 |
Articles |
 |
29 May 2003 |
|
| |
Tip: Tell a parser where to find a schema
This tip shows you how to implement robust document validation with XML schema and JAXP 1.2. Examples are included for SAX and DOM parsers.
|
 |
Articles |
 |
22 May 2003 |
|
| |
Tip: Asynchronous SAX
Over asynchronous channels -- such as a socket that produces data over a long duration -- SAX is a wonderfully lightweight programming technique for parsing incoming messages.
|
 |
Articles |
 |
14 May 2003 |
|
| |
Tip: Command-line XML processing
Most of the time, processing XML documents utilizes heavy-duty APIs and custom applications. However, the tradition of using small tools with I/O piped between them works fine on Unix-like platforms. Here, David shows you how you can use XML for this kind of quick-and-dirty processing with one-liners that are especially useful during development and debugging cycles.
|
 |
Articles |
 |
07 May 2003 |
|
| |
Tip: Make your CGI scripts available via XML-RPC
Utilizing XML-RPC instead of CGI
|
 |
Articles |
 |
30 Apr 2003 |
|
| |
Tip: Output large XML documents, Part 5
In this, the last in a five-part series of tips on outputting large XML documents, Brett McLaughlin provides several practical examples of using the SAX DataWriter class to output XML.
|
 |
Articles |
 |
23 Apr 2003 |
|
| |
Tip: Output large XML documents, Part 4
This tip introduces the XMLWriter class, a specialized SAX filter that handles output of stream-based XML. The tip also examines DataWriter, a subclass of XMLWriter that offers even more output capabilities. Both classes are examined in the context of handling the output of large XML documents and datasets.
|
 |
Articles |
 |
17 Apr 2003 |
|
| |
Tip: Output large XML documents, Part 3
This tip delves further into the use of XML filters, as introduced in the previous tip. You will see several practical examples of filters, including utilities that filter out all elements, all attributes, or particular elements or attributes in an XML document. Each is provided as a reusable filter.
|
 |
Articles |
 |
09 Apr 2003 |
|
| |
Tip: Output large XML documents, Part 2
This tip begins to detail ways to handle large XML documents. You will learn what an XMLFilter is, and how it builds upon the core SAX API to offer advanced data filtering. This is the first piece in the puzzle of handling large datasets, allowing you to extract only relevant data from an XML document for output.
|
 |
Articles |
 |
02 Apr 2003 |
|
| |
Tip: Output large XML documents, Part 1
This tip details the problems associated with outputting large XML documents, starting with an examination of the options for XML output. It then looks at DOM and XML output, along with possible solutions to the memory consumption associated with extended DOM usage. You'll get an understanding of why outputting XML is so tricky, and a solid grasp of the output alternatives that are available.
|
 |
Articles |
 |
26 Mar 2003 |
|
| |
Tip: Use internal references in XML vocabularies
In some cases, you can avoid repeating identical data fields by using internal references from one field to another. Uche Ogbuji demonstrates how in this tip.
|
 |
Articles |
 |
01 Mar 2003 |
|
| |
Tip: Loop with recursion in XSLT
XSLT is a functional programming language like Haskell or Scheme, and unlike C or Fortran. Thus it has no loops and no mutable variables. Instead, you must replace these constructs with recursion and parameters. This tip demonstrates how to provide this functionality using named templates and the xsl:call-template, xsl:with-param, and xsl:param elements.
|
 |
Articles |
 |
28 Jul 2006 |
|
| |
Tip: SAX filters for flexible processing
SAX filters allow you to construct complex XML processing behaviors from simple, independent modules. In this tip, Uche Ogbuji introduces this important XML processing technique.
|
 |
Articles |
 |
01 Mar 2003 |
|
| |
Tip: Use rdf:about and rdf:ID effectively in RDF/XML
The combination of RDF and XML allows for several different approaches to specifying resources, and sometimes the rules for interpreting the syntax can be troublesome. In this tip, Uche Ogbuji uses examples to illustrate the various behaviors of the rdf:ID and rdf:about attributes, and shows how to use XML Base to control these behaviors.
|
 |
Articles |
 |
01 Feb 2003 |
|
| |
Tip: SAX and document order -- deliver maximally contiguous text
Previous tips in this series have explored how SAX can help delineate the relationships that exist between nodes in your XML documents. The tips have examined the use of document order and document order indices (DOIs) to track both parent-to-child and sibling-to-sibling relationships. This tip concludes the series with a look at character data and text nodes.
|
 |
Articles |
 |
01 Feb 2003 |
|
| |
Tip: SAX and document order -- track sibling relationships
Previous tips in this series have been using examples of SAX code to explore the concept of document order and the use of document order indices (DOIs) to model hierarchy in XML documents. This tip continues that exploration with a look at sibling relationships.
|
 |
Articles |
 |
01 Feb 2003 |
|
| |
Tip: SAX and document order -- track parent-child relationships
The tips in this series explore the concept of document order and the use of so-called document order indices in SAX. This tip looks at the use of DOIs in modeling parent-child relationships in XML documents. Such DOI representations of document hierarchy are useful in building applications, such as DOMs and query engines, that need to navigate through XML trees.
|
 |
Articles |
 |
01 Jan 2003 |
|
| |
Tip: SAX and document order
Focus on document order, SAX, and document order indices (DOIs) as Howard Katz discusses document order in an XML context. He presents simple SAX code that shows a practical application of DOIs in a search engine.
|
 |
Articles |
 |
01 Jan 2003 |
|
| |
Tip: Flexible DTDs with parameter entities
In this tip, Brett defines parameter entities and shows you how they're used. You will learn how to construct parameter entities and use them in your XML DTDs.
|
 |
Articles |
 |
01 Jan 2003 |
|
| |
Tip: Simplify with entity references
XML is primarily a static language. However, by using entity references, you can perform a limited amount of dynamic substitution. This tip explains how to use entity references, and shows you how they are useful.
|
 |
Articles |
 |
01 Jan 2003 |
|
| |
Tip: Basics of bootstrapping with DOM, Part 3
This tip explains the changes to DOM Level 3 that relate to bootstrapping, and how they improve upon DOM Levels 1 and 2..
|
 |
Articles |
 |
01 Dec 2002 |
|
| |
Tip: Basics of bootstrapping with DOM, Part 2
In this tip, you'll learn about a better way to bootstrap in your DOM applications. This builds upon the previous tip, which examined the abilities that DOM natively provides for this task.
|
 |
Articles |
 |
01 Dec 2002 |
|
| |
Tip: Basics of bootstrapping with DOM, Part 1
This tip, the first in a series on bootstrapping with DOM, explains what bootstrapping is, explores the problems associated with it, and lays out the basics for use in DOM Levels 1 and 2.
|
 |
Articles |
 |
01 Nov 2002 |
|
| |
Tip: Use a SAX filter to manipulate data
This tip explains how to create and use a SAX filter to control how data is processed.
|
 |
Articles |
 |
01 Oct 2002 |
|
| |
Tip: Control white space in an XSLT style sheet
This tip shows you how to control the production of white space in a transformation's result, which can lead to documents that more closely align with your requirements.
|
 |
Articles |
 |
01 Nov 2002 |
|
| |
Tip: Use imports and includes to override XSLT templates
Extensible Stylesheet Language Transformations (XSLT) provide two ways to combine several style sheets in the transformation of a single source document. Which template is actually applied depends on whether and how the template has been included in the main style sheet.
|
 |
Articles |
 |
01 Nov 2002 |
|
| |
Tip: Using a DOM NodeFilter
This tip shows you how to create a a NodeFilter as well as a Traversal object that uses it.
|
 |
Articles |
 |
01 Nov 2002 |
|
| |
Tip: Traversing an XML document with a TreeWalker
This tip demonstrates the process of determining whether TreeWalkers are available and using them to extract information from a document.
|
 |
Articles |
 |
01 Oct 2002 |
|
| |
Tip: Using generators
Generators are a very powerful new language feature of Python 2.2. In this tip, Uche Ogbuji presents a set of techniques for using generators for fast and lucid XML processing patterns in Python.
|
 |
Articles |
 |
01 Oct 2002 |
|
| |
Tip: Multi-pass XSLT
Transforms can often be made cleaner and clearer if executed in phases or passes. First some intermediate output is produced, and then this is further transformed into a final output form. There can even be more than one intermediate form. In this tip, Uche Ogbuji discusses ways of breaking down XSLT operation into two or more clear passes of transformation using the common node-set extension.
|
 |
Articles |
 |
01 Sep 2002 |
|
| |
Tip: Using fixed attributes in XML vocabularies
Fixed attributes are not the most common feature in XML, but they can sometimes come in surprisingly handy. In this tip, Uche Ogbuji introduces fixed attributes and shows how they can be used to reduce the visibility of XML namespaces to authors.
|
 |
Articles |
 |
01 Sep 2002 |
|
| |
Tip: Localization within a document format
Internationalization support is one of XML's key strengths. Unfortunately, too few XML formats provide mechanisms for localizing content. This tip shows you how to develop localized XML formats.
|
 |
Articles |
 |
01 Sep 2002 |
|
| |
Tip: Work with schemas and namespaces
This tip explains how the XML Schema specification requires one XML Schema per namespace, and shows you how to include more than one schema for a document and how to reference one schema from another.
|
 |
Articles |
 |
01 Sep 2002 |
|
| |
Tip: Customized validation in SAX
This tip explains how to use a partial validation approach, rather than the full-blown validation that's included in parsing APIs. By validating only what is absolutely required, you can save tons of processing time.
|
 |
Articles |
 |
01 Aug 2002 |
|
| |
Tip: Using SAX InputSource effectively
This tip explains how using an InputStream to feed XML to the SAX API is significantly more efficient and safer than using a Reader as input. It also briefly touches on the impact of such a choice on internationalization.
|
 |
Articles |
 |
01 Aug 2002 |
|
| |
Tip: Load resources from the classpath
This tip describes how to use the EntityResolver interface to resolve entities using the local Java classpath.
|
 |
Articles |
 |
01 Aug 2002 |
|
| |
Tip: Make choices at runtime with XSLT parameters
This tip takes a basic look at using parameters and conditional statements in an XSLT style sheet.
|
 |
Articles |
 |
01 Aug 2002 |
|
| |
Tip: Generating internal HTML links with XSLT
Uche Ogbuji walks you through how to use XSLT to populate HTML or XHTML output with anchors and internal links. Internal links help to organize long HTML content; XSLT provides facilities for generating those internal links, but some of the methods are somewhat obscure. This tip, with reusable sample code, clearly spells out two approaches for the process.
|
 |
Articles |
 |
01 Feb 2001 |
|
| |
Tip: Include external information with general entities
General entities enable XML authors to conveniently include not only characters that would be difficult to represent directly, but also information that must be repeated. They also enable you to import information from another file, as well as from another location. This tip shows you how to include external information through the use of general entities.
|
 |
Articles |
 |
01 Jul 2002 |
|
| |
Tip: Create an XForms form that submits a second instance
Because they can easily send and receive XML, XForms forms make great Web services clients, but using them in this way limits your control over the structure of your instance. This tip explains how to manage your data within one instance while submitting a second.
|
 |
Articles |
 |
22 Jul 2004 |
|
| |
Tip: Use XForms to send and receive Web services messages
One of the great strengths of XForms is the fact that an XForms client can send its data as XML, and that it receives XML in return. This capability can be exceptionally useful in the field of Web services, where that's exactly what gets sent and received: XML messages. In this tip, the author looks at how to use an XForms browser as a Web services client, sending a SOAP request and displaying the results directly in the browser.
|
 |
Articles |
 |
24 Jun 2004 |
|
| |
Tip: Use XML to send SMS messages
Many developers tend to think of Web services as a way to easily move information from one place to another, but it's also important to understand how integral a Web service can be to the overall application. This tip gives some examples of using XML for Short Message Service (SMS) messages. If you're familiar with SMS, you'll find out how adding this tool to your toolbox can help you; if you're not an SMS developer, you'll see a real-life example of how Web services are integrated into an application.
|
 |
Articles |
 |
07 Jun 2004 |
|
| |
Tip: Use data dictionary links for XML and Web services schemata
When designing XML and Web services schemata you will often (and ideally) reuse data elements defined in pre-existing standards. When you do, it is extremely useful to include links to such standards, providing precise data dictionary references. In so doing, you make processing and maintenance easier to automate. This tip illustrates this practice.
|
 |
Articles |
 |
20 May 2004 |
|
| |
Tip: Always use an XML declaration
The XML declaration is optional in XML files, and defaults determine most of the information in the file. However, problems are common when these defaults do not match reality -- for example, the document could use an encoding other than one of the defaults. It's always safer to make the XML declaration. In this tip, Uche Ogbuji covers what should be included in the XML declaration on all files.
|
 |
Articles |
 |
05 Jun 2007 |
|
| |
Tip: Compress XML files for efficient transmission
Binary XML has generated a lot of talk, and one of the motivators is the need for a less verbose transfer format, especially for use with Web services. One solution that is already at hand is data compression. This tip shows you how to use compression to prepare XML for transmission over Web services.
|
 |
Articles |
 |
09 Apr 2004 |
|
| |
Tip: Send and receive SOAP messages with SAAJ
In this tip, author and developer Nicholas Chase shows you how to use the SOAP with Attachments API for Java (SAAJ) to simplify the process of creating and sending SOAP messages.
|
 |
Articles |
 |
22 Jan 2008 |
|
| |
Tip: Configure SAX parsers for secure processing
Because XML systems often accept and process data from many different sources, it's important to consider the effect bad data may cause if it's intentionally or unintentionally injected into the system. Although validation and well-formedness checking provide a substantial amount of protection compared to traditional binary formats, you also need to consider some issues that are unique to XML. Fortunately, proper configuration of the parser and some reasonable intelligence about what to store can ameliorate most security concerns.
|
 |
Articles |
 |
27 May 2005 |
|
| |
Tip: Create multiple files in XSLT 2.0
For any reasonably complex data set, you need multiple views to navigate it. Take a QA test system, for example: With a pool of tests and test results, you need to see the data by date, by test category, by individual test, and so on. Each view would be in its own HTML file. So, can you have a single template in XSLT 2.0 build multiple HTML files from the one input data set?
|
 |
Articles |
 |
18 Mar 2005 |
|
| |
Tip: Look up XML schemata and Web services with these helpful resources
It's not always easy to find XML schemata and Web services that meet your exact needs. This tip shows you how to comb through the enormous variety of Internet resources to find schemata and Web services using common search criteria.
|
 |
Articles |
 |
11 Feb 2005 |
|
| |
Tip: Batch processing XML with XSLT 2.0
A common problem with XSLT is that it takes only a single XML file as input. You can use a cross-platform Java tool to create an XML directory listing, then use XSLT to process every file in the directory from that listing. This tip covers installation and use of such a tool, as well as the corresponding XSL that processes multiple files from the directory listing.
|
 |
Articles |
 |
07 Mar 2005 |
|
| |
Tip: Set up a SAX parser
This is the first in a series of tips that will serve as a comprehensive guide to using XML from the Java programming language. I begin with coverage of the SAX API. This tip reviews getting an instance of a SAX parser and setting various features and properties on that parser.
|
 |
Articles |
 |
02 Jul 2003 |
|
| |
Tip: Use a proxy network library for SOAP behind a firewall
If you are trying to access a SOAP service from behind a firewall and your SOAP library does not have support for proxying network connections, you may not be able to get through by direct request. In such cases, you can use socket redirection programs to make the connection through a proxy server. Uche Ogbuji shows how to do so in this tip.
|
 |
Articles |
 |
26 Mar 2004 |
|
| |
Tip: Packaging XSLT lookup tables as EXSLT functions
In an earlier tip, Uche Ogbuji demonstrated how to build lookup tables in XSLT. In a follow-up tip, he covered how to handle error or default conditions for such a lookup. This tip shows how to use the functions module from EXSLT, the community standard in XSLT extensions, and how this technique further improves such lookup tables by packaging code into easily reusable functions.
|
 |
Articles |
 |
24 Jan 2005 |
|
| |
Tip: Default and error handling in XSLT lookup tables
In a previous tip, Uche Ogbuji demonstrated how to build lookup tables in XSLT. One follow-up question to emerge from that article is how to handle error or default conditions in XSLT lookup tables. This tip illustrates how to do so.
|
 |
Articles |
 |
22 Dec 2004 |
|
| |
Tip: Use Universal Feed Parser to tame RSS
RSS is supposed to be based on XML (or XML/RDF) standards. Unfortunately, the famous wild west community behind RSS has many renegade elements producing feeds that are not even well-formed XML. Mark Pilgrim's excellent Universal Feed Parser is a great tool for parsing even ill-formed feeds, and this tip demonstrates how to use it to extract feed data from RSS.
|
 |
Articles |
 |
01 Oct 2004 |
|
| |
Tip: Manipulate del.icio.us bookmarks with PHP
The del.icio.us service lets users collect and share bookmarks online.
Manipulate these bookmarks with PEAR's Services_Delicious package that interfaces
with the REST API of del.icio.us and build customized PHP applications.
|
 |
Articles |
 |
22 Jan 2008 |
|
| |
Tip: Easy command line processing with the DITA Open Toolkit
The DITA Open Toolkit can transform your DITA files into a wide variety of
output types. When you first install it, it's easy to get the impression that you
need to know Ant well to use it, but you can pack most of its available options into
a single Java(TM) command line.
|
 |
Articles |
 |
08 Jan 2008 |
|
| |
Tip: Parsing RDDL documents with PHP
The Resource Directory Description Language (RDDL) lets document authors provide more information about resources used within an XHTML document. Parse these RDDL descriptors with an API in the XML_RDDL package from PEAR, and extract resource information for use in any PHP application.
|
 |
Articles |
 |
10 Dec 2007 |
|
| |
Tip: Read News Industry Text Format (NITF) files with PHP
The News Industry Text Format is an XML-based format used by the news industry to encode and share the content of news articles. PEAR's XML_NITF package provides an extensible API to read and parse NITF-formatted files, making it easy to extract bibliographical information and article content for use in any PHP application.
|
 |
Articles |
 |
28 Aug 2007 |
|
| |
Tip: Create portable database representations with PEAR MDB2_Schema
To change an application's database back-end is a complex task, that often
requires the developer to manually re-create database tables and records using data
types and SQL functions compatible with the new RDBMS. The PEAR MDB2_Schema package can make this task easier, by generating a vendor-neutral representation of a database using XML and providing tools to import this representation into any supported RDBMS.
|
 |
Articles |
 |
07 Aug 2007 |
|
| |
Tip: Make your life easier with the XML Schema Standard Type Library
XML validation enables you to create complex rules that define acceptable data. But they're no good to anybody unless you use them. In this tip, you learn to use the XML Schema Standard Type Library to simplify the process of requiring formatted data such as e-mail addresses and telephone numbers.
|
 |
Articles |
 |
31 Jul 2007 |
|
| |
Tip: Organize content with Atom categories
Atom lets you provide an easy way to manage lots of data, but there will come a point at which you need to add some sort of categorization to make that data manageable. This tip shows you how to use categories with Atom feeds and the Atom API. Although you will naturally add category information to information syndicated using Atom, this tip focuses on these categories from the perspective of the Atom Publishing Protocol.
|
 |
Articles |
 |
17 Jul 2007 |
|
| |
Tip: Apply profile links to microformats
Microformats are a popular way to incorporate structured data into regular Web pages. Unfortunately, using microformats without some measure of control can lead to confusion and technical problems. Learn how formal profile declarations in your documents can improve the value of your microformats.
|
 |
Articles |
 |
26 Jun 2007 |
|
| |
Tip: How to use Atom's slug header when you publish content
One advantage of the Atom Publishing Protocol is the ability to not only retrieve information, but also to add or edit information. In this tip, learn to use Atom's Slug header to influence the final URL for this information. This tip uses the Blogapps server, which supports draft 10 of the Atom Publishing Protocol 1.0 specification, but is applicable to any APP 1.0 compliant server.
|
 |
Articles |
 |
05 Jun 2007 |
|
| |
Tip: Paging Atom: Create a multi-section Atom collection or feed
As feeds move beyond merely announcing new content on somebody's blog and into organizing data, you can easily find situations where you don't want your feed to include all of the available data. This tip shows you how to create an Atom feed that lets users page through it using "next" and "previous" links or buttons. While the tip shows you how to implement this functionality using PHP, the concepts are the same for any programming language.
|
 |
Articles |
 |
10 Apr 2007 |
|
| |
Tip: Use Atom's structure to avoid duplicates in aggregate feeds
Atom is a growing syndication format favored by many over the major syndication format, RSS. With any indexing system like Atom, you never want to intentionally create duplicate feeds as this can overwrite the older, original id element. And duplicated entries (if they aren't overwritten) waste hard disk space. But more importantly, duplicate content confuses search engines, which can cause your rankings in the search engines to suffer. This tip shows you how to take full advantage of the id tag as the main identifier, including other information about the feed entry (like the link id and source URL for the feed), to avoid duplicates in your Atom feeds.
|
 |
Articles |
 |
02 Apr 2007 |
|
| |
Tip: Configure Apache to send the right MIME type for XHTML
This tip shows you how to configure Apache to tag Extensible Hypertext Markup Language (XHTML) documents with the media type application/xhtml+xml for browsers that support it, while still sending text/html to nonconformant browsers such as Microsoft Internet Explorer.
|
 |
Articles |
 |
06 Mar 2007 |
|
| |
XForms tip: Making a read-only control writeable
At times it is crucial to programmatically control the writability of data in your XForms. For example, if you're browsing data in read-only mode (so modifications aren't made by accident), and then you need to update or add new data, the read-only mode of the same controls will need to become writeable. This tip shows how you can change the readonly property of controls programmatically.
|
 |
Articles |
 |
13 Feb 2007 |
|
| |
XForms tip: Reacting to the refreshing of the form
As data changes in your XForms form it can be essential to know right away and do something with the new data, especially when your XForms get more advanced. This tip shows you how to hook such events right into JavaScript methods, thus allowing you to then use the data in many different ways.
|
 |
Articles |
 |
13 Feb 2007 |
|
| |
XForms tip: Using the incremental attribute to detect keystrokes
One of the slickest application genres are those that update data as you type. XForms does this with finesse! Controls have the ability to send events after each keystroke entered within them using the incremental attribute. That way controls that need to change their data based on the data of a control that's changing incrementally can also update their data incrementally, effectively keeping what's viewed "on screen" in sync across the board. This tip shows you how to make the most of the incremental feature with sample XForms code.
|
 |
Articles |
 |
06 Feb 2007 |
|
| |
XForms tip: Using extension functions with Firefox
XForms with Firefox has extension functions that aid your development of JavaScript with XForms. These functions allow you to access your XForms instance data with ease, enabling you to do cool stuff with your XForms, including creating dynamic XForms code. The goal of this tip is to help you make the most of your XForms applications by introducing you to Firefox's extension functions.
|
 |
Articles |
 |
06 Feb 2007 |
|
| |
XForms tip: Using accesskeys for greater accessibility
XForms, the Web 2.0 of forms, could not possibly be Web 2.0 without providing accessibility features. I'm sure you've used the Alt key before, or accidentally typed it while typing up a document. The Alt key focuses in on the File tab at the top of most applications. XForms has similar accessibility capabilities that allow you to focus in on the exact text box you desire, all without having to touch the mouse. This tip shows you how to use this accessibility feature.
|
 |
Articles |
 |
23 Jan 2007 |
|
| |
XForms tip: Enabling cross-domain loading and sending in Firefox
XForms with Firefox has a built-in security feature that inhibits users from "cross-domain" loading and sending of instance data. Just like pop-ups, you don't want this to happen by default unless you trust the Web site. You shouldn't have to worry about it since this security feature is on by default, but sometimes you'll want to be able to perform cross-domain loading and sending of instance data with certain Web sites. This tip will show you how.
|
 |
Articles |
 |
23 Jan 2007 |
|
| |