[xsd-users] request for guidance

Borse, Ganesh ganesh.borse at credit-suisse.com
Mon Oct 1 03:46:17 EDT 2007


Hi,

I am trying to create the following C++ class from the sample input XML given below.
class orderCategory {
         pubilc:
           orderCategory(){};
           orderCategory(int minOrderQty, float minOrderValue):_minQty(minOrderQty), _minValue(minOrderValue)
           {  }
           bool isOrderSmall(int orderQty, float orderValue)
           {
                if ( (orderQty < _minQty) || (orderValue < _minValue){
                     return true;
                }
                return false;
           }
        private:
           int _minQty;
           flaot _minValue;
};

The possible XML which I want to transform into this C++ class could be as below:
<ruleCategory>
    <category genre="orderSizeCategory" type=SMALL>
        <title>SMALL ORDER</title>
        <FunctionName>isOrderSmall</FunctionName>
        <FunctionBody>if((Qty < _minQty) OR (Value < _minValue)){ return true; } return false;</FunctionBody>
        </if-clause>
    </category>
</ruleCategory>
(This XML document may not be very correct, as I am totally new to XML).

Here, I am not trying to read the data stored in XML document.
But, instead I'm trying to generate an independent class from XML which then can be used for totally different purpose than just reading the XML document.

Can you please guide me, can we do this?
If yes, how can we perform such transformation?

Many thanks in advance for your kind help & guidance.

Thanks,
Ganesh

==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer: 

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================



More information about the xsd-users mailing list