By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,652 Members | 1,698 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,652 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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

"Alastair Cameron" <al**************@blueyonder.co.uk> wrote in message
news:hr*****************@news-binary.blueyonder.co.uk...
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

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.