473,473 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

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
1 2173
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Russell O'Connor | last post by:
The following XML and Schema doesn't validate in Visual Studio .NET 2003. Is there some mistake I'm making, or is VS.NET in error. The error is r:\test2.xml(3): The key sequence 'foo' in Keyref...
6
by: Tjerk Wolterink | last post by:
When i open the following xml file in internetexplorer: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE xc:content > <xc:xcontent...
1
by: Alastair Cameron | last post by:
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...
12
by: Stefano | last post by:
Hi all, what is the correct use of the "default" attribute in XML Schema? For example: <xs:element name="myProperty" type="xs:string" default="myDefaultValue"/> What can I do with it? What...
2
by: KJS | last post by:
Hello, I'm receiving: 'System.Xml.Xsl.XsltException: Missing mandatory attribute 'version' After I try and run my transformation. I spent a good few days coming up with the appropriate (I think)...
1
by: Nick Bassiliades | last post by:
Hi everybody, I would like to ask a very specific question about how I can re-define an enumerated attribute type. Specifically, I have two XML Schema files. In file A I have the following...
1
by: davidmcb | last post by:
I have defined an enumerated type that I use in various places in my schema. I am in the process of creating a new complex type that contains an attribute that I want to restrict to NOT being a...
5
by: Soren Kuula | last post by:
Hi, If I declare an attribute #FIXED as in <!ATTLIST gedefims a1 CDATA #FIXED "fis"> Does the attribute HAVE to be present in instance docuements, as with #REQUIRED? As I read the XML spec,...
4
by: Olivier Lefevre | last post by:
I want to define an attribute as a list of values taken from a finite set, with a singleton default. Intuitively I want to write attrname (AA|BB|CC)* "AA" but that is not valid syntax and I...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.