Loading xi:include xml files from the program code #2403
-
I have been using the .earth file to organize annotations, features, labels etc. by storing them in different .xml files and loading them by using the <xi:include href="myData.xml"/> in the earth file. I'd like to dynamically load and unload these same xml files in my c++ code instead of the .earth file by sending in the file name/location in as a function argument and appending a node to the earth node (or whatever is appropriate to add the child to). Is this possible, and are there any examples I can follow? Thanks for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I don't think there's a straight up example, but the steps would be something like:
You can look at the code that processes |
Beta Was this translation helpful? Give feedback.
I don't think there's a straight up example, but the steps would be something like:
XmlDocument::load()
to load the fileConfig
object from the firstXmlElement
in the document by callinggetConfig()
on itLayer::create(config)
to create your new map layer from theConfig
.You can look at the code that processes
<xi:include>
for guidance, near XmlUtils.cpp:253Hope this helps :)