Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: how to make my "FunctionFilter" work? need some help!

$
0
0
i create a C# function as follows:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
using Composite.Data;
using Composite.Data.Types;

namespace XjfCms.Data
{
    public static class InlineMethodFunction
    {
        public static bool NewsContentFilter(string Content)
        {
            return Content.Contains("获");
        }
    }
}
and use it as FunctionFilter :
<Filters>
  <FunctionFilter>
    <function name="XjfCms.Data.NewsContentFilter" xmlns="http://www.composite.net/ns/function/1.0">
      <param name="Content" value="${C1:Data:XjfCms.Data.Types.News:Content}" />
    </function>
  </FunctionFilter> 
</Filters>
but it can't work, and get errors
Syntax error: the element namespace "http://www.composite.net/ns/management/trees/treemarkup/1.0 in the" Filters ". Can not contain text. Should be a list of possible elements: namespace the http://www.composite.net/ns/management/trees/treemarkup/1.0 in ParentIdFilter, FieldFilter FunctionFilter. . Line 31, position 34 at in D: \ XjfCms \ App_Data \ Composite \ TreeDefinitions \ SearchNews.xml
Syntax error: Element naming the space "http://www.composite.net/ns/management/trees/treemarkup/1.0 in the" FunctionFilter. Can not contain text. Should be a list of possible elements: namespace "http://www.composite.net/ns/function/1.0," function ". . 32 row position 71 at in D: \ XjfCms \ App_Data \ Composite \ TreeDefinitions \ SearchNews.xml
Syntax error: Element named space http://www.composite.net/ns/function/1.0 "in" function. Can not contain text. Should be a list of possible elements: namespace "http://www.composite.net/ns/function/1.0," param ". . Line 33 position 157 at in D: \ XjfCms \ App_Data \ Composite \ TreeDefinitions \ SearchNews.xml
Syntax error: the element namespace "http://www.composite.net/ns/management/trees/treemarkup/1.0 in the" Filters ". Can not contain text. Should be a list of possible elements: namespace the http://www.composite.net/ns/management/trees/treemarkup/1.0 in ParentIdFilter, FieldFilter FunctionFilter. . Line 34 position 169 at in D: \ XjfCms \ App_Data \ Composite \ TreeDefinitions \ SearchNews.xml
ps:i use google translate these exception message from chinese to english

how to make it work? need your help! thanks

Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>