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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Adding a full node to an existing XML document on a by xpath specified location

Posted By:      Posted Date: September 15, 2010    Points: 0   Category :ASP.Net
I want to add a complete node to an existing XML document.So:1. get the XML document from the session2. create a new node3. pass the node and the session to a function, that adds the node on the location of the xpath4. return the new session, updated with the node in the specified locationBelow my code, which DOESNT work.I've had some other advices, but nothing seems to work. What am i doing wrong?!?!Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load    Dim doc As XmlDocument = New XmlDocument()    Dim xmldoc As XmlDocument = Session("XML") 'get XMLdocument from session    Dim locationNode As XmlNode = doc.CreateElement("location")    Dim locationAttribute As XmlAttribute = doc.CreateAttribute("id")    locationAttribute.Value = "3"    locationNode.Attributes.Append(locationAttribute)    Dim titleNode As XmlNode = doc.CreateElement("title")    titleNode.AppendChild(doc.CreateTextNode("Empire State Building"))    locationNode.AppendChild(titleNode)    doc.AppendChild(locationNode)    Dim newNode As XmlNode = doc.ImportNode(locationNode, True)    AddOrUpdateNodeInSession(Session, "//root/dat

View Complete Post

More Related Resource Links

Getting "A domain group is missing for one or more services" error when adding new node to existing


Hey all,

Current configuration:

2-node sql 2005 cluster

windows 2003 enterprise R2 w/ sp2 x64

sql 2005 enterprise x64 SP3


In the process of adding a third node into the existing 2-node cluster, we received the

"A domain group is missing for one or more services.  To install SQL 2005 as a failover cluster, domain groups must be specified for all the clustered services bing installed. To proceed, enter the missiong domain group information." 

The existing cluster functions properly and has been running w/o problems for a long while now.  An AD Global Group was created to support the cluster back when the cluster was initially created.


I found different suggestions from people online about this issue, any where from adding registry keys to take trailing blank space from sql resource group name, but none works. 


Any ideas?


Thank you in advance for any assistance.



adding a node to existing SQL Server 2000 cluster


We have a SQL 2000 cluster pair, say node A and node B. The node B has been corrupted and now the SQL instance is running only on node A. The node B has been rebuilt from scratch and OS reinstalled.

Now, we need to add the node B to node A and they should have a SQL cluster pair. Any one can provide any steps how to add this newly built node to an existing SQL 2000 cluster.

Full text search in a Word document



  I´m currently programming a web search application in ASP.Net and having problem with full text searching. My requirements are:

1. Save a byte array from SQL server to word document as a temp file in a server side?

2. How to highlight the string I am currently searching in the Word document and return to the user the sentence with the highlighted string (like on Bing or any other search engines)? Is it possible to fullfill this requirement with full-text search integrated in SQL Server 2008?

Thanks in advance,




The file reached the maximum download limit. Check that the full text of the document can be meaning



I'm facing an issue with the indexing.

I have 1 WFE+Index server+DB server.

Index server is not installed with MS FIlter pack 1.0

When crawling, the there will be document with warning in crawl log:
The file reached the maximum download limit. Check that the full text of the document can be meaningfully crawled.

Documents that with warning are such as doc, ppt, xls, docs, ppts and many others.
However, I view into the successful crawled document, there are doucments with ext doc and ppt.

For large file index, there are MaxGrowthFactor + MaxDownLoadSize required to be added into the index server.

As my understanding is, MS Filter Pack should installed into index server(already did, correct me if i'm wrong).

I looked into the Office SharePoint Seach(CA>Services in farm), if the server is appointed to "Use this server as indexing server", then MS Filter Pack is suppose to be installed into that particular server as well.

At the bottom, there also has another option is "Use all web front end for crawling".

The question here is, IF the option "Use all web front end for crawling" is selected.
Does the WED FRONT END Server required to installed the Ms Filte

Error adding a document library to a site



I am receiving the error "Cannot complete this action.  Please try again"  when trying to add a document library to one of the sites.  This is Sharepoint 2007 SP1.  I seem to be able to do it thru designer but not the web interface.

Does anyone know how to fix this?

web.config - adding css friendly adapters to existing website

Hi Forum,  Please help me with the major headache I've wasted hours trying to figure out!  I have done everything explained in the tuturial to add css friendly adaters to an existing site and still no luck.  I am thinking that it has to do with modifying my current web.config file to use the css adapters.  Problem is, I can't find any specific instructions as to what I have to do to the current web.config file to make the site compatible with the css adapters!  I tried to modify the config file based on what on the example, but nothing seems to work.  Any help would be greatly appreciated!  Thanks, D

Adding a footer to a pre-existing row group

Hi, I want to add a group footer to my report which includes the individual provider name for each page. I have already added a parent row group for details relating to each provider without specifying to include a footer to the row group. When I now add a footer using the insert footer path this places the footer below my row grouping, when I then add the provider field to the footer every page returns the first provider in the list. How do I include the footer to the grouping so ever footer relates to the individual provider type in the main body of the report? Thanks James

Ok, XPath expert... how to access this node??

I need to alter the "something else" attribute in the xml below. The only way the correct 'category' node can be found is by finding the right 'subCat', in this case the subcat with a subCatTypeCode equal to 'B'.<root> <category> <subCat subCatTypeCode='A' /> <features> <item id='5678' attribute='something'/> </features> </category> <category> <subCat subCatTypeCode='B' /> <features> <item id='5678' attribute='something else'/> </features> </category> </root>  If you try to do something like the below, you will end up with the FIRST 'item' node.  XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(sXML); XmlNode node = xmlDoc.SelectSingleNode("//category/subCat[@subCatTypeCode='B']").ParentNode.SelectSingleNode("//features/item[@id='5678']"); Please... how to do this?  Thanks.

Adding second node to SQL Server cluster fails.

I have successfully created a MSCS cluster and I have the SQL cluster up and running on the first node.   When I put the install cd in the second node and go through the install it fails with the error SQL Server Setup has encountered the following error:  Object reference not set to an instance of an object. I'm assuming I get this error because on the cluster node configuration screen the "cluster network name" box is blank.   It won't let me select a name or type a name. The SQL cluster is up and running on the first node.   I can ping the sql cluster network name from both boxes.   The setup shows the installed node and the node I"m trying to add, so I don't see any problem. I have Windows 2008 R2 on both nodes and I'm installing SQL Server 2008 R2.   Any idea how I can get past this error?    Thank you.

Customizing Send To Other Location Functionality for a document library item in Moss 2007

Hi All i have a requirment to customize the Send To Other Location funtionality. while using OOTB Send to Other Location option for a document library item we have  selection like Prompt the author to send out updates when the document is checked in? <input id="ctl00_PlaceHolderMain_ctl01_ctl01_RadShouldUpdateYes" name="ctl00$PlaceHolderMain$ctl01$ctl01$ShouldUpdate" type="radio" value="RadShouldUpdateYes" /><label for="ctl00_PlaceHolderMain_ctl01_ctl01_RadShouldUpdateYes">Yes</label> <input id="ctl00_PlaceHolderMain_ctl01_ctl01_RadShouldUpdateNo" checked="checked" name="ctl00$PlaceHolderMain$ctl01$ctl01$ShouldUpdate" type="radio" value="RadShouldUpdateNo" /><label for="ctl00_PlaceHolderMain_ctl01_ctl01_RadShouldUpdateNo">No</label> how we can set this option in my custom coding based on the user selection. i am not able to understand the functionality of the above option. can any one please explain the above option and let me know how to set this option programmtically in my custom code.   Thanks in Advance  muthu

selecting value from non-existing node

Im using XSL to retrieve a value from XML.Label1.Text = nodeList(0).SelectSingleNode("str[@name=""website""]").InnerTextBut it might be that the node <str name="website"> does not exist for the currently selected parentnode.In that case the above line will throw an error.Is there an easy way to ignore this?So that if no value can be found, just pass an empty string "" to Label1.Text?I tried using ToString, but without luck:Label1.Text = nodeList(0).SelectSingleNode("str[@name=""website""]").InnerText

determining if node contains a value using XPath

I have this document:<doc>    <float name="score">1.0</float>    <arr name="services">        <str>Fotoreport</str>        <str>Exclusive</str>    </arr></doc>I want to check if the node <arr name="services"> contains the value "Fotoreport"I now have this:XPath("arr[@name=""services""]/str[@Fotoreport]")But, that doesnt work....what is the correct XPath?

Adding thrid Node to SS2K8 cluster fails on adding fileshare

I am attempting to add a third node to a two node cluster. I am using the SS2K8 SP1 slipstream I used to successfully install the other two nodes. The new node of the cluster is:  Hardware: Dell R610 blade  OS: Windows Server 2008 R2 Enterprise 64 bit SQL: SQL Server 2008 SP1 64 bit Enterprise. The two node system has been running for months without problems. How do I fix a failure to add a file share for filestream because the value of group was null (Bold Italics below)? I have not found anything on the web that addresses this problem. Brad The bootstrap summary file woes content(s): Detailed results:   Feature:                       Database Engine Services   Status:                        Failed: see logs for details   MSI status:                    Passed   Configuration status:          Failed: see details below   Configuration error code:      0x11428655   Configuration error description: Value cannot be null.  Parameter name: group &nbs

Help needed on XPath Error: System.Xml.XPath.XPathException: Expression must evaluate to a node-set.

Im trying to determine if a value already exists in an XML file. In this case I want to know if there's a node "id" with value 3. But I cant figure out how...XML:<root><data><compare><locations><id>3</id><id>5</id></locations></compare></data></root>XSL:xmldoc.SelectSingleNode("//root/data/compare/locations/id=""3""")Error:XPath Error: System.Xml.XPath.XPathException: Expression must evaluate to a node-set.

add an XML node to an existing XMLdocument

I want to add an XML node (locationNode) to an existing XMLdocument (xmldoc)However, I get the error: The node to be inserted is from a different document context.Which makes sense, but then I dont know how I can do what I want.Here's my code:Dim doc As XmlDocument = New XmlDocument()Dim locationNode As XmlNode = doc.CreateElement("location")Dim locationAttribute As XmlAttribute = doc.CreateAttribute("id")locationAttribute.Value = "3"locationNode.Attributes.Append(locationAttribute)'doc.AppendChild(locationNode)Dim titleNode As XmlNode = doc.CreateElement("title")titleNode.AppendChild(doc.CreateTextNode("Opera house"))locationNode.AppendChild(titleNode)xmldoc.AppendChild(locationNode)contents of xmldoc:    <root>    <data>        <compare>            <locations>                <location id="4">                    <title>Empire state building</title>                </location>                <location id=&quo

Issue Adding a new Lookup Field to an existing List Instance

I have a code base that houses all of the column, content types, template, and list instance definitions. Am using the Update functionlaity a lot from version to version. Has been working well to this point. I just added two new columns (fields), one a Lookup and the other a Multi-Lookup. The fields are added fine on the update, columns look correct and the content type to which these were added also look fine. I can create a new List instance from the content type, and the new lookup columns are fine. The problem is this. Any existing list instances that were created from this same content type, now blow up when I try and access list items via the SP GUI. Something about a valid GUID, I dont't have the exect error anymore, but will repost it when I recreate the issue for the tenth time. I tried deleting the new lookup fields from this new list instance, thinking that I might be able to re-add them to fix the problem, but I get a new stack trace when I try and re-add them. Any hints on where I can start digging would be appreciated. I think I'll start with comparing the list instance schemas between an existing list and a newly created one.  
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