From: Marcus <lam...@ya...> - 2007-01-10 20:37:19
|
Again I have a xquery question. I was already trying it by my own for a long time, but it doesn't seem to work. I have 2 different files with the same "filename" elements. I want to reduce these files into one where similar filename elements are closed together surrounded by meta elements. Furthermore the "Value" element that belong to each filename should also be inside the meta element. For better understanding here is the first file: <FNumber> <meta> <Value2>2.9</Value2> <FileName>file4</FileName> <FileName>file5</FileName> </meta> <meta> <Value2>2.8</Value2> <FileName>file7</FileName> <FileName>file8</FileName> <FileName>file9</FileName> <FileName>file14</FileName> <FileName>file15</FileName> <FileName>file16</FileName> <FileName>file17</FileName> <FileName>file18</FileName> <FileName>file19</FileName> </meta> <meta> <Value2>16.0</Value2> <FileName>file13</FileName> </meta> </FNumber> and here the second: <FocalLength> <meta> <Value1>70.0mm</Value1> <FileName>file11</FileName> </meta> <meta> <Value1>7.90mm</Value1> <FileName>file1</FileName> <FileName>file7</FileName> <FileName>file8</FileName> <FileName>file9</FileName> <FileName>file14</FileName> <FileName>file15</FileName> <FileName>file16</FileName> <FileName>file17</FileName> <FileName>file18</FileName> <FileName>file19</FileName> </meta> <meta> <Value1>6.13mm</Value1> <FileName>file6</FileName> </meta> <meta> <Value1>6.0mm</Value1> <FileName>file3</FileName> </meta> </FocalLength> There are still some meta elements missing. Now I want to put these files together to something like this <FF> <meta> <Value2>2.8</Value2> <Value1>7.90mm</Value1> <FileName>file7</FileName> <FileName>file8</FileName> <FileName>file9</FileName> <FileName>file14</FileName> <FileName>file15</FileName> <FileName>file16</FileName> <FileName>file17</FileName> <FileName>file18</FileName> <FileName>file19</FileName> </meta> </FF> So "file1" is missing, because it belongs only to Value1 but not to value2. I hope one can understand what I am trying to achieve. Hopefully someone knows how to do it. Thanks Marcus |