PeteTheGreek
PeteTheGreek

Reputation: 729

asp.net Razor output xml dynamicxml

How do you just dump/output xml to the page from a razor macro?

I've got a variable which just returns "umbraco.MacroEngines.DynamicXml" with @field

But could do with just outputting just to see what nodes it contains.

Thanks

Upvotes: 1

Views: 414

Answers (1)

Brad Richardson
Brad Richardson

Reputation: 421

The problem is due to the Razor Scripting settings in the umbracoSettings.config file. It is there that several HTML items are listed that will be ignored as DynamicXml. I have added several to mine to make this problem go away.

<scripting>
    <razor>
        <!-- razor DynamicNode typecasting detects XML and returns DynamicXml - Root elements that won't convert to DynamicXml -->
        <notDynamicXmlDocumentElements>
            <element>p</element>
            <element>div</element>
            <element>ul</element>
            <element>span</element>
            <element>script</element>
            <element>iframe</element>
        </notDynamicXmlDocumentElements>
    </razor>
</scripting>

Upvotes: 1

Related Questions