[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

3 Common Patterns in XML Processing

  • From: "Costello, Roger L." <costello@mitre.org>
  • To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
  • Date: Sat, 26 Feb 2011 15:24:57 -0500

3 Common Patterns in XML Processing
Hi Folks,

I wrote a short article titled:

   3 Common Patterns in XML Processing


Here is the start of the article:

---------------------------
XML Documents Contain Lists
---------------------------

Most XML documents contain lists of elements. For example, this document contains a list of <book> elements:

<?xml version="1.0" encoding="UTF-8"?>
<books>
    <book>
        <title>The Origin of Wealth</title>
        <author>Eric D. Beinhocker</author>
        <date>2006</date>
        <ISBN>1-57851-777-X</ISBN>
        <publisher>Harvard Business School Press</publisher>
        <cost currency="USD">29.95</cost>
    </book>
    <book>
        <title>DOM Scripting</title>
        <author>Jeremy Keith</author>
        <date>2005</date>
        <ISBN>1-59059-533-5</ISBN>
        <publisher>friends of ed</publisher>
        <cost currency="USD">34.99</cost>
    </book>
    ...
</books>

Consequently, processing XML documents typically involves processing lists.


---------------------------------
3 Common Ways of Processing Lists
---------------------------------

There are 3 things that are commonly done to lists:

1. Map: a new list is created with the same length as the original, and each item in the new list is the result of doing one piece of work on the corresponding item in the original list.

2. Filter: select pieces of a list-walk through a list, selecting those that satisfy a criterion.

3. Fold: reduce a list to a single value-do something to every element of a list, updating an accumulator along the way, and returning the accumulator when done.

More ... http://www.xfront.com/3-Common-Patterns-in-XML-Processing.pdf

Comments welcome.

/Roger


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.