Ejemplo n.º 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);
            }
        }
Ejemplo n.º 2
0
        public void ValueOf_String_CreatesElement()
        {
            var xslt    = new XsltFactory();
            var select  = "testSelect";
            var valueOf = xslt.ValueOf(select);

            Assert.Equal("value-of", valueOf.Name.LocalName);
            Assert.Contains(valueOf.Attributes(), a => a.Name == "select" && a.Value == select);
        }