1

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

1 Answer 1

1

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>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.