Tests



Tests/w3c_tests/digtest


Tests/w3c_tests/digtest/dig.xsd

<!--
    A test case derived from http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd, which 
    has following header comment:
-->

<!-- Schema for XML Signatures
    http://www.w3.org/2000/09/xmldsig#
    $Revision: 1.1 $ on $Date: 2002/02/08 20:32:26 $ by $Author: reagle $

    Copyright 2001 The Internet Society and W3C (Massachusetts Institute
    of Technology, Institut National de Recherche en Informatique et en
    Automatique, Keio University). All Rights Reserved.
    http://www.w3.org/Consortium/Legal/

    This document is governed by the W3C Software License [1] as described
    in the FAQ [2].

    [1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
    [2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
-->


<schema xmlns="http://www.w3.org/2001/XMLSchema"
      xmlns:ds="http://www.w3.org/2000/09/xmldsig"
      targetNamespace="http://www.w3.org/2000/09/xmldsig" >

  <element name="DSAKeyValue" type="ds:DSAKeyValueType"/>

  <complexType name="DSAKeyValueType">
    <sequence>
      <sequence minOccurs="0">
        <element name="P" type="string"/>
        <element name="Q" type="string"/>
      </sequence>
      <element name="G" type="string" minOccurs="0"/>
      <element name="Y" type="string"/>
      <element name="J" type="string" minOccurs="0"/>
      <sequence minOccurs="0">
        <element name="Seed" type="string"/>
        <element name="PgenCounter" type="string"/>
      </sequence>
    </sequence>
  </complexType>
</schema>


Tests/w3c_tests/digtest/nsaliases.xml

<nsaliases>
  <alias uri="http://www.w3.org/2000/09/xmldsig" toUrn="urn:xmldsig"/>
</nsaliases>


Tests/w3c_tests/digtest/valid.xml

<?xml version="1.0"?>
<ns1:DSAKeyValue xmlns:ns1="http://www.w3.org/2000/09/xmldsig">
  <Y>ctA8YGxrtngg/zKVvqEOefnwmViFztcnPBYPlJsvh6yKI4iDm68fnp4Mi3RrJ6bZAygFrUIQLxLjV+OJtgJAEto0xAs+Mehuq1DkSFEpP3oDzCTOsrOiS1DwQe4oIb7zVk/9l7aPtJMHW0LVlMdwZNFNNJoqMcT2ZfCPrfvYvQ0=</Y>
</ns1:DSAKeyValue>


Tests/w3c_tests/digtest/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "xmldsig/all-include.h"

void populateDocument(xmldsig::Document* xsdDoc);
void updateOrConsumeDocument(xmldsig::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<xmldsig::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<xmldsig::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(xmldsig::Document* xsdDoc)
{
  xsdDoc->element_DSAKeyValue()->set_Y("ctA8YGxrtngg/zKVvqEOefnwmViFztcnPBYPlJsvh6yKI4iDm68fnp4Mi3RrJ6bZAygFrUIQLxLjV+OJtgJAEto0xAs+Mehuq1DkSFEpP3oDzCTOsrOiS1DwQe4oIb7zVk/9l7aPtJMHW0LVlMdwZNFNNJoqMcT2ZfCPrfvYvQ0=");
}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(xmldsig::Document* xsdDoc)
{

}

  



Tests/w3c_tests/stZ015


Tests/w3c_tests/stZ015/stZ015.xsd

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   	
	<xsd:element name="Root">
	  <xsd:complexType>
	    <xsd:sequence>
		<xsd:element name="Total1" type="Base"/>
		<xsd:element name="Total2" type="Derived"/>
 	    </xsd:sequence>
	  </xsd:complexType>
	</xsd:element>
	

	<xsd:simpleType name="Base">
	  <xsd:restriction base="xsd:integer">
		<xsd:totalDigits value="3"/>
	  </xsd:restriction>
	</xsd:simpleType>            
 	
  <xsd:simpleType name="Derived">
	  <xsd:restriction base="Base">
	    <xsd:minExclusive value="100"/>
	  </xsd:restriction>
	</xsd:simpleType>
</xsd:schema>




Tests/w3c_tests/stZ015/stZ015.xml

<Root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="stZ015.xsd">
  <Total1>123</Total1>
  <Total2>101</Total2>
</Root>


Tests/w3c_tests/stZ015/valid.xml

<?xml version="1.0"?>
<Root>
  <Total1>123</Total1>
  <Total2>101</Total2>
</Root>


Tests/w3c_tests/stZ015/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{
  xsdDoc->element_Root()->set_Total1("123");
  xsdDoc->element_Root()->set_Total2("101");
}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/w3c_tests/nist5


Tests/w3c_tests/nist5/5.xsd

<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:nist="NISTSchema-SV-IV-list-unsignedShort-pattern-5-NS"
        targetNamespace="NISTSchema-SV-IV-list-unsignedShort-pattern-5-NS">

  <annotation>
    <documentation>
      The National Institute of Standards and Technology.
      Conformance test for W3C XML Schema Part 2: Datatypes.
      Created Jan 13, 2004.

      File: NISTSchema-SV-IV-list-unsignedShort-pattern-5.xsd
      This schema specifies a datatype, NISTSchema-SV-IV-list-unsignedShort-pattern-5,
      which is derived by restriction of a list with item type unsignedShort
      by facet pattern with a value of: \d{1} \d{2} \d{3} \d{4} \d{5} \d{1} \d{2}
      This schema is intended to be valid with
      regard to the schema for schemas.
    </documentation>
  </annotation>

  <element name="NISTSchema-SV-IV-list-unsignedShort-pattern-5" type="nist:NISTSchema-SV-IV-list-unsignedShort-pattern-5-Type"/>

  <simpleType name="listOfunsignedShort">
    <list itemType="unsignedShort"/>
  </simpleType>

  <simpleType name="NISTSchema-SV-IV-list-unsignedShort-pattern-5-Type">
    <restriction base="nist:listOfunsignedShort">
      <pattern value="\d{1} \d{2} \d{3} \d{4} \d{5} \d{1} \d{2}"/>
    </restriction>
  </simpleType>

</schema>


Tests/w3c_tests/nist5/NISTXML-SV-IV-list-unsignedShort-pattern-5-1.xml

<?xml version="1.0"?>

<!--
      The National Institute of Standards and Technology.
      Conformance test for W3C XML Schema Part 2: Datatypes.
      Date: Jan 13, 2004.

      File name: NISTXML-SV-IV-list-unsignedShort-pattern-5-1.xml
      Description: XML instance number 1 in a series of 5.
      Schema location:
      NISTSchema-SV-IV-list-unsignedShort-pattern-5.xsd
      This instance is intended to be valid with
      regard to the defining schema.
-->

<NISTSchema-SV-IV-list-unsignedShort-pattern-5
    xmlns="NISTSchema-SV-IV-list-unsignedShort-pattern-5-NS"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="NISTSchema-SV-IV-list-unsignedShort-pattern-5-NS NISTSchema-SV-IV-list-unsignedShort-pattern-5.xsd">6 63 225 3222 63222 2 39</NISTSchema-SV-IV-list-unsignedShort-pattern-5>


Tests/w3c_tests/nist5/NISTXML-SV-IV-list-unsignedShort-pattern-5-2.xml

<?xml version="1.0"?>

<!--
      The National Institute of Standards and Technology.
      Conformance test for W3C XML Schema Part 2: Datatypes.
      Date: Jan 13, 2004.

      File name: NISTXML-SV-IV-list-unsignedShort-pattern-5-2.xml
      Description: XML instance number 2 in a series of 5.
      Schema location:
      NISTSchema-SV-IV-list-unsignedShort-pattern-5.xsd
      This instance is intended to be valid with
      regard to the defining schema.
-->

<NISTSchema-SV-IV-list-unsignedShort-pattern-5
    xmlns="NISTSchema-SV-IV-list-unsignedShort-pattern-5-NS"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="NISTSchema-SV-IV-list-unsignedShort-pattern-5-NS NISTSchema-SV-IV-list-unsignedShort-pattern-5.xsd">8 53 819 3323 62112 3 18</NISTSchema-SV-IV-list-unsignedShort-pattern-5>


Tests/w3c_tests/nist5/NISTXML-SV-IV-list-unsignedShort-pattern-5-3.xml

<?xml version="1.0"?>

<!--
      The National Institute of Standards and Technology.
      Conformance test for W3C XML Schema Part 2: Datatypes.
      Date: Jan 13, 2004.

      File name: NISTXML-SV-IV-list-unsignedShort-pattern-5-3.xml
      Description: XML instance number 3 in a series of 5.
      Schema location:
      NISTSchema-SV-IV-list-unsignedShort-pattern-5.xsd
      This instance is intended to be valid with
      regard to the defining schema.
-->

<NISTSchema-SV-IV-list-unsignedShort-pattern-5
    xmlns="NISTSchema-SV-IV-list-unsignedShort-pattern-5-NS"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="NISTSchema-SV-IV-list-unsignedShort-pattern-5-NS NISTSchema-SV-IV-list-unsignedShort-pattern-5.xsd">9 21 924 2629 61222 4 68</NISTSchema-SV-IV-list-unsignedShort-pattern-5>


Tests/w3c_tests/nist5/NISTXML-SV-IV-list-unsignedShort-pattern-5-4.xml

<?xml version="1.0"?>

<!--
      The National Institute of Standards and Technology.
      Conformance test for W3C XML Schema Part 2: Datatypes.
      Date: Jan 13, 2004.

      File name: NISTXML-SV-IV-list-unsignedShort-pattern-5-4.xml
      Description: XML instance number 4 in a series of 5.
      Schema location:
      NISTSchema-SV-IV-list-unsignedShort-pattern-5.xsd
      This instance is intended to be valid with
      regard to the defining schema.
-->

<NISTSchema-SV-IV-list-unsignedShort-pattern-5
    xmlns="NISTSchema-SV-IV-list-unsignedShort-pattern-5-NS"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="NISTSchema-SV-IV-list-unsignedShort-pattern-5-NS NISTSchema-SV-IV-list-unsignedShort-pattern-5.xsd">8 85 638 4278 62321 7 66</NISTSchema-SV-IV-list-unsignedShort-pattern-5>


Tests/w3c_tests/nist5/NISTXML-SV-IV-list-unsignedShort-pattern-5-5.xml

<?xml version="1.0"?>

<!--
      The National Institute of Standards and Technology.
      Conformance test for W3C XML Schema Part 2: Datatypes.
      Date: Jan 13, 2004.

      File name: NISTXML-SV-IV-list-unsignedShort-pattern-5-5.xml
      Description: XML instance number 5 in a series of 5.
      Schema location:
      NISTSchema-SV-IV-list-unsignedShort-pattern-5.xsd
      This instance is intended to be valid with
      regard to the defining schema.
-->

<NISTSchema-SV-IV-list-unsignedShort-pattern-5
    xmlns="NISTSchema-SV-IV-list-unsignedShort-pattern-5-NS"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="NISTSchema-SV-IV-list-unsignedShort-pattern-5-NS NISTSchema-SV-IV-list-unsignedShort-pattern-5.xsd">8 73 142 3996 62313 5 22</NISTSchema-SV-IV-list-unsignedShort-pattern-5>


Tests/w3c_tests/nist5/valid.xml

<?xml version="1.0"?>
<ns1:NISTSchema-SV-IV-list-unsignedShort-pattern-5 xmlns:ns1="NISTSchema-SV-IV-list-unsignedShort-pattern-5-NS">6 63 225 3222 63222 2 39</ns1:NISTSchema-SV-IV-list-unsignedShort-pattern-5>


Tests/w3c_tests/nist5/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NISTSchema_SV_IV_list_unsignedShort_pattern_5_NS/all-include.h"

void populateDocument(NISTSchema_SV_IV_list_unsignedShort_pattern_5_NS::Document* xsdDoc);
void updateOrConsumeDocument(NISTSchema_SV_IV_list_unsignedShort_pattern_5_NS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NISTSchema_SV_IV_list_unsignedShort_pattern_5_NS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<NISTSchema_SV_IV_list_unsignedShort_pattern_5_NS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NISTSchema_SV_IV_list_unsignedShort_pattern_5_NS::Document* xsdDoc)
{
  xsdDoc->element_NISTSchema_SV_IV_list_unsignedShort_pattern_5()->stringValue("6 63 225 3222 63222 2 39");

}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NISTSchema_SV_IV_list_unsignedShort_pattern_5_NS::Document* xsdDoc)
{

}

  



Tests/w3c_tests/stE080


Tests/w3c_tests/stE080/stE080.xsd

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

	<xsd:simpleType name="list">
		<xsd:list itemType="xsd:int"/>
	</xsd:simpleType>

	<xsd:element name="root" fixed="1 2 3 4 20 100">
		<xsd:simpleType>
			<xsd:union memberTypes="xsd:gMonth xsd:gYear list"/>
		</xsd:simpleType>
	</xsd:element>
</xsd:schema>


Tests/w3c_tests/stE080/stE080.xml

<root>1 2 3 4 20 100</root>


Tests/w3c_tests/stE080/valid.xml

<?xml version="1.0"?>
<root>1 2 3 4 20 100</root>


Tests/w3c_tests/stE080/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{

}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/w3c_tests/reDH7a


Tests/w3c_tests/reDH7a/reDH7a.xsd

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>

<xsd:element name="doc">
    <xsd:complexType>
            <xsd:choice maxOccurs="2">
                <xsd:element name="elem" type="Regex" minOccurs="1" maxOccurs="unbounded"/>
            </xsd:choice>
    </xsd:complexType>
</xsd:element>

<xsd:simpleType name="Regex">
       <xsd:restriction base="xsd:IDREF">
           <xsd:pattern value="\C[\C\d]*"/>    
       </xsd:restriction>
</xsd:simpleType>



</xsd:schema>


Tests/w3c_tests/reDH7a/reDH7a.xml

<?xml version="1.0"?>
<doc>


     <elem>a123</elem>

 </doc>


Tests/w3c_tests/reDH7a/valid.xml

<?xml version="1.0"?>
<doc>
  <elem>123</elem>
  <elem>234</elem>
  <elem>789</elem>
</doc>


Tests/w3c_tests/reDH7a/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{
  NoNS::doc* pdoc = xsdDoc->element_doc();
  pdoc->set_count_choiceList(2);

  List<NoNS::doc::elem_ptr>  choice1ElemList = pdoc->choice_at(0)->choose_list_elem(2);
  choice1ElemList.at(0)->stringValue("123");
  choice1ElemList.at(1)->stringValue("234");

  List<NoNS::doc::elem_ptr>  choice2ElemList = pdoc->choice_at(1)->choose_list_elem(1);
  choice2ElemList.at(0)->stringValue("789");
}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/w3c_tests/ste099


Tests/w3c_tests/ste099/ste099.xsd

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

	<xsd:simpleType name="union">
		<xsd:union memberTypes="xsd:gYear xsd:base64Binary xsd:gDay"/>
	</xsd:simpleType>

	<xsd:element name="root" fixed="abcdefab">
		<xsd:simpleType>
			<xsd:list itemType="union"/>
		</xsd:simpleType>
	</xsd:element>

</xsd:schema>


Tests/w3c_tests/ste099/ste099.xml

<root>abcdefab</root>


Tests/w3c_tests/ste099/valid.xml

<?xml version="1.0"?>
<root>abcdefab</root>


Tests/w3c_tests/ste099/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{

}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/w3c_tests/stG003


Tests/w3c_tests/stG003/stG003.xsd

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<xsd:element name="root">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref="fooTest"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="fooTest" type="fooType"/>
	<xsd:simpleType name="myInteger">
		<xsd:list itemType="xsd:integer"/>
	</xsd:simpleType>
	<xsd:simpleType name="fooType">
		<xsd:restriction base="myInteger">
			<xsd:maxLength value="3"/>
		</xsd:restriction>
	</xsd:simpleType>
</xsd:schema>


Tests/w3c_tests/stG003/stG003.xml

<?xml version="1.0"?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="stG003.xsd">
	<fooTest>
	10	25	   33
	55
  </fooTest>
</root>


Tests/w3c_tests/stG003/valid.xml

<?xml version="1.0"?>
<root>
  <fooTest>10 25 33</fooTest>
</root>


Tests/w3c_tests/stG003/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
  
void chooseDocumentElement(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  cbStruct.cbChooseDocumentElement      =  chooseDocumentElement;

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

  
// choose the element inside Document that you want as root using
// a call like : xsdDoc->set_root_xyz();
void chooseDocumentElement(NoNS::Document* xsdDoc)
{
  // uncomment one of folowing to choose root
  
  xsdDoc->set_root_root();
  
  //xsdDoc->set_root_fooTest();
    
}
    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{
  xsdDoc->element_root()->set_fooTest("10 25 33 ");
}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/w3c_tests/stH005


Tests/w3c_tests/stH005/stH005.xsd

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<xsd:element name="root">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref="fooTest"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="fooTest" type="fooType"/>
	<xsd:simpleType name="ListOfZips">
		<xsd:list>
			<xsd:simpleType>
				<xsd:restriction base="xsd:string">
					<xsd:pattern value="[0-9]{5}"/>
				</xsd:restriction>
			</xsd:simpleType>
		</xsd:list>
	</xsd:simpleType>
	<xsd:simpleType name="fooType">
		<xsd:union>
			<xsd:simpleType>
				<xsd:restriction base="ListOfZips">
					<xsd:pattern value="[0-8]{5}"/>
				</xsd:restriction>
			</xsd:simpleType>
		</xsd:union>
	</xsd:simpleType>
</xsd:schema>


Tests/w3c_tests/stH005/stH005.xml

<?xml version="1.0"?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="stH005.xsd">
	<fooTest>
	12345
  </fooTest>
</root>


Tests/w3c_tests/stH005/valid.xml

<?xml version="1.0"?>
<root>
  <fooTest>12348</fooTest>
</root>


Tests/w3c_tests/stH005/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
  
void chooseDocumentElement(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  cbStruct.cbChooseDocumentElement      =  chooseDocumentElement;

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

  
// choose the element inside Document that you want as root using
// a call like : xsdDoc->set_root_xyz();
void chooseDocumentElement(NoNS::Document* xsdDoc)
{
  // uncomment one of folowing to choose root
  
  xsdDoc->set_root_root();
  
  //xsdDoc->set_root_fooTest();
    
}
    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{
  xsdDoc->element_root()->set_fooTest("12348");
}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/xplus_tests/scExt3


Tests/xplus_tests/scExt3/scExt3.xsd

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <xsd:complexType name="ComplexTypeSCExtn">
    <xsd:simpleContent>
      <xsd:extension base="xsd:string">
        <xsd:attribute name="id" type="xsd:ID" use="required"/>
      </xsd:extension>
    </xsd:simpleContent>
  </xsd:complexType>

  <xsd:element name="root" type="ComplexTypeSCExtn"/> 

</xsd:schema>


Tests/xplus_tests/scExt3/valid.xml

<?xml version="1.0"?>
<root id="ID1">simple content with extension</root>


Tests/xplus_tests/scExt3/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{
  xsdDoc->element_root()->set_attr_id("ID1");
  xsdDoc->element_root()->stringValue("simple content with extension");
}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/xplus_tests/includeTests


Tests/xplus_tests/includeTests/i1.xsd

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
  
  <xsd:element name="elem1_from_i1" type="xsd:int"/>

  <xsd:simpleType name="AlphabeticString">
    <xsd:restriction base="xsd:string">
      <xsd:pattern value="[A-Z]+"/>
    </xsd:restriction>
  </xsd:simpleType>

</xsd:schema>


Tests/xplus_tests/includeTests/i2.xsd

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
  
  <xsd:element name="elem1_from_i2" type="xsd:int"/>

  <xsd:simpleType name="StringLength5">
    <xsd:restriction base="xsd:string">
      <xsd:length value='5'/>
    </xsd:restriction>  
  </xsd:simpleType>

</xsd:schema>


Tests/xplus_tests/includeTests/i3.xsd

<xsd:schema 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  targetNamespace="urn:includeTests"
>
  <xsd:element name="elem1_from_i3" type="xsd:int"/>

</xsd:schema>


Tests/xplus_tests/includeTests/including1.xsd

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" >

  <xsd:include schemaLocation="i1.xsd"/>
  <xsd:include schemaLocation="i2.xsd"/>

  <xsd:element name="root1" type="AlphabeticString"/>
  <xsd:element name="root2" type="StringLength5"/>
  <xsd:element name="root3">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="elem1_from_i1"/>
        <xsd:element ref="elem1_from_i2"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

</xsd:schema>



Tests/xplus_tests/includeTests/including2.xsd

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <xsd:include schemaLocation="i3.xsd"/>
  
  <xsd:element name="root"/>

</xsd:schema>



Tests/xplus_tests/includeTests/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
  
void chooseDocumentElement(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  cbStruct.cbChooseDocumentElement      =  chooseDocumentElement;

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

  
// choose the element inside Document that you want as root using
// a call like : xsdDoc->set_root_xyz();
void chooseDocumentElement(NoNS::Document* xsdDoc)
{
  // uncomment one of folowing to choose root
  
  //xsdDoc->set_root_root1();
  
  //xsdDoc->set_root_root2();
  
  //xsdDoc->set_root_elem1_from_included1();
  
  //xsdDoc->set_root_elem1_from_included2();
  
  //xsdDoc->set_root_elem1_from_included1();
    
  //xsdDoc->set_root_elem1_from_included2();
      
}
    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{

}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/xplus_tests/ccExtAny


Tests/xplus_tests/ccExtAny/ccExtAny.xsd

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" >

  <xsd:complexType name="AnyComplexType">
    <xsd:complexContent>
      <xsd:extension base="xsd:anyType"/>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:element name="root" type="AnyComplexType"/> 

</xsd:schema>   
    
 


Tests/xplus_tests/ccExtAny/valid.xml

<?xml version="1.0"?>
<root></root>


Tests/xplus_tests/ccExtAny/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  Please do not edit.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

    

int main (int argc, char**argv)
{
  XSD_USER_OPS::xsd_main(argc, argv);
}

DOM::Document* createXsdDocument(bool buildTree)
{
  NoNS::Document* xsdDoc = new NoNS::Document(buildTree);
    
  return xsdDoc;
}

DOM::Document* createXsdDocument(string inFilePath)
{
  XPlusFileInputStream is;
  is.open(inFilePath.c_str(), ios::binary);

  NoNS::Document* xsdDoc = new NoNS::Document(false);

  is >> *xsdDoc; 
  return xsdDoc;
}

//
// Following functions are templates.
// You need to put code in the context
//

    

// template function to populate the Tree with values
void populateDocument(DOM::Document* pDoc)
{
  NoNS::Document* xsdDoc = dynamic_cast<NoNS::Document *>(pDoc);
  // write code to populate the Document here
  //xsdDoc->element_root()->stringValue("tt")

}

void updateOrConsumeDocument(DOM::Document* pDoc)
{
  NoNS::Document* xsdDoc = dynamic_cast<NoNS::Document *>(pDoc);
  // write code to operate on the populated-Document here

}

  



Tests/xplus_tests/ccRest2


Tests/xplus_tests/ccRest2/ccRest2.xsd

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" >

  <xs:complexType name="length2">
   <xs:complexContent>
    <xs:restriction base="xs:anyType">
     <xs:sequence>
      <xs:element name="size" type="xs:nonNegativeInteger"/>
      <xs:element name="unit" type="xs:NMTOKEN"/>
     </xs:sequence>
    </xs:restriction>
   </xs:complexContent>
  </xs:complexType>

  <xs:element name="depth" type="length2" />

  <!--
    <depth>
     <size>25</size><unit>cm</unit>
    </depth>
  -->

</xs:schema>


Tests/xplus_tests/ccRest2/valid.xml

<?xml version="1.0"?>
<depth>
  <size>25</size>
  <unit>cm</unit>
</depth>


Tests/xplus_tests/ccRest2/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{
  xsdDoc->element_depth()->set_size(25);
  xsdDoc->element_depth()->set_unit("cm");
}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/xplus_tests/defaultTest


Tests/xplus_tests/defaultTest/defaultTest.xsd

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

	<xsd:element name="root">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="e1" type="xsd:int" default="500" minOccurs="0" />
        <xsd:element name="e2" type="xsd:int" default="600"/>
      </xsd:sequence>
      <xsd:attribute name="a2" type="xsd:int" default="200" use="optional"/>
      <xsd:attribute name="a3" type="xsd:int"/>
    </xsd:complexType>
  </xsd:element>
	

</xsd:schema>


Tests/xplus_tests/defaultTest/t1.xml

<?xml version="1.0"?>
<root>
  <e1></e1>
  <e2></e2>
</root>


Tests/xplus_tests/defaultTest/t2.xml

<?xml version="1.0"?>
<root a2="50" a3="75">
  <e1>700</e1>
  <e2>800</e2>
</root>


Tests/xplus_tests/defaultTest/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{

}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/xplus_tests/scExt2


Tests/xplus_tests/scExt2/scExt2.xsd

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <xsd:simpleType name="aStringOfLen50">
    <xsd:restriction base='xsd:string'>
      <xsd:maxLength value='50'/>
    </xsd:restriction>
  </xsd:simpleType>


  <xsd:complexType name="ComplexTypeSCExtn">
    <xsd:simpleContent>
      <xsd:extension base="aStringOfLen50">
        <xsd:attribute name="id" type="xsd:ID" use="required"/>
      </xsd:extension>
    </xsd:simpleContent>
  </xsd:complexType>


  <xsd:element name="root"> 
    <xsd:complexType>
      <xsd:simpleContent>
        <xsd:extension base="ComplexTypeSCExtn">
          <xsd:attribute name="idx" type="xsd:int" use="required"/>
        </xsd:extension>
      </xsd:simpleContent>
    </xsd:complexType>
  </xsd:element>

</xsd:schema>


Tests/xplus_tests/scExt2/valid.xml

<?xml version="1.0"?>
<root id="ID1" idx="100">simple content with extension</root>


Tests/xplus_tests/scExt2/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{
  xsdDoc->element_root()->set_attr_id("ID1");
  xsdDoc->element_root()->set_attr_idx("100");
  xsdDoc->element_root()->stringValue("simple content with extension");
}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/xplus_tests/xsiTest


Tests/xplus_tests/xsiTest/xsiTest.xsd

<xsd:schema 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  elementFormDefault="qualified"
  >

  <xsd:complexType name="SomeType">
    <xsd:sequence>
      <xsd:element name="item" type="xsd:string" minOccurs="3" maxOccurs="3"/>
    </xsd:sequence>
    <xsd:attribute name="id" type="xsd:string" default="102"/>
  </xsd:complexType>  

  <xsd:complexType name="SomeType2">
    <xsd:complexContent>
      <xsd:extension base="SomeType">
        <xsd:sequence>
          <xsd:element name="item2" type="xsd:int"/>
        </xsd:sequence>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>  

  <xsd:element name="root">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="items" type="SomeType"/>
      </xsd:sequence>
    </xsd:complexType>  
  </xsd:element>

</xsd:schema>



Tests/xplus_tests/xsiTest/valid2.xml

<?xml version="1.0"?>

<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  <items id="102" xsi:type="SomeType2">
    <item>item 1</item>
    <item>item 2</item>
    <item>item 3</item>
    <item2>123</item2>
  </items>
</root>



Tests/xplus_tests/xsiTest/valid.xml

<?xml version="1.0"?>
<root>
  <items id="102">
    <item>item 1</item>
    <item>item 2</item>
    <item>item 3</item>
  </items>
</root>


Tests/xplus_tests/xsiTest/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{
  NoNS::root::items* pItems =  xsdDoc->element_root()->element_items();
  pItems->mark_present_attr_id();
  pItems->set_item(0, "item 1");
  pItems->set_item(1, "item 2");
  pItems->set_item(2, "item 3");
}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/xplus_tests/scExt


Tests/xplus_tests/scExt/scExt.xsd

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <xsd:element name="root"> 
    <xsd:complexType>
      <xsd:simpleContent>
        <xsd:extension base="xsd:string">
          <xsd:attribute name="id" type="xsd:ID" use="required"/>
        </xsd:extension>
      </xsd:simpleContent>
    </xsd:complexType>
  </xsd:element>

</xsd:schema>


Tests/xplus_tests/scExt/valid.xml

<?xml version="1.0"?>
<root id="ID1">simple content with extension</root>


Tests/xplus_tests/scExt/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{
  xsdDoc->element_root()->set_attr_id("ID1");
  xsdDoc->element_root()->stringValue("simple content with extension");
}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/xplus_tests/importTests


Tests/xplus_tests/importTests/i1.xsd

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
  
  <xsd:element name="elem1_from_i1" type="xsd:int"/>

</xsd:schema>


Tests/xplus_tests/importTests/i2.xsd

<xsd:schema 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  targetNamespace="urn:importTests"
>
  
  <xsd:element name="elem1_from_i2" type="xsd:int"/>

</xsd:schema>


Tests/xplus_tests/importTests/importing1.xsd

<xsd:schema 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  xmlns:ns1="urn:importTests"
>

  <xsd:import namespace="urn:importTests" schemaLocation="i2.xsd"/>
  <xsd:element ref="ns1:elem1_from_i2"/>

</xsd:schema>


Tests/xplus_tests/importTests/importing3.xsd

<xsd:schema 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  xmlns:ns1="urn:importTests"
  targetNamespace="urn:importTests"
>
  <xsd:import namespace="urn:importTests" schemaLocation="i2.xsd"/>
  <xsd:element ref="ns1:elem1_from_i2"/>

</xsd:schema>


Tests/xplus_tests/importTests/importing4.xsd

<xsd:schema 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  targetNamespace="urn:importTests"
>
  <xsd:import schemaLocation="i1.xsd"/>

  <xsd:element ref="elem1_from_i1"/>

</xsd:schema>


Tests/xplus_tests/importTests/importing5.xsd

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
  
  <xsd:import schemaLocation="i1.xsd"/>
  <xsd:element name="root"/>

</xsd:schema>


Tests/xplus_tests/importTests/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{

}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/xplus_tests/ccExt2


Tests/xplus_tests/ccExt2/ccExt2.xsd

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" >

  <xs:complexType name="ComplexTypeSeq">
    <xs:sequence>
      <xs:element name="e1" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="e2"/>
      <xs:element name="e3"/>
    </xs:sequence>
    <xs:attribute name="a1" type="xs:ID" use="optional"/>
  </xs:complexType>

  <xs:element name="root">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="ComplexTypeSeq">
          <xs:sequence>
            <xs:element name="e4" minOccurs="1" maxOccurs="1"/>
            <xs:element name="e5"/>
          </xs:sequence>
          <xs:attribute name="a2" type="xs:int" use="required"/>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>


</xs:schema>


Tests/xplus_tests/ccExt2/valid.xml

<?xml version="1.0"?>
<root a2="100" a1="IDA1">
  <e1>e1 value</e1>
  <e1>e1 value2</e1>
  <e2>e2 value</e2>
  <e3>e3 value</e3>
  <e4>e4 value</e4>
  <e5>e5 value</e5>
</root>


Tests/xplus_tests/ccExt2/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{
  NoNS::root* pRootElem = xsdDoc->element_root();

  pRootElem->set_attr_a1("IDA1");
  pRootElem->set_attr_a2("100");
  
  pRootElem->set_count_e1(2);
  // need revisit for API on anyType :
  pRootElem->element_e1_at(0)->stringValue("e1 value");
  pRootElem->element_e1_at(1)->stringValue("e1 value2");

  pRootElem->element_e2()->stringValue("e2 value");
  pRootElem->element_e3()->stringValue("e3 value");
  pRootElem->element_e4()->stringValue("e4 value");
  pRootElem->element_e5()->stringValue("e5 value");
}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/xplus_tests/choiceOfSeq


Tests/xplus_tests/choiceOfSeq/choiceOfSeq.xsd

<?xml version="1.0" encoding="utf-8"?>
<xs:schema 
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:ns1="urn:ns1"
    targetNamespace="urn:ns1"
    version="0.1" elementFormDefault="qualified"> 


  <element name="myData" type="ns1:myDataType"/> 
  
  <complexType name="myDataType"> 
    <choice>
      <sequence>
        <element name="e1" type="xs:string"/> 
        <element name="e2" type="xs:string" minOccurs="0"/> 
        <!-- enable following when support for wildcards is implemented -->
        <!--
        <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        -->
      </sequence>
      <sequence>
        <element name="e1" type="xs:string"/> 
        <!-- enable following when support for wildcards is implemented -->
        <!--
        <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        -->
      </sequence>
    </choice>
  </complexType>

</xs:schema>


Tests/xplus_tests/choiceOfSeq/valid.xml

<?xml version="1.0"?>
<ns1:myData xmlns:ns1="urn:ns1">
  <ns1:e1>e1 value</ns1:e1>
  <ns1:e2>e2 value</ns1:e2>
</ns1:myData>


Tests/xplus_tests/choiceOfSeq/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "ns1/all-include.h"

void populateDocument(ns1::Document* xsdDoc);
void updateOrConsumeDocument(ns1::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<ns1::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<ns1::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(ns1::Document* xsdDoc)
{
  ns1::myData* pMyData =  xsdDoc->element_myData();
  ns1::Types::myDataType::choice::sequence1* pSeq1 = pMyData->get_choice()->choose_sequence1();
  pSeq1->set_e1("e1 value");
  pSeq1->set_e2("e2 value");
}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(ns1::Document* xsdDoc)
{

}

  



Tests/xplus_tests/ctAnyType


Tests/xplus_tests/ctAnyType/ctAnyType.xsd

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" >

  <xs:element name="root" type="xs:anyType"/>

</xs:schema>


Tests/xplus_tests/ctAnyType/valid.xml

<?xml version="1.0"?>
<root>abcd</root>


Tests/xplus_tests/ctAnyType/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{
  // need revisit for API on anyType :
  xsdDoc->element_root()->stringValue("abcd");
}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/xplus_tests/ccExt


Tests/xplus_tests/ccExt/ccExt.xsd

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" >

  <xs:complexType name="ComplexTypeSeq">
    <xs:sequence>
      <xs:element name="e1" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="e2"/>
      <xs:element name="e3"/>
    </xs:sequence>
    <xs:attribute name="a1" type="xs:ID" use="optional"/>
    <!--
    <xs:attribute name="a2" type="xs:int" use="optional"/>
    -->
  </xs:complexType>

  <xs:complexType name="ComplexTypeCCExtn">
    <xs:complexContent>
      <xs:extension base="ComplexTypeSeq">
        <xs:sequence>
          <xs:element name="e4" minOccurs="1" maxOccurs="1"/>
          <xs:element name="e5"/>
        </xs:sequence>
        <xs:attribute name="a2" type="xs:int" use="required"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:element name="root" type="ComplexTypeCCExtn"/>

</xs:schema>


Tests/xplus_tests/ccExt/valid.xml

<?xml version="1.0"?>
<root a2="100" a1="IDA1">
  <e1>e1 value</e1>
  <e1>e1 value2</e1>
  <e2>e2 value</e2>
  <e3>e3 value</e3>
  <e4>e4 value</e4>
  <e5>e5 value</e5>
</root>


Tests/xplus_tests/ccExt/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{
  NoNS::root* pRootElem = xsdDoc->element_root();

  pRootElem->set_attr_a1("IDA1");
  pRootElem->set_attr_a2("100");
  
  pRootElem->set_count_e1(2);
  // need revisit for API on anyType :
  pRootElem->element_e1_at(0)->stringValue("e1 value");
  pRootElem->element_e1_at(1)->stringValue("e1 value2");

  pRootElem->element_e2()->stringValue("e2 value");
  pRootElem->element_e3()->stringValue("e3 value");
  pRootElem->element_e4()->stringValue("e4 value");
  pRootElem->element_e5()->stringValue("e5 value");
}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/xplus_tests/ccRest3


Tests/xplus_tests/ccRest3/ccRest3.xsd

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" >

  <xs:complexType name="ComplexTypeSeq">
    <xs:sequence>
      <xs:element name="e1" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="e2" minOccurs="0"/>
      <xs:element name="e3"/>
    </xs:sequence>
    <xs:attribute name="a1" type="xs:ID" use="optional"/>
    <xs:attribute name="a2" type="xs:int" use="optional"/>
  </xs:complexType>

  <xs:element name="root">
    <xs:complexType>
      <xs:complexContent mixed="true">
        <xs:restriction base="ComplexTypeSeq">
          <xs:sequence>
            <xs:element name="e1" minOccurs="1" maxOccurs="1"/>
            <xs:element name="e3"/>
          </xs:sequence>
          <xs:attribute name="a2" type="xs:int" use="required"/>
        </xs:restriction>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>  

</xs:schema>


Tests/xplus_tests/ccRest3/valid.xml

<?xml version="1.0"?>
<root a2="200" a1="IDA1">
  <e1>e1 value</e1>
  <e3>e3 value</e3>
</root>


Tests/xplus_tests/ccRest3/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{
  xsdDoc->element_root()->set_attr_a1("IDA1");
  xsdDoc->element_root()->set_attr_a2("200");
  
  // need revisit for API on anyType :
  xsdDoc->element_root()->element_e1()->stringValue("e1 value");
  xsdDoc->element_root()->element_e3()->stringValue("e3 value");
}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/xplus_tests/xsiTest3


Tests/xplus_tests/xsiTest3/xsiTest3.xsd

<xsd:schema 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  elementFormDefault="qualified"
  >

  <xsd:complexType name="SomeType" abstract="true">
    <xsd:sequence>
      <xsd:element name="item" type="xsd:string"/>
    </xsd:sequence>
    <xsd:attribute name="id" type="xsd:string" default="102"/>
  </xsd:complexType>  

  <xsd:complexType name="SomeType2">
    <xsd:complexContent>
      <xsd:extension base="SomeType">
        <xsd:sequence>
          <xsd:element name="item2" type="xsd:int"/>
        </xsd:sequence>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>  
  
  <xsd:element name="items" type="SomeType"/>
</xsd:schema>



Tests/xplus_tests/xsiTest3/valid2.xml

<?xml version="1.0"?>

<items id="102" xsi:type="SomeType2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <item>abc</item>
  <item2>123</item2>
</items>



Tests/xplus_tests/xsiTest3/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{

}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/xplus_tests/fixedTest


Tests/xplus_tests/fixedTest/fixedTest.xsd

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

	<xsd:element name="root">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="e1" type="xsd:int" minOccurs="0" fixed="500"/>
        <xsd:element name="e2" type="xsd:int" fixed="600"/>
      </xsd:sequence>
      <xsd:attribute name="a1" type="xsd:int" fixed="100" use="optional"/>
      <xsd:attribute name="a2" type="xsd:int" fixed="200" use="required"/>
      <xsd:attribute name="a3" type="xsd:int"/>
    </xsd:complexType>
  </xsd:element>
	

</xsd:schema>


Tests/xplus_tests/fixedTest/t1.xml

<?xml version="1.0"?>
<root a2="200">
  <e1>500</e1>
  <e2>600</e2>
</root>


Tests/xplus_tests/fixedTest/t2.xml

<?xml version="1.0"?>
<root a1="50" a2="75">
  <e1>800</e1>
  <e2>900</e2>
</root>


Tests/xplus_tests/fixedTest/t3.xml

<?xml version="1.0"?>
<root a1="100" a2="200" a3="300">
  <e1>500</e1>
  <e2>600</e2>
</root>


Tests/xplus_tests/fixedTest/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{

}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/xplus_tests/xsiTest2


Tests/xplus_tests/xsiTest2/xsiTest2.xsd

<xsd:schema 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  elementFormDefault="qualified"
  >

  <xsd:complexType name="SomeType" abstract="true">
    <xsd:sequence>
      <xsd:element name="item" type="xsd:string"/>
    </xsd:sequence>
    <xsd:attribute name="id" type="xsd:string" default="102"/>
  </xsd:complexType>  

  <xsd:complexType name="SomeType2">
    <xsd:complexContent>
      <xsd:extension base="SomeType">
        <xsd:sequence>
          <xsd:element name="item2" type="xsd:int"/>
        </xsd:sequence>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>  

  <xsd:element name="root">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="items" type="SomeType"/>
      </xsd:sequence>
    </xsd:complexType>  
  </xsd:element>

</xsd:schema>



Tests/xplus_tests/xsiTest2/valid2.xml

<?xml version="1.0"?>

<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  <items id="102" xsi:type="SomeType2">
    <item>abc</item>
    <item2>123</item2>
  </items>
</root>



Tests/xplus_tests/xsiTest2/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{

}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/xplus_tests/nillableTest


Tests/xplus_tests/nillableTest/nillableTest.xsd

<xsd:schema 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  elementFormDefault="qualified"
  >

  <xsd:complexType name="SomeType">
    <xsd:sequence>
      <xsd:element name="item" type="xsd:string" minOccurs="3" maxOccurs="3"/>
    </xsd:sequence>
    <xsd:attribute name="id" type="xsd:string" default="102"/>
  </xsd:complexType>  

  <xsd:element name="root">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="items" type="SomeType" nillable="true"/>
      </xsd:sequence>
    </xsd:complexType>  
  </xsd:element>

</xsd:schema>



Tests/xplus_tests/nillableTest/valid2.xml

<?xml version="1.0"?>
<root  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <items id="102" xsi:nil="true"/>
</root>


Tests/xplus_tests/nillableTest/valid.xml

<?xml version="1.0"?>
<root>
  <items id="102">
    <item>item 1</item>
    <item>item 2</item>
    <item>item 3</item>
  </items>
</root>


Tests/xplus_tests/nillableTest/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{
  NoNS::root::items* pItems =  xsdDoc->element_root()->element_items();
  pItems->set_attr_id("100");
  pItems->set_item(0, "item 1");
  pItems->set_item(1, "item 2");
  pItems->set_item(2, "item 3");
}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/xplus_tests/choice


Tests/xplus_tests/choice/choice.xsd

<?xml version="1.0" encoding="utf-8"?>
<xs:schema 
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:ns1="urn:ns1"
        targetNamespace="urn:ns1"
        version="0.1" elementFormDefault="qualified"> 


  <element name="elem" type="ns1:ElemType"/> 
  <complexType name="ElemType" mixed="true">
    <choice>     
      <element name="e1" type="xs:string"/> 
      <element name="e2" type="xs:string"/> 
    </choice>
  </complexType>

</xs:schema>


Tests/xplus_tests/choice/valid.xml

<?xml version="1.0"?>
<ns1:elem xmlns:ns1="urn:ns1">
  <ns1:e1>e1 value</ns1:e1>
</ns1:elem>


Tests/xplus_tests/choice/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "ns1/all-include.h"

void populateDocument(ns1::Document* xsdDoc);
void updateOrConsumeDocument(ns1::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<ns1::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<ns1::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(ns1::Document* xsdDoc)
{
  xsdDoc->element_elem()->set_e1("e1 value");
}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(ns1::Document* xsdDoc)
{

}

  



Tests/xplus_tests/ccRest


Tests/xplus_tests/ccRest/ccRest.xsd

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" >

  <xs:complexType name="ComplexTypeSeq">
    <xs:sequence>
      <xs:element name="e1" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="e2" minOccurs="0"/>
      <xs:element name="e3"/>
    </xs:sequence>
    <xs:attribute name="a1" type="xs:ID" use="optional"/>
    <xs:attribute name="a2" type="xs:int" use="optional"/>
  </xs:complexType>

  <xs:complexType name="ComplexTypeCCRestn">
    <xs:complexContent mixed="true">
      <xs:restriction base="ComplexTypeSeq">
        <xs:sequence>
          <xs:element name="e1" minOccurs="1" maxOccurs="1"/>
          <xs:element name="e3"/>
        </xs:sequence>
        <xs:attribute name="a2" type="xs:int" use="required"/>
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>

  <xs:element name="root" type="ComplexTypeCCRestn"/>

</xs:schema>


Tests/xplus_tests/ccRest/valid.xml

<?xml version="1.0"?>
<root a2="200" a1="IDA1">
  <e1>e1 value</e1>
  <e3>e3 value</e3>
</root>


Tests/xplus_tests/ccRest/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{
  xsdDoc->element_root()->set_attr_a1("IDA1");
  xsdDoc->element_root()->set_attr_a2("200");
  
  // need revisit for API on anyType :
  xsdDoc->element_root()->element_e1()->stringValue("e1 value");
  xsdDoc->element_root()->element_e3()->stringValue("e3 value");
}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/xplus_tests/ccRest4


Tests/xplus_tests/ccRest4/ccRest4.xsd

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" >

  <xs:element name="depth">
    <xs:complexType>
     <xs:complexContent>
      <xs:restriction base="xs:anyType">
       <xs:sequence>
        <xs:element name="size" type="xs:nonNegativeInteger"/>
        <xs:element name="unit" type="xs:NMTOKEN"/>
       </xs:sequence>
      </xs:restriction>
     </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <!--
    <depth>
     <size>25</size><unit>cm</unit>
    </depth>
  -->

</xs:schema>


Tests/xplus_tests/ccRest4/valid.xml

<?xml version="1.0"?>
<depth>
  <size>25</size>
  <unit>cm</unit>
</depth>


Tests/xplus_tests/ccRest4/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{
  xsdDoc->element_depth()->set_size(25);
  xsdDoc->element_depth()->set_unit("cm");
}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/xplus_tests/scExt4


Tests/xplus_tests/scExt4/scExt4.xsd

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <xsd:simpleType name="aStringOfLen50">
    <xsd:restriction base='xsd:string'>
      <xsd:maxLength value='50'/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:complexType name="ComplexTypeSCExtn">
    <xsd:simpleContent>
      <xsd:extension base="aStringOfLen50">
        <xsd:attribute name="id" type="xsd:ID" use="required"/>
      </xsd:extension>
    </xsd:simpleContent>
  </xsd:complexType>

  <xsd:complexType name="ComplexTypeSCExtn2">
    <xsd:simpleContent>
      <xsd:extension base="ComplexTypeSCExtn">
        <xsd:attribute name="idx" type="xsd:int" use="required"/>
      </xsd:extension>
    </xsd:simpleContent>
  </xsd:complexType>


  <xsd:element name="root" type="ComplexTypeSCExtn2"/> 

</xsd:schema>


Tests/xplus_tests/scExt4/valid.xml

<?xml version="1.0"?>
<root id="ID1" idx="100">simple content with extension</root>


Tests/xplus_tests/scExt4/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{
  xsdDoc->element_root()->set_attr_id("ID1");
  xsdDoc->element_root()->set_attr_idx("100");
  xsdDoc->element_root()->stringValue("simple content with extension");
}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/xplus_tests/ctAnyTypeRest


Tests/xplus_tests/ctAnyTypeRest/ctAnyTypeRest.xsd

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" >

  <xs:complexType name="anyThing" mixed="false"/>
  <xs:element name="root" type="anyThing"/>

</xs:schema>


Tests/xplus_tests/ctAnyTypeRest/valid.xml

<?xml version="1.0"?>
<root/>


Tests/xplus_tests/ctAnyTypeRest/main.cpp


 //
 //  This file was automatically generated using XmlPlus xsd2cpp tool.
 //  On subsequent "xsd2cpp" invocations, this file would not be overwritten.
 //  You can edit this file.
 //
  
#include <iostream>
#include <string>

#include "XSD/UserOps.h"
#include "NoNS/all-include.h"

void populateDocument(NoNS::Document* xsdDoc);
void updateOrConsumeDocument(NoNS::Document* xsdDoc);
    

int main (int argc, char** argv)
{
  XSD::UserOps<NoNS::Document>::UserOpsCbStruct cbStruct;
  cbStruct.cbPopulateDocument           =  populateDocument;
  cbStruct.cbUpdateOrConsumeDocument    =  updateOrConsumeDocument;
  

  XSD::UserOps<NoNS::Document> opHandle(cbStruct);
  opHandle.run(argc, argv);
}

//
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//

    

// template function to populate the Tree with values
// write code to populate the Document here ...
void populateDocument(NoNS::Document* xsdDoc)
{
  // need revisit for API on anyType :
  //cout << "contentType:" << xsdDoc->element_root()->contentType() << endl;
  cout << endl;
  //xsdDoc->element_root()->stringValue("abcd");
  cout << endl;
}

// write code to operate(update/consume/test etc.) on the Document here...
// This Document is typically already populated(eg. read from an input
// xml file)
void updateOrConsumeDocument(NoNS::Document* xsdDoc)
{

}

  



Tests/xplus_neg_tests/scRest2


Tests/xplus_neg_tests/scRest2/scRest2.xsd

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <xsd:simpleType name="anInt1To200">
    <xsd:restriction base="xsd:int">
      <xsd:minInclusive value="1"/>
      <xsd:maxInclusive value="200"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:complexType name="ComplexTypeSCRestn">
    <xsd:simpleContent>
      <xsd:restriction base="anInt1To200">
        <xsd:minInclusive value="1"/>
        <xsd:maxInclusive value="100"/>
        <xsd:attribute name="id" type="xsd:string"/>
      </xsd:restriction>
    </xsd:simpleContent>
  </xsd:complexType>

  <xsd:element name="root" type="ComplexTypeSCRestn"/> 

</xsd:schema>



Tests/xplus_neg_tests/ccExtAny


Tests/xplus_neg_tests/ccExtAny/ccExtAny.xsd

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" >

  <xsd:complexType name="AnyComplexType">
    <xsd:complexContent>
      <xsd:extension base="xsd:anyType"/>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:element name="root" type="AnyComplexType"/> 

</xsd:schema>   
    
 



Tests/xplus_neg_tests/scRest4


Tests/xplus_neg_tests/scRest4/scRest4.xsd

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  
  <xsd:simpleType name="anInt1To200">
    <xsd:restriction base="xsd:int">
      <xsd:minInclusive value="1"/>
      <xsd:maxInclusive value="200"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:element name="root"> 
    <xsd:complexType>
      <xsd:simpleContent>
        <xsd:restriction base="anInt1To200">
          <xsd:minInclusive value="1"/>
          <xsd:maxInclusive value="100"/>
          <xsd:attribute name="id" type="xsd:string"/>
        </xsd:restriction>
      </xsd:simpleContent>
    </xsd:complexType>
  </xsd:element>  


</xsd:schema>



Tests/xplus_neg_tests/scRest


Tests/xplus_neg_tests/scRest/scRest.xsd

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">


  <xsd:complexType name="ComplexTypeSCRestn">
    <xsd:simpleContent>
      <xsd:restriction base="xsd:int">
        <xsd:minInclusive value="1"/>
        <xsd:maxInclusive value="99"/>
        <xsd:attribute name="id" type="xsd:ID" use="required"/>
      </xsd:restriction>
    </xsd:simpleContent>
  </xsd:complexType>

  <xsd:element name="root" type="ComplexTypeSCRestn"/> 

</xsd:schema>



Tests/xplus_neg_tests/ccExt2


Tests/xplus_neg_tests/ccExt2/ccExt2.xsd

<xs:schema xmlns="http://cscB2BCIDXSchemas.Schema1" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://cscB2BCIDXSchemas.Schema1" xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:element name="Root" type="Type1" />
  <xs:element name="Record" type="Type2" />

  <!-- try mixed="true" -->
  <xs:complexType name="Type1">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="Field1" type="xs:string" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <!-- try mixed="true" -->
  <xs:complexType name="Type2">
    <xs:complexContent>
      <xs:extension base="Type1">
        <xs:attribute name="Field2" type="xs:string" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

</xs:schema>



Tests/xplus_neg_tests/stInvalidDerivation3


Tests/xplus_neg_tests/stInvalidDerivation3/stInvalidDerivation3.xsd

<xsd:schema
elementFormDefault="qualified"
attributeFormDefault="qualified"
targetNamespace="http://www.example.com/STDemo"
xmlns:tns="http://www.example.com/STDemo"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>

  <xsd:simpleType name='IntMax5k'>
    <xsd:restriction base='xsd:int'>
      <xsd:maxExclusive value='5000'/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name='ListOfIntMax5k'>
    <xsd:list itemType='tns:IntMax5k'/>
  </xsd:simpleType>

  <xsd:simpleType name='ListOfIntMax3k' final="restriction">
    <xsd:list>
      <xsd:simpleType>
        <xsd:restriction>
          <xsd:simpleType>
            <xsd:restriction base='tns:IntMax5k'>
              <xsd:maxExclusive value='4000'/>
            </xsd:restriction>
          </xsd:simpleType>
          <xsd:maxExclusive value='3000'/>
        </xsd:restriction>
      </xsd:simpleType>
    </xsd:list>  
  </xsd:simpleType>

  <xsd:simpleType name='ListOfTwoIntMax3k'>
    <xsd:restriction base='tns:ListOfIntMax3k'>
      <xsd:maxLength value='2'/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:element name="elem" type="tns:ListOfTwoIntMax3k"/>
  
</xsd:schema>




Tests/xplus_neg_tests/stInvalidDerivation1


Tests/xplus_neg_tests/stInvalidDerivation1/stInvalidDerivation1.xsd

<xsd:schema
elementFormDefault="qualified"
attributeFormDefault="qualified"
targetNamespace="http://www.example.com/STDemo"
xmlns:tns="http://www.example.com/STDemo"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>

  <xsd:simpleType name='IntMax5k' final="list">
    <xsd:restriction base='xsd:int'>
      <xsd:maxExclusive value='5000'/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name='ListOfIntMax5k'>
    <xsd:list itemType='tns:IntMax5k'/>
  </xsd:simpleType>

  <xsd:element name="elem" type="tns:ListOfIntMax5k"/>
  
</xsd:schema>




Tests/xplus_neg_tests/scRest3


Tests/xplus_neg_tests/scRest3/scRest3.xsd

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <xsd:element name="root" > 
    <xsd:complexType>
      <xsd:simpleContent>
        <xsd:restriction base="xsd:int">
          <xsd:minInclusive value="1"/>
          <xsd:maxInclusive value="99"/>
          <xsd:attribute name="id" type="xsd:ID" use="required"/>
        </xsd:restriction>
      </xsd:simpleContent>
    </xsd:complexType>
  </xsd:element>


</xsd:schema>



Tests/xplus_neg_tests/stInvalidDerivation2


Tests/xplus_neg_tests/stInvalidDerivation2/stInvalidDerivation2.xsd

<xsd:schema
elementFormDefault="qualified"
attributeFormDefault="qualified"
targetNamespace="http://www.example.com/STDemo"
xmlns:tns="http://www.example.com/STDemo"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
  <xsd:simpleType name="Fontbynumber">
    <xsd:restriction base="xsd:positiveInteger">
      <xsd:maxInclusive value="72"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="Fontbystringname" final="union">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="small"/>
      <xsd:enumeration value="medium"/>
      <xsd:enumeration value="large"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="Font">
    <xsd:union memberTypes="tns:Fontbynumber tns:Fontbystringname"/>
  </xsd:simpleType>

  <xsd:element name="elem" type="tns:Font"/>
  
</xsd:schema>