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>
0
coconet (2)
5/28/2008 8:16:28 PM
dotnet.xml 7266 articles. 0 followers. Follow

1 Replies
730 Views

Similar Articles

[PageSpeed] 9

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/
0
mahotrash (1777)
5/29/2008 11:38:17 AM
Reply:

Similar Artilces:

create one table from six queries
I have an excel report which draws data from access. The excel table looks like this: Each project is reviewed by two people Reviewer Name | Reviewer1 | Reviewer2 | Total last 12 months AA x y x+y This is repeated for 3 months and 1 month (so the querry uses a date between to work that out) x is a create-tabel query and so is y. I want to create one table for these queries (in total 6 per reviewer) and import that table into excel. I would also need to add the reviewer 1 and 2 in the table so as to import it in one go. Can you help ...

Query Question
my data looks like the following 111 0 01/01/2007 111 0 02/01/2007 222 0 04/01/2007 222 0 05/01/2007 555 1 06/01/2007 666 0 06/01/2007 how can i retrieve the following??? 111 0 01/01/2007 222 0 04/01/2007 555 1 06/01/2007 666 0 06/01/2007 my goal is to retrive distinct cols 1 and 2, and then the earliest date in col 3 for distinct records in cols 1 and 2??? any suggestions??? I tried different ways of using FIRST, but was unsuccessful. Thanks in advance. Jeff How is this a "reports" newsgroup question? Take a loo...

Part number surrounded by quotation text qualifier imports as a number not text
I am trying to import a comma delimited text file which contains among other information, a numeric part number (ie 00123). I surround the part number with quotes and import indicating use quotes a text qualifier. No mater what I do, Excel still refuses to import this data as text, it always converts it to a number (123). This is an issue because this Excel file will be going into another program which will be using that field in table relationships. Can't fix it after the fact because all of the part numbers are different (00123, 0001., 1234A, etc...) I have turned off all error checking ...

Send 900 Billion valid Emails in Just 5 Minutes Only!
...

SPECIAL QUERY
HI ALL! I have a table with following 3 fields: Account_1, Account_2, Amount Any query that would result into following layout? Account (Containing Unique Names From BOTH Account_1, Account_2) Amount_1 (Containing Amounts of Accounts Listed In Account_1) Amount_2 (Containing Amounts of Accounts Listed In Account_2) For instance, consider the following sample: Account_1, Account_2, Amount ====== ======= ===== AccountA AccountB 1000 AccountC AccountA 2000 AccountB AccountC 3000 To be generating a result as follows: Account, Amount_1, Amou...

One Query as datasource??
I have three different tables that cannot be combined using a Union query due to efficiency. I would like to use a form to select the table or query to use and have one query that I can use as the primary datasource. Is this possible? If so, how? Have a form with two (three) subforms, each subform with data from one of the table. If there is no link between the data, have no parent-child link (or even have no table for the main form). Vanderghast, Access MVP "hshepardjr" <hshepardjr@discussions.microsoft.com> wrote in message news:E9CB8EB1-C421-4927...

Query Formula Help
I have a field "Last Contact Date" in a query. I need to create a formula to show me the records that have a last contact date more than 30 days old. Any thoughts??? Thanks. WHERE DateDiff("d", [YourTable].[Last Contact Date], Now()) > 30 HTH; Amy "Jimmy" <Jimmy@discussions.microsoft.com> wrote in message news:820174F0-445C-472D-8B1C-F6711482D8C0@microsoft.com... >I have a field "Last Contact Date" in a query. I need to create a formula >to > show me the records that have a last contact date more than 30 days old. > Any ...

DDL Query execution
Hi all, how can I execute a large amount of DDL Queries on Access 2000? I've a DDl/SQL Script file which defines a data structure with CREATE TABLE, ALTER TABLE UPDATE TABLE, etc. etc. I know how to execute this script on MySQL, MS Sql Server, but don't know how execute it on access 2000 :( Thank you all. Bye Ale On Nov 9, 7:12 am, Ale <alkon...@freemail.it> wrote: > Hi all, > how can I execute a large amount of DDL Queries on Access 2000? > > I've a DDl/SQL Script file which defines a data structure with CREATE > TABLE, ALTER TABLE UPDATE TABLE, etc. etc....

Importing multiple XML queries into Excel
I am trying to import multiple XML queries into Excel and cannot import more than one at a time. I have a list of queries and am using the XML feature to pull the data. Unfortunately, I have to cut and paste each query and then import them individually. Does anyone know how to automate this process or if there is an easier way to import batches? -- Thank you in advance for the help. I need it! ...

Queries
Hello everyone! Please help. I am creating a Thank You Receipt and would like to create a query for those who donate only one time a year. Also I would like to link the name and addresses of the people. Thank you all so much. Hi how do you have your data stored. Please post some example data (plain text - no attachment please) -- Regards Frank Kabel Frankfurt, Germany Therese wrote: > Hello everyone! Please help. I am creating a Thank You Receipt and > would like to create a query for those who donate only one time a > year. Also I would like to link the name and addresses ...

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....

Using 3 queries in one report
Access 2007 I am trying to create a monthly inventory report that lists the Product Name, Beginning Balance, Sales, Purchases and Ending Balance, which is a calculated field, in rows sorted by product name. My problem is getting all the information from the Beginning Balance query, Sales query and Purchases query to list all the information from all 3 queries even if there is no data for one of them. I can make this work with only 2 queries, but I can't seem to make it work for 3 queries. Everything I try links all the fields so I only get the records that show data that is in eac...

How do I hide part of a data series in a chart?
We have a chart with 2 data series - Budget & Actual. We want to show all 12 months of the budget, but only the year-to-date months of the actual. The problem is the data cells for the future actual amounts have formulas in them so the chart use the result and plots the line. We do not want to delete the data (which will require manual input each month, we just want the actual data series line to not show for the future periods. We tried using IF statements with 0, "", " " and an alpha character, but these have not worked. -- Jeff Hi Jeff: You can set up yo...

Method Add of object Validation Failed
I am getting error on the add method on validation - Method Add of object Validation Failed - please help Me.Unprotect With Sheet1.Cells(1, 1).Validation .Delete .Add xlValidateList, xlValidAlertWarning, , Lst <<<< Error here!!!!! .ErrorMessage = "Please select an Employee from the list" .ErrorTitle = "Select Employee" End With You have a response at one of your other posts. Shokie wrote: > > I am getting error on the add method on validation - > > Method Add of object Validation Failed - please help &g...

search query from a button in a form
I have created a button in a form that will be used to search from a table. I have three different queries made to search from that table. When I push the button to run the macro which in turn runs the 3 individual queries, it just creates the results in 3 individual windows. I would like it to save the results all in one window, how can I do this? Thanks much in advance! Has to be one query to get one result. -- Dave Hargis, Microsoft Access MVP "wspintern" wrote: > I have created a button in a form that will be used to search from a table. > I have three diffe...

Simple Select Query
I am trying to perform a select query to select all records that are NOT in both tables. So I have tblPROJHIST and tblWMSNEW and they both have project # fields. What I am trying to do is find all the new project # records in tblWMSNEW that are not in tblPROJHIST and put them in tblPROJHIST. Thanks If the tblPROJHIST project # field is a unique index or primary key field, just do an append query from tblWMSNEW into tblPROJHIST. The unique index or primary key will prevent duplicate project #'s from being added to the table. You should get an error message saying how many record...

Conditional Formatting Query
Hi I'm facing a problem from last month but I'm not able to put conditional formatting with Icons. If somebody can help as its really urgent for me !!!!! I have values for two months - Current and Previous. If current month's value is closer to zero than previous month's value then i want to show a green arrow. If current month's value is away from zero than previous month's value then i want to show a red arrow. Though these values are positive and negative both, i need to apply conditional formatting on absolute values. e.g. previous Cur...

Query Problem!
How would I query this ChargeDate,ChargeItem,ChargeAmount [ChargeDate] >Date()-365 [ChargeItem,ChargeAmount] No Duplicates , 2 fields together No Duplicate Thanks if you can Help On Wed, 15 Aug 2007 17:44:55 +1200, "Bob V" <rjvance@ihug.co.nz> wrote: >How would I query this >ChargeDate,ChargeItem,ChargeAmount >[ChargeDate] >Date()-365 >[ChargeItem,ChargeAmount] No Duplicates , 2 fields together No Duplicate SELECT DISTINCT ChargeItem, ChargeAmount FROM [someunspecifiedtablename] WHERE [ChargeDate] > DateAdd("yyyy", -1, Date()) If you wan...

Hyperlink in query?
Is it possible to make a value displayed in a query into a hyperlink? For example we have a query that lists the sales invoices relating to each of our orders, and it would be great to be able to click on a sales invoice number and fire up the saved image of that invoice. Can do? Many thanks CW Sure. But not in a query. Use a form based on the query. You can even use datasheet view so it looks like a query output. Now you need to tell me what the output is. I'll assume and Access report, and it could be as simple as: DoCmd.OpenReport "Invoice", acViewPreview, , &q...

How To Use Remote_Host in a query?
Using SQL2005 - I have a table with these fields. USERID, NAME. IPaddress. I know that I can get the user's IP address from the HTML header REMOTE_HOST. I need some help with the query. Select USERID, Name FROM table WHERE IPaddress = REMOTE_HOST How do I match the IPaddress to the REMOTE_HOST? It seems so simple but I can't seem to get it. Any help is greatly appreciated. -- Message posted via http://www.sqlmonster.com Chamark via SQLMonster.com wrote: > Using SQL2005 - I have a table with these fields. USERID, NAME. > IPaddress. I know that I can get the u...

look up query
I have two worksheets. They are both identical with an exception of on column which is on my summary table. The tables are as follows: data table: job_no; patient; hospital; fault; req_date; rec_date; This table contains all the records from every job we have received. summary table: job_no; patient; hospital; fault; req_date; rec_date; ACTION; This table contains a sample of the data in the 'data table'. I add actions to each job on this table. I need to know how to create a lookup so it will take the ACTION from the 'summary table' and add it into a new column in the ...

Goto Data validation Same ERROR
Hi, I'm puzzled by this process: I click Edit/GoTO/special/ data validation/ Same and several cells are found. With these cells still selected, I click menu item Data/Validation and receive the warning "The selection contains more than one type of validation. Erase current settings and continue?" Why would these cells have been selected if they had DIFFERENT data validations???? Thanks for any input -Kate Kate, The Goto - Special - Data Validation identified any cells with any type of Data Validation settings. They don't have to have the same data validation se...

LIST OF SQL QUERIES FOR RMS
This is a multi-part message in MIME format. ------=_NextPart_000_0000_01C896C6.7DD0DC30 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit IS THERE A LIST OF SQL QUERIES FOR USE WITH RMS. FOR EXAMPLE HOW TO CANGE BARCODE TYPES WITH A QUERY ECT. ANY HELP WOULD BE APPRICIATED. ------=_NextPart_000_0000_01C896C6.7DD0DC30 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <html xmlns:o=3D"urn:schemas-microsoft-com:office:office" = xmlns:w=3D"urn:schemas-microsoft-com:office:word" = xm...

LINQ(DLINQ,XLINQ) - XML
Greetings, i want to be able to use linq new technology with sql server. the senario i am not able to do so far is as follow: 1- i program with linq 2- be able to generate and manipulate xml files 3- all this xml files are stored in Sqlserver for those who are not familiar with linq http://msdn.microsoft.com/data/ref/linq/ u can still help me by mentioning orignal ways of working with xml files through sqlserver as the database. thanx Sharing makes All the Difference -- Sent via .NET Newsgroups http://www.dotnetnewsgroups.com can anyone help please ??! any ideas ??! Sharing makes All...

Timer for Queries?
Does anyone know of a macro or add-on that I could use as a simple timer for queries? I don't like to use the CPU time in the Task Manager because of it's inaccuracy when not receiving full CPU usage. THanks for any suggestions -- cmungs Exactly what are you trying to accomplish? Are you trying to cause a query to run automatically every so often? If so, you will need to use the timer event on a form to do that. -- Lynn Trapp Microsoft MVP (Access) www.ltcomputerdesigns.com "cmungs" <cmungs@discussions.microsoft.com> wrote in message news:88EC7019-045F-4EF...