Copied to clipboard

Flag this post as spam?

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


  • Sharon Weiter 56 posts 20 karma points
    Feb 20, 2009 @ 03:17
    Sharon Weiter
    0

    Writing to an xml file

    I have an xslt file and macro that is pretty simple. It gets the current page name. It works well.
    When I put the macro on a page it writes the current page name on the page just as I want it.
    I am happy with that. But I want more...

    What I would like to do is write that page name to an xml file
    Then use the current page name xml in my flash animations.

    When a user comes to a page I want
    1.) The macro/xslt to write "current page name" to the "currentpage.xml" file as the page loads
    2.)THEN when the flash animation loads -it reads the "current page name" from the xml
    3.) The "current page name" is displayed in the animation sequence.

    I don't know the sequence of what loads first on pages but I hope it can work in that order.

    Can this work?

    What is the syntax of the xslt to get it to write to an xml file?

    Here is what I have currently that works to get the name I need. I don't know how to then write it to a file:

    [quote]

    ]>
    <>
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    xmlns:umbraco.library="urn:umbraco.library"
    exclude-result-prefixes="msxml umbraco.library">










    [/quote]

  • bob baty-barr 1180 posts 1294 karma points MVP
    Feb 20, 2009 @ 04:07
    bob baty-barr
    0

    sharon, here is a pretty typical example of what i do to create xml output for my flash goodies...

    [code]

    ]>

    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    xmlns:umbraco.library="urn:umbraco.library"
    exclude-result-prefixes="msxml umbraco.library">












    [/code]

    i place this macro on a template that is completely blank [save the v4 required stuff] and then just call ?altTemplate=xmloutputtemplate from my flash file [or even better, pass that var into the flash file with flashvar]

    hope this helps. If you need anything, let me know.

  • Sharon Weiter 56 posts 20 karma points
    Feb 26, 2009 @ 01:24
    Sharon Weiter
    0

    Thanks for that. I will try it.
    This site is using Umbraco 3.03. I will see if it still works.
    I am afraid to upgrade just yet. everything is working so well on this site so far I don't want to mess it up.

    :)

  • Sharon Weiter 56 posts 20 karma points
    Feb 26, 2009 @ 04:33
    Sharon Weiter
    0

    Creating xml document for flash using umbraco.

    I think this solution is a start but I don't know enough to take it to the next level

    I just need umbraco to output a xml file with the current page name when a page loads.

    I don't even need the macro to appear on the pages except to extract the "currentpage" name.

    When a new page loads I want it to rewrite the ( or part of) the xml doc to update it to the new current page.

    I need to grab the "currentpage"

    From there I can do what I need to do in Flash.


  • Sharon Weiter 56 posts 20 karma points
    Feb 26, 2009 @ 04:41
    Sharon Weiter
    0

    My end goal is to pull the 'current page name' into flash to display in an animation (on that very page)

    Maybe I am going about it all wrong.

    I am getting the page name displayed on the page --so I know my xslt is getting the correct information

    Trying to extract the information (currentpage) for use in Flash!

    Any help at all appreciated.

    :)

  • Daniel Lindstrom 454 posts 271 karma points
    Feb 26, 2009 @ 07:02
    Daniel Lindstrom
    0

    The idea with bobs example is that you do not need to write anything to a physical xml file.

    Do like this:
    1. Create a new macro that outputs the XML you need. Start with bobs example and modify it.
    2. Create a new alternative template for your page. Do not put anything there except the macro you created in (1).
    3. Make sure the new template is an allowed template for the document type.
    4 Instead of giving your flash file the url of a physical XML file, point it to the same page (use NiceUrl to get the url of the current page), using altTemplate in the querystring.

    Something like this: www.domain.com/currentPage.aspx?altTemplate=XMLTemplate

  • Sharon Weiter 56 posts 20 karma points
    Mar 03, 2009 @ 20:43
    Sharon Weiter
    0

    Good! Thanks for the explanation.
    I am so used to calling an actual file in Flash that I just didn't get it. (not unusual- actually)

    I think you just solved my problem. I was almost to the point of just using a graphic and 10 template versions.

    Thanks!
    Sharon

Please Sign in or register to post replies

Write your reply to:

Draft