Well, I'm sorry that someone told you that, because it seems to me that it has to do with how WPF parses XML, not just XML. So, you'll have more luck in the WPF forum. And I suggest that entirely to try to help you find an answer.
I said 'we' because I'm referring to community standards. It's rude to tell us that your question is urgent. If you can't wait for a free answer, find a way to pay for one.
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
I use the following to specify the Uri path for the XmlDataProvider dp:
System.Windows.Forms.OpenFileDialog ofd = new System.Windows.Forms.OpenFileDialog();
if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
string fileName = ofd.FileName;
XmlDataProvider dp = this.FindResource("dpNewDS") as XmlDataProvider;
dp.Source = new Uri(fileName);
Now I want to now, what if I don't want to use an OpenFileDialog to specify the path, but instead I want to specify it myself. I know typing in the folder address e.g C:\xmlfile.xml works fine, but I don't want to hard code the path. I want to keep the file in the "bin" folder, how do I specify the path to this folder?
I tried various methods but none seemed to work.
I recently got it working to bind an XML file to a treeview using a XmlDataProvider, but my problem is that my XML file does not contain attributes which can be easily bound to. Here's a sample of what my XML looks like:
<Product>QQ CORE 2200 X 800 X 1500 X 600</Product>
<Description_x0020_1>CORE 2200 X 800 X 1500 X 600</Description_x0020_1>
<Description_x0020_2>CORE 2200 X 800 X 1500 X 600</Description_x0020_2>
As you can see, ProductRangeID and the ProductRange description are not specified as attributes, but instead as a values between 2 tags each.
The code I'm using in my XAML to bind these are as follows:
This does not give me the output I want though. It lists all the Product Ranges in the treeview, but it displays Product_x0020_range as the header for the root treeview items, then when I expand this item, it then displays the actual ID and description of the product range e.g. 1, Specials.
How can I do my bindings so that "Specials" is displayed as the header for the root treeview items?
Okay I got it working by setting the Binding of the TextBlock Text to "XPath=Product_x0020_Range". Now it displays the correct description. But when I expand this, it shows the description again within the expanded node. Any help here?
I want to create a tree structure like there is a root element and the root contains left and right nodes,again these nodes contains right and left nodes likewise.Here I want this dynamically.How can insert the nodes,delete the nodes.Please help me in this issue.
I am using client WSDL file, i want to generate proxy class from it.
I am using WSDL.exe to generate that proxy class.
But i am getting this error:
Unable to cast object of type 'System.Xml.XmlElement' to type 'System.Web.Services.Description.ServiceDescriptionFormatExtension'.
And I'm quite bugged down in it.
I can most likely fix it using scripts in my XML file and some temporary variables, but I was wondering if it would be possible to either use more pure XSL syntaxt to solve this problem.
The following works (i.e. I've tested it) in Microsoft XSLT - but it. It creates a key containing all 'Price' NAMEVALUE nodes, indexed on the text after 'Price' in the NAMEVALUE/NAME node. This is used in the 'From' NAMEVALUE node template, to establish the linkage between 'From' and 'Price' nodes.
Hi, I'm a bit new to XML schemas and I've run into a scenario that I am unable to discover how to describe in an XML schema. I need to have a shema describe the following two document scenarios (Simplified from my real project)
header elements here
detailed information here
header elements here
different detailed information here
I actually have several different types of detailed information that I need to be able to optionally have in the XML. I know that I can allow for the different information with a choice, but I can not discover how to get the header information into the schema.
One other thing, the hearer must be optional as well.
I'm using an XmlSerializer and TextReader to read some XML:
XmlSerializer ser = new XmlSerializer(typeof(MyClass));
TextReader tr = new StreamReader(filename);
MyClass myClass = (MyClass)ser.Deserialize(tr);
With this I can read the XML and populate the myClass object with simple string values even when one of the myClass members is a class itself. It all works fine up to a point in my XML file which lists multiple messages so the XML is like this:
I can deserialize the application part of the XML into a class member in my MyClass object but I need to deserialize the messages into a Messages class member which is some sort of collection of messages.
Can anyone help? Is there some collection class I can use that will work?
Can anyone tell me how to generate an XML file using a typed dataset?
I have a typed dataset called _WorkStationDataSet. But WriteXml() can not be called direclty from it, I have to create a new instance of it using:
_WorkStationDataSet ds = new _WorkStationDataSet(), but then calling WriteXml() on ds does not create a hierarchical xml file, instead it just puts two lines of xml at the top of the file showing the name of the dataset.
What I also want to know, is say for instance you have 2 tables; Categories and Products. And the relationship between them is one-to-many (A category can have many products). Is it possible to generate an XML file showing all the different categories as well as the products belonging to them hierarchically?