VBA: Parsing XSD - Where's the annotation/documentation items?

ACinKC

New Member
Joined
Nov 20, 2012
Messages
5
I'm working on a project to parse XSD files into Excel (2010) files to create some mapping documents. I'm just after the Name, Type, size/length and documentation elements. Trouble is, I can't seem to find where the annotation/documentation items are in the SOM (using MSXML6 library). It seems there's a writeAnnotation method, but not a corresponding fetch.
<xsd:element name="STCUST" minOccurs="0"><xsd:element name="STCUST" minOccurs="0">
<xsd:annotation><xsd:element minOccurs = "0" name = "STCUST">
  <xsd:annotation>
    <xsd:documentation>Ship to Customer - Identifier for the customer that will ultimately recieve this order.</xsd:documentation>
  </xsd:annotation>
  <xsd:simpleType>
    <xsd:restriction base = "xsd:string">
      <xsd:maxLength value = "20"/>
    </xsd:restriction>
  </xsd:simpleType>
</xsd:element>

</xsd:annotation></xsd:element></xsd:element>
So out of the above segment I'd want to grab "STCUST string 20 Ship to Customer..." and plop them into a worksheet. No problem with the first three, but the annotation is eluding me as I've sifted through the various interfaces without much success.

Anyone know how to grab the documentation values out of an XSD doc?
 

Some videos you may like

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

ACinKC

New Member
Joined
Nov 20, 2012
Messages
5
Wow, crickets...getting lots of views, but no one is suggesting how I can retrieve the <annotation> <ANNOTATION>info I'm craving, or telling me that it's not available at all. Frustrating thing is that I see a lot of other folk asking the same question (some dating back to 2002) but none of those got any feedback either. Hump de Bump for the afternoon folk...
 

Watch MrExcel Video

Forum statistics

Threads
1,123,176
Messages
5,600,147
Members
414,365
Latest member
UUR

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top