Multiple XML includes

  • How can I load multiple XML files?


    Only the last works (Content_B) if I put the contents eith 2 files


    so.addVariable("xml", "script_A.xml"); -> Content_A
    so.addVariable("xml", "script_B.xml"); -> Content_B


    If I put both contents in the same XML file, it works


    so.addVariable("xml", "script_AB.xml"); -> Content_A + Content_B


    I know that I am overlapping "xml" var, but I can´t find any solution *unsure*


    Thanks in advance

  • Yes, but...


    I´m creating a dynamic application (database with images.. images with properties..)

    I need to load only the corresponding properties,


    example:

    Nadir logo : ON (load nadir.xml)/ OFF ()


    nadir.xml:

    <krpano version="1.0.8">

    <hotspot name="nadirlogo"

    url="logo.png"

    ath="0"

    atv="90"

    distorted="true"

    scale="1.0"

    rotate="0.0"

    rotatewithview="false"

    onclick="switch(rotatewithview);"

    />

    </krpano>


    Banner picture: ON (load banner.xml) / OFF ()

    Banner.xml :

    <krpano version="1.0.8">

    <view hlookat="12"

    vlookat="40"

    fov ="105"

    />

    </krpano>


    In this example I´m using only 2 properties, so I use a lot of them as separate codes and they must be organized.


    ¿Is there any solution?


    Thanks so much and sorry for my bad english *whistling*

  • Hi,

    I´m creating a dynamic application (database with images.. images with properties..)

    in this case - why not generating the xml dynamically? (via php or similar)
    what could be the easiest solution!

    In this example I´m using only 2 properties, so I use a lot of them as separate codes and they must be organized.

    instead of including a xml, the variables could be also set direct,
    e.g: instead of including your banner.xml:

    Code
    so.addVariable("view.hlookat", 12);
    so.addVariable("view.vlookat", 40);
    so.addVariable("view.fov", 105);

    or instead your nadir.xml:

    Code
    so.addVariable("hotspot[nadirlogo].url", "logo.png");
    so.addVariable("hotspot[nadirlogo].ath", 0);
    so.addVariable("hotspot[nadirlogo].atv", 90);
    so.addVariable("hotspot[nadirlogo].distorted", true);
    so.addVariable("hotspot[nadirlogo].rotatewithview", false);
    so.addVariable("hotspot[nadirlogo].onclick", "switch(rotatewithview);");

    best regards,
    Klaus

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!