READ-XMLSCHEMA

Posted by tsa on 06-Mar-2007 06:29

Progress version 10.1B

Stylus Studio XML Enterprise Version 2007

I receive following error: Unable to map simpleType myDateTimeOptional to Progress Datatype.

The XML and XSD are coming from a partner.

Is there an easy way to map such datatypes in Progress without altering the XML and XSD files?

Excerpt out “myschema.xsd”



.
.

        
            
        
    
.
.

       
            
  			 OpenEdge Development - Forum

All Replies

Posted by Thomas Mercer-Hursh on 06-Mar-2007 10:43

Have you looked at the XML methods for temp-tables?

Posted by tsa on 06-Mar-2007 10:50

Yes, but I want to create a dynamic prodataset out of the xsd schema. I have no control over the schema nor over the XML-files. Is this possible?

Posted by Thomas Mercer-Hursh on 06-Mar-2007 11:14

So, did you look at and try the READ-XMLSCHEMA() method?

If so, did you have some problem with it that we could react to?

FWIW, one basic diagnostic technique I have done in playing with this stuff, if I have a problem reading the schema is to manually create the schema that I know I want and then use the WRITE-XMLSCHEMA() to create the XSD. Then, compare the one I was trying to read with what got written. This might guide you to some pre-processing that would get you past the problem.

Does the XSD change frequently?

BTW, a couple of carriage returns in that XML would make this forum easier to read.

Posted by tsa on 06-Mar-2007 11:26

It's the READ-XMLSCHEMA() method who gives the following error: Unable to map simpleType myDateTimeOptional to Progress Datatype.

The xsd is very deep nested with several includes and a lot of simpleType's. In Stylus studio it validates well. I tought the READ-XMLSCHEMA() method on a new dynamic created dataset would create the dataset structure, but it fails on some simpleType defined with a "union".

Example: excerpt out of the main xsd:

Posted by Thomas Mercer-Hursh on 06-Mar-2007 11:36

OK, the waters are beginning to clear a little here ... partly from my going back to re-read your original post more closely!

I guess that I'm not surprised that READ-XMLSCHEMA() is having trouble reading a datatype which is not a single data type. Just at a guess, what happens if you change it to just be a datetime with no option empty string piece? I would think there was a chance, at least, that it would correctly read an empty string as unknown value.

If this works, you could either preprocess the XSD or simply have your own version and update it when ever it changes.

Posted by tsa on 06-Mar-2007 12:42

I changed all the 'union'-constructs to simpletype's such as "int, decimal, string ...)

Now I receive another error:

Error 1:

Temp-table 'Document' not found in XML Schema. (13138)

Error 2:

The specified Temp-Table definition was not included in the XML Schema.

Unable to create Temp-Table or dataset schema from XML Schema. (13032)

READ-XML or READ-XMLSCHEMA encountered errors when trying to create the schema for a dynamic Temp-Table or dataset from an XML Schema.

Posted by Thomas Mercer-Hursh on 06-Mar-2007 13:15

Well, I'm afraid that I am out of immediate suggestions and we are going to have to get someone else to chime in here. Other than trying to create the temp-tables manually and then write the schema to see how that compares. The only other thought I would have is the possibility of an XSLT transform into a form which would be acceptable, but I can't begin to suggest what that would look like. My general instinct here is that the schema you are trying to work with is too complex, perhaps in multiple ways, for what the read-xmlschema() method is capable of handling. If so, your only options may be transforming it to something simpler or just building your own parser to your own predefined schema ... which I know means that you have to hand edit every time the schema changes.

Possibly you might want to post this on the XML forum at PEG for a larger audience.

This thread is closed