Copied to clipboard

Flag this post as spam?

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


  • NightWolf 41 posts 44 karma points
    Jan 16, 2009 @ 02:21
    NightWolf
    0

    NiceUrl Macro

    ~Umbraco v4

    I have a template with 4 tabs, each tab has 3 properties (featureOneTitle, featureOneBody, featureOneUrl) each tab the word one increments to the appropriate value ie: Two, Three...

    I am trying to make a macro using xslt which will accept a value (featureOneUrl, etc). This macro will then create a hyper link, I can't work out two things...

    1) How to accept a paramater for a macro in xslt.
    2) Why the XSLT below is not working.

    [code][/code]

    Error:
    [code]System.OverflowException: Value was either too large or too small for an Int32.
    at System.Convert.ToInt32(Double value)
    at System.Double.System.IConvertible.ToInt32(IFormatProvider provider)
    at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
    at System.Xml.Xsl.Runtime.XmlQueryRuntime.ChangeTypeXsltArgument(XmlQueryType xmlType, Object value, Type destinationType)
    at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
    at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter)
    at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results)
    at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, TextWriter results)
    at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
    at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging) in d:\inetpub\wwwroot\ccnet\Source\Umbraco 3.1\umbraco\presentation\umbraco\webservices\codeEditorSave.asmx.cs:line 124[/code]

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jan 16, 2009 @ 09:12
    Dirk De Grave
    0

    Hi,

    1/ Accepting parameters in the xslt



    where paramAlias the alias of the parameter you've defined for the macro

    2/

    [code][/code]

    is not the same as

    [code]

    [/code]

    (Mind the capitalization)

    Error is due to the fact that when xslt are saved, they're checked against a node (top level node) which might or might not have that property defined! And even if that property exists, it doesn't have a value when saving the value. Solution is to surround the statement with an xsl:if statement as snippet below:

    [code]

    [/code]

    Hope this helps.

    Regards,
    /Dirk

  • NightWolf 41 posts 44 karma points
    Jan 19, 2009 @ 23:49
    NightWolf
    0

    Thank you very much.

Please Sign in or register to post replies

Write your reply to:

Draft