hi,
suppose i have:
<a>
<b i="Y" j="aaaa"/>
<c i="N" j="bbbb"/>
<d i="Y" j="cccc"/>
<e i="N" j="dddd"/>
<f i="N" j="eeee"/>
<g i="Y" j="ffff"/>
</a>
and i want to extract the elements where i="Y" such that i get something like
<x>
<y>1. aaaa</y>
<y>2. cccc</y>
<y>3. gggg</y>
</x>
how would i get the numbering to work across the different elements?
thanks,
mike
mmmm.. you just want to enumerate all of your elements?
What technology is at your disposal?
In XQuery, using books.xml,
this query:
for $t at $i in document("books.xml")//*[@year="1994"]
return <Response>{$i, name($t), string($t/@year)}</Response>
returns this data:
<Response>1 book 1994</Response>
Here is books.xml (from katz_c01.pdf tutorial I found via google at
http://www.datadirect.com/news/whatsnew/xquerybook/index.ssp)
<bib>
<book year="1994">a1994 <title>TCP/IP Illustrated</title>
<author>
<last>Stevens</last>
<first>W.</first>
</author>
<publisher>Addison-Wesley</publisher>
<price>65.95</price>
</book>
<book year="1992">a1992<title>Advanced Programming in the UNIX
Environment</title>
<author>
<last>Stevens</last>
<first>W.</first>
</author>
<publisher>Addison-Wesley</publisher>
<price>65.95</price>
</book>
<book year="2000">a2000<title>Data on the Web</title>
<author>
<last>Abiteboul</last>
<first>Serge</first>
</author>
<author>
<last>Buneman</last>
<first>Peter</first>
</author>
<author>
<last>Suciu</last>
<first>Dan</first>
</author>
<publisher>Morgan Kaufmann Publishers</publisher>
<price>65.95</price>
</book>
<book year="1999">a1999<title>The Economics of Technology and Content
for Digital TV</title>
<editor>
<last>Gerbarg</last>
<first>Darcy</first>
<affiliation>CITI</affiliation>
</editor>
<publisher>Kluwer Academic Publishers</publisher>
<price>129.95</price>
</book>
</bib>
Jeff Kish