XPath question
-
Let's say I have a complex type defined in the schema: The corresponding XML looks something like this: CalcItemTax Determine the tax on the item CalculateItemTax TaxExempt Flag indicating customer is tax exempt Taxable Flag indicating item is taxable Is there a single XPath statement I can use to extract just the DataSetName and the DSREvent, for example, with both returned as children IN THE SAME NODE??? If I use the '|' operator, I get two nodes for every line. Any ideas? Thanks, Marc Help! I'm an AI running around in someone's f*cked up universe simulator.
Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus
Every line of code is a liability - Taka Muraoka
Microsoft deliberately adds arbitrary layers of complexity to make it difficult to deliver Windows features on non-Windows platforms--Microsoft's "Halloween files" -
Let's say I have a complex type defined in the schema: The corresponding XML looks something like this: CalcItemTax Determine the tax on the item CalculateItemTax TaxExempt Flag indicating customer is tax exempt Taxable Flag indicating item is taxable Is there a single XPath statement I can use to extract just the DataSetName and the DSREvent, for example, with both returned as children IN THE SAME NODE??? If I use the '|' operator, I get two nodes for every line. Any ideas? Thanks, Marc Help! I'm an AI running around in someone's f*cked up universe simulator.
Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus
Every line of code is a liability - Taka Muraoka
Microsoft deliberately adds arbitrary layers of complexity to make it difficult to deliver Windows features on non-Windows platforms--Microsoft's "Halloween files"If I am reading your question right, I think you want to look at the usage of ... to create the data for a single new element that combines the data from the two you had. If you are wanting the elements then I do not understand your question because you do have two elements (or nodes) before and after. edited (check display as is stupid!) "I will find a new sig someday."
-
If I am reading your question right, I think you want to look at the usage of ... to create the data for a single new element that combines the data from the two you had. If you are wanting the elements then I do not understand your question because you do have two elements (or nodes) before and after. edited (check display as is stupid!) "I will find a new sig someday."
Well..., I guess I'm confused. Is XPath and XSL interchangeable? I'm not sure how to set up an XSL query in C# using the XmlDataDocument.SelectNodes method (and I don't really want to get into implementation specifics, I just want to figure out the right XPath command, if one exists!). At this point, I don't even know what the right question is to ask. I basically want something that returns an XmlNode with two children--the DataSetName text field and the DSREvent text field. Seems this shouldn't be so dang hard, and if it's not possible, this seems like a real limitation of XPath. Marc Help! I'm an AI running around in someone's f*cked up universe simulator.
Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus
Every line of code is a liability - Taka Muraoka
Microsoft deliberately adds arbitrary layers of complexity to make it difficult to deliver Windows features on non-Windows platforms--Microsoft's "Halloween files" -
Well..., I guess I'm confused. Is XPath and XSL interchangeable? I'm not sure how to set up an XSL query in C# using the XmlDataDocument.SelectNodes method (and I don't really want to get into implementation specifics, I just want to figure out the right XPath command, if one exists!). At this point, I don't even know what the right question is to ask. I basically want something that returns an XmlNode with two children--the DataSetName text field and the DSREvent text field. Seems this shouldn't be so dang hard, and if it's not possible, this seems like a real limitation of XPath. Marc Help! I'm an AI running around in someone's f*cked up universe simulator.
Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus
Every line of code is a liability - Taka Muraoka
Microsoft deliberately adds arbitrary layers of complexity to make it difficult to deliver Windows features on non-Windows platforms--Microsoft's "Halloween files"Marc Clifton wrote: Is XPath and XSL interchangeable? The straight answer to that is no. XPath is a thecnique that is used in XSL transformation to identify what it is to work on. Now that what can be in respect to the whole document. I.E. what element to start with and it can be relative to its starting point or the element it that is currently the reference point. Once you have identified a starting element you can copy elements in whole or create new element and then assign data to those elements (new or the copied ones). One method of getting data from existing XML is the value-of Now to confuse you. internal to the value-f is a select option that you may say what data you want. And guess what, you can use the XPath in that select statement. At this point I am probably getting you fairly confused, sorry. Do you have any XSLT reference books? It may be a worth while effort to get one. Michael Kays is a good book and amazon has it for I think $25. I do not have it just because one of "my guys" has it. Or I would have purchased it. The other book I would recommend is Holzners Inside XSLT book from New Riders. It is not as good in the explaination but is better with samples. It also is found in the used area on amazon for under $10. (6.98) I will be happy to continue if I am helping you. I will be honest though, I have been leading a group now for about 18 months and they do the day to day coding and I am getting rusty. "I will find a new sig someday."
-
Marc Clifton wrote: Is XPath and XSL interchangeable? The straight answer to that is no. XPath is a thecnique that is used in XSL transformation to identify what it is to work on. Now that what can be in respect to the whole document. I.E. what element to start with and it can be relative to its starting point or the element it that is currently the reference point. Once you have identified a starting element you can copy elements in whole or create new element and then assign data to those elements (new or the copied ones). One method of getting data from existing XML is the value-of Now to confuse you. internal to the value-f is a select option that you may say what data you want. And guess what, you can use the XPath in that select statement. At this point I am probably getting you fairly confused, sorry. Do you have any XSLT reference books? It may be a worth while effort to get one. Michael Kays is a good book and amazon has it for I think $25. I do not have it just because one of "my guys" has it. Or I would have purchased it. The other book I would recommend is Holzners Inside XSLT book from New Riders. It is not as good in the explaination but is better with samples. It also is found in the used area on amazon for under $10. (6.98) I will be happy to continue if I am helping you. I will be honest though, I have been leading a group now for about 18 months and they do the day to day coding and I am getting rusty. "I will find a new sig someday."