Copied to clipboard

Flag this post as spam?

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


  • Nikola Petkovic 64 posts 63 karma points
    Jul 03, 2009 @ 17:58
    Nikola Petkovic
    0

    Is there umbraco API to handle XSL transformation from code behind?

    Hi folks,

    what I actually want to do is to use one of the XSLT files (i regularly use in macros) to apply on umbraco content xml tree, but from codebehind.

    Anyone tried this before?

     

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jul 03, 2009 @ 22:31
    Dirk De Grave
    1

    Nikola,

    .net has pleny to api to handle xslt transformations. I suggest to perform a search on msdn on how to apply a transformation on an xml.

    Here's a first reference on xslt transformation that should het you started: http://msdn.microsoft.com/en-us/library/system.xml.xsl.xslcompiledtransform.aspx

     

    Cheers,

    /Dirk

     

     

  • Comment author was deleted

    Jul 04, 2009 @ 12:29

    Sure, that pretty easy, check out the sourcecode for the locator package on codeplex

    http://locator4umbraco.codeplex.com/

  • Comment author was deleted

    Jul 04, 2009 @ 12:34

    Should be something like:

    umbraco.macro.GetXsltTransformResult(content, umbraco.macro.getXslt(ResultsXslt)); 

  • Comment author was deleted

    Jul 04, 2009 @ 12:36

    Where content is umbraco.content.Instance.XmlContent</span>

    And ResultsXslt is just the name of the xslt file in your /xslt folder 

  • Nikola Petkovic 64 posts 63 karma points
    Jul 06, 2009 @ 14:55
    Nikola Petkovic
    0

    @Dirk: Great Dirk, thanks for the reference. Unfortinatelly, I tried this at first, but those methods cannot recognize "the references" to umbraco library methods used in my XSLT. Thats why I was sure that umbraco core took care of properly running xslt by their apis ;)

    @Tim: You rock... works like a charm. Thanks a billion.

Please Sign in or register to post replies

Write your reply to:

Draft