It Bugs Me

So many people post articles that start in the middle of a subject and end before the conclusion is reached. While I appreciate succint comments, please, start at the beginning!

I've recently been searching for articles about reading XML files using XPath to drill right into the entity needed. Lots and lots of folks post about what to do when you have loaded to document, but almost none start at the beginning - what namespaces to use. After a week or so of research, I finally hit on the right combination. So I'm going to share it ... ALL of it.

at the top:

using System.Xml;
using System.Linq;
using System.Xml.Linq;
using System.Xml.XPath;

load the document & read the desired element:

                    XmlReader reader = XmlReader.Create(filename);
                    XElement root2 = XElement.Load(reader);
                    XmlNameTable nameTable = reader.NameTable;
                    XmlNamespaceManager namespaceManager = new XmlNamespaceManager(nameTable);
                    namespaceManager.AddNamespace("", Properties.Settings.Default.ENTITY_DTD_URI);

                    NewPatentRelations newRelations = new NewPatentRelations();
                    if (root2 != null  )
                    { //my paths and elements are fetched into the SqlDataReader rdrElements

            string xmlpath = "";
            string elementname = "";
            while (rdrElements.Read())
            {
                elementname = rdrElements["ElementName"].ToString();
                xmlpath = rdrElements["XMLSearchPath"].ToString() ;
                XElement child1 = root.XPathSelectElement(xmlpath, nspace );
                if (child1.Value != "")
                {
                    currPatent.AbstractEng = child1 .Value .ToString ();
                }
            }

}

That's it! I can read through the data reader to get the elements I want to drill to, and process them. I've also applied a DTD for validation to it.

Just one note: The path to the first XElement.Load is the root element of the document. The paths of the subsequent nodes are in the format {./entity-name/child-name"}. So, looking at the original XML, you would see tags for <root>, <entity-name>, and <child-name>.


Bole Logo Approaches

Working on a site for an environmental consulting firm. Here are two approaches to the logo.

 

 

 

third concept:


Code On Time

Been working a lot with Code On Time code generator for database websites.

What a terrific productivity tool! I can make application pages in about 25% of the time required for full .NET development.

Check it out at www.codeontime.com


Up and Running on a New Host

Just finished moving to a new host - IXWebHosting.com. Other than the fact that I had to re-develop a few things and implement a new client forum, It's great.

I moved from a private hosting company, where everything I did had to be done by the host, so it was constantly submit a request and when it could get done, it did. IX is different - you get a control panel where you can instantly do whatever you need - email, domain management, IP addresses, IIS changes - whatever. It's great for me, as a consultant building a small business clientelle.

So what have I been doing? Well, learning WordPress. It's not done, but the tools is great. Here's my site: wordpress.endif.ws. I'm going to try to keep these sites parallel, but who knows!

TTYL-
Stephanie


A New Era

BAck on my own, finally out of corporate life.

Loving the freedom and ability to work with more people. Exploring new tools and systems.


What's New for 2011

I'm starting to get  back in touch with my clients, both old and new. I've gotten familiar with these new tools:

  • blogengine.net: great little open source, xml-based website for blogging and other information. That's what this site is. I've implemented 3 sites so far: endif.ws, invalidateclaim.com, and a custom site for estate management.
  • CodeOnTime: for generating SQL and ASP.NET membership based websites. Nothing live yet, but it looks pretty goo. Not sure I'll use this or the competitor below.
  • IronSpeedDeveloper: code generating toolset which I'm investigating

My first project will be converting a VB6 application that I developed for Sierra Gold Nurseries to manage their tree growing and sales business.

I'm still working in semantic searching for patents, too. The InvalidateClaim business is based on a tool for litigation support that I developed. It is a finely-focused tool for invalidating specific claims of patents. This is especially good for defendants of patent litigation assertions.

More next month!

Stephanie


About Me

Stephanie is a creative professional in many disciplines - from search technology to website design, from operations software to computer art.

Recent posts

Recent comments

None

Archive

Search

Categories

Recommendations

Check out MXGuardDog for a free Postini Alternative.