如何选择除特定元素之外的所有元素作为特定元素的兄弟元素

时间:2016-01-14 18:57:10

标签: xml xpath

鉴于XML:

<publications>
 <publication>
    <journal_article key="journals/is/DimitriouTS15" mdate="2014-09-23">
      <author>Aggeliki Dimitriou</author>
      <author>Dimitri Theodoratos</author>
      <author>Timos Sellis</author>
      <title>Top-k-size keyword search on tree structured data.</title>
      <pages>178-193</pages>
      <year>2015</year>
      <volume>47</volume>
      <journal>Inf. Syst.</journal>
      <ee>http://dx.doi.org/10.1016/j.is.2014.07.002</ee>
      <url>db/journals/is/is47.html#DimitriouTS15</url>
    </journal_article>
  </publication>
  <publication>
    <journal_article key="journals/jiis/GiannopoulosKWJS15" mdate="2015-01-15">
      <author>Giorgos Giannopoulos</author>
      <author>Marios Koniaris</author>
      <author>Ingmar Weber</author>
      <author>Alejandro Jaimes</author>
      <author>Timos K. Sellis</author>
      <title>Algorithms and criteria for diversification of news article comments.</title>
      <pages>1-47</pages>
      <year>2015</year>
      <volume>44</volume>
      <journal>J. Intell. Inf. Syst.</journal>
      <number>1</number>
      <ee>http://dx.doi.org/10.1007/s10844-014-0328-1</ee>
      <url>db/journals/jiis/jiis44.html#GiannopoulosKWJS15</url>
    </journal_article>
  </publication>
  <publication>
    <journal_article key="journals/sigkdd/GoonetillekeSZS14" mdate="2014-10-12">
      <author>Oshini Goonetilleke</author>
      <author>Timos Sellis</author>
      <author>Xiuzhen Zhang</author>
      <author>Saket Sathe</author>
      <title>Twitter analytics: a big data management perspective.</title>
      <pages>11-20</pages>
      <year>2014</year>
      <volume>16</volume>
      <journal>SIGKDD Explorations</journal>
      <number>1</number>
      <ee>http://doi.acm.org/10.1145/2674026.2674029</ee>
      <url>db/journals/sigkdd/sigkdd16.html#GoonetillekeSZS14</url>
    </journal_article>
  </publication>
  <publication>
    <journal_article key="journals/geoinformatica/TsatsanifosSS13" mdate="2013-06-13">
      <author>George Tsatsanifos</author>
      <author>Dimitris Sacharidis</author>
      <author>Timos Sellis</author>
      <title>Index-based query processing on distributed multidimensional data.</title>
      <pages>489-519</pages>
      <year>2013</year>
      <volume>17</volume>
      <journal>GeoInformatica</journal>
      <number>3</number>
      <ee>http://dx.doi.org/10.1007/s10707-012-0163-x</ee>
      <url>db/journals/geoinformatica/geoinformatica17.html#TsatsanifosSS13</url>
    </journal_article>
  </publication>
  <publication>
    <journal_article key="journals/is/WuTWS13" mdate="2013-05-20">
      <author>Xiaoying Wu</author>
      <author>Dimitri Theodoratos</author>
      <author>Wendy Hui Wang</author>
      <author>Timos Sellis</author>
      <title>Optimizing XML queries: Bitmapped materialized views vs. indexes.</title>
      <pages>863-884</pages>
      <year>2013</year>
      <volume>38</volume>
      <journal>Inf. Syst.</journal>
      <number>6</number>
      <ee>http://dx.doi.org/10.1016/j.is.2013.02.003</ee>
      <url>db/journals/is/is38.html#WuTWS13</url>
    </journal_article>
  </publication>
  <publication>
    <journal_article key="journals/tkde/BourosSDSS12" mdate="2012-07-02">
      <author>Panagiotis Bouros</author>
      <author>Dimitris Sacharidis</author>
      <author>Theodore Dalamagas</author>
      <author>Spiros Skiadopoulos</author>
      <author>Timos K. Sellis</author>
      <title>Evaluating Path Queries over Frequently Updated Route Collections.</title>
      <pages>1276-1290</pages>
      <year>2012</year>
      <volume>24</volume>
      <journal>IEEE Trans. Knowl. Data Eng.</journal>
      <number>7</number>
      <ee>http://doi.ieeecomputersociety.org/10.1109/TKDE.2011.30</ee>
      <url>db/journals/tkde/tkde24.html#BourosSDSS12</url>
    </journal_article>
  </publication>
  <publication>
    <journal_article key="journals/vldb/VergoulisDSS12" mdate="2012-11-20">
      <author>Thanasis Vergoulis</author>
      <author>Theodore Dalamagas</author>
      <author>Dimitris Sacharidis</author>
      <author>Timos K. Sellis</author>
      <title>Approximate regional sequence matching for genomic databases.</title>
      <pages>779-795</pages>
      <year>2012</year>
      <volume>21</volume>
      <journal>VLDB J.</journal>
      <number>6</number>
      <ee>http://dx.doi.org/10.1007/s00778-012-0270-1</ee>
      <url>db/journals/vldb/vldb21.html#VergoulisDSS12</url>
    </journal_article>
  </publication>
  <publication>
    <journal_article key="journals/is/PatroumpasS11" mdate="2010-11-08">
      <author>Kostas Patroumpas</author>
      <author>Timos K. Sellis</author>
      <title>Maintaining consistent results of continuous queries under diverse window specifications.</title>
      <pages>42-61</pages>
      <year>2011</year>
      <volume>36</volume>
      <journal>Inf. Syst.</journal>
      <number>1</number>
      <ee>http://dx.doi.org/10.1016/j.is.2010.02.001</ee>
      <url>db/journals/is/is36.html#PatroumpasS11</url>
    </journal_article>
  </publication>
  <publication>
    <journal_article key="journals/pvldb/KantereBS11" mdate="2011-11-16">
      <author>Verena Kantere</author>
      <author>Dimos Bousounis</author>
      <author>Timos K. Sellis</author>
      <title>GrouPeer: A System for Clustering PDMSs.</title>
      <pages>1371-1374</pages>
      <year>2011</year>
      <volume>4</volume>
      <journal>PVLDB</journal>
      <number>12</number>
      <ee>http://www.vldb.org/pvldb/vol4/p1371-kantere.pdf</ee>
      <url>db/journals/pvldb/pvldb4.html#KantereBS11</url>
    </journal_article>
  </publication>
  <publication>
    <conference_paper key="conf/dexa/BikakisSS14" mdate="2014-09-10">
      <author>Nikos Bikakis</author>
      <author>Dimitris Sacharidis</author>
      <author>Timos Sellis</author>
      <title>A Study on External Memory Scan-Based Skyline Algorithms.</title>
      <pages>156-170</pages>
      <year>2014</year>
      <booktitle>DEXA (1)</booktitle>
      <ee>http://dx.doi.org/10.1007/978-3-319-10073-9_13</ee>
      <crossref>conf/dexa/2014-1</crossref>
      <url>db/conf/dexa/dexa2014-1.html#BikakisSS14</url>
    </conference_paper>
  </publication>
  <publication>
    <journal_article key="journals/nar/AlexiouVGPDMGSH10" mdate="2011-04-12">
      <author>Panagiotis Alexiou</author>
      <author>Thanasis Vergoulis</author>
      <author>Martin Gleditzsch</author>
      <author>George Prekas</author>
      <author>Theodore Dalamagas</author>
      <author>Molly Megraw</author>
      <author>Ivo Grosse</author>
      <author>Timos K. Sellis</author>
      <author>Artemis G. Hatzigeorgiou</author>
      <title>miRGen 2.0: a database of microRNA genomic information and regulation.</title>
      <pages>137-141</pages>
      <year>2010</year>
      <volume>38</volume>
      <journal>Nucleic Acids Research</journal>
      <number>Database-Issue</number>
      <ee>http://dx.doi.org/10.1093/nar/gkp888</ee>
      <url>db/journals/nar/nar38.html#AlexiouVGPDMGSH10</url>
    </journal_article>
  </publication>
  <publication>
    <conference_paper key="conf/icsoc/NeiatBSD14" mdate="2014-10-13">
      <author>Azadeh Ghari Neiat</author>
      <author>Athman Bouguettaya</author>
      <author>Timos Sellis</author>
      <author>Hai Dong</author>
      <title>Failure-Proof Spatio-temporal Composition of Sensor Cloud Services.</title>
      <pages>368-377</pages>
      <year>2014</year>
      <booktitle>ICSOC</booktitle>
      <ee>http://dx.doi.org/10.1007/978-3-662-45391-9_26</ee>
      <crossref>conf/icsoc/2014</crossref>
      <url>db/conf/icsoc/icsoc2014.html#NeiatBSD14</url>
    </conference_paper>
  </publication>
  <publication>
    <conference_paper key="conf/jurix/PobletACSC14" mdate="2014-12-02">
      <author>Marta Poblet</author>
      <author>Amir Aryani</author>
      <author>Kate Caldecott</author>
      <author>Timos Sellis</author>
      <author>Pompeu Casanovas</author>
      <title>Open-Access Grant Data: Towards Meta-Research Innovation.</title>
      <pages>125-130</pages>
      <year>2014</year>
      <booktitle>JURIX</booktitle>
      <ee>http://dx.doi.org/10.3233/978-1-61499-468-8-125</ee>
      <crossref>conf/jurix/2014</crossref>
      <url>db/conf/jurix/jurix2014.html#PobletACSC14</url>
    </conference_paper>
  </publication>
  <publication>
    <conference_paper key="conf/swat4ls/GkirtzouVHSD14" mdate="2015-01-03">
      <author>Katerina Gkirtzou</author>
      <author>Thanasis Vergoulis</author>
      <author>Artemis G. Hatzigeorgiou</author>
      <author>Timos Sellis</author>
      <author>Theodore Dalamagas</author>
      <title>Publishing Diachronic Life Science Linked Data.</title>
      <year>2014</year>
      <booktitle>SWAT4LS</booktitle>
      <ee>http://ceur-ws.org/Vol-1320/paper_3.pdf</ee>
      <crossref>conf/swat4ls/2014</crossref>
      <url>db/conf/swat4ls/swat4ls2014.html#GkirtzouVHSD14</url>
    </conference_paper>
  </publication>
  <publication>
    <conference_paper key="conf/swat4ls/GkirtzouVHSD14" mdate="2015-01-03">
      <author>Katerina Gkirtzou</author>
      <author>Thanasis Vergoulis</author>
      <author>Artemis G. Hatzigeorgiou</author>
      <author>Timos Sellis</author>
      <author>Theodore Dalamagas</author>
      <title>Publishing Diachronic Life Science Linked Data.</title>
      <year>2014</year>
      <booktitle>SWAT4LS</booktitle>
      <ee>http://ceur-ws.org/Vol-1320/paper_3.pdf</ee>
      <crossref>conf/swat4ls/2014</crossref>
      <url>db/conf/swat4ls/swat4ls2014.html#GkirtzouVHSD14</url>
    </conference_paper>
  </publication>
  <publication>
    <conference_paper key="conf/ercimdl/BikakisGLSDS13" mdate="2013-09-02">
      <author>Nikos Bikakis</author>
      <author>Giorgos Giannopoulos</author>
      <author>John Liagouris</author>
      <author>Dimitrios Skoutas</author>
      <author>Theodore Dalamagas</author>
      <author>Timos Sellis</author>
      <title>RDivF: Diversifying Keyword Search on RDF Graphs.</title>
      <pages>413-416</pages>
      <year>2013</year>
      <booktitle>TPDL</booktitle>
      <ee>http://dx.doi.org/10.1007/978-3-642-40501-3_49</ee>
      <crossref>conf/ercimdl/2013</crossref>
      <url>db/conf/ercimdl/tpdl2013.html#BikakisGLSDS13</url>
    </conference_paper>
  </publication>
  <publication>
    <conference_paper key="conf/sebd/Sellis12" mdate="2012-10-18">
      <author>Timos K. Sellis</author>
      <title>Personalization in Web Search and Data Management.</title>
      <pages>3</pages>
      <year>2012</year>
      <booktitle>SEBD</booktitle>
      <ee>http://sebd2012.dei.unipd.it/documents/188475/e9e8d7fd-7cb5-4f6b-b199-57693decedfd</ee>
      <crossref>conf/sebd/2012</crossref>
      <url>db/conf/sebd/sebd2012.html#Sellis12</url>
    </conference_paper>
  </publication>
  <publication>
    <conference_paper key="conf/ssdbm/PatroumpasTS12" mdate="2012-09-18">
      <author>Kostas Patroumpas</author>
      <author>Kyriakos Toumbas</author>
      <author>Timos K. Sellis</author>
      <title>Multiplexing Trajectories of Moving Objects.</title>
      <pages>595-600</pages>
      <year>2012</year>
      <booktitle>SSDBM</booktitle>
      <ee>http://dx.doi.org/10.1007/978-3-642-31235-9_42</ee>
      <crossref>conf/ssdbm/2012</crossref>
      <url>db/conf/ssdbm/ssdbm2012.html#PatroumpasTS12</url>
    </conference_paper>
  </publication>
  <publication>
    <encyclopedia_entry key="books/idea/encyclopediaDB2005/SimitsisVS05" mdate="2011-11-25">
      <author>Alkis Simitsis</author>
      <author>Panos Vassiliadis</author>
      <author>Timos K. Sellis</author>
      <title>Extraction-Transformation-Loading Processes.</title>
      <pages>240-245</pages>
      <year>2005</year>
      <crossref>books/idea/EncyDB05</crossref>
      <booktitle>Encyclopedia of Database Technologies and Applications</booktitle>
      <url>db/books/collections/encyclopediaDB2005.html#SimitsisVS05</url>
    </encyclopedia_entry>
  </publication>
  <publication>
    <informal_journal_article key="journals/ercim/SkoutasSS08" mdate="2013-11-22">
      <author>Dimitrios Skoutas</author>
      <author>Alkis Simitsis</author>
      <author>Timos K. Sellis</author>
      <title>Discovery and Selection of Services on the Semantic Web.</title>
      <year>2008</year>
      <volume>2008</volume>
      <journal>ERCIM News</journal>
      <number>72</number>
      <ee>http://ercim-news.ercim.eu/discovery-and-selection-of-services-on-the-semantic-web</ee>
      <url>db/journals/ercim/ercim2008.html#SkoutasSS08</url>
    </informal_journal_article>
  </publication>
  <publication>
    <informal_journal_article key="journals/corr/cs-DB-0310006" mdate="2011-12-05">
      <author>Serge Abiteboul</author>
      <author>Rakesh Agrawal</author>
      <author>Philip A. Bernstein</author>
      <author>Michael J. Carey</author>
      <author>Stefano Ceri</author>
      <author>W. Bruce Croft</author>
      <author>David J. DeWitt</author>
      <author>Michael J. Franklin</author>
      <author>Hector Garcia-Molina</author>
      <author>Dieter Gawlick</author>
      <author>Jim Gray</author>
      <author>Laura M. Haas</author>
      <author>Alon Y. Halevy</author>
      <author>Joseph M. Hellerstein</author>
      <author>Yannis E. Ioannidis</author>
      <author>Martin L. Kersten</author>
      <author>Michael J. Pazzani</author>
      <author>Michael Lesk</author>
      <author>David Maier</author>
      <author>Jeffrey F. Naughton</author>
      <author>Hans-Jörg Schek</author>
      <author>Timos K. Sellis</author>
      <author>Avi Silberschatz</author>
      <author>Michael Stonebraker</author>
      <author>Richard T. Snodgrass</author>
      <author>Jeffrey D. Ullman</author>
      <author>Gerhard Weikum</author>
      <author>Jennifer Widom</author>
      <author>Stanley B. Zdonik</author>
      <title>The Lowell Database Research Self Assessment</title>
      <year>2003</year>
      <volume>cs.DB/0310006</volume>
      <journal>CoRR</journal>
      <ee>http://arxiv.org/abs/cs.DB/0310006</ee>
      <url>db/journals/corr/corr0310.html#cs-DB-0310006</url>
    </informal_journal_article>
  </publication>
  <publication>
    <book key="books/daglib/0017733" mdate="2011-02-09">
      <author>Sanjoy Dasgupta</author>
      <author>Christos H. Papadimitriou</author>
      <author>Umesh V. Vazirani</author>
      <title>Algorithms.</title>
      <pages>I-X, 1-320</pages>
      <publisher>McGraw-Hill</publisher>
      <year>2008</year>
      <isbn>978-0-07-352340-8</isbn>
    </book>
  </publication>
  <publication>
    <book key="books/daglib/0018514" mdate="2011-03-21">
      <author>Christos H. Papadimitriou</author>
      <title>Computational complexity.</title>
      <pages>1-49</pages>
      <publisher>Academic Internet Publ.</publisher>
      <year>2007</year>
      <isbn>978-1-4288-1409-7</isbn>
    </book>
  </publication>
  <publication>
    <book key="books/daglib/0015083" mdate="2011-03-25">
      <author>Christos H. Papadimitriou</author>
      <title>Turing - a novel about computation.</title>
      <pages>1-284</pages>
      <publisher>MIT Press</publisher>
      <year>2005</year>
      <isbn>978-0-262-66191-1</isbn>
    </book>
  </publication>
</publications>

我正在努力让每一位与西奥多达拉马加斯#34; Theodore Dalamagas&#34;使用XPath。到目前为止我所做的是:

//author[../author="Theodore Dalamagas"]

我如何纠正它,以便作者&#34; Theodore Dalamagas&#34;是不是和其他人一起回来了?

2 个答案:

答案 0 :(得分:4)

以下是与Theodore Dalamagas在authors上列出的publications,不包括Theodore Dalamagas本人:

//publication/*[author = 'Theodore Dalamagas']/author[. != 'Theodore Dalamagas']/text()

或者,更短的时间:

//author[../author='Theodore Dalamagas'][. != 'Theodore Dalamagas']/text()

<强>结果:

Panagiotis Bouros
Dimitris Sacharidis
Spiros Skiadopoulos
Timos K. Sellis
Thanasis Vergoulis
Dimitris Sacharidis
Timos K. Sellis
Panagiotis Alexiou
Thanasis Vergoulis
Martin Gleditzsch
George Prekas
Molly Megraw
Ivo Grosse
Timos K. Sellis
Artemis G. Hatzigeorgiou
Katerina Gkirtzou
Thanasis Vergoulis
Artemis G. Hatzigeorgiou
Timos Sellis
Katerina Gkirtzou
Thanasis Vergoulis
Artemis G. Hatzigeorgiou
Timos Sellis
Nikos Bikakis
Giorgos Giannopoulos
John Liagouris
Dimitrios Skoutas
Timos Sellis

答案 1 :(得分:3)

我们如何使用preceding-siblingfollowing-sibling组合:

//author[preceding-sibling::author = "Theodore Dalamagas" or following-sibling::author = "Theodore Dalamagas"]/text()