Pages

Tuesday, May 17, 2016

Ref and Type in XML Schema

Ref is used to refer to another XML element.


<xsd:element name="Product">
    <xsd:complexType>
        <xsd:sequence>
            <xsd:element name="ProductName" type="xsd:string" />
            <xsd:element ref="Customer" />
        </xsd:sequence>
    </xsd:complexType>
</xsd:element>
<xsd:element name="Customer">
    <xsd:complexType>
        <xsd:sequence>
            <xsd:element name="FullName" type="xsd:string" />
            <xsd:element name="Age" type="xsd:string" />
            <xsd:element name="Age" type="xsd:occupation" />
       </xsd:sequence>
    </xsd:complexType>
</xsd:element>


Type is used to refer to a complexType, simpleType or a built-in type.


<xsd:element name="Product">
    <xsd:complexType>
        <xsd:sequence>
            <xsd:element name="ProductName" type="xsd:string" />
            <xsd:element name="Customer" type="Cust" />
        </xsd:sequence>
    </xsd:complexType>
</xsd:element>

    <xsd:complexType name="Cust" >
        <xsd:sequence>
            <xsd:element name="FullName" type="xsd:string" />
            <xsd:element name="Age" type="xsd:string" />
            <xsd:element name="Age" type="xsd:occupation" />
       </xsd:sequence>
    </xsd:complexType>

Sunday, May 8, 2016

Compile C++ program using C++11

C++11 is the standard of the programming language C++ approved by ISO in 12th August, 2011 replacing C++03. The name follows the tradition of naming language versions by the publication year of the specification, though it was formerly named C++0x because it was expected to be published before 2010.

To compile a C++ program using this version and make use of all the libraries added in this version we need to use the argument c++0x in the command line.

For Eg.:  g++ -std=c++0x hello.cpp -o hello  //Note:its c++ and numeral 0 and x.