Click here to Skip to main content
16,006,535 members
Home / Discussions / XML / XSL
   

XML / XSL

 
GeneralXML Schema and circular references Pin
Senkwe Chanda18-Sep-02 2:13
Senkwe Chanda18-Sep-02 2:13 
GeneralRe: XML Schema and circular references Pin
Erik Westermann18-Sep-02 3:22
professionalErik Westermann18-Sep-02 3:22 
GeneralRe: XML Schema and circular references Pin
Senkwe Chanda18-Sep-02 4:44
Senkwe Chanda18-Sep-02 4:44 
GeneralBegginer XML question. Pin
Chagit17-Sep-02 3:13
Chagit17-Sep-02 3:13 
GeneralRe: Begginer XML question. Pin
Christian Graus17-Sep-02 12:45
protectorChristian Graus17-Sep-02 12:45 
GeneralRe: Begginer XML question. Pin
Paul Watson17-Sep-02 21:47
sitebuilderPaul Watson17-Sep-02 21:47 
GeneralSOAP ... Pin
Kain16-Sep-02 12:03
Kain16-Sep-02 12:03 
GeneralA parent or not a parent, that is the question... Pin
Nood!e16-Sep-02 9:52
Nood!e16-Sep-02 9:52 
I was wondering if anyone has found an elegant solution to find if an xml node (of any XmlNodeType) is a child of another xml node using .NET?

Lol! - and I can't just use (node.Parent == parent) because it may not be a direct desendant Frown | :(

The code I came up with is:
private bool IsChild(XmlNode parent, XmlNode child, bool directDescendantsOnly) {
return ((child.ParentNode == parent)?
(true):
(directDescendantsOnly?
(false):
(((child.ParentNode == child.OwnerDocument)?
(false):
IsChild(parent, child.ParentNode, directDescendantsOnly)))
));
}

But it fails when you query NameSpace nodes, etc. It seems to be getting more and more special case, which is annoying...so please, if anyone has already tackled this one, can you let me know?

Many thankyous,
Ben
GeneralRe: A parent or not a parent, that is the question... Pin
Christian Graus17-Sep-02 12:46
protectorChristian Graus17-Sep-02 12:46 
GeneralRe: A parent or not a parent, that is the question... Pin
Nood!e17-Sep-02 21:19
Nood!e17-Sep-02 21:19 
QuestionXSD ??? Pin
Christian Graus9-Sep-02 14:12
protectorChristian Graus9-Sep-02 14:12 
AnswerRe: XSD ??? Pin
Michael A. Barnhart9-Sep-02 15:24
Michael A. Barnhart9-Sep-02 15:24 
GeneralRe: XSD ??? Pin
Christian Graus9-Sep-02 15:31
protectorChristian Graus9-Sep-02 15:31 
GeneralRe: XSD ??? Pin
Michael A. Barnhart9-Sep-02 15:57
Michael A. Barnhart9-Sep-02 15:57 
GeneralRe: XSD ??? Pin
Christian Graus9-Sep-02 16:10
protectorChristian Graus9-Sep-02 16:10 
GeneralRe: XSD ??? Pin
Michael A. Barnhart9-Sep-02 16:26
Michael A. Barnhart9-Sep-02 16:26 
GeneralRe: XSD ??? Pin
Christian Graus9-Sep-02 16:30
protectorChristian Graus9-Sep-02 16:30 
GeneralRe: XSD ??? Pin
Michael A. Barnhart9-Sep-02 16:35
Michael A. Barnhart9-Sep-02 16:35 
GeneralRe: XSD ??? Pin
Paul Watson11-Sep-02 8:11
sitebuilderPaul Watson11-Sep-02 8:11 
GeneralRe: XSD ??? Pin
Nood!e17-Sep-02 21:57
Nood!e17-Sep-02 21:57 
AnswerRe: XSD ??? Pin
Ranjan Banerji11-Sep-02 4:09
Ranjan Banerji11-Sep-02 4:09 
AnswerRe: XSD ??? Pin
Paul Watson11-Sep-02 8:14
sitebuilderPaul Watson11-Sep-02 8:14 
AnswerRe: XSD ??? Pin
Richard Deeming12-Sep-02 5:14
mveRichard Deeming12-Sep-02 5:14 
Generalpassing a variable to xsl Pin
Thesisus7-Sep-02 16:25
Thesisus7-Sep-02 16:25 
GeneralRe: passing a variable to xsl Pin
Erik Westermann8-Sep-02 12:04
professionalErik Westermann8-Sep-02 12:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.