.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

Manipulate XML data with XPath and XmlDocument (C#)

Posted By: Pravin     Posted Date: March 14, 2012    Points: 2   Category :C#
 
This link given a basic knowledge about XPath


View Complete Post


More Related Resource Links

Real-World XML: Manipulate XML Data Easily with the XPath and XSLT APIs in the .NET Framework

  

XPath is emerging as a universal query language. With XPath, you can identify and process a group of related nodes in XML-based data sources. XPath provides an infrastructure that is integral to XML support in the .NET Framework. The XPath navigation model is even used under the hood of the XSLT processor. In this article, the author reviews the implementation details of the XPath navigator and the XSLT processor and includes practical examples such as asynchronous transformations, sorted node-sets, and ASP.NET server-side transformations.

Dino Esposito

MSDN Magazine July 2003


Easily manipulate data with the GridView control in ASP.NET 2.0

  
Last week, I introduced ASP.NET 2.0's GridView data control and covered the basics of using it. This week, I go a step further by going into the details of working with the data contained in the control. This includes viewing, editing, and deleting data. Thankfully, the GridView control makes it easy to utilize these features. Before diving into these topics, I begin with an examination of the different field types supported by the GridView control.

Real-World XML: Manipulate XML Data Easily with Integrated Readers and Writers in the .NET Framework

  

In the .NET Framework, XmlTextReader and XmlTextWriter provide for XML-driven reading and writing operations. In this article, the author discusses the architecture of readers and how they relate to XMLDOM and SAX parsers. He also shows how to use readers to parse and validate XML documents, how to leverage writers to create well-formed documents, and how to optimize the processing of large XML documents using functions to read and write Base64 and BinHex-encoded text. He then reviews how to implement a stream-based read/write parser that combines the functions of a reader and a writer into a single class.

Dino Esposito

MSDN Magazine May 2003


How to find a rownumber in a matrix in SSRS and use it to manipulate data

  
Hi, I have an MDX query which returns me a dataset. It is something like this. Country Measure 1 Measure 2 Country 1 99 100 City 1 45 50 City 2 40 30 City3 14 20 Now in the actual report I need to show the data for the City Rows using a logic like City.Measure - Country.Measure. This has to be dynamic as I dont know the number of rows in my report. I have taken a tablix and bound my cells to the appropriate measures. My problem is to write an expression for the cell such that if it is the 1st row (Country row), then it should directly take the value, else it should do a logic like City.Value- Country.Value (in ex. for City 1, Measure 1 data should be -44 ). Can someone help me in writing the expression. I checked on net and saw that we can use the RowNumber function, but I could not use it like =iif(Rownumber=1, "1st Condition", "2nd Condition"). Any help will be appreciated. Thanks, Suman

MSXML2 or XmlDocument ? using an union Expression in XPath 2

  


Hallo, I'm using XPath for a long time by MSXML, now I tested some xml access with XmlDocument and have a problem with using XPath2.
 

This one works:

DOMDocument doc2 = new MSXML2.DOMDocument();
MSXML2.doc2.loadXML(xmlText);
MSXML2.IXMLDOMNode node = doc2.selectSingleNode("bla1/bla2/(ytype|xtype)");



This one works not:

XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xmlText);
XmlNode node = xmlDoc.SelectSingleNode("bla1/bla2/(ytype|xtype)");


Is there any explanation? Which class should I use in .NET for XPath 2 XML access ?

Best regards

Roy


MSXML2 or XmlDocument ? using an union Expression in XPath 2

  


Hallo, I'm using XPath for a long time by MSXML, now I tested some xml access with XmlDocument and have a problem with using XPath2.
 

This one works:

DOMDocument doc2 = new MSXML2.DOMDocument();
MSXML2.doc2.loadXML(xmlText);
MSXML2.IXMLDOMNode node = doc2.selectSingleNode("bla1/bla2/(ytype|xtype)");



This one works not:

XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xmlText);
XmlNode node = xmlDoc.SelectSingleNode("bla1/bla2/(ytype|xtype)");


Is there any explanation? Which class should I use in .NET for XPath 2 XML access ?

Best regards

Roy


How to retrieve conditional XML data using XPath

  

 I have a XMLDataSource somewhat like:

<bookstore>
  <author>author1</author>
  <publication>publication1</publication>
  <book>
    <genre>Thriller</genre>
    <name>ABC</name>
  </book>
  <book>
    <genre>Romance</genre>
    <name>XYZ</name>
  </book>
  <book>
    <genre>Horror</genre>
    <name>000</name>
  </book>
</bookstore>

I am storing these in a asp:formview. I am able to store author and publication values but not sure how can I store the value of book name? Actually I just want to use condition that I need to store "name" if "genere=Romance". something like this. I know we can use contition/expression in XPath method but if it is an attribute like <book genere="romance">. Can someone throw light on this question.


How to retrieve conditional XML data using XPath Expression

  
I have a XMLDataSource somewhat like:
<bookstore>
 <author>author1</author>
 <publication>publication1</publication>
 <book>
  <genre>Thriller</genre>
  <name>ABC</name>
 </book

Binding WPF Controls to an Entity Data Model

  
In this interview, programming writer, McLean Schofield, demonstrates how to bind WPF controls to an entity data model, using Visual Studio 2010 Beta 1. You can also learn more in the topic: Walkthrough: Binding WPF Controls to an Entity Data Model.

Surrogate vs Natural Primary Keys - Data Modeling Mistake 2 of 10

  
In case you're new to the series I've compiled a list of ten data modeling mistakes that I see over and over that I'm tackling one by one. I'll be speaking about these topics at the upcoming IASA conference in October, so I'm hoping to generate some discussion to at least confirm I have well founded arguments.

The last post in this series Referential Integrity was probably less controversial than this one. After all, who can argue against enforcing referential integrity? But as obvious as surrogate keys may be to some, there is a good deal of diversity of opinion as evidenced by the fact that people continue to not use them.

Editing the Data in a GridView

  
In addition to deleting a GridView's underlying data, another common need is to allow end users to edit the data displayed in a GridView. With ASP.NET 1.x's DataGrid control, editing the data is certainly possible, but requires creating three event handlers and writing a dozen or so lines of code. With the GridView and ASP.NET 2.0, it is possible to create an editable GridView without writing a single line of code! All of the necessary functionality is encapsulated within the GridView.

The GridView allows editing on a row-by-row basis. An editable GridView contains an additional column with an Edit button in each row. When the end user clicks on an Edit button that row becomes editable, causing the Edit button to change to Update and Cancel buttons and the other columns to become TextBoxes. The end user can then update one or more column values and click Update to save their changes.

Using ASP.NET 3.5's ListView and DataPager Controls: Displaying Data with the ListView

  
Prior to ASP.NET 3.5, developers who needed to display a set of records could choose between the GridView, DataList, and Repeater controls. The GridView provides rich data features, but has a very boxy layout; the DataList and Repeater allow for a more flexible layout, but lack the "point and click" data features found in the GridView, DetailsView, and FormView controls. The ListView bridges the gap between layout flexibility and built-in data features.

This article, the first in a series of articles on the ListView and DataPager controls, looks at the ListView's many available templates and illustrates how to display data. Read on to learn more!

Dynamic Data Templates in GridView ASP.NET 3.5

  
At a high level, Dynamic Data Templates can be seen as a system to very quickly build up a User Interface linked with the relevant data model, immediately enabling you to perform CRUD operations (Create, Read, Update, Delete) on the database using the specified data source. They provide a powerful method for building up these kinds of applications, and I'm going to focus on an overview of what Dynamic Data Templates actually are, and a few ways of customizing them to suit industry needs.

MS SQL Server: Search All Tables, Columns & Rows For Data or Keyword Query

  
If you need to search your entire database for specific data, this query will come in handy.

So when a client needs a custom report or some sort of custom development using Great Plains, most of the time I will have to track down the data in the system by running this query and find the table(s) it is in.

Displaying Data using ASP.NET 2.0 Repeater and C#

  
This tutorial will show you how to display data using the .NET Repeater Control, ASP.NET 2.0 and C#.NET


The Repeater control is a powerful tool and is easy to use.

First, you will need to import the System.Data.SqlClient namespace.

MVC architecture in ASP.Net using C# and Microsoft Data Access Application block

  
The Model-View-Controller (MVC) pattern separates the modeling of the domain, the presentation, and the actions based on user input into three separate classes [Burbeck92]:

Model. The model manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller).

View. The view manages the display of information.

Controller. The controller interprets the mouse and keyboard inputs from the user, informing the model and/or the view to change as appropriate.
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend