Dave's Brain

Browse - computer tips - 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>
What this info useful to you? You can donate to say thanks

Add a comment

Sign in to add a comment
Copyright © 2008-2012, 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.
Advertisements: