Groups | Blog | Home
all groups > dotnet xml > june 2007 >

dotnet xml : How do I get the <xsd:documentation>?


David Thielen
6/30/2007 4:06:01 PM
Hi;

It looks like this is in Annotations.Items but there can be multiple items -
how do I know which is the <xsd:documentation>?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm

John Saunders [MVP]
6/30/2007 9:29:28 PM
[quoted text, click to view]

First of all, there can be more than one <xsd:documentation>, and they may
contain more than one text node.

Each of the Annotation.Items is of type XmlSchemaObject. You can use code
like this:

foreach (XmlSchemaObject xso in annotation.Items)
{
if (xso is XmlSchemaDocumentation)
{
XmlSchemaDocumentation doc = (XmlSchemaDocumentation) xso;
foreach (XmlNode node in doc.Markup)
{
// Do what you like with the node
}
}
}
--
John Saunders [MVP]
David Thielen
7/1/2007 7:06:03 AM
What we want to do is in our TreeView of the schema, have the tooltip for
each node in the tree be the documentation for that element/attribute. If
there are multiple documentation nodes should we just concat them all
together in that single tooltip or just use the first one or ???

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




[quoted text, click to view]
David Thielen
7/1/2007 11:10:01 AM
perfect - thank you.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




[quoted text, click to view]
AddThis Social Bookmark Button