Validation with XML Schemas with Clarion 5.5 and Microsoft XML Parser 4.0 
Author Message
 Validation with XML Schemas with Clarion 5.5 and Microsoft XML Parser 4.0

Hi,

I'm Using Clarion 5.5 and Microsoft XML Parser 4.0 and I want to
validate with XML Shemas. There are two ways to do it. I succesfully
did it one way, but it didn't work with the other. Both codes are as
following:

!************************************************************!
!First Code:
?OLE{PROP:Create} = 'Msxml2.DOMDocument.4.0'
?OLE{'async'} = FALSE
?OLE{'validateOnParse'} = TRUE
flag = ?OLE{'Load("C:\RaulCodigo\xmlDomClarion\order.xml")'}

message(?OLE{'parseError.errorCode'})
message(?OLE{'parseError.reason'})

!This code works

!************************************************************!
!Second Code:
?OLE{PROP:Create} = 'Msxml2.DOMDocument.4.0'
?OLESchema{PROP:Create} = 'Msxml2.XMLSchemaCache.4.0'
?OLESchema{'add("","C:\RaulCodigo\xmldomClarion\order_schema.xsd")'}
?OLE{'shemas'} = ?OLESchema{''}
?OLE{'async'} = FALSE
?OLE{'validateOnParse'} = TRUE
flag = ?OLE{'Load("C:\RaulCodigo\xmlDomClarion\order.xml")'}

message(?OLE{'parseError.errorCode'})
message(?OLE{'parseError.reason'})

! I think this code is right, but it doesn't works ????
! Does anyone know why it doesnt work?

!************************************************************!
!The files are the following.
!order.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<shipOrder>
        <shipTo>
                <name>Tove Svendson</name>
                <address>Ragnhildvei 2</address>
                <city>4000 Stavanger</city>
                <country>Norway</country>
        </shipTo>
        <items>
                <item>
                        <title>Empire Burlesque</title>
                        <quantity>1</quantity>
                        <price>10.90</price>
                </item>
                <item>
                        <title>Hide your heart</title>
                        <quantity>-1</quantity>

                </item>
        </items>
</shipOrder>

!************************************************************!
! order_schema.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns:xs=" http://www.*-*-*.com/ ;>
        <xs:element name="shipOrder" type="order"></xs:element>
        <xs:complexType name="order">
                <xs:sequence>
                        <xs:element name="shipTo" type="shipAddress"></xs:element>
                        <xs:element name="items" type="cdItems"></xs:element>
                </xs:sequence>
        </xs:complexType>
        <xs:complexType name="shipAddress">
                <xs:sequence>
                        <xs:element name="name" type="xs:string"></xs:element>
                        <xs:element name="address" type="xs:string"></xs:element>
                        <xs:element name="city" type="xs:string"></xs:element>
                        <xs:element name="country" type="xs:string"></xs:element>
                </xs:sequence>
        </xs:complexType>
        <xs:complexType name="cdItems">
                <xs:sequence>
                        <xs:element name="item" type="cdItem"
maxOccurs="unbounded"></xs:element>
                </xs:sequence>
        </xs:complexType>
        <xs:complexType name="cdItem">
                <xs:sequence>
                        <xs:element name="title" type="xs:positiveInteger"></xs:element>
                        <xs:element name="quantity" type="xs:positiveInteger"></xs:element>
                        <xs:element name="price" type="xs:decimal"></xs:element>
                </xs:sequence>
        </xs:complexType>
</xs:schema>

!************************************************************!



Tue, 05 Oct 2004 22:59:45 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. SAX/DOM/SXML parsers with support for XML Namespaces and validation

2. Validating XML-parser using XML Schema?

3. Anyone using CL-XML(a xml parser)?

4. Microsoft XML-parser

5. Using CLOCC xml.lisp to print XML in XML format

6. xml schemas and smalltalk tools

7. CW 5.5 and XML

8. XML Parsers for Clarion??

9. generating Ruby libs from XML Schemas

10. XML Schemas and Python?

11. Differences between Clarion 4.0 and 5.5

 

 
Powered by phpBB® Forum Software