adding namespace for an XPathDocument

I have read the messages about adding namespaces, but have not found how 
to do so when using an XPathDocument instead of an XmlDocument.

I have an application that writes a dataset using WriteXML. The file 
contains a default namespace. A second application reads the file using 
the XPathDocument Load method. My Select expression will not work with 
the default namespace.

I am very new to this and would appreciate any help!
LuAnn

0
9/8/2003 9:34:22 PM
dotnet.xml 7266 articles. 0 followers. Follow

1 Replies
379 Views

Similar Articles

[PageSpeed] 58

Found the answer...

XPathDocument doc = new XPathDocument( "name of XML file");
XPathNavigator nav = doc.CreateNavigator();
XmlNamespaceManager ns = new XmlNamespaceManager( nav.NameTable);
ns.AddNamespace( "usr", "http://tempuri.org/Users.xsd");
XPathExpression expr = nav.Compile( "//user:Users");
expr.SetContext( ns);
XPathNodeIterator nodes = nav.Select( expr);

The XPathNavigator object has a NameTable property. Hope that is helpful 
to anyone having the same problem I was having.
LuAnn


LuAnn Bradford wrote:
> I have read the messages about adding namespaces, but have not found how 
> to do so when using an XPathDocument instead of an XmlDocument.
> 
> I have an application that writes a dataset using WriteXML. The file 
> contains a default namespace. A second application reads the file using 
> the XPathDocument Load method. My Select expression will not work with 
> the default namespace.
> 
> I am very new to this and would appreciate any help!
> LuAnn
> 

0
9/8/2003 11:54:06 PM
Reply:

Similar Artilces:

Lookup function together with adding up column values
This is a multi-part message in MIME format. ------=_NextPart_000_0013_01CA9E03.97997EB0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Dear experts out there, I would highly appreciate some assistance of my financial Excel = compilations below Period from (date) 2010-01-01 (Swedish format - yyyy-mm-dd, user = input)=20 To (date) 2010-01-25 (Swedish format - yyyy-mm-dd, = user input)=20 =20 =20 BALANCE SHEET January 25, 2010 =20 =20 Brought ...

Adding information
I have created a form which the user adds data to, on a button click procedure I want the data to be check and then added to a spreadsheet. I dont know how I would go about placing this data in the write spreadsheet, in the ocrrect place. I would need to place the data at the end of the data already there. So i need to check where the last entry is write ?? also i am having issues with Sheet("wksmain").Select where wksmain is the name of the sheet. any ideas would be greatful for any help. -- bach ------------------------------------------------------------------------ ba...

Adding a worksheet and making it sheet1
Now that my masterpiece workbook is nearly complete with 7 worksheets and pages of VBA code, I now would like to add a sheet that is displayed only if the Security level does not allow macros. I would like to display a message on changing the Security setting on the sheet, and it should be the default sheet displayed initially. This page could be hidden using VBA code which is the test for the Macro Security level...if it doesn't hide, the level is set too high. The question is...first is this the best way to do this? But more importantly can I add a sheet and make it the first she...

Adding Barcodes to Publisher
Anyone know how to mail merge into Publisher and add bar codes, as in the Word mail merge wizard? Thanks for the help! -- Imoctar While in a state of withdrawal waiting for components to arrive to repair his dead laptop, Ed notices a message from "Imoctar" <imoctar@hotmail.com>. > Anyone know how to mail merge into Publisher and add bar codes, as in the > Word mail merge wizard? You might try this article: http://office.microsoft.com/en-us/assistance/HP011269721033.aspx (US-specific - different rules and fonts are used elsewhere) -- Ed Bennett - MVP Microsoft Pub...

adding one colum up with referance to a second
Hi In a spread sheet I have I want to add the numbers of one column while a number in a second column is below 18 the reference is in column "E" and the data I need to add is in column "I" Thanks Jon Details? -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett1@austin.rr.com "jon" <jon@nospam.com> wrote in message news:4b111067$1_1@glkas0286.greenlnk.net... > Hi > In a spread sheet I have I want to add the numbers of one column while a > number in a second column is below 18 > the reference is in colum...

adding a toolbar to a specific query
I am wondering if there is a way to add a customized toolbar to a specific query. I have a query, accessed through a switchboard, that I want users to be able to export to excel (I created a macro). When I try to do it, it makes the toolbar available all the time, not just for this one query. Am I trying to do the impossible? Linda Linda wrote: > I am wondering if there is a way to add a customized toolbar to a > specific query. I have a query, accessed through a switchboard, that > I want users to be able to export to excel (I created a macro). When > I try to do it, it ...

Adding a "." to the end of a field
On a report, i'm trying to add a ".", at the end of a field with a phone number input mask. I've tried several things to no avail. Any help would be greatly appreciated. I'm trying to make it appear as follows: If you have any questions, please feel free to contact me at (Phone Number). Thanks in advance for your help -- Scott Scott Since you are working in a report, you don't need to mess with the data to get that done. In a control that will hold your message, type the following into the Control Source property: = "If you have any questions, p...

Adding running total to union query
I posted this before and thought I had a solution. Unfortunately, it became too large and I received a "Query is too complex" error, so now I'd like to try a different approach... I have created a Union Query to consolidate results from separate queries, each one of which represents results for a single month: SELECT ReportMonth, MonthlyRev, MonthlyCost FROM qryMonth1Total UNION SELECT ReportMonth, MonthlyRev, MonthlyCost FROM qryMonth2Total UNION SELECT ReportMonth, MonthlyRev, MonthlyCost FROM qryMonth3Total; etc. (12 months total) This gives me the following results: ...

Automatically adding Vertical lines after certain points in line graph
Hi, I'll get right to the point. For my X series I have 7 consecutive dates. For my Y series I have different values representing a disease index. An example for the Y series would be 5, 12, 23, 27, 35, 42, 58. I need to some how have a vertical line drawn after every 18th index, so at 18, 36, 54, 72, etc. It doesn't necessarily need to be drawn at that exact value, it could be drawn every time that value is reached. Does this make sense??? Any help would be appreciated. Thanks, Matt -- matthoffman33 ------------------------------------------------------------------------ ...

Adding Horizontal Lines to a stock chart
How do I add horizontal lines to a stock chart using vba? What i am trying to do is this: I am pulling historical stock data for a certain time frame and displaying it in an excel stock bar chart. I also have levels which i want to display on this chart, but can not figure out a way to do it. Does anyone have any suggestions? Thanks! Mike Combine these two methods: http://peltiertech.com/Excel/Charts/AddLine.html http://peltiertech.com/Excel/Charts/StockChartPlus.html - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - ht...

Adding numbers from multiple worksheets using same format
Hi, I have a question about using Excel to add data from multiple worksheets. I am a salesman and have a daily report I have to email in (using an Excel worksheet) each night. The form is set up to hold one pay period of data (or two consecutive weeks, Mon. through Sat.) The form is set up to add the daily numbers for a given set of categories on a weekly basis. There is a place for the sum of each category for week 1 of the pay period and a place for the sum of each category for week 2 of the pay period. Then there is a place where the totals for both weeks are added together for the grand to...

Import Contacts data into AD / GAL
We have a few public Contact lists for various sets of contacts, such as sister companies. Unfortunately, we also have all our own internal contact info there, including helpful additional information like home office addresses, fax numbers, cell phones, etc. I'm looking for a way to import the data into AD. I don't immediately see a way to do this en masse. I don't want to cut and paste, or delegate that to someone else. -- Greg Stigers, MCSA remember to vote for the answers you like Check out CSVDE or LDIFDE. http://www.microsoft.com/technet/prodtechnol/windowsserver20...

Store Crash when adding Org-Form
Hi *, I have got a pretty weird problem on Exchange 2003 running on SBS2003 (fully patched) I tried to create a new Org-Form in Exchange System Manager: Show System Folders, Select EFORMS Registry, Add Form -> I entered a name and selected a language (german). -> OK.... The System Manger froze. Eventlog: Microsoft Exchange Server , ID 1000 Faulting application store.exe, version 6.5.7650.28, stamp 43dfe228, faulting module exoledb.dll, version 6.5.7638.1, stamp 430e810e, debug? 0, fault address 0x000e0ea4. Application Hang ID 1002 Stillstehende Anwendung mmc.exe, Version 5.2.3790.1...

Adding and subtracting hours in Excel 2000 worksheet
I'm having some success with the addition part but not with the subtracting part! I have an Excel spreadsheet that is used to keep track of time worked by staff on a weekly basis and I need to keep track of the overtime worked. For example, one staff member has worked 40 hours, 54 minutes and 25 seconds in a week (displayed in a cell as 40:54:25 with the cell formatted as Category: --> Time and Type:--> 37:30:55). I then went to subtract 40 hours from the total hours worked to get the overtime displayed and thats where I'm having the problem. I tried the format of "=F9 -...

Adding
...

NDR Attacks... trying to enable Filter Recipients not in AD
I've got all the setting in both my SMTP and Message Delivery Properties but it doesn't seem to be working. I'd rather not restart my server. Is there a service that needs to be restarted to make this work? I've stopped and restarted SMTP with no luck. Spammers should rot in hell for this stuff! Thanks See http://www.msexchange.org/tutorials/Sender-Recipient-Filtering.html "Tom O." <TomO@discussions.microsoft.com> wrote in message news:217BF80E-E6E7-4135-B2F7-213265E6A436@microsoft.com... > I've got all the setting in both my SMTP and Message ...

adding cells in time format
I was looking for some ideas on how to add up cells that contain time vaulues. I work with peoples shifts and hours and I want to be able to add up in any given day, how many 7-330 shifts, 8-430...shifts that I have on each day. How can I get Excel to add down each column representing each day of the week giving me the number of shifts per day? Thanks. It would help to see some example data and results. -- HTH RP (remove nothere from the email address if mailing direct) "Vinnie@bby" <Vinniebby@discussions.microsoft.com> wrote in message news:E060402C-A3D9-4A36-A7BB-A...

AD New Mailbox Not Created
When creating a new user account in AD...on our 2003 Exchange Server, the mailbox does not show up in properties or in system manager mailboxes. There are no errors in the application logs or reported anywhere else. How do we manually create a mailbox, now that we have a user?? Or How do we fix why AD users is not creatinhg a mailbox?? Thanx, Kevin 2 possible answers, depending on your situation. 1. To create the mailboxes, you must have the Exchange System Manager tools installed on the server / workstation that you are creating it from. Otherwise you will only be able to create...

MX Record for our External site in AD?
We have a domain on Internet as YYY.COM, and our internal at YYY.LOCAL Our Exchange 2003 server is available at MAIL.YYY.COM Do I need an MX record in our internal YYY.LOCAL Active Directory integrated domain? The reason I ask is that it seems to work without it for last 3 weeks since initiation. Can someone clarify some key concepts here for me - thx MX records are specifically used to locate mail exchangers given a domain name. In your example, someone sends mail to yyy.com. A DNS query is sent for MX records registered for yyy.com and a host is returned. That host is used to rout...

Adding Character Question
This is my first post on this forum. Thanks for having me. I have a se of data consisting of tracking numbers and locations. For example: A1 B1 54321568 California 33258469 Maine 77894965 Florida I want to insert a character (/) between A1 and B1 then be able to cop and paste my data into Microsoft Word so it will look like exactl this: Tracking number (Space) / (Space) Location: 54321568 / California 33258469 / Maine 77894965 / Florida I used this formula =(A1&"/") and it worked in Excel but this made m data, when pasted into Word look like: 54321568/...

Adding contacts and spam requests from multiple contacts.
I've had this problem for years and its gradually got worse and worse. Whenever I add a contact to my messenger it fails to add them properly, right clicking only gives me the option to "send email" to the person, I then delete the contact and add them again for it to show as "send offline" The contact never comes online though, I've tried this with multiple people and multiple accounts and the only way I can add and chat with someone as normal who is new is if they add me first and I get a add request from them. I also seem to get hundreds of reques...

1.2 and 3.0 on the same AD
can 1.2 and 3.0 co-exist on the same Active Directory environment? Yes, but they need to be installed under different OUs. -- Matt Parks MVP - Microsoft CRM "Joel" <odurasler@yahoo.com> wrote in message news:e86Wrw7FGHA.1032@TK2MSFTNGP15.phx.gbl... can 1.2 and 3.0 co-exist on the same Active Directory environment? ...

adding error bars to graph in XL2007
So, am I just missing something or is this really as terrible as it seems to me? I'm trying to add error bars to a graph, and take the size of the error bars from the same spreadsheet as the data points, from the column right next to data point values. So I try to use the "Custom Specify Value" thing, and browse over to the spot on the spreadsheet. But the dialog is on top, and then there's the little floating box with the button on it. And I can't *see* the spreadsheet section with the data on it, because the dialog is hiding it and I can't move the dialog, becau...

Adding Mailboxes
When I add a user in the AD on the DC and then I go to the exchange server and I right click and go to exchange tasks, I dod not get an option to add a mailbox for the user. I only get "Remove Exchange Attributes" option. Can someone tell me what I am doing wrong. Thanks. Add the user using Active Directory Users & Computers on the Exchange server. There's no reason to do these tasks separately on 2 servers. Either that, or install the Exchange System Tools (Exchange System Manager) on your DC - this will extend the capability of ADUC to be able to create mailboxes a...

adding items to calender
I have my budget all set up with the expenses and income. I go to the calender page and do the setup bills and deposits. When I enter a bill into the calender, it automatically adds it to my expense budget and I don't want it to, because I already have that item in the budget. Example: I have $95.00 budgeted for my PPL bill (electric). I go to the calnder, put the PPL bill on the 17th of the month(when it's due). I go back to my budget and now I have PPL listed twice for $95.00. If I erase it, it takes it off my calender. Someone please help and tell me what to do. Thank you. ...