How to obtain enumerated attribute declarations from a DTD using MSXML & VB?

  • Thread starter Alastair Cameron
  • Start date
A

Alastair Cameron

I have a VB (VB6, not .NET) application that reads an XML file (using MSXML
v3.2 parser); the XML file contains a reference to an external DTD.

The DTD has numerous enumerated attribute declarations like so:

<!ATTLIST MyElement
MyAttribute (One | Two | Three) "One"
The VB code needs to generate dynamic pick-list for all the attributes that
appear in the DTD as part of a data-entry application; each dynamically
created pick list should contain all the allowable values for the attribute
as defined by the DTD (and presented in some kind of multiple choice control
like a combo or list box). So in this case the pick list would be:

One
Two
Three

I don't want to hard-code any of this; I figured the MSXML DOM should expose
the enumerated attribute declarations in some way allowing me to create my
pick list. However, I can't find any way to do it.

Can somebody help!

Thanks.

Alastair
 
C

Colin Mackenzie

Hi,

I dont think you can do this as
a) the DTD has no API
b) the DTD is not XML so you cant open it and find th results yourself

Options
1/ change the DTD to a schema (by hand, using XML spy etc) and use the
schema object model to walk the tree to find the choices for the attribute
type
2/ write your won DTD parser :(

Colin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top