[Openroad-users] Importing XML files into Ingres/OpenROAD

Bodo.Bergmann at t-online.de Bodo.Bergmann at t-online.de
Thu Nov 16 18:22:12 EST 2006


Just additional info:

The XML automatically generated by OpenROAD according to your user class
attributes may be invalid XML, if names of classes or attributes
contain special characters that are valid within OpenROAD identifiers
but are invalid within XML tag names, i.e. @, $ and #.

So, in order to prevent later parsing errors, just don't use these
characters in OpenROAD class/attribute names.

Bodo.

-----Original Message-----
Date: Wed, 15 Nov 2006 17:55:16 +0100
Subject: Re: [Openroad-users] Importing XML files into Ingres/OpenROAD
From: "Kim Ginnerup" 
To: "Bloomfield, Martin \(PSD\)" 

   Message       

Hi Martin, 



I have attached a small frame, that gives you an idea on how to use
msxml to make transformations inside OpenROAD. 

Just import the frame into an application that has an msxml external
component. 



I found the iixmlpreprocess a bit confusing at first myself. 

But I think you can more or less copy paste the code from the frame
sample. 



How your class hierarchy should be is a little more tricky.  

OpenROAD do not make the xml output as I would have expected at
first. 

OpenROAD do not make an xml element around an array, it just dumps
the elements. 

So sometimes you will need to have an extra class as a wrapper for
an array. 

So the best way to figure out how to do, is to make your classes or
some of them from the top down. 

Then put some testdata into them and let our generated xml
reader/writer generate the xml output  file. 

OpenROAD will use the procedure name as the root-tag of the xml
file. 



One thing to be aware of is that OpenROAD do not generate the top
Processing Instructtion; setting the correct characterset. 

Also OpenROAD automatically generates an internal dtd. 

Normally I use the iixmlpostprocess() procedure, 

To add the top PI, and remove the dtd. 

I do that just be manipulating the stringObject. 



In your xml example below, the Results tag would have been you gscp
name in OpenROAD 

Again you can simply remove that in the preprocess, if you do not
like it. 

To get the below output your parameter to the procedure would be an
"array of sample" 



As said the best way is to put some test data into your class
hierarchy and then see what comes out of it. 

What comes out is what your system expects to receive. 



Regards, 



Kim 



  
-------------------------

FRA: Bloomfield, Martin (PSD)
[mailto:Martin.Bloomfield at psd.defra.gsi.gov.uk] 
SENDT: 15. november 2006 15:39
TIL: Kim Ginnerup
CC: Openroad-Users
EMNE: RE: [Openroad-users] Importing XML files into Ingres/OpenROAD 


 

Kim,   

  

Sorry to bother you again.  Thanks for the XSL transformation code. 
I've tested it in XML-spy and it works fine.  However, I'm struggling
to work out how to do this in OpenROAD.  I've created myself an
external class pointing to the MSXML 4 control.  Unfortunately, not
having used external controls before, I'm rather lost as to how to
put the XSL code into the control and get it to process the
b_so_preprocessxml parameter in the iixmlpreprocess procedure.   

  

Would it be possible for you to send me sample code detailing how to
use the external control, or an export of the procedure?  Also, when I
create my own "ReadFile" procedure should the class I pass to it map
to the root element of the XML file? Also, how should I name array
attributes which correspond to repeatable complex XML elements?   

  

for info my XML doc has following structure:   

                                

            

    item1   

    data   

                     

       1.2   

       *1.0   

        

       

       1.4   

       *0.5   

      

     

    

    item2   

    data2   

       

       1.2   

       *1.0   

       

       

       1.4   

       *0.5   

       

    

  

Many thanks for your assistance,  

Martin Bloomfield. 
____________________________________________ 
Application Developer & Database Administrator 
IT Branch, 
Pesticides Safety Directorate 
YORK  

Email: martin.bloomfield at psd.defra.gsi.gov.uk [1] 
Website: www.pesticides.gov.uk [2]   

-----Original Message-----
FROM: Kim Ginnerup [mailto:kgi at bording.dk] 
SENT: Tuesday, November 14, 2006 11:48 AM
TO: Bloomfield, Martin (PSD)
CC: openroad-users at peerlessit.com
SUBJECT: SV: [Openroad-users] Importing XML files into
Ingres/OpenROAD   

Martin, 



And here it is: 









 

  

   

    

     

    

   

  

  

 



Martin Bloomfield. 
____________________________________________ 
Application Developer & Database Administrator 
IT Branch, 
Pesticides Safety Directorate 
YORK  

Email: martin.bloomfield at psd.defra.gsi.gov.uk [3] 
Website: www.pesticides.gov.uk [4]   

-----Original Message-----
FROM: openroad-users-bounces at peerlessit.com
[mailto:openroad-users-bounces at peerlessit.com] ON BEHALF OF Kim
Ginnerup
SENT: Tuesday, November 14, 2006 5:31 AM
TO: openroad-users at peerlessit.com
SUBJECT: Re: [Openroad-users] Importing XML files into
Ingres/OpenROAD   

I forgot to mention 

OpenROAD only reads elements from an xml-file all attributes are
ignored. 

But you can make a very simple generic XSL-script that change all
attributes to elements. 

Put that transformation into iixmlpreprocess using msxml. 



I have such a script somewhere if you are interested I think it is
less than 10 lines of xsl. 



Kim 

 

Department for Environment, Food and Rural Affairs (Defra)



This email and any attachments is intended for the named recipient
only.

If you have received it in error you have no authority to use,
disclose,

store or copy any of its contents and you should destroy it and
inform

the sender.

Whilst this email and associated attachments will have been checked

for known viruses whilst within Defra systems we can accept no

responsibility once it has left our systems.

Communications on Defra's computer systems may be monitored and/or

recorded to secure the effective operation of the system and for
other

lawful purposes.   

Links:
------
[1] mailto:martin.bloomfield at psd.defra.gsi.gov.uk
[2] http://www.pesticides.gov.uk/
[3] mailto:martin.bloomfield at psd.defra.gsi.gov.uk
[4] http://www.pesticides.gov.uk/





More information about the Openroad-users mailing list