cyclus / cyclus.github.com

Landing page repository
http://fuelcycle.org
Other
8 stars 30 forks source link

XML including files #182

Open bam241 opened 8 years ago

bam241 commented 8 years ago

After testing it appears including files as described works only when including file with only one block.

I have tested different cases and found a solution. The different test I have made are described there : https://groups.google.com/forum/#!topic/cyclus-dev/tbzLDZ3zFP4

BaM

FlanFlanagan commented 6 years ago

@bam241 Do you think you could take a look at this and maybe update the website? I think I have a handle of your solution here, but it might be best coming from you.

bam241 commented 6 years ago

yes I can.

I believe @katyhuff and @jbae11 have also working solution, maybe we can cross check our copies to provide the best answer ?

jbae11 commented 6 years ago

@gyutaepark is the original author of Predicting the past. I believe he explored various options for this function.

bam241 commented 6 years ago

our solution are pretty close. my solution: main.xml:

<simulation xmlns:xi="http://www.w3.org/2001/XInclude">
[...]
         <xi:include href="inclusion.xml" xpointer="xpointer(//My_include/*)"/>
[...]
</simulation>

inclusion.xml:

<My_include>
         [some cyclus archetypes/recipes declarations]
<\My_include>

@gyutaepark solution: main.xml:

<simulation xml:base="/home/gyutae/cyclus/predicting-the-past/cyclus_input/"
  xmlns:xi="http://www.w3.org/2001/XInclude">
[...]
         <xi:include href="inclusion.xml#xpointer(/inclusions/child::*)"/>
[...]
<\simulation>

inclusion.xml:

<inclusions>
         [some cyclus archetypes/recipes declarations]
</inclusions>
bam241 commented 6 years ago

but looking at the reactor list, I feel like he was able to remove the <inclusions><\inclusions> bracket from the included file @gyutaepark Am I correct ?

gyutaepark commented 6 years ago

Sorry for the loooong delay. I've only realized today that this issue was created. Yes, I was able to remove the root tag from the to_be_included.xml. This was done so using an xpointer as shown here predicting-the-past under XML inclusion and Setting XML base for final input file.

gyutaepark commented 6 years ago

It seems like both our solutions agree on using xpointer's. @bam241