Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Avoid NodeType Comment Avoid NodeType CommentTo: NULL Date: 3/3/2006 6:35:00 AM I have a problem with comments in my xml document. I have a xsd that validate the the book element only has one child, with a id attribute: <book> <title /> </book> or <book> <author id="1" /> </book> But the xsd allows this xml to pass: <book> <!-- a comment --> <author id="1" /> </book> In my code (c#) i do: string id = bookNode.FirstChild.Attributes["id"]; This will fail if a xml comment is contained in the xml. Can I load the xml document in to a XmlDocument with an options to ignore comments? Any other ideas? | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
