You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Graydon

Professional

  • "Graydon" started this thread

Posts: 614

Location: Texas

Occupation: Industrial gas turbine services.

  • Send private message

1

Sunday, November 16th 2008, 5:06am

limits / restrictions to included xml files?

Is there any set limit to the number of included xml files referenced in the top parent xml that is initially loaded... or any limit to the depth of included xml files?

i.e.

Experimenting with different items and am debugging by loading an initial xml that has the cubegrid preview... and then a series of

Source code

1
<include url="file.xml" />


... each one separating out bits and pieces that I want to play with... like an added logo and different sizes, locations... masks and different effects, etc...


Next part of the question...
if something like...

Source code

1
loadpano(%1,null,MERGE,BLEND(1));


is in one xml file... while the

Source code

1
action(loadpano,festung2.xml);


is in a different one... it won't matter, correct... at least not initially?



I see that hotspots and plugins can be "sticky" with the "keep=true"... how does it work with includes from the original xml?

- edit - thought about this again and realized that anything from a loaded xml file will probably be able to be defined with it's own "keep" property... so, if I use a "logo.xml" file and use the plugin node to setup my image logo, I can say keep - true and it should carry through... despite being loaded as part of an "included" xml file.

I know I could experiment and validate... but on some other more complex items that I'm trying to sort out... it'll be good to know what is "supposed" to work and what isn't.
- end edit -

This post has been edited 1 times, last edit by "Graydon" (Nov 16th 2008, 5:45am)


2

Sunday, November 16th 2008, 10:36am

Hi,

no there are no limits / restrictions to included xml files,
including works as follow:

1. the including file is loaded
2. then it is parsed to resolve all "url" attributes to make them relative to this xml file
3. if there is a "krpano" root node in the include xml file, it will be removed
4. then this included xml code replaces the include node
5. after all include nodes are resolved, krpano starts parsing the final xml file itself

example - this two xml files:

subdir/logo.xml:

Source code

1
2
3
<krpano>
  <plugin name="logo" url="logo.png" />
</krpano>


pano.xml:

Source code

1
2
3
4
<krpano>
  <include url="subdir/logo.xml" />
  <image>...</image>
</krpano>


becomes internally to:

Source code

1
2
3
4
<krpano>
  <plugin name="logo" url="subdir/logo.png" />
  <image>...</image>
</krpano>


NOTE - the url attribute has changed!


to your second question, yes this is possible,
plugins, hotspots and lensflares are normally removed when loading a new pano,
but when they have the "keep" attribute set to "true" OR a KEEPPLUGINS and/or KEEPHOTSPOTS is set on the loadpano() call they will not be removed and kept,

different to that - "action" definitions are always kept,
only if a new loaded xml defines a "action" that already exists - the new action overwrites the old one

so your code works as supposed

best regards,
Klaus

Graydon

Professional

  • "Graydon" started this thread

Posts: 614

Location: Texas

Occupation: Industrial gas turbine services.

  • Send private message

3

Sunday, November 16th 2008, 8:48pm

thanks Klaus

good example and good to know about the actions being kept until redefined.