comp.lang.ada
 help / color / mirror / Atom feed
* XML for Win32
@ 2001-10-15 17:31 Al Christians
  2001-10-15 18:19 ` Pascal Obry
  2001-10-30 10:03 ` Emmanuel Briot
  0 siblings, 2 replies; 11+ messages in thread
From: Al Christians @ 2001-10-15 17:31 UTC (permalink / raw)


The XML example, Win32-XML.html, on AdaPower.com may be out of date.
I haven't been able to get it to work recently, maybe because the 
libraries it refers to are not currently at hand, IDK.  

I'll be trying to get it going.  I expect that with the newer GnatCom
and GWindows libraries, traversing XML might even be easier to 
do than it is in the Win32-XML example, but I haven't yet figured out 
all the translations required to update this example. 

TIA for any pointers to a newer example, or for hints on how to 
transliterate to use with  currently current libraries (ie things now 
available that work with gnat 3.13p1).

Similarly, trying to install the xmlada package from 

	http://libre.act-europe.fr/xmlada/

gives me

	gnatmake: invalid switch: u

Is this because I've got gnat 3.13p1 and not gnat 3.14?

TIA for any advice on how to get past this (NT4.0 sp6a)?


Al



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: XML for Win32
  2001-10-15 17:31 XML for Win32 Al Christians
@ 2001-10-15 18:19 ` Pascal Obry
  2001-10-15 19:54   ` Al Christians
  2001-10-30 10:03 ` Emmanuel Briot
  1 sibling, 1 reply; 11+ messages in thread
From: Pascal Obry @ 2001-10-15 18:19 UTC (permalink / raw)



Al Christians <achrist@easystreet.com> writes:

> 	gnatmake: invalid switch: u
> 
> Is this because I've got gnat 3.13p1 and not gnat 3.14?

Could be the problem. Just removes the gnatmake -u option.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--|
--| "The best way to travel is by means of imagination"



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: XML for Win32
  2001-10-15 18:19 ` Pascal Obry
@ 2001-10-15 19:54   ` Al Christians
  2001-10-15 20:14     ` Al Christians
  0 siblings, 1 reply; 11+ messages in thread
From: Al Christians @ 2001-10-15 19:54 UTC (permalink / raw)


Pascal Obry wrote:
> 
> Al Christians <achrist@easystreet.com> writes:
> 
> >       gnatmake: invalid switch: u
> >
> > Is this because I've got gnat 3.13p1 and not gnat 3.14?
> 
> Could be the problem. Just removes the gnatmake -u option.
> 

It's not that easy.  I don't think there is an option u set anywhere.
Somehow, the 'unicode' parameter is being interpreted as an option 
switch, I think. When I run make with the gnu make v3.78 that is 
recommended on the Ada XML site, I get:

make -e -C unicode all_obj
make[1]: Entering directory `L:/Ada/xmlada/unicode'
A subdirectory or file -p already exists.
Error occurred while processing: -p.
A subdirectory or file obj already exists.
Error occurred while processing: obj.
make[1]: [dirs] Error 1 (ignored)
A subdirectory or file -p already exists.
Error occurred while processing: -p.
A subdirectory or file test already exists.
Error occurred while processing: test.
make[1]: [dirs] Error 1 (ignored)
The system cannot find the path specified.
make[1]: *** [unicode-ccs-iso_8859_1.o] Error 1
make[1]: Leaving directory `L:/Ada/xmlada/unicode'
make: *** [unicode] Error 2

I run make with the gnu make v3.77 that was previously in my gnat\bin
directory, I get:

make -e -C unicode all_obj
make[1]: Entering directory `L:/Ada/xmlada/unicode'
gnatmake: invalid switch: u
make[1]: *** [unicode-ccs-iso_8859_1.o] Error 4
make[1]: Leaving directory `L:/Ada/xmlada/unicode'
make: *** [unicode] Error 2


This happens whether I run make from the regular Windows NT cmd prompt
or from inside of the Cygwin bash shell.  I have run the configure 
script from within bash, and it didn't crash that I could tell, but
I don't know much about what it should have looked like.


Al



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: XML for Win32
  2001-10-15 19:54   ` Al Christians
@ 2001-10-15 20:14     ` Al Christians
  2001-10-16 23:10       ` David Botton
  0 siblings, 1 reply; 11+ messages in thread
From: Al Christians @ 2001-10-15 20:14 UTC (permalink / raw)


At first glance, the following appears to work as a variant
of the Win32-XML code from AdaPower.  What should I straighten 
out?


Al



----------------------Code Follows-----------------------

with GNAT.IO; use GNAT.IO;

with Interfaces.C;

with GnatCom.Types;
with GnatCom.BSTR; use GnatCom.BSTR;
with GnatCom.Variant; use GnatCom.Variant;
with GnatCom.Initialize;

with MSXML;

with MSXML.IXMLDomDocument_Interface; 
use  MSXML.IXMLDomDocument_Interface; 

with MSXML.IXMLDomNode_Interface;
with MSXML.IXMLDomNodeList_Interface;
use MSXML;

procedure XMLWalk is

   use type GnatCom.Types.VARIANT_BOOL;

   -- Document   : Dispinterface_Type;
   Document   : MSXML.IXMLDomDocument_Interface.IXMLDomDocument_Type;
   Node       : IXMLDOMNode_Interface.IXMLDOMNode_Type;

   Input_File : aliased GnatCom.Types.Variant 
                        := To_Variant("J:\QAReview\Src\test.xml");

   Result     : GnatCom.Types.Variant_Bool;

   procedure Walk (Node  : IXMLDOMNode_Interface.IXMLDOMNode_Type;
                   Level : Integer := 0)
   is
      use type Interfaces.C.Long;

      Node_List : IXMLDOMNodeList_Interface.IXMLDOMNodeList_Type;
      M         : Interfaces.C.Long;      
      Name      : GnatCom.Types.BSTR;
      Value     : GnatCom.Types.Variant;
   begin
      begin
         Name := IXMLDOMNode_Interface.Get_NodeName(Node);
         Value := IXMLDOMNode_Interface.Get_NodeValue(Node);
      exception
         when others =>
            Initialize(Value);
      end;

      for N in 1 .. Level loop
         Put(" ");
      end loop;

      Put_Line("Name: " & To_Ada(Name) & 
               "  Value: " & To_Ada(Value) &
               "  Level: " & Integer'Image(Level));

      IXMLDOMNodeList_Interface.Attach
        (Node_List,
         IXMLDOMNode_Interface.Get_ChildNodes(Node));
         
      M := IXMLDOMNodeList_Interface.Get_Length(Node_List);   
      Put_Line("Nodes:"  & Natural'Image(Natural(M)));

      for N in 1 .. M loop
         declare
            Next_Node : IXMLDOMNode_Interface.IXMLDOMNode_Type;
         begin
            IXMLDOMNode_Interface.Attach
              (Next_Node,
               IXMLDOMNodeList_Interface.NextNode(Node_List));
            Walk(Next_Node, Level+1);
         end;
      end loop;
      
      GnatCom.BSTR.Free(Name);
      GnatCom.Variant.Free(Value);

   end Walk;

begin
   GnatCom.Initialize.Initialize_Com;
   Put_Line("Creating Document...");
   Create( Document, CLSID_DOMDocument);

   IXMLDOMDocument_Interface.Put_Async(Document, 0);

   Put_Line("Loading Document...");
   Result := IXMLDomDocument_Interface.Load(Document, Input_File);

   if Result /= 0 then
      Put_Line("Document Loaded...");
      MSXML.IXMLDomNode_Interface.Attach( Node, cloneNode(Document,
-1));
      Walk(Node);
   end if;

   Free(Input_File);

end XMLWalk;



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: XML for Win32
  2001-10-15 20:14     ` Al Christians
@ 2001-10-16 23:10       ` David Botton
  2001-10-17  1:34         ` Al Christians
  0 siblings, 1 reply; 11+ messages in thread
From: David Botton @ 2001-10-16 23:10 UTC (permalink / raw)


Looks OK to me :-)
Perhaps submit it to AdaPower to replace the old version (that I forgot to
update for GNATCOM from the old AdaCOM packages).

I use the MSXML COM object in many projects (both Ada and C++) and am very
happy with it. I use its ability to process XSL and other XML based
searching and transforming "APIs" extensively.

I often use the MSXML COM object like an in memory database that I can
persist with XML.

David Botton

"Al Christians" <achrist@easystreet.com> wrote in message
news:3BCB43B9.1D861B23@easystreet.com...
> At first glance, the following appears to work as a variant
> of the Win32-XML code from AdaPower.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: XML for Win32
  2001-10-16 23:10       ` David Botton
@ 2001-10-17  1:34         ` Al Christians
  2001-10-17  1:53           ` David Botton
  0 siblings, 1 reply; 11+ messages in thread
From: Al Christians @ 2001-10-17  1:34 UTC (permalink / raw)


David Botton wrote:
> 
> Looks OK to me :-)
> Perhaps submit it to AdaPower to replace the old version (that I > > forgot to update for GNATCOM from the old AdaCOM packages).

I'll try to tidy it up and send by email to you.

> 
> I often use the MSXML COM object like an in memory database that I can
> persist with XML.
> 

Is the performance OK?  How many megabytes of XML and/or how many
nodes does it take to give any noticeable delays in processing?


Al



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: XML for Win32
  2001-10-17  1:34         ` Al Christians
@ 2001-10-17  1:53           ` David Botton
  2001-10-17  3:00             ` Al Christians
  0 siblings, 1 reply; 11+ messages in thread
From: David Botton @ 2001-10-17  1:53 UTC (permalink / raw)


Don't know, never pressed it. I am sure there is data around the net on it.
It is certainly a heavily used component. I believe the latest is version 3
of the control.

David Botton

"Al Christians" <achrist@easystreet.com> wrote in message
news:3BCCE032.62A78161@easystreet.com...
> David Botton wrote:

> Is the performance OK?  How many megabytes of XML and/or how many
> nodes does it take to give any noticeable delays in processing?






^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: XML for Win32
  2001-10-17  1:53           ` David Botton
@ 2001-10-17  3:00             ` Al Christians
  2001-10-17 14:12               ` David Botton
  0 siblings, 1 reply; 11+ messages in thread
From: Al Christians @ 2001-10-17  3:00 UTC (permalink / raw)


David Botton wrote:
> 
> Don't know, never pressed it. I am sure there is data around the net on it.
> It is certainly a heavily used component. I believe the latest is version 3
> of the control.
> 

Speaking of versions, are these controls upward/backward compatible, ie 
is there any kind of checking that should be done at run-time to make 
sure that the installed version on the target machine will work with 
the calls from gnatcom? (Of course, I'm thinking about shipping exe's 
to unsophisticated users)  This all works so slick and easy that it
makes
me nervous.

Found some performance info on this page, which gives pretty 
interesting times:  

http://www.geocities.com/fastxml/inside.html

Even though it is illustrating the advantages of a 3rd party library,
all the times are in milliseconds for multi-megabyte files, so that 
looks pretty good to me.

Are there any requirements on the user (run-time) machine for the
gnatcom XML components to work?  Is that requiring IE 4 or IE 5?
Any versions of Windows that won't work? I assume that the early 
release of Win95 won't work unless a later version of IE is installed.
Is that right?   Anything else that needs to be done to setup the
typical user machine, or can I just copy in an exe and it all will 
work?


Al



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: XML for Win32
  2001-10-17  3:00             ` Al Christians
@ 2001-10-17 14:12               ` David Botton
  2001-10-17 16:16                 ` Al Christians
  0 siblings, 1 reply; 11+ messages in thread
From: David Botton @ 2001-10-17 14:12 UTC (permalink / raw)



"Al Christians" <achrist@easystreet.com> wrote in message
news:3BCCF46B.63443CB9@easystreet.com...

> Speaking of versions, are these controls upward/backward compatible, ie
> is there any kind of checking that should be done at run-time to make
> sure that the installed version on the target machine will work with
> the calls from gnatcom? (Of course, I'm thinking about shipping exe's
> to unsophisticated users)  This all works so slick and easy that it
> makes
> me nervous.

Part of the idea behind COM was to make things easier, particular with
versioning. They are upwards and downwards compatable with additional
features available as additional interfaces, but the same basic set (the DOM
with some MS extensions) are supported in all versions. I have run the same
software with out compiling on all versions with no problems.

> Are there any requirements on the user (run-time) machine for the
> gnatcom XML components to work?

It is the Microsoft XML component.  No requirements on the part of GNATCOM
other than NT service pack 3.0 or greater or 9X or greater.

>  Is that requiring IE 4 or IE 5?

MSXML comes with IE4. Although MSXML is not perse dependant on IE4 (the
other way around is another story).

> Any versions of Windows that won't work? I assume that the early
> release of Win95 won't work unless a later version of IE is installed.
> Is that right?   Anything else that needs to be done to setup the
> typical user machine, or can I just copy in an exe and it all will
> work?

Just make sure they have IE4 or greater and everything should work. On 95
look at IE4 as a service pack that is required. On NT, IE4 is required for
the option pack, etc. IE4 or greate should be on the machine.

David Botton






^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: XML for Win32
  2001-10-17 14:12               ` David Botton
@ 2001-10-17 16:16                 ` Al Christians
  0 siblings, 0 replies; 11+ messages in thread
From: Al Christians @ 2001-10-17 16:16 UTC (permalink / raw)


Thanks for all the good info.  That is a very nice situation.  

Al

David Botton wrote:
> 
> "Al Christians" <achrist@easystreet.com> wrote in message
> news:3BCCF46B.63443CB9@easystreet.com...
> 
> > Speaking of versions, are these controls upward/backward compatible, ie
> > is there any kind of checking that should be done at run-time to make
> > sure that the installed version on the target machine will work with
> > the calls from gnatcom? (Of course, I'm thinking about shipping exe's
> > to unsophisticated users)  This all works so slick and easy that it
> > makes
> > me nervous.
> 
> Part of the idea behind COM was to make things easier, particular with
> versioning. They are upwards and downwards compatable with additional
> features available as additional interfaces, but the same basic set (the DOM
> with some MS extensions) are supported in all versions. I have run the same
> software with out compiling on all versions with no problems.
> 
> > Are there any requirements on the user (run-time) machine for the
> > gnatcom XML components to work?
> 
> It is the Microsoft XML component.  No requirements on the part of GNATCOM
> other than NT service pack 3.0 or greater or 9X or greater.
> 
> >  Is that requiring IE 4 or IE 5?
> 
> MSXML comes with IE4. Although MSXML is not perse dependant on IE4 (the
> other way around is another story).
> 
> > Any versions of Windows that won't work? I assume that the early
> > release of Win95 won't work unless a later version of IE is installed.
> > Is that right?   Anything else that needs to be done to setup the
> > typical user machine, or can I just copy in an exe and it all will
> > work?
> 
> Just make sure they have IE4 or greater and everything should work. On 95
> look at IE4 as a service pack that is required. On NT, IE4 is required for
> the option pack, etc. IE4 or greate should be on the machine.
> 
> David Botton



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: XML for Win32
  2001-10-15 17:31 XML for Win32 Al Christians
  2001-10-15 18:19 ` Pascal Obry
@ 2001-10-30 10:03 ` Emmanuel Briot
  1 sibling, 0 replies; 11+ messages in thread
From: Emmanuel Briot @ 2001-10-30 10:03 UTC (permalink / raw)



Al Christians <achrist@easystreet.com> writes:

> Similarly, trying to install the xmlada package from 
> 
> 	http://libre.act-europe.fr/xmlada/
> 
> gives me
> 
> 	gnatmake: invalid switch: u
> 
> Is this because I've got gnat 3.13p1 and not gnat 3.14?
> 
> TIA for any advice on how to get past this (NT4.0 sp6a)?



A little bit late, but did you check the README file (this is a copy of the
first three paragraphs, which explains everything you need, or should). Suggest
other wording if you think it is unclear.




INSTALLING THIS LIBRARY
=======================

Edit the file Makefile in the root directory, and change the variable
PREFIX at the top to reflect the intended location for the library.

If you are using GNAT version 3.13p or lower, comment the second
COMPILER line in the file Makefile.module, so that it only contains
"gnatmake". The other switches are not supported in these versions.



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2001-10-30 10:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-15 17:31 XML for Win32 Al Christians
2001-10-15 18:19 ` Pascal Obry
2001-10-15 19:54   ` Al Christians
2001-10-15 20:14     ` Al Christians
2001-10-16 23:10       ` David Botton
2001-10-17  1:34         ` Al Christians
2001-10-17  1:53           ` David Botton
2001-10-17  3:00             ` Al Christians
2001-10-17 14:12               ` David Botton
2001-10-17 16:16                 ` Al Christians
2001-10-30 10:03 ` Emmanuel Briot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox