Dave's Brain

Browse - Computer Tips - Can I put XML inside XML?

Date: 2011sep7
Language: XML

Q.  Can I put XML inside XML?

A.  Yes.  Use CDATA.  The inner XML will not have its syntax checked.

For example:

<?xml version="1.0"?> <myfile> <thing>Stuff</thing> <xaml> <!-- Put some XAML inside a regular XML file --> <![CDATA[ <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="ExampleNamespace.ExamplePage"> <Button Click="Button_Click" >Click Me!</Button> </Page> ]]> </xaml> </myfile>

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.