Page 4 of 4 FirstFirst ... 234
Results 31 to 37 of 37

Thread: xmlPackages calling app_code functions

  1. #31
    Join Date
    Mar 2008
    Posts
    18

    Default xmlPackages calling app_code functions

    Hi,

    I know we have probably been over this before, but I am having a similar problem to unspokenchaos in January. I am using vb, but I getting the same error...

    XmlPackage Exception: Exception=Last Trace Point=[]. Cannot find the script or external object that implements prefix 'urn:myFunctions'.

    Firstly I assume this should work with vb? (I am not a web programmer by trade).

    Secondly, it is probably something really dumb, I have been banging my head against a brick wall for a few hours and a second pair of eyes always helps so...

    Thirdly, I am on 7.1.0.0, I assume this will not be a problem?

    The end game is to get magiczoom working so I am planning to override LookUpProductImage, however at the moment I just want to the basics going...

    So new namespace file:

    Imports System
    Imports System.Collections
    Imports System.Collections.Generic
    Imports System.Xml
    Imports System.Xml.XPath
    Imports System.Xml.Xsl
    Imports System.IO
    Imports System.Resources
    Imports System.Globalization
    Imports System.Reflection
    Imports System.Data
    Imports System.Configuration
    Imports System.Drawing
    Imports System.Web
    Imports System.Web.Security
    Imports System.Web.UI
    Imports System.Web.UI.WebControls
    Imports System.Web.UI.WebControls.WebParts
    Imports System.Web.UI.HtmlControls
    Imports System.Threading
    Imports System.Text
    Imports System.Text.RegularExpressions
    Imports AspDotNetStorefrontCommon

    '<summary>
    'Summary description for MyCode
    '</summary>

    Namespace mynamespace

    Public Class Slug

    Public Function getmylistbox() As String
    Return "<select id='Select1'> <option>hello</option></select> "
    End Function


    End Class


    End Namespace


    My webconfig update:

    <add name="myCustomFunctions" type="mynamespace.slug" namespace="urn:myFunctions" />

    My xml package:

    <?xml version="1.0" encoding="UTF-8" ?>
    <!-- ################################################## ################################################## ## -->
    <!-- Copyright AspDotNetStorefront.com, 1995-2006. All Rights Reserved. -->
    <!-- http://www.aspdotnetstorefront.com -->
    <!-- For details on this license please visit the product homepage at the URL above. -->
    <!-- THE ABOVE NOTICE MUST REMAIN INTACT. -->
    <!-- $Header: /v6.1/Web/XmlPackages/test.xml.config 1 12/30/05 2:33p Administrator $ -->
    <!-- ################################################## ################################################## ## -->
    <package version="2.1" displayname="Variants In Right Bar" allowengine="true" debug="true" includeentityhelper="true">
    <PackageTransform>
    <xsl:stylesheet version="1.0" xmlns:mynamespace="urn:mynamespace" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:myFunctions="urn:myFunctions" xmlns:aspdnsf="urn:aspdnsf" exclude-result-prefixes="aspdnsf">
    <xslutput method="html" omit-xml-declaration="yes" />
    <xsl:template match="*">
    I AM HEAR!!!!

    <xsl:value-of select="myFunctions:getmylistbox()" disable-output-escaping="yes" />

    aspdnsf:GetMLValue(Name)
    </xsl:template>
    </xsl:stylesheet>
    </PackageTransform>
    </package>

    and then dropped into engine.aspx:

    <aspdnsf:XmlPackage id="Package1" PackageName="test.xml.config" runat="server" EnforceDisclaimer="true" EnforcePassword="true" EnforceSubscription="true" AllowSEPropogation="true" ReplaceTokens="true"/>


    I have basically copied the original guy in this post apart from the conversion to vb...

    Any advice would be great.

  2. #32
    Join Date
    Jul 2008
    Location
    Could be anywhere between 60N-28N and 77W-36E
    Posts
    84

    Exclamation Please do a search before asking questions:

    Quote Originally Posted by K&N View Post
    XmlPackage Exception: Exception=Last Trace Point=[]. Cannot find the script or external object that implements prefix 'urn:myFunctions'.
    As I think I have mentioned before in these forums, this seems to be only a problem with the vb version.
    See http://forums.aspdotnetstorefront.co...6&postcount=49
    Using ASPDotNetStoreFront since Version 3
    Got Version 9.
    Almost ready to deploy MultiStore (final testing stages for the new FirstData gateway)
    Finally upgraded our server to 2008 R2.

  3. #33
    Join Date
    Mar 2010
    Posts
    2

    Default Calling a UserControl from an XmlPackage

    Hi,

    After reading the start of this thread I've been able to call app_code functions within an xml package that will generate html, ideally though I would like to load a custom usercontrol from the xml package to do the html generation rather than a function within app_code.

    Is there a way to load user controls within an xml package?

    Thanks in advance.

  4. #34
    Join Date
    Mar 2007
    Location
    Ashland, OR
    Posts
    2,390

    Default

    Is there a way to load user controls within an xml package?
    Unfortunately, there is not.

  5. #35
    Join Date
    Feb 2011
    Posts
    2

    Default Use MEF with .net 4

    Sorry to resurrect this thread, but I would like to suggest that in .net 4 builds, the application uses mef instead of the manual web.config work.

    This would allows developers to drop any dll into the bin folder, and then call it from the xslt.

    No config


  6. #36
    Join Date
    Feb 2011
    Posts
    2

    Default Documented on Blog

    If anyone is looking for a full documentation, I wrote down on my blog what worked for me: (link)

    I was able to get an external dll working. No need to muck around in the app_code folder.
    Last edited by jr365; 02-17-2011 at 11:02 AM. Reason: spelling correction

  7. #37
    Join Date
    Mar 2009
    Posts
    78

    Red face Got this working in MultiStore 9.2.0.0

    Hope this helps someone else.

    It still works as of MS 9.2.0.0 ...

    I had a problem, but it turned out to be this (I don't know much about xsl):

    In my xmlpackage file, I had one node was embedded within another ( </add> is out of place - needed another </add> after <add name>)

    http://forums.aspdotnetstorefront.co...742#post112742

    But I followed Jeremiah Redekop's example:
    http://blogs.geniuscode.net/JeremiahRedekop/?p=401

    At one point I put in a support ticket, but the response was a) incorrect, and b) not helpful.

    Follow your dreams and believe in yourself, no one else will ....
    Last edited by cengen; 04-20-2012 at 10:19 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •