473,473 Members | 4,185 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

XLINQ to Query and Validate Parts?

I have a document that looks like the below. In the .NET 2.0 days, I
might use an XmlDomDocument to read the whole thing to see if it is a
basically good XML document. Then I might step through it with a
reader of some kind.

The entire XML document is now huge. Way too big to go into a DOM
document for parsing.

I was wondering if I could use LINQ for XML to query the "level_1"
parts to put each of them into something I can test, like a new
object.

Thanks.



<?xml version="1.0" encoding="UTF-8"?>
<Feed>
<level_1>
<url>http://www.aaaaaa.com</url>
<urlalt>http://www.aaaaa.net</urlalt>
<title>title from one</title>
<desc>description from one</desc>
<richdata>
<![CDATA[
this is rich data from one
]]>
</richdata>
<subdata>
<subdata_a>
<title>sub-a</title>
<info>sub-a information</info>
</subdata_a>
</subdata>
</level_1>
<level_1>
<url>http://www.bbbbb.com</url>
<urlalt>http://www.bbbbb.net</urlalt>
<title>title from two</title>
<desc>description from two</desc>
<richdata>
<![CDATA[
this is rich data from two
]]>
</richdata>
<subdata>
<subdata_a>
<title>sub-b</title>
<info>sub-b information</info>
</subdata_a>
</subdata>
</level_1>
</Feed>
Jun 27 '08 #1
1 1600
coconet wrote:
I was wondering if I could use LINQ for XML to query the "level_1"
parts to put each of them into something I can test, like a new
object.
If I understand you correctly then the document contains other elements
besides the "level_1" elements and you only want to store the level_1
stuff. In that case have a look at the approach described in
http://msdn.microsoft.com/en-us/library/bb387008.aspx, it shows how to
use the ReadFrom method to read an XML fragment from an XmlReader.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Jun 27 '08 #2

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

Similar topics

7
by: Ali-R | last post by:
Hi all, I am getting a CSV file like this from our client: "C1","2","12344","Mr","John","Chan","05/07/1976"......... I need to validate **each filed value** against a set of rules ,for...
6
by: RSB | last post by:
Hi Every one Need some help to Validate the Date i have in the Form. ALso how to Convert the Date Data i read from table to yyyy/MMM/dd format. Thanks RSB
3
by: george.lengel | last post by:
Hello experts, I have been struggling for days to solve this problem and every suggestion I find via Google does not work for me. There is probably a solution out there that will do what I want,...
4
by: UKuser | last post by:
Hi Guys, I am trying to create an editable table of a MySQL query where every field can be updated. My example script is at: http://nana46.coconia.net/test4.php however I am currently getting...
4
by: uspensky | last post by:
I have a table (cars) with 3 fields: VIN, Class, sell_price 101, sports, 10000 102, sports, 11000 103, luxury, 9000 104, sports, 11000 105, sports, 11000 106, luxury, 5000 107, sports, 11000
0
by: Marc Scheuner | last post by:
Folks, I'm faced with a dilemma here - I have an XML document and for part of it, I have an XSD schema to validate it - but not for the rest of it. Can I still validate at least part of the...
8
by: Briansmi1116 | last post by:
I have a downloaded Access template I am trying to use. I am having a problem tying to add to the query. I am still learning so any help would be great. The SQL follows. SELECT DISTINCTROW...
0
by: Don | last post by:
I am attempting to build a Schedule with the help of XLINQ in VB using VSTS 2008 RTM. I have a collection of activities described in XML that have startTime and endTime of type Date (only time of...
4
by: acgritt | last post by:
I am looking for some information on if it is possible/how to create a dynamic XLinq statement. I know for Linq to SQL you can do the following: var query = db.Customers. Where("City = @0 and...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
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...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.