Extracting the generated xml

  • Hi,

    I am trying to extract the generated (i.e. 'live view') XML from KRPano using the API. It seems that the variable "xml.content" only contains the original XML before it was manipulated (e.g. hotspot added).

    I can see that the Editor plugin has a "get generated xml" button which does exactly what I require, but the plugin source is not available to see how it is done.

    How can I extract the 'live' XML from memory?

    Thanks.

    Martin

  • Hi,

    right - there is no live xml, the xml is only a transport/storage format - internally krpano is organized in an object structure (similar to the HTML DOM).

    You could either manually store the original xml and modify if (by inserting, remove or replace texts) or manually rebuild the xml by reading-out all values and generating the xml this way, this would be like a snapshot of the current state (e.g. the editor plugin is doing this), but that's not always the optimal solution when things were build dynamically by scripts.

    Best regards,
    Klaus

  • Thanks for the reply.

    Having looked into it further I've also realised that the objects (hotspots, etc.) are not held in a single object 'graph' but are in separate arrays of objects.

    I guess I misinterpreted the editor.swf, thinking that it showed use of an API call to retrieve the updated XML. (I think it should be more clear that there is no underlying single KRPano state.)

    Edit: thanks for confirming Klaus - I didn't see your reply until I had already clicked 'Submit'. We will extract the properties from KRPano and apply the changes to the original XML stored in our database. It's an extra step but not a big problem.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!