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


0
7/4/2003 2:46:37 PM
dotnet.xml 7266 articles. 0 followers. Follow

1 Replies
513 Views

Similar Articles

[PageSpeed] 17

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" <alastair.cameron@blueyonder.co.uk> wrote in message
news:hrgNa.10048$T4.5726@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
>
>


0
colin3512 (2)
7/4/2003 3:03:41 PM
Reply:

Similar Artilces:

cannot connect to CRM using web client
Hello... I have the following problem. I set up CRM 3.0 on a Virtual PC Server inside a windows 2003 server. Inside the VPC the crm server behaves correctly, I can open Internet explorer and connect normally. Now, when connecting from the host server or from another computer in another network, I cannot connect to CRM. Is not that I'm having network problems, because when IE tries to connect to CRM Website, it asks for a user and password. In a normal case the user will be crmdomain\user. the user is created in Active Directory and CRM within the VPC. Apparently the VPC IIS i...

non admin user cannot use application #2
after installing office 2004 via the installer as an admin user in Tiger and Panther the users on the machine that do not have admin status cannot access <use> the applications. The microsoft office folder and sub folders have a red minus sign which means access privileges are denied. G5 Panther and Tiger Dual boot Multi user Machine plenty o RAM Standard Users should not have a problem at all. Try repairing permissions. If you are deliberately creating users that are more limited than the default Standard user, check the permissions on the app folder. You may find this thread usef...

CArchive error using << operator
Hey all, I'm running into a problem with using the << or >> operators when using cout, cin, or CArchive. It keeps telling me, in the most recent case: error C2678: binary '<<' : no operator defined which takes a left-hand operand of type 'class CArchive' (or there is no acceptable conversion). The offending line of code tries to write 1 item from a vector (*allfile) to the archive (*pArchive) like so... try { (*pArchive) << (*fit); } I ran into this same error when trying to use cout or cin. Is this a compiler problem, preprocessor probl...

Addin UDF Registration/Declaration
Any guidance as to how to have a UDF in an addin be declared/registered etc. so as to be used like all other usual/normal functions? like be autocompleted upon partial entry, arguments be displayed in the supertip and be capable to be used in the Conditional Formatting and other features? -- Thanx in advance & Best Regards, Faraz! Read this: http://www.jkp-ads.com/articles/RegisterUDF00.asp -- Kind regards, Niek Otten Microsoft MVP - Excel "Faraz Ahmed Qureshi" <FarazAhmedQureshi@discussions.microsoft.com> wrote in message news:B5447321-57FD...

missing type in xs:attribute
What type is used when I not specify it on xs:attribute? for example <?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:complexType name="XXX"> <xs:attribute name="name" use="required"/> </xs:complexType> </xs:schema> Lars Lars Schouw wrote: > What type is used when I not specify it on xs:attribute? > > for example > > <?xml version="1.0" encoding="utf-8"?> > <xs:schema ...

Using OleDB to get data from Excel
Hi people! I'm using OleDbDataReader to get rows one-by-one from Excel sheet. The code I'm using to do this: oConn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + name + ";Extended Properties=\"Excel 8.0;HDR=YES;IMEX=1;\""); oConn.Open(); OleDbCommand oCmd = new OleDbCommand("SELECT * FROM [Sheet1$]", oConn); OleDbDataReader oReader = oCmd.ExecuteReader(); while (oReader.Read()) { //array to store current row object[] rowValues = new object[oReader.FieldCount]; oReader.GetValues(rowValues); ...

how can I creat venn diagram using Excel?
I want to analysis data using excel. my idea is to find tht overlaping between different groups. How can I find the overlaping among differnt groups using Excel? I think Venn diagram will do such job but how to do that with Excel. thanks Consider simulating a Venn diagram with a Bubble chart. You will have to devise a scheme to specify the location (X,Y coordinates) and the size of each bubble to get the desired effect. -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article <00499137-A889-4ABB...

Problems using Outlook 2003 with Word as E-mail Editor
I am posting this question to both Outlook and Word newsgroups as it involves using both programs--composing e-mail messages in Outlook 2003 with "use Word as e-mail editor" selected. (Word is also version 2003, as are all my office products). When one has that option selected, one can choose to have the "Web Tools" toolbar in view. This toolbar adds some nice options (in an HTML-formatted e-mail message) like adding a sound, scrolling marquee text, or a video. (For instance, following is the URL on the Microsoft Office site about adding video: http://office.microsoft.com/...

Using meta-info or is it possible to extend the OneNote XML Schema
Hey, I'm working on an add-in that will sync "To Do"-tags with a CalDAV-Server, making them available on iPhones and Mozilla Thunderbird. Unfortunately OneNote is making this very hard for two reasons: 1. <Meta>-elements can't be childs of <Tag>-elements, so they wouldn't move with a <Tag>-element or be deleted if the user moves the <Tag> to another <Outline> or even <Folder>. That means that <Tag>-Elements are hard to identify uniquely, unless there's a good way to extend the OneNote XML-Schema (for exampl...

use command button to total datas in cells through VBA codes in ex
how can i establish a new command button in combo box to total datas in cells by wrinting VBA codes ?? thanks you ! Roy ...

How determine where "virtual size" is being used?
My MFC application has some strange behavior ... as it runs, the "virtual size" as reported by Process Manager slowly grows to a ridiculous size, while the "working set" stays relatively constant. When I exit the application, MFC's built-in memory leak detection says I'm not leaking memory anywhere. However, I absolutely realize the limitations of the MFC memory leak stuff. The application does a lot of creating of threads and communication with an in-process COM object, so I can see lots of places where memory could be allocated where MFC wouldn't kno...

Using dates for x-axis values as string instead of creating a scale
I am creating a line graph where I want to identify each point on the graph by a date (i.e. the source of the x-axis is to a column full of dates). When I do this, excel puts the dates on a scale, so a lot of my data is bunched up in the center of the graph. Is there any way to format the dates as text for use in the graph without the text version of the dates being the unreadable number format? Or, is there any way to stop excel from putting my dates on a scale? Thanks! -Eleanor -- cs_weirdo You can change the axis back to a category type, instead of a time scale type. Choose Chart...

Want to know if there is a canned project summary format that I can use/customize #2
Hi Debra, Thanks for the tip. I found some very interesting templates there However, I didn't find any that suits my needs. I will continue t search for that -- ssaiba ----------------------------------------------------------------------- ssaibal's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1493 View this thread: http://www.excelforum.com/showthread.php?threadid=26567 ...

VB Wait...
Hi all, I asked in here the other day how i could get rid of : Application.Wait Now + TimeValue("00:00:3") from my code and instead wait for a page to be fully loaded before the program continues running, someone kindly told me to use: Do Until ie.ReadyState = 4 DoEvents Loop However i was unable to get this to work, if anybody could offer some help it would be greatly appreciated, my code is below: Sub CDS_Test() Dim ie As Object Set ie = CreateObject("InternetExplorer.Application") With ie ..Navigate "URL" ..Visible = True Do Until .ReadyState = 4 D...

Use XML Classes or DataSet to manage Data Records?
I am currently using native .net XML classes for managing my little key/value data storage requirements and they work great. I have created a simple class to abstract the XML and manage my key/value data requirements that saves me tons of time and works great. Now I need to use XML files to store and manage records as a flat file (no relational data) and was wondering which path would be best. Do the native ..net classes make this kind of data manipultion easy (such as creating an auto index field) or am I better of to read the XML file into a DataSet and manipulate it from there. If native ...

Using MS Access to ODBC 3.0 Filtered views
I seem to be getting an issue seeing the records in FilteredActivityParty table through a linked table in MSAccess. The view is correctly returing 5 records for one Appointment record but they are all the same Filterrecord. When I do the same query in MS Query I get 5 records returned and they are all different. Can anyone can shed any light on this? ...

Using Journal to record daily tasks
Does anyone know how to make new journal entry types default to "task" instead of to "phone call?" Thanks, Marti ...

Word 2003 VB
I woudl appreciate some help with my syntax please.... I am trying to prevent a word form document being left blank. I wrote the following from an example in this community but I get an error message 13 when running it. I have attached this to the Field Exit property. The formfield name is FF1. Public Sub FieldExitMacro() If (ActiveDocument.FormFields("FF1").Result) = 0 Then MsgBox "Sorry, you cannot leave this field blank" End If End Sub Thanks -- Nigel Forge ...

Vb code working one time
Hi, I have a form for adding data to a table. In this form , there is a command button for adding those data and it has the following code: Private Sub Command22_Click() On Error GoTo Err_Command22_Click If IsNull(Me.Combo28) = True Then MsgBox "You Must Select a S.O.Processor First.", vbCritical, "No Processor Selected..." Me.Combo28.SetFocus ElseIf IsNull(Me.CONTRACT_NO) = True Then MsgBox "You Must Input a Contract No. First.", vbCritical, "No Contract No. Input..." Me.CONTRACT_NO.SetFocus ElseIf IsNull(Me.CONTRACTOR) = True Then ...

can not get the index of the array when I use any other type ?
Why can I get the index of the item of the array when I use string*, but can not get the index of the array when I use any other type (such as Int32)? This code will compile perfectly, but if I replace String* with Int32, the code would not compile? The code using String* type: #include "stdafx.h" #using <mscorlib.dll> using namespace System; using namespace System::Collections; int _tmain() { String* Items[] = { S"Dog", S"Cat", S"Elephant", S"Gerbil", S"Dog", S"Horse", S"Pig", S"Cat" }; S...

Configuring Exchange 5.5 to use a RBL (Real-time Spam Black List)
Is it possible to use a RBL with Exchange 5.5? What's the simplest way? Don't want to manually enter every email address to block. Thanks Not directly. But majority of antivirus softwares for Exchange support RBL, for example Symantec Mail Security so you could do RBL's in antivirus software -- Regards, Dejan Foro dejan.foro@exchangemaster.net www.exchangemaster.net Join Exchange User Group Europe for free, post questions about Exchange, find useful Exchange links in our link library, chat with other members...See you at www.eugeurope.org/join "Cal_Cougar" ...

Update to GL00100 using Query Analyzer
I am updating Account Numnbers for GP 7.5's table GL00100 using Query Analyser (SQl Server 2000). Most of the tables are update but some records are returning the following error: 'Cannot insert duplicate key row in object GL00100 with unique index AK6GL00100' How do i fix it? The following is the query I used toupdate the table: update GL00100 set ACTNUMBR_1 = 111, ACTNUMBR_2 = 100000, ACTNUMBR_3 = 000000, ACTNUMBR_4 = 555, ACTNUMBR_5 = 666 where ACTINDX=28278 You already have a GL account 111-100000-000000-555-666 This update would result in your having two accounts wi...

Using Replication ID data type in VB?
Hello, I have an Access 2003 database where I'm using the Autonumber with the Replication ID data type and have a second table and storing that replication id in a numeric field (also specified as teh Replication ID data type). I'm trying to write a VB function where I'm trying to pass in the Replication ID and match it to another Replication ID using SQL and an ADODB connection. My problem is I keep getting a data type mismatch. When I reference the data right from the field, I get "????????" as a result. Any ideas? Any help would be greatly appreciated. Tha...

How do i force the use of a Subject in all emails?
We have decided that all employees shoould put something in the subject of an email and I'm looking for a setting in Exchange to force them to do so before allowing them to send an email. Anyone know if that setting exists? Thanks, -- Michael E. McAteer Network Engineer MCSA, MCSE, CNA, A+ On Tue, 21 Feb 2006 15:46:28 -0800, Michael E. McAteer <MichaelEMcAteer@discussions.microsoft.com> wrote: >We have decided that all employees shoould put something in the subject of an >email and I'm looking for a setting in Exchange to force them to do so before >allowing them...

Error message when using Excel on Terminal Server
Hi, We have been using Excel 2003 on a Windows 2003 Terminal server for about a year with no problems until yesterday. Now when we open Excel we get a message that says "C:\documents and sattings\administrator.rco1\application data\microsoft\addins\c:\program files\common files\microsoft shared\geography\mpoai9.dll is not a valid office addin". We click ok and excel opens fine. I think it is because we deleted some mapping software that must have tied into excel. It has not been a problem but we want it to go away because it is preventing us from exporting things from oth...