xml
XML Validation Failure Due To Invincible White Space
After spending 3 hours of my life trying to resolve the following error message: The element cannot contain white space. Content model is empty I decided to share my solution in hope that this will help somebody else. The xml file that was failing validation is:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
<?xml version="1.0" encoding="utf-8"?> <ComponentSet Default="Create Data Set"> <Procedures> <Procedure Name="Create Data Set"> <MainFlow> <CreateDataSetVersion Name="run create data set version task" Description="this the description" CollectionId="collection" DataProviderId="dataprovider" DataSetDescription="datasetDescription" DataSetName="datasetName" DataSetSchemaCode="schemaCode" DataSetVersionCode="datasetCode"> </CreateDataSetVersion> </MainFlow> </Procedure> </Procedures> </ComponentSet> |
And the xsd part responsible for the validation [...]
NLog with SQL Server and MVC 4
NLog is an awesome open-source logging tool that allows developers to easily and efficiently implement custom logging. Nlog can be configured to log to a number of targets, but on this tutorial we will be looking at logging to the database. First you need to add NLog to your MVC website. Bring up the Nuget package [...]
Mutliple object definition files with Spring.Net
Spring.Net is a great IoC (Inversion of Control) framework that allows developers to implement Dependency Injection using an xml configuration. In most cases, the Spring config will end up in either your app/ web.config files. However, in some cases, it may be desirable or necessary to keep the Spring object definitions outside your app/web.config files [...]
Using an Smtp client in ASP.NET MVC 4 and C#
If you need to send emails from your website, the .NET framework provides a very handy library for this: System.Net.Mail. The configuration and testing is pretty straightforward so let’s get started. Firstly we need to configure the SMTP settings in the web.config. Under the <configuration> element add the following config section:
|
1 2 3 4 5 6 7 8 9 10 |
<system.net> <mailSettings> <!-- Method#1: Send emails over the network --> <smtp deliveryMethod="Network" from="anyemailaddress@test.com"> <network host="your_smpt_server_dns_name" userName="your_smpt_server_username" password="your_smpt_server_password" port="25" /> </smtp> </mailSettings> </system.net> |
The port in [...]
Editing xml files with Advanced Installer
As part of my #learn365 today I will post a new feature I’ve learned about the Advanced Installer application. Advanced Installer, for those who never heard it before, is equivalent to InstallShield and allows users to create powerful custom installers for a variety of apps. So today’s lesson is: How to edit xml files and keep them [...]



