0

There seems like there should be an obvious solution to this unless I have the wrong approach. So I have some complex data I am trying to store in a native XML db and retrieve using XQuery

example:

<stuff>
 <group1>
  <group1-1>
   <group1-1-1>
   </group1-1-1>
   <group1-1-2>
     <group1-1-2-1>
     </group1-1-2-1>
   </group1-1-2>
   <group1-1-3>
   </group1-1-3>
  </group1-1>
 </group1>
 <group2>
  <group2-1>
   <group2-1-1>
    <group2-1-1-1>
    </group2-1-1-1>
    <group2-1-1-2>
    </group2-1-1-2>
   </group2-1-1>
   <group2-1-2>
   </group2-1-2>
  </group2-1>
 </group2>
</stufF>

No problem right? Yet, the documents are getting quite large because there is a lot of data at the lower levels. Is there a way to split the data among multiple documents and still query them as they were a single document? Like have group1 and group1 as separate documents and make a third wrapper file that encodes their relationship and links to them? If I understand correctly, XLink doesn't work this way. Some of the data would be split like this and some not, and I want to use the same XQuery for them all. I know I could just use the db file structure for the upper levels, but I want that information encoded as well, eventually for display.

Ry-
  • 218,210
  • 55
  • 464
  • 476
user2509710
  • 79
  • 1
  • 7
  • You can easily access multiple documents in an XQuery. So you could simply concatenate the results from different files in your actual XQuery, thus getting the correct result. Btw, what are we talking about when you say "quite large" - An XML database like exists should be able to handle quite large documents, although there are of course limits. So are we talking about some megabytes, gigabytes or terabytes? – dirkk Jan 10 '14 at 11:19
  • The size is large but within the database's capabilities, around 20mb. I'd like to separate them for two reasons. One, maintenance would be easier with smaller documents. Two, we'd like to add an additional lower level eventually which would make the file much larger. What I'd like to do is query data from the lower levels and then display the highest level information on request even though its in another document. I don't want to write a custom XQuery for each dataset and I'd like the relationships between the documents explicitly encoded anyway and to also be available without the XQuery – user2509710 Jan 10 '14 at 16:08
  • possible duplicate of [XQuery multiple xml files?](http://stackoverflow.com/questions/484192/xquery-multiple-xml-files) – Paul Sweatte Jun 25 '14 at 05:44

0 Answers0