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

Generating a list of items NOT present in source XML

Subject: Generating a list of items NOT present in source XML
From: Greg Faron <gfaron@xxxxxxxxxxxxxxxxxx>
Date: Fri, 17 May 2002 11:02:57 -0600
xml list of items
Hello all,

I'm wondering if anyone has created a template (or has ideas on how to efficiently create such) that generates a list of items that is missing from a given source document. Assume that a node-set is passed that contains an assorted cluster of indices, the template should start at one, and continue to the highest provided element, outputting all missing elements.

  For example, the source document:
<root>
  <obj><childnode>3</childnode></obj>
  <obj><childnode>5</childnode></obj>
  <obj><childnode>9</childnode></obj>
  <obj><childnode>5</childnode></obj>
  <obj><childnode>4</childnode></obj>
  <obj><childnode>1</childnode></obj>
  <obj><childnode>7</childnode></obj>
</root>

might produce

<missing>
  <obj><childnode>2</childnode></obj>
  <obj><childnode>6</childnode></obj>
  <obj><childnode>8</childnode></obj>
</missing>

when passed through such a template.

I figure one way to do this is to first sort the node-set (possibly using a parameter to identify the indexed node), and then apply a template on all children that don't have an index that is 1 less than that of the following sibling. But there are problems there when there are 2 consecutively missing nodes. Any ideas?


Greg Faron Integre Technical Publishing Co.



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Current Thread

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
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.