Sunday, February 27, 2011

Nested List Sitemap From a Flat XML File

I needed to build a Sitemap where each sub-level is indented more than the top levels...a very typical sitemap. However, my XML file was not in the order it needed to be output to the page and it was a flat XML file, so I couldn't pull the hierarchy from the XML.

I decided to do a template for each level of the sitemap and trigger each template recursively at each level till no more items were available on the level.

It took about 15 hours of staring at code that didn't work till I got it right.

Here is my solution:

Nested Sitemap from a Flat XML File

Thursday, February 17, 2011

Creating SQL Statements from an XML File

I worked up an XSL Stylesheet to transform a two-column Excel file into a SQL Update Statement.

Here is my order of events:

I saved the Excel File as a .csv file.

I used creativyst.com to change the .csv to an XML file.

I put a XML header on the file:

I saved the XML file to a web server where I could access it with a URL.

I used PORDL to create a new feed transform with the following XSL:



The output was a clean SQL Update Statement I could use to do a mass update of records on an OsCommerce database.

Friday, February 11, 2011

Grouping XSL Search Results

How to group XML items using the Muenchian Method

It took a while to figure this out because no one on the internet had a really good example that was easy to port over for my uses. So, I created an XSL sheet that can easily be ported to most any application.