How to set XML attribute's value dynamically? (w/o using events)

  • Hello,

    I want to set XML attribue's value dynamically, but not sure whether this is possible without using events (and actions).

    From my html document, I am passing a parameter "langauge".


    And I have multilanguage set in krpano XML format.

    Quote


    <multi_language>
    <welcome name="welcome" en="Welcome" de=Wilkommen" it="Benvenuti" .../>
    ...
    </multi_language>

    I want to set scene's title depending on the language setting using multi_language XML element.

    I have tried following and realized that get() function doesn't work in attribute.

    Quote

    <scene title="multi_langauge.welcome[welcome].get(lanauge)" .../>


    I saw "get:..", "calc:" feature in the krpano vrtourskin.xml and thought maybe I could use this feature to achieve my goal, but no luck..


    I know I could use events+actions (or JavaScript CDATA too?) to make it work but if possible, I want to use minimum code.

    Anybody had this issue too?

    Best Regards,
    hyung

  • ps.
    calc:calc('loc[goodbye].'+language) --> calc:loc[goodbye].en --> "Good Bye"

    Klaus
    shouldn't this work? (it doesn't)
    title="get:calc('loc[goodbye].'+language)

  • Hello indexofrefraction!

    Thank you very much for your answer.

    calc:calc('loc[goodbye].'+language)

    -> I have never ever imaginged this expression! *thumbsup*


    Klaus
    shouldn't this work? (it doesn't)
    title="get:calc('loc[goodbye].'+language)
    -> I am very curious too.

    Have a nice day! *smile*

    Best Regards,
    hyung

    ps.
    calc:calc('loc[goodbye].'+language) --> calc:loc[goodbye].en --> "Good Bye"

    Klaus
    shouldn't this work? (it doesn't)
    title="get:calc('loc[goodbye].'+language)

Participate now!

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