Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rob 43 posts 79 karma points
    Nov 20, 2012 @ 04:09
    Rob
    0

    Working with External Data (file based xml) Q..

    Im not certain if this is the right forum for this, but I need to be able to have the CMS upload XML (KML) data into the system, then i will need to extract the KML data to apply it to either Google.Maps or Bing.Maps.

    So.. My current thinking is that i will need to use a user control to open the xml files and then process the nodes to extract the points in a way that shapes can be drawn on the map.

    The question I have - and i am a little new to umbraco, is... Does this seem to be a resonable option. All of the geo data is currently stored in a number of different KML files. To process the files it seems that i need to upload them into umbraco via something like the file upload datatype.

    Thoughs and ideas are welcome. Is there a better option. Is this something i can do with XSLT? Im at a bit of a loss here.

    Thanks in advance.

    Rob

     

     

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Nov 20, 2012 @ 06:26
    Tom Fulton
    0

    Hi Rob,

    The simplest option would probably be to use an Upload datatype to upload the XML files, then in XSLT you can use the umbraco.library:GetXmlDocumentByUrl extension to grab the contents into parseable XML.  From there you can do what you please with it from your XSLT macro :)  Make sense?

    -Tom

  • Rob 43 posts 79 karma points
    Nov 20, 2012 @ 21:00
    Rob
    0

    Tom.

    Thanks. I think you may have solved the problem.

    So.. to paraphrase..

    1. Allow the user to use the filupload datatype to upload an xml document
    2. Use the documents friendly ulr to load the document into an xslt macro using the GetXmlDocumentByUrl  method.
    3. Have the macro generate the "text" to be merged back into the page
      The XML will produce two outputs
      a. A menu to load/remove the KML dynamically from a map
      b. Generate the "javascript array" into a standard "script tag" to link the menu with the mapping api.

    Does that sound about right?

    Thanks in advance (I think you have probably made my life much easier!!)

    Rob

     

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Nov 22, 2012 @ 17:31
    Tom Fulton
    0

    Hi Rob,

    Yep, that sounds right - let us know how you get along.

    -Tom

  • Rob 43 posts 79 karma points
    Nov 22, 2012 @ 17:46
    Rob
    1

    I'd love to tell you I am doing well, however I have bumped into a problem. I suspect it is with the KML having a bad declaration but I am really not certain.

    I posted a much shortened version of the KML and the XLST macro to this link http://our.umbraco.org/forum/developers/xslt/36382-Problem-processing-XML-file
    If you have the time and could give it a look I would really appreciate it! The rss feed from the BBC worked great, but the KML is not processing at all.

    I FOUND THE ANSWER - I Will post to the other link, but i suspect i am now on the way!

    I think it was this line <gx:balloonVisibility>1</gx:balloonVisibility>

    Rob.

     

     

Please Sign in or register to post replies

Write your reply to:

Draft