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

Discussion in 'XML' started by Alastair Cameron, Jul 4, 2003.

  1. 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
    Alastair Cameron, Jul 4, 2003
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:hrgNa.10048$...
    > 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
    >
    >
    Colin Mackenzie, Jul 4, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joseph Tilian
    Replies:
    0
    Views:
    338
    Joseph Tilian
    Dec 21, 2004
  2. Nick Bassiliades

    Redefining an enumerated attribute type

    Nick Bassiliades, Dec 9, 2005, in forum: XML
    Replies:
    1
    Views:
    430
    Henry S. Thompson
    Dec 12, 2005
  3. Replies:
    1
    Views:
    365
    Henry S. Thompson
    Mar 6, 2006
  4. David
    Replies:
    0
    Views:
    360
    David
    Mar 1, 2006
  5. tastyrerun
    Replies:
    1
    Views:
    408
    Bjoern Hoehrmann
    Jun 14, 2007
Loading...

Share This Page