Skip to main content

Tip: Divide and conquer large XML documents

How to break up documents with XSLT

Return to article.


Listing 1. gallery.xml -- a photo gallery in one XML document
<?xml version="1.0"?>
<gl:gallery xmlns:gl="http://ananas.org/2003/tips/gallery">
   <gl:title>Flowers and plants</gl:title>
   <gl:photo>
      <gl:title>Rose</gl:title>
      <gl:date>September 2002</gl:date>
      <gl:image>rose.jpg</gl:image>
      <gl:description>
         This photo was taken early in the morning in a very soft light. 
         This rose flower was shot at a gas station on the highway!
      </gl:description>
   </gl:photo>
   <gl:photo>
      <gl:title>Orchid</gl:title>
      <gl:date>May 2003</gl:date>
      <gl:image>orchid.jpg</gl:image>
      <gl:description>
         This is a lady slipper (paphiopedilum liemianum) orchid. 
         In this shot, the flower is window-lit.
      </gl:description>
   </gl:photo>
   <gl:photo>
      <gl:title>Lily-of-the-valley</gl:title>
      <gl:date>May 2003</gl:date>
      <gl:image>lily.jpg</gl:image>
      <gl:description>
         The lily-of-the-valley is popular for its sweet perfume and is typically 
         associated with May 1st. This was done under artificial lights.
      </gl:description>
   </gl:photo>
   <gl:photo>
      <gl:title>Cardoon</gl:title>
      <gl:date>September 2002</gl:date>
      <gl:image>cardoon.jpg</gl:image>
      <gl:description>
         Also known as artichoke thistle, the cardoon is grown for its gentle  
         laxative properties. This specimen is dried and the colors have been 
         digitally altered to create a more graphic image.
      </gl:description>
   </gl:photo>
</gl:gallery>

Return to article.