473,789 Members | 3,060 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Implementing XPathNavigator on my class

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 objectXpathnavi gator on MSDN
(http://msdn.microsoft.com/library/de...entstores.asp),
and FileSystemNavig ator, AssemblyNavigat or and RegistryNavigat or 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<PrevEmploy er> 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

Mar 30 '06 #1
3 2663


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 XslCompiledTran sform instead.

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

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Mar 30 '06 #2
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

"Vinayak Kamat" <kg*******@gmai l.com> wrote in message
news:11******** **************@ i40g2000cwc.goo glegroups.com.. .
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 objectXpathnavi gator on MSDN
(http://msdn.microsoft.com/library/de...entstores.asp),
and FileSystemNavig ator, AssemblyNavigat or and RegistryNavigat or 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<PrevEmploy er> 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

Mar 30 '06 #3
Vin
@Martin:
you are very correct, I am in .Net 2.0 world, and for sure I am using
XslCompiledTran sform. 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

Mar 30 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3378
by: Craig Pearson | last post by:
Hi My function receives an XPathNavigator object. From here I need to build a DataSet to load into SQL Server (using SQLXML adaptor). Does anyone have an idea on the most efficient way to convert the XPathNavigator into a DataSet? Here is what I have at the moment: void function DoSomething( string xmlSchemeFile, System.Xml.XPath.XPathNavigator nav ) {
7
3900
by: news.microsoft.com | last post by:
Hi, Is the compilation of XSLT, using XPathNavigator.Compile, only beneficial when the returned XPathExpression is cached? Next question, how do I cache the returned XPathExpression object? Should I programmatically cache it or is it automatically cached when the Compile method is called? Thanks
7
4088
by: David Thielen | last post by:
Hi; Is there a way from an XPathNavigator object to get an xpath string that will, when used in a Select(xpath) on the underlying base/root XPathNavigator return the same XPathNavigator? In other words, I initially create an XPathNavigator for my entire xml document. To get an XPathNavigator object who's root is a given node in the original xml document, there is a unique xpath that will return that node. The unique xpath could have,...
12
3965
by: David Thielen | last post by:
Hi; I have an element: <space> </space> When I call SelectSingleNode() on it, the InnerXml is a 0 length String, not a String containing 1 space. Any ideas?
2
2897
by: JSheble | last post by:
I'm integrating with a customer application, and in their assembly, when I call a method it returns data to us as an XPathNavigator object. I can parse the various elements I need out of this object with no problem, but what I cannot seem to do is get at the actual XML string itself. For accountability, tracking, auditing, and logging, I need to save the XML as an XML file in an archive folder, but there doesn't seem to be any way of...
11
6467
by: ericms | last post by:
Can anybody show me how to insert a CDATA section using XPathNavigator ? I have tried the follwing with no luck: XmlDocument docNav = new XmlDocument(); docNav.LoadXml(xmlString); XPathNavigator nav = docNav.CreateNavigator(); XmlDocument doc = new XmlDocument(); doc.LoadXml("<DocumentData></DocumentData>"); XmlElement elem = doc.CreateElement(currentNodeName);
4
4405
by: Bruce Sandeman | last post by:
Hi, Does anyone know how to serialize an XPathNavigator object? I have tried the following but it moans that the xpn does not have a parameterless constructor. XPathNavigator xpn = e.Source.SelectSingleNode("/ns1:Invoice/ns1:InvoiceDetail/ns1:Lines/ns1:Line/ns1:Matches/ns1:Match/ns1:SubLedger", this.NamespaceManager); XmlSerializer x = new XmlSerializer(xpn.GetType()); StringWriter tw = new StringWriter();
0
1796
by: kelvin273 | last post by:
Hi all, i'm new in this community (and in .NET programming) and i've a problem with xpathnavigator. The idea is to have an xml document with attribute editable by windows form. I write this code, where xPath is, of course, the correct path of the selected node, and NodeEntity is a class that encapsulate the new attribute value. The method extract value from NodeEntity and update attribute value of the current node. But i don't find the...
2
4543
by: =?Utf-8?B?Tm9yZW1hYw==?= | last post by:
Hi. Using VS2005, .NET 2.0. I have an xml document that I want to go through and set the values on attributes of elements. The elements are complex types defined in my schema (xsd) files. I can iterate the document and get my XmlType and XmlBaseType values just fine. However, as soon as I call SetValue to write to an attribute, the
0
9665
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10199
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6768
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4092
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.