Permalink
Browse files

Xml Renderer

  • Loading branch information...
1 parent 0ae0af7 commit 71d1ebf6642a88541db591f181869399032d5daf @charliesome committed May 8, 2010
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+namespace bbsharp.Renderers.Xml
+{
+ public static class XmlRenderer
+ {
+ public static XmlDocument ToXml(this BBCodeDocument obj)
+ {
+ var xdoc = new XmlDocument();
+
+ var root = xdoc.CreateElement("body");
+
+ foreach (var c in obj.Children)
+ root.AppendChild(c.ToXml(xdoc));
+
+ return xdoc;
+ }
+
+ public static XmlNode ToXml(this BBCodeNode obj, XmlDocument xdoc)
+ {
+ var el = xdoc.CreateElement(obj.TagName);
+ el.SetAttribute("attribute", obj.Attribute);
+
+ if (!obj.Singular)
+ foreach (var c in obj.Children)
+ el.AppendChild(c.ToXml(xdoc));
+
+ return el;
+ }
+ }
+}
View
@@ -17,6 +17,21 @@
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
+ <PublishUrl>publish\</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Disk</InstallFrom>
+ <UpdateEnabled>false</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <ApplicationRevision>0</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -65,6 +80,24 @@
<Compile Include="Renderers\Html\Image.cs" />
<Compile Include="Renderers\Html\ToHtml.cs" />
<Compile Include="Renderers\Html\Error.cs" />
+ <Compile Include="Renderers\Xml\ToXml.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+ <Visible>False</Visible>
+ <ProductName>Windows Installer 3.1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
View
@@ -1,2 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <PublishUrlHistory />
+ <InstallUrlHistory />
+ <SupportUrlHistory />
+ <UpdateUrlHistory />
+ <BootstrapperUrlHistory />
+ <ErrorReportUrlHistory />
+ <FallbackCulture>en-US</FallbackCulture>
+ <VerifyUploadedFiles>false</VerifyUploadedFiles>
+ </PropertyGroup>
+</Project>
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 71d1ebf

Please sign in to comment.