Home
About
Search
Welcome to M-Files Empower – our new support experience. We'd love to hear what you think!Give feedback
Home/Support and troubleshooting/Examples and how to

Use a "shell" XML document to use fragments

Last updated on 22 June 2022

Admin
Connections to External File Sources (Integrated)

Overview

If you come across XML documents that have no root element, but are otherwise valid (i.e. XML fragments), this article provides one solution for how to use those fragments.

Solution

One option is of course to add the root element to the fragments programmatically. For example in C# using the System.Linq.Xml class.
If that is not possible, a 'shell' document pulling the fragments can be evaluated.
In the following example, the fragment is named "TestData.xml". TestDataSource.xml can be used for example in an M-Files file source, as it is pulling the fragment inside a root element:

TestDataSource.xml:
<!DOCTYPE root [
  <!ENTITY frag SYSTEM "TestData.xml">
]>
<Import>
  &frag;
</Import>

 

Still need help?

On this page