Best way to read annotated schemas ?

What is the best way (easiest to code/maintain) to read annotations from within an annotated schema ? Either using foreign namespaced attributes like this:

<xsd:element name="CustomerName" type="xsd:string"myNS:Foo="MyStuff" />

or using appinfo elements like this:

<xsd:element name="CustomerName" type="xsd:string">
<xsd:annotation>
<xsd:appinfo>
<myNS:Foo>MyStuff Here</myNS:Foo>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>

Is it best to use the xmlschema objects in .NET ? Or maybe just treat the schema as an XML document and use XPath?.

Any examples of reading appinfo annotations or foreign attributes ?

Thanks,
Andy Mackie.

[828 byte] By [AndrewMackie] at [2007-12-17]
# 2
If this is the only information you care about I'd use XmlDocument. If you also care about the semantics of the XSD schema itself (derrivation relationships and so on) then I'd use XmlSchema.
ChrisLovett at 2007-9-9 > top of Msdn Tech,.NET Development,XML and the .NET Framework...

.NET Development

Site Classified