|
Please tell me wat's wrong with the code below
I'd try both way in the asp file to delete the childnode in xml but it couldn't work
*** News.xml ***
-------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Edited with XML Spy v4.2 -->
<News>
<Article>
<Head>Test 1</Head>
<Des>Testing 123</Des>
<Date>1/9/2003</Date>
</Article>
<Article>
<Head>Test 2</Head>
<Des>Testing 321</Des>
<Date>1/9/2003</Date>
</Article>
</News>
-------------------------------------------------
*** file.asp ***
-------------------------------------------------
<%
If Request.QueryString("Action")="Delete" Then
Dim strID
Dim objXML
Dim subArticle
Dim objLst
Dim subLst
strID = CInt(Request.Form("selectAnnouncement"))
Set objXML = Server.CreateObject("Microsoft.XMLDOM")
objXML.Load(Server.MapPath("News.xml"))
**** 01 ****
Set objLst = objXML.getElementsByTagName("Article")
Set subLst = objLst.item(strID)
objXML.documentElement.removeChild subLst
**** 02 ****
'Set subArticle = objXML.documentElement.childNodes(strID)
'objXML.documentElement.removeChild (subArticle)
Set childNode = Nothing
End If
%>
-------------------------------------------------
|
|
|
|
|
try saving the file...
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
... and replace "Microsoft.XMLDOM" with "MSXML2.DOMDocument"
optionally followed by a version number, like "MSXML2.DOMDocument.4.0"
|
|
|
|
|
I am having trouble using column expressions to return an aggregate of child rows in a typed dataset. Here is my scenario:
I have two tables defined in my xsd schema: Orders and Order Details. The relevant fields are:
Orders
- OrderID (primary key)
- Total (expression column)
OrderDetail
- OrderID (foreign key)
- Qty
- PricePerUnit
- ItemTotal (expression column: Qty*PricePerUnit)
my problem is that when I try to set the expression property of the Total column in "Orders" to "Sum(Child.ItemTotal)" and then run the dataset generator, I get the following error: The custom tool 'MSDataSetGenerator' failed. Unbound reference in the aggregate expression 'Sum(child.[ItemTotal])'
I also get this error when referencing the foreign key constaint name: Sum(Child(FK_Orders2OrderDetails).ItemTotal)"
The MSDN library says that my syntax is correct (look up DataColumn.Expression property)
Any ideas? Thanks
|
|
|
|
|
Does anyone know of a c++ API function that replaces xml forbidden chars (<>&'") with their respective entity references (i.e, replacing the & chars with &amp; entity) ?
|
|
|
|
|
I've written a spirit (http://spirit.sourceforge.net) grammar that does that.
You can download it at http://iobind.sourceforge.net
|
|
|
|
|
i'm new to xml and i'm using the hlep files trying to read an xml document but i can't get it to work. everytime it tries to access anything in the xmldoc it errors with an unhandled exception.
here's my code:
private void button1_Click(object sender, System.EventArgs e)<br />
{<br />
OpenFileDialog1.ShowDialog();<br />
XmlNodeList nodeList;<br />
XmlDocument doc = new XmlDocument();<br />
doc.LoadXml(OpenFileDialog1.FileName);<br />
<br />
XmlNode root = doc.DocumentElement;<br />
nodeList=root.SelectNodes("members");<br />
<br />
foreach (XmlNode node in nodeList)<br />
{<br />
listBox1.Items.Add(node.Name);<br />
}<br />
}
please help, thanks,
Rob
--
There are 10 kinds of people. Those who understand binary and those who don't. <param name="e" />
<member name="M:Newco.Controls.GroupBoxLine.Dispose(System.Boolean)">
Clean up any resources being used.
<member name="P:Newco.Controls.GroupBoxLine.LineColor">
Specifies the color of the line.
<member name="P:Newco.Controls.GroupBoxLine.TextColor">
Specifies the color of the text.
please help, thanks,
Rob
--
There are 10 kinds of people. Those who understand binary and those who don't.
|
|
|
|
|
stupid thing posted when i hit the 'preview' button. here's the xml source:
<?xml version="1.0"?>
<doc>
<assembly>
<name>Newco.Controls</name>
</assembly>
<members>
<member name="T:Newco.Controls.GroupBoxLineDesigner">
<summary>
Summary description for GroupBoxLine.
</summary>
</member>
<member name="M:Newco.Controls.GroupBoxLineDesigner.PostFilterProperties(System.Collections.IDictionary)">
<summary>
Removes the 'FlatStyle' property for this item.
</summary>
<param name="id"></param>
</member>
<member name="M:Newco.Controls.GroupBoxLineDesigner.OnPaintAdornments(System.Windows.Forms.PaintEventArgs)">
<summary>
Draws a light dashed line around the control in design view to make it more visible.
</summary>
<param name="pe"></param>
</member>
<member name="T:Newco.Controls.GroupBoxLine">
<summary>
Custom control to mirror the look of an Office 2003 groupBox.
</summary>
</member>
<member name="F:Newco.Controls.GroupBoxLine.lineColor">
<summary>
Specifies the color of the line.
</summary>
</member>
<member name="F:Newco.Controls.GroupBoxLine.textColor">
<summary>
Specifies the color of the text.
</summary>
</member>
<member name="M:Newco.Controls.GroupBoxLine.#ctor">
<summary>
Default contructor for the class GroupBoxLine.
</summary>
</member>
<member name="M:Newco.Controls.GroupBoxLine.OnPaint(System.Windows.Forms.PaintEventArgs)">
<summary>
Overrides the OnPaint event to create the look of Office 2003.
</summary>
<param name="e"></param>
</member>
<member name="M:Newco.Controls.GroupBoxLine.Dispose(System.Boolean)">
<summary>
Clean up any resources being used.
</summary>
</member>
<member name="P:Newco.Controls.GroupBoxLine.LineColor">
<summary>
Specifies the color of the line.
</summary>
</member>
<member name="P:Newco.Controls.GroupBoxLine.TextColor">
<summary>
Specifies the color of the text.
</summary>
</member>
</members>
</doc>
--
There are 10 kinds of people. Those who understand binary and those who don't.
|
|
|
|
|
LoadXml expects the string to be the XML
you should be using Load(filename)
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
MindNets
“MindNets” is an organization that is being established for providing support and solution in different fields of IT/Computer Science.
Our Expertise includes:
Web Design and Development, Databases, Networks, Desktop Applications, Business Applications, Image Processing, Biometrics, Science and Engineering.
For Students:
During our final projects, we found that there is very little guidance for students; in working on their projects (software) using latest tools and technologies. This is where the whole idea came to our mind and became the basis of “MindNets”.
For Companies:
In this era, for each and every organization; it’s necessary to transfer its business online. This is so, because it not only helps in expanding the business but also in providing more facilities to the customers.
For this we are providing complete web site design, development and hosting facilities. We are also looking forward to facilitate these companies in building and maintaining efficient LAN/WAN networks.
So feel free to contact us at any time; you need us; as we are to help YOU.
Team:
Khurram Ishtiaq Qazi (Netsol)
(c++, visual c++, java, Oracle 8i, (sql/plsql, Developer6))
Asim Nazir (XavorInt)
(c++, java, visual c#, ASP.NET, Sqlserver 2000, Crystal Reports)
Irfan Yousaf (ICBCS)
(VB6, ASP, VB.NET, ASP.NET, Oracle, Visual C++, Visual Prolog)
Mohsin Ali (TWE)
(Microsoft Certified Solution Developer (MCSD), VB6, Flash)
Aamir Alla-u-Din (Operation Al-Badar)
(Microsoft Certified System Engineer (MCSE NT+2000), CCNA)
Contact:
Mail: mind_nets@yahoo.com
Voice: 0333-4294413
MindNets
|
|
|
|
|
Okay i just upgraded from vs.net 2002 to vs.net 2003 and this error comes up. It worked fine before the upgrade but now this error can someone please help. I even did some error testing i can pull xml from my machince and i can access the file directly. Ahhhh!! whats the problem? Thanks.
"The underlying connection was closed: Unable to connect to the remote server. "
Line 69: {
Line 70: case 0:
Line 71: dataSet1.ReadXml("http://www.w3schools.com/xml/note.xml");
Line 72: break;
Line 73: case 1:
Source File: c:\inetpub\wwwroot\bc\webform1.aspx.cs Line: 71
Stack Trace:
[WebException: The underlying connection was closed: Unable to connect to the remote server.]
System.Net.HttpWebRequest.CheckFinalStatus()
System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
System.Net.HttpWebRequest.GetResponse()
System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials)
System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials) +94
System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) +55
System.Xml.XmlTextReader.CreateScanner() +384
System.Xml.XmlTextReader.Init() +23
System.Xml.XmlTextReader.Read() +530
System.Xml.XmlReader.MoveToContent() +75
System.Data.DataSet.ReadXml(XmlReader reader, Boolean denyResolving) +145
System.Data.DataSet.ReadXml(String fileName) +63
BC.WebForm1.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\bc\webform1.aspx.cs:71
System.Web.UI.WebControls.Button.onclick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain() +1277
Da Intern
|
|
|
|
|
Are you saying that you can access http://www.w3schools.com/xml/note.xml from a browser, but not your ASPX page?
- Mike
|
|
|
|
|
exactly, do you have some ideas
Da Intern
|
|
|
|
|
I have an XML document that in some elements can contain HTML. The document is being sent to a client app via a web service. The HTML contained in the document can contain images. The images have document delative Urls. I want to add the complete url to the image tag. Is there an easy way to do this? I have tried using a regex but have been unable to get it to work. Thanks.
Steve
Not all who wander are lost...
|
|
|
|
|
Hi im trying to use this line of code to create an xml file but it just overwrites it every time or appends to the wrong part. I have tried changing the bool to true and false also tried changing write to writeline nothing works please help.
using (StreamWriter sw = new StreamWriter("TestFile.xml"))
{
sw.Write("<DispatcherQ>" + "<Dispatcher> " + DispID.Text + "</Dispatcher>" + "<CustomerInfo> " + listBox2.SelectedItem.ToString() + "</CustomerInfo>" + "<TaxiInfo> " +listBox3.SelectedItem.ToString()+ "</TaxiInfo>" + "</DispatcherQ>" );
}
Thanks alot,
Da Intern
|
|
|
|
|
Hi
Isn´t XmlTextWriter a better choice?
in VB
Dim wrtXMLWriter As New XmlTextWriter("TestFile.xml", Nothing)
and use .WriteRaw or any other XmlTextWriter-method that works for your purposes.
Regards
Daniel
|
|
|
|
|
okay but i want it to create a new set of elements like this: when i click this button it creates the xml file and the first element then when i click it again it adds the new elements to that xml file.
Da Intern
|
|
|
|
|
You can use XmlDocument.CreateElement and .AppendChild to add your information to your document.
in c++
given that Child,Name,TopElement all are XmlElements
sData is the content, the info in the element;
ChildElement = doc->CreateElement("tagname");
TopElement->AppendChild(ChildElement);
NameElement = doc->CreateElement("tagname");
NameElement->InnerText = sData;
ChildElement->AppendChild(NameElement);
.. or something like that
I guess you have to check in the button_click function if you already have pressed the button and if not -> create a new xmldokument
Regards
Daniel
|
|
|
|
|
Anyone know where to find one? I'm too lazy to make one;) just wanted the news on my site...
// Steve McLenithan
Family Guy: Season 2 - Episode 8
|
|
|
|
|
|
Yeah I have that... I just need a stylesheet to display it properly, and not just a bunch of text. Thanks anyway;)
// Steve McLenithan
Family Guy: Season 2 - Episode 8
|
|
|
|
|
I am creating a few modules for DNN and I want to use an XML file for each one to store the settings. Doing this would greatly reduce the pain of installing the module (not having to mess with DB scripts). I know there is a function that you can use to get the value of a key in the web.config file (can't remember its name...).
How would I go about creating a similar function of my own?
// Steve McLenithan
Family Guy: Season 2 - Episode 8
|
|
|
|
|
|
|
Awesome! That is way better
// Steve McLenithan
Family Guy: Season 2 - Episode 8
|
|
|
|