Expresso Regular Expression Tool

Expresso is a free tool that you can download and run to aid you in building and testing regular expressions.

It’s pretty handy!

Advertisements

Validating XML document against an XML Schema with VB.Net

It seems like validating an XML document against a schema would be a pretty simple thing to do in the .Net framework, seeing as how they have such deep support for dealing with XML.

But as of yet, I haven’t found a simple way to do it.

Here is the code I have been using to validate XML against an XML Schema.

Imports System.IO
Imports System.Xml
Imports System.Xml.Schema


Private schemaValidation As New ValidationEventHandler(AddressOf ValidationHandler)

Private Function ValidateXml(ByVal xmlFileName As String, ByVal xmlSchemaName As String) As Boolean
Using myFile As New FileStream(xmlFileName, FileMode.Open, FileAccess.Read, FileShare.None)
Dim xDoc As New Xml.XmlDocument()
xDoc.Load(myFile)
xDoc.Schemas.Add(GetSchema(xmlSchemaName))
Try
xDoc.Validate(schemaValidation)
Return True
Catch ex As XmlSchemaValidationException
Console.Write(ex.ToString)
Return False
Catch ex As XmlSchemaException
Console.Write(ex.ToString)
Return False
Catch ex As Exception
Console.Write(ex.ToString)
Return False
End Try
End Using
End Function

Private Function GetSchema(ByVal filePath As String) As XmlSchema
Dim schema As XmlSchema
Using s As New System.IO.FileStream(filePath, FileMode.Open)
Using reader As New StreamReader(s)
schema = XmlSchema.Read(reader, Nothing)
End Using
End Using
Return schema
End Function

Private Sub ValidationHandler(ByVal sender As Object, ByVal e As System.Xml.Schema.ValidationEventArgs)
Throw e.Exception
End Sub
 

Here Is A Article Talking About The Ability To Put Some Of Your Config Info In Another Config File When Using Aspnet

Here is a article talking about the ability to put some of your .config info in another config file when using asp.net

http://www.beansoftware.com/ASP.NET-Tutorials/Multiple-Config.aspx

What I found most interesting is that it says that changing the otherFile.config will not reset your app.

I am guessing that it also means that it won’t find your new values until the app is reloaded, but if it DID find the new values w/o a reload that would be great.

<?xml version=1.0?>
<configuration>
    <appSettings/>
    <connectionStrings/>
    <system.web>
        <compilation debug=false strict=false explicit=true />
    </system.web>
    <appSettings file=externalSettings.config/>
</configuration>

I also wonder if you could have more than 1 appSettings external file.

Some Good Links For Updating Cisco PIX Devices

Problem getting PDM running:
http://www.experts-exchange.com/Security/Firewalls/Q_21611023.html

Installing PDF on a Pix Firewall:
http://www.cisco.com/univercd/cc/td/doc/product/iaabu/pix/pix_61/pdm_ig/pdm_inst.htm

Upgrade/Update/Flash a Cisco Pix:
http://www.windowsitpro.com/Article/ArticleID/20281/20281.html?Ad=1

Change Password on Pix:
http://www.linuxhomenetworking.com/cisco-hn/dsl-pix.htm