Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / March 2006

Tip: Looking for answers? Try searching our database.

Implementing XPathNavigator on my class

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vinayak  Kamat - 30 Mar 2006 17:55 GMT
Hi,

I've an 'Employee' class. In my program this object is manipulated,
children (List<T>) added, properties modified etc. Everytime this
happens I want to be able to show some relevent html to the user. So I
use XSLTransform. This Employee class is basically an XML serializable
class produced out of an XML file when the program loads for the first
time. Later on, if I've to show the modifications done to this object,
I don't want to go back to save this object into the file, then load it
to XMLdocument object and then use XSLTransform on it. This is tedious,
nasty and inefficient (as per MS experts).

So comes to the rescue - XPathNavigator. I am supposed to implement
this abstract class in my Employee class and provide implementations
for 20 odd properties and methods. So when I am ready with this
Xpathnavigable employee class, I just need to pass this to Xsltransform
and whoosh. I am  done with the display.

I referred to the objectXpathnavigator on MSDN
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cp
conxpathnavigatoroverdifferentstores.asp
),
and FileSystemNavigator, AssemblyNavigator and RegistryNavigator by
Aaron over here.
(http://msdn.microsoft.com/msdnmag/issues/01/09/xml/)
While the former is buggy (Especially with XSLTransform) and unusable,
Aaron's navigators are complex and hard to follow/replicate. I even
downloaded them and tried to study them. They look complex.

I am looking for some real help in this regard to implement
XPathNavigator on top of my class. Is there a step by step guide on how
to achieve this in the most easiest and intuitive way. I am using
List<PrevEmployer> in my Employee class as well.
Isn't there a much better easier way of achieving this? in .Net 2.0?

Your help is much appreciated.

Thanks,

Vin
Martin Honnen - 30 Mar 2006 18:20 GMT
Vinayak Kamat wrote:

> I've an 'Employee' class. In my program this object is manipulated,
> children (List<T>) added, properties modified etc. Everytime this
> happens I want to be able to show some relevent html to the user. So I
> use XSLTransform.

List<T> sounds like you are using .NET 2.0. With .NET 2.0 XslTransform
is obsolete and you should use XslCompiledTransform instead.

As for example XPathNavigator implementations, the XML MVP project has
at least one with Mvp.Xml.Common.XPath.SubtreeXPathNavigator, see the
documentation on
  <http://www.xmlmvp.org/>

Signature

    Martin Honnen --- MVP XML
    http://JavaScript.FAQTs.com/

Sergey Dubinet - 30 Mar 2006 18:35 GMT
Your intention is very correct and you are right that this is quite
complicated task.
We had some time ago reflection based XPathNavigator that was able to
iterate through arbitrary object tree.
I am not sure that it was ever published. If I find it I send it to you.

Sergey

> Hi,
>
[quoted text clipped - 34 lines]
>
> Vin
Vin - 30 Mar 2006 21:28 GMT
@Martin:
you are very correct, I am in .Net 2.0 world, and for sure I am using
XslCompiledTransform. I meant it implicitely. I hate the old world
Xsltransform. No worries with that. And thanks for your pointers on
some samples.

@Sergey:
Thanks for your comments.
Please do send across your reflection based XPathNavigator, that is
exactly what I am looking for. I would appreciate for this helpful act
of yours.

Thanks very much,
Awaiting your navigator,
Vin

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.