summaryrefslogtreecommitdiff
path: root/examples/cxx/parser/hello
diff options
context:
space:
mode:
Diffstat (limited to 'examples/cxx/parser/hello')
-rw-r--r--examples/cxx/parser/hello/README28
-rw-r--r--examples/cxx/parser/hello/driver.cxx67
-rw-r--r--examples/cxx/parser/hello/hello.xml19
-rw-r--r--examples/cxx/parser/hello/hello.xsd21
-rw-r--r--examples/cxx/parser/hello/makefile100
5 files changed, 0 insertions, 235 deletions
diff --git a/examples/cxx/parser/hello/README b/examples/cxx/parser/hello/README
deleted file mode 100644
index 97449de..0000000
--- a/examples/cxx/parser/hello/README
+++ /dev/null
@@ -1,28 +0,0 @@
-This is a "Hello, world!" example that shows how to use the
-C++/Parser mapping to parse XML instance documents.
-
-The example consists of the following files:
-
-hello.xsd
- XML Schema which describes "hello" instance documents.
-
-hello.xml
- Sample XML instance document.
-
-hello-pskel.hxx
-hello-pskel.cxx
- Parser skeletons generated by XSD from hello.xsd.
-
-driver.cxx
- A parser implementation and a driver for the example. The
- parser implementation simply prints the data to STDERR.
- The driver first constructs a parser instance from the
- parser implementation mentioned above and a couple of
- predefined parsers for the XML Schema built-in types.
- In then invokes this parser instance to parse the input
- file.
-
-To run the example on the sample XML instance document simply
-execute:
-
-$ ./driver hello.xml
diff --git a/examples/cxx/parser/hello/driver.cxx b/examples/cxx/parser/hello/driver.cxx
deleted file mode 100644
index e261e10..0000000
--- a/examples/cxx/parser/hello/driver.cxx
+++ /dev/null
@@ -1,67 +0,0 @@
-// file : examples/cxx/parser/hello/driver.cxx
-// copyright : not copyrighted - public domain
-
-#include <string>
-#include <iostream>
-
-#include "hello-pskel.hxx"
-
-using namespace std;
-
-struct hello_pimpl: hello_pskel
-{
- virtual void
- greeting (const string& greeting)
- {
- greeting_ = greeting;
- }
-
- virtual void
- name (const string& name)
- {
- cout << greeting_ << ", " << name << "!" << endl;
- }
-
-private:
- string greeting_;
-};
-
-int
-main (int argc, char* argv[])
-{
- if (argc != 2)
- {
- cerr << "usage: " << argv[0] << " hello.xml" << endl;
- return 1;
- }
-
- try
- {
- // Construct the parser.
- //
- xml_schema::string_pimpl string_p;
- hello_pimpl hello_p;
-
- hello_p.greeting_parser (string_p);
- hello_p.name_parser (string_p);
-
- // Parse the XML instance document. The second argument to the
- // document's constructor is the document's root element name.
- //
- xml_schema::document doc_p (hello_p, "hello");
-
- hello_p.pre ();
- doc_p.parse (argv[1]);
- hello_p.post_hello ();
- }
- catch (const xml_schema::exception& e)
- {
- cerr << e << endl;
- return 1;
- }
- catch (const std::ios_base::failure&)
- {
- cerr << argv[1] << ": unable to open or read failure" << endl;
- return 1;
- }
-}
diff --git a/examples/cxx/parser/hello/hello.xml b/examples/cxx/parser/hello/hello.xml
deleted file mode 100644
index dd0c13d..0000000
--- a/examples/cxx/parser/hello/hello.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-
-file : examples/cxx/parser/hello/hello.xml
-copyright : not copyrighted - public domain
-
--->
-
-<hello xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="hello.xsd">
-
- <greeting>Hello</greeting>
-
- <name>sun</name>
- <name>moon</name>
- <name>world</name>
-
-</hello>
diff --git a/examples/cxx/parser/hello/hello.xsd b/examples/cxx/parser/hello/hello.xsd
deleted file mode 100644
index be69957..0000000
--- a/examples/cxx/parser/hello/hello.xsd
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-
-file : examples/cxx/parser/hello/hello.xsd
-copyright : not copyrighted - public domain
-
--->
-
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <xsd:complexType name="hello">
- <xsd:sequence>
- <xsd:element name="greeting" type="xsd:string"/>
- <xsd:element name="name" type="xsd:string" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:element name="hello" type="hello"/>
-
-</xsd:schema>
diff --git a/examples/cxx/parser/hello/makefile b/examples/cxx/parser/hello/makefile
deleted file mode 100644
index 9317315..0000000
--- a/examples/cxx/parser/hello/makefile
+++ /dev/null
@@ -1,100 +0,0 @@
-# file : examples/cxx/parser/hello/makefile
-# license : GNU GPL v2 + exceptions; see accompanying LICENSE file
-
-include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make
-
-xsd := hello.xsd
-cxx := driver.cxx
-
-obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=-pskel.o))
-dep := $(obj:.o=.o.d)
-
-driver := $(out_base)/driver
-install := $(out_base)/.install
-dist := $(out_base)/.dist
-dist-win := $(out_base)/.dist-win
-clean := $(out_base)/.clean
-
-
-# Import.
-#
-$(call import,\
- $(scf_root)/import/libxerces-c/stub.make,\
- l: xerces_c.l,cpp-options: xerces_c.l.cpp-options)
-
-
-# Build.
-#
-$(driver): $(obj) $(xerces_c.l)
-
-$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd
-$(obj) $(dep): $(xerces_c.l.cpp-options)
-
-genf := $(xsd:.xsd=-pskel.hxx) $(xsd:.xsd=-pskel.ixx) $(xsd:.xsd=-pskel.cxx)
-gen := $(addprefix $(out_base)/,$(genf))
-
-$(gen): xsd := $(out_root)/xsd/xsd
-$(gen): $(out_root)/xsd/xsd
-
-$(call include-dep,$(dep),$(obj),$(gen))
-
-# Convenience alias for default target.
-#
-$(out_base)/: $(driver)
-
-
-# Install & Dist.
-#
-dist-common := $(out_base)/.dist-common
-
-$(install) $(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
-
-$(install):
- $(call install-data,$(src_base)/README,$(install_doc_dir)/xsd/$(path)/README)
- $(call install-data,$(src_base)/driver.cxx,$(install_doc_dir)/xsd/$(path)/driver.cxx)
- $(call install-data,$(src_base)/hello.xsd,$(install_doc_dir)/xsd/$(path)/hello.xsd)
- $(call install-data,$(src_base)/hello.xml,$(install_doc_dir)/xsd/$(path)/hello.xml)
-
-$(dist-common):
- $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
- $(call install-data,$(src_base)/hello.xsd,$(dist_prefix)/$(path)/hello.xsd)
- $(call install-data,$(src_base)/hello.xml,$(dist_prefix)/$(path)/hello.xml)
-
-$(dist): $(dist-common)
- $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
-
-$(dist-win): $(dist-common)
- $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
- $(call message,,todos $(dist_prefix)/$(path)/README.txt)
-
-# Clean.
-#
-$(clean): $(driver).o.clean \
- $(addsuffix .cxx.clean,$(obj)) \
- $(addsuffix .cxx.clean,$(dep)) \
- $(addprefix $(out_base)/,$(xsd:.xsd=-pskel.cxx.xsd.clean))
-
-# Generated .gitignore.
-#
-ifeq ($(out_base),$(src_base))
-$(gen): | $(out_base)/.gitignore
-$(driver): | $(out_base)/.gitignore
-
-$(out_base)/.gitignore: files := driver $(genf)
-$(clean): $(out_base)/.gitignore.clean
-
-$(call include,$(bld_root)/git/gitignore.make)
-endif
-
-# How to.
-#
-$(call include,$(bld_root)/cxx/o-e.make)
-$(call include,$(bld_root)/cxx/cxx-o.make)
-$(call include,$(bld_root)/cxx/cxx-d.make)
-$(call include,$(bld_root)/install.make)
-$(call include,$(scf_root)/xsd/parser/xsd-cxx.make)
-
-
-# Dependencies.
-#
-$(call import,$(src_root)/xsd/makefile)