コード例 #1
0
        internal XsltElement GetOutputElement(IFieldData fieldData)
        {
            switch (fieldData?.ContentType)
            {
            case ContentType.Variable:
                return(xslt.Variable(fieldData.Name));

            case ContentType.Attribute:
                return(xslt.Attribute(fieldData.Name));

            case ContentType.Element:
                return(xslt.Element(fieldData.Name));

            case ContentType.Text:
                return(xslt.Text());

            case ContentType.Number:
                return(xslt.Number());

            case ContentType.Calculation:
            case ContentType.Aggregation:
                return(xslt.ValueOf(fieldData.Name));

            default:
                return(null);
            }
        }
コード例 #2
0
        public void Text_None_CreatesElement()
        {
            var xslt = new XsltFactory();
            var text = xslt.Text();

            Assert.Equal("text", text.Name.LocalName);
            Assert.False(text.Attributes().Any());
        }
コード例 #3
0
        public void Text_String_CreatesElementWithData()
        {
            var data = "TestData";
            var xslt = new XsltFactory();
            var text = xslt.Text(data);

            Assert.Equal("text", text.Name.LocalName);
            Assert.False(text.Attributes().Any());
            Assert.Equal(data, text.Value);
        }