Showing posts with label XSLT. Show all posts
Showing posts with label XSLT. Show all posts

Sunday, August 12, 2012

Check out XFiles... ["Using XPath to Navigate the File System"]

CodeProject - Using XPath to Navigate the File System

Introduction

This article has two goals:

  1. It shows how to make your own XPathNavigator implementation and use it to evaluate XPath expressions and apply XSLT transformation to the structures, not intended to be used this way
  2. It presents the new alternative way to work with files and folders that some people may consider useful

What is XPathNavigator

XPathNavigator is the system abstract class, that implements XPath document model and provides means of navigating through XML nodes, and evaluating XPath expressions. Unlike XmlNode or XNode, XPathNavigator is a cursor, that may point to any node in the XML tree and be moved to another node. XPathNavigator is also used as an input for XslCompiledTransform, and therefore any implementation of the XPathNavigator can be transformed with an XSLT stylesheet.

XPathNavigator implementations exist for all XML models in .NET, including XmlDocument and LINQ to XML. Generally an instance of an XPathNavigator inheritor can be created for classes that implement IXPathNavigable interface. This interface contains a single method - CreateNavigator. Classes XmlNode and XPathDocument (a special fast model that only provides read-only access via XPathNavigator model) implement IXPathNavigable. However this is not always the case. The newest library for working with XML - LINQ to XML - allows creation of XPathNavigator with extension methods.

It's worth mentioning that none of the system-integrated implementations of the XPathNavigator are public.

How to implement XPathNavigator

XPathNavigator contains 116 public members, 112 of which can be overridden. Good news that only 20 of them are abstract, i.e. must be implemented.

Here they are:

...

SNAGHTML99d2f8a[4]

image..."

When I first saw this I wasn't sure if it was insane or inspired. I'm still not sure about that, but I am sure that I think this is pretty awesome.

Friday, February 08, 2008

XSLT Profiler Addin for Visual Studio 2008 - aka The "Why is my XSLT so slow..." Addin

Microsoft XML Team's WebLog - Announcing the XSLT Profiler Addin for VS 2008

"XML Tools team has released the XSLT Profiler Addin for VS 2008 - a quick and reliable performance analysis profiler tool that assists in the development and debugging of XSLT documents. The XSLT Profiler Addin for VS 2008 allows developers to measure, evaluate, and target performance-related problems in XSLT code by creating detailed XSLT performance reports. The XSLT Profiler includes a wealth of useful hints for XSL and XSLT style sheet optimizations, which are essential for XSLT-based applications that demand maximum performance.

...

For more information and download check out Microsoft Downloads site.

..."

I keep saying that "one of these days" I'm going to use XSLT to help me in my Blogger Backup utility, to transform the ATOM feeds I get from Google into other formats (HTML, PDF via XSL-FO, etc)... And more importantly use XSLT to decouple the transform from the utility. To let others easily tweak their transforms, add new ones, etc.

While I'm not there yet (I did just get BlogML added through, via their .Net API... :) I'm watching for XSLT "stuff", like this addin...

Monday, September 03, 2007

XSLT and XSL-FO Task Based Reference Site

www.dpawson.co.ukFO Questions, &  XSLT Questions and Answers

I'll likely be using XSLT and possibly XSL-FO in my Blogger backup utility, so this caught my eye (since I have little practical experience using XSLT and none with XSL-FO).

What I like about this site is that it's not just a link site but a reference site. 

David Pawson (author of XSL-FO Making XML Look Good in Print) has put together this nice reference site, based on tasked based questions and answers.

For example, here is a couple entries from the XSLT - HTML page;

"1. How to use HTML as input documents?
2. Embedding HTML in XML documents using HTML dtd
3. HTML to XML conversion
...
5. How to embed HTML in XML
6. Including BR in an XSL template
...
10. HTML in XML
...
13. Parsing HTML as XML

..."

That's just a tiny bit of the information available...

(Joteke's Blog - Handy XSLT Reference Site focused on specific tasks)