+++ /dev/null
-PROJECT(xml-t)
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-
-SET(WITH_XSD_TOOL FALSE CACHE TYPE BOOL)
-SET(WITH_XSD_TOOL_TESTS OFF CACHE TYPE BOOL)
-
-
-IF (WITH_XSD_TOOL)
-
-INCLUDE_DIRECTORIES("${aebutils_SOURCE_DIR}")
-IF (WITH_XSD_TOOL_TESTS)
-# Requires Cmake 2.8
-if (CMAKE_VERSION VERSION_GREATER 2.8.12 OR CMAKE_VERSION VERSION_EQUAL 2.8.12)
-
- MESSAGE("xml-transform TESTS ENABLED.")
-SUBDIRS(libxsd tests)
-find_package(Java REQUIRED)
-include(UseJava)
-
-enable_testing()
-
-
-set(CMAKE_JAVA_COMPILE_FLAGS "-source" "1.6" "-target" "1.6")
-set(CMAKE_JAVA_INCLUDE_PATH "${CMAKE_JAVA_INCLUDE_PATH}/Users/aeb/Downloads/xalan-j_2_7_1/xalan.jar")
-#set(CMAKE_JAVA_INCLUDE_PATH "${CMAKE_JAVA_INCLUDE_PATH}:/Users/aeb/Downloads/saxon9he.jar")
-set(CMAKE_JAVA_INCLUDE_PATH "${CMAKE_JAVA_INCLUDE_PATH}:/Users/aeb/Downloads/saxonb9-1-0-8j/saxon9.jar")
-
-#FILE(GLOB XSD2CPP_XSD "${CMAKE_CURRENT_SOURCE_DIR}/xsd2cpp*.xsl")
-FILE(GLOB XSD2CPP_XSD "xsd2cpp*.xsl")
-add_jar(xsd2cpp xsd2cpp.java ResourceResolver.java ${XSD2CPP_XSD})
-get_target_property(_jarFile xsd2cpp JAR_FILE)
-get_target_property(_classDir xsd2cpp CLASSDIR)
-
-add_jar(xsd2cpp_saxon xsd2cpp_saxon.java ResourceResolver.java ${XSD2CPP_XSD})
-get_target_property(_jarFile xsd2cpp_saxon JAR_FILE)
-get_target_property(_classDir xsd2cpp_saxon CLASSDIR)
-
-
-message(STATUS "Jar file ${_jarFile}")
-message(STATUS "Class compiled to ${_classDir}")
-
-
-
-INSTALL(DIRECTORY ./
- DESTINATION bin COMPONENT Application
- FILES_MATCHING PATTERN "*.xsl"
- PATTERN "CVS" EXCLUDE
- PATTERN "libxsd" EXCLUDE
- PATTERN "CMakeFiles" EXCLUDE
- PATTERN "use-cases" EXCLUDE
- PATTERN "tests" EXCLUDE)
-
-
-ELSE ()
- MESSAGE("TESTS DISABLED. Cmake version must be > 2.8.12")
- #end of test version
-SUBDIRS(libxsd)
-ENDIF()
-
-ELSE(WITH_XSD_TOOL_TESTS)
-SUBDIRS(libxsd)
-ENDIF(WITH_XSD_TOOL_TESTS)
-
-ENDIF(WITH_XSD_TOOL)
-
+++ /dev/null
-README
-
-This directory contains xsl 2.0 transformers. The main
-purpose is to generate code from xmi and xsd description.
-
-Features like generating idl, cpp, csharp, java code
-are important.
-
-xsd2cpp is the first tool I need. The goal is to provide
-an object representation based on a xsd data description.
-
-uml14-2-xsd will traduce an UML model in xsd strucutures
-
-I introduced libxsd. This library must be used in conjonction
-with xsd2cpp. What I have noticed, they are a many ways to
-use parsing. For instance, expat is an event driven xml
-driver. using that parser,
-1) I can of course, build up an
-object tree
-2) I can also write an event driven parser ....
- What do I want ?
-The fact is that the function and implementations of the
-objects will be different in both cases.
-- Having a tree, I probably want to be able to serialze.
-
-What I need is a parser that builds a tree using expect.
-How can I build the tree with specialized features ?
-It's clear that the parser and the tree are two different things.
-The final tree does not any more need the parsing feature.
-A factory might ne required to build up the tree.
-
-That means on one side, I have parsing objects ! and
-on the other, I have the tree objets !!!
-The parser uses a factory to build up the tree. :e
-
-TODO, implement the any element and any attribute
-features.
-I was able to read the total soap envelop description.
-I need to do the same with soap encoding, then
-with cwmp.
-If that works, I think I can attrack people
-and provide the feature in OXO800.
-
-09/09/29:
- - I started the implementation of optional attributes. The code
- is not bad. I'm loocking for a way to link the serialisation and
- parser. How the passe an optional element to post ? It does
- not work, so I need to find another way.
- - The way I build my objects is bad too. the constructors must be
- improved. Using affectation is really bad.
-
-09/09/30:
- - I corrected the issue, with constructor, I still need to look at
- the AttributeGroup area. But globaly, it's much better now.
- - Still need to treat optional elements. This will be the next
- step.
- - I started to write more test case, for all basic types.
-
-09/10/01:
- - The implementation of sequences to treat maxOccurs = unbounded
- starts working. I have an issue at the end. There is a double memory
- release.
- - I also corrected the bug, in debug feature.
- - They are still pointers that need to be converted to shared ptr
- - auto_ptr starts to become obsolete, so I might replace them. TODO
- -
-09/10/02:
- - maxOccurs works for umf. Now, I start to see the problem with expact.
- how to have a complete paring chain?
- - I also noticed that I have recursion issues. I cannot use the same
- parser at two different places !! This is crutial.
-
-11/03/30:
- - There is still work for the private elements.
- <element name >
- <complexType >
- <sequence>
- <element name=''>
- <simpleType>
- </simpleType>
- </element>
-
-SEVERAL STEPS IN THE DEFINTION
-------------------------------
-
-1) The global view
-------------------
- To generate CPP 1 XSD will generate 4 CPP files .
- serialization header
- serialization body
- implementation header
- implementation body
-
- What is important to keep is the namespace which will be used to
- compute a cpp namespace. External namespace and imports are
- also important. They help in the generation of the include part.
-
-1.1 serialization header
-------------------------
-
-The template will look like
-
-#ifndef [namespace]_H
- /* Forward declaration of the classes. But it's not enought.
- * Depending on the order of the elements, we might need to compute dependencies
- * to order the elements so that the cpp compiler will not complain. Right
- * now ecore.xsd does not compile at all.
- */
-
-class [complexType / simpleType / element[not(@type)]_skel;
-...
-
-/* Now comes the declation for the classes */
-
-/**
- [annotation could go here]
- */
-class [@name]_skel : public (xmlSerialize | [inheritance from restriction or
-extension]) {
- /* constructors */
- @name_skel() ;
- @name_skel([parametes]) ;
- /* destructors */
-
- public:
- /* setter and getter */
-
- protected:
- /* member attributes / elements (type name)*/
-};
-
-#endif [namespace]_H
-
-1.2 template serialize implemetation
-------------------------------------
-
-
-#include "[schemaLocation of import were .xsd -> .h].";
-...
-
-1.3 template parser header
---------------------------
-
-2 TODO
-------
-
-2.1 xsd:include needs to be treated
------------------------------------
-
-2.2 xsd:group needs to be treated in a better way
--------------------------------------------------
-
-2.3 Recursion is still an issue for parser
--------------------------------------------
-
-The example below does not work.
-<element name="dede">
- <complexType >
- <sequence>
- <element ref="@dede"/>
- <sequence>
- </complexType>
-</element>
-
-26/06/2011
-----------
--> Need absolutly to treat
- xsd:union
- xsd:group
- and xsd:list
-
- I still need to separate code generation for :
- tree-src-constructor important pour les group (pas complet)
- tree-src-serialize important pas complet pour les xsd:group;
- xsd:union, xsd:list
+++ /dev/null
-
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.Source;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.stream.StreamSource;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.Iterator;
-
-
-public class ResourceResolver implements URIResolver {
- private final URIResolver baseResolver;
-
- public ResourceResolver(final URIResolver r) {
- baseResolver = r;
- }
- /* (non-Javadoc)
- * @see javax.xml.transform.URIResolver#resolve(java.lang.String, java.lang.String)
- */
- public Source resolve(String href, String base) throws TransformerException {
- System.out.println("Try Resolve href="+href+" Base="+base);
- if ("".equalsIgnoreCase(href)) {
- return baseResolver.resolve(href,base);
- }
- try {
- String pathWithinJar = "Users/aeb/Devs/home/tools/xml-transform/";
-
- InputStream is = ClassLoader.getSystemResourceAsStream(pathWithinJar+href);
- return new StreamSource(is, href);
- } // try
- catch (Exception ex) {
- throw new TransformerException(ex);
- } // catch
- } // resolve
-
- /**
- * @param href
- * @return
- * @throws TransformerException
- */
- public InputStream resolve(String href) throws TransformerException {
- System.out.println("Try Resolve no base : "+href);
- try {
- String pathWithinJar = "Users/aeb/Devs/home/tools/xml-transform/";
-
- InputStream is = ClassLoader.getSystemResourceAsStream(pathWithinJar+href);
- return is;
- } // try
- catch (Exception ex) {
- throw new TransformerException(ex);
- } // catch
- }
-} // ResourceResolver
+++ /dev/null
-// ajax.js
-// Common Javascript methods and global objects
-// Ajax framework for Internet Explorer (6.0, ...) and Firefox (1.0, ...)
-// Copyright (c) by Matthias Hertel, http://www.mathertel.de
-// This work is licensed under a BSD style license. See http://www.mathertel.de/License.aspx
-// More information on: http://ajaxaspects.blogspot.com/ and http://ajaxaspekte.blogspot.com/
-// -----
-// 05.06.2005 created by Matthias Hertel.
-// 19.06.2005 minor corrections to webservices.
-// 25.06.2005 ajax action queue and timing.
-// 02.07.2005 queue up actions fixed.
-// 10.07.2005 ajax.timeout
-// 10.07.2005 a option object that is passed from ajax.Start() to prepare() is also queued.
-// 10.07.2005 a option object that is passed from ajax.Start() to prepare(), finish()
-// and onException() is also queued.
-// 12.07.2005 correct xml encoding when CallSoap()
-// 20.07.2005 more datatypes and XML Documents
-// 20.07.2005 more datatypes and XML Documents fixed
-// 06.08.2005 caching implemented.
-// 07.08.2005 bugs fixed, when queuing without a delay time.
-// 04.09.2005 bugs fixed, when entering non-multiple actions.
-// 07.09.2005 proxies.IsActive added
-// 27.09.2005 fixed error in handling bool as a datatype
-// 13.12.2005 WebServices with arrays on strings, ints, floats and booleans - still undocumented
-// 27.12.2005 fixed: empty string return values enabled.
-// 27.12.2005 enable the late binding of proxy methods.
-// 21.01.2006 void return bug fixed.
-// 18.02.2006 typo: Finsh -> Finish.
-// 25.02.2006 better xmlhttp request object retrieval, see http://blogs.msdn.com/ie/archive/2006/01/23/516393.aspx
-// 22.04.2006 progress indicator added.
-// 28.01.2006 void return bug fixed again?
-// 09.03.2006 enable late binding of prepare and finish methods by using an expression.
-// 14.07.2006 Safari Browser Version 2.03/Mac OS X 10.4. compatibility: xNode.textContent || xNode.innerText || xNode.text || xNode.childNodes[0].nodeValue
-// 10.08.2006 date to xml format fixed by Kars Veling
-// 16.09.2006 .postUrl -- unfinished...
-// 26.11.2006 enable null for xml based objects
-// 19.05.2007 enabling ajax engine calls with multiple parameters
-// 14.07.2007 xml2json added.
-// 14.09.2007 ajax._resolve implemented to avoid the eval function
-// 19.09.2007 lots of changes to get a better code as suggested by Breton Slivka (Thanks)
-// 01.10.2007 ... more of it.
-// 13.10.2007 structured parameter support for calling webservice methods
-// 16.10.2007 xml2json bug fixed
-// 10.11.2008 better documentation support.
-// 10.11.2008 inspectText added.
-// 30.11.2008 ajax.StartLocalAction added.
-// 03.01.2009 better handling of the result namespace
-// 27.04.2009 some issues when using ajax.js standalone, including the xml compatible code
-// in FireFOx for XMLDocument.selectSingleNode
-
-// ----- global variable for the proxies to webservices. -----
-
-var proxies = function() {
- /// <summary>The root object for the proxies to webservices.</summary>
-};
-
-if (window.OpenAjax && window.OpenAjax.hub) {
- OpenAjax.hub.registerLibrary("proxies", "http://www.mathertel.de/proxies", "1.5", {});
-} // if
-
-proxies.current = null; // the current active webservice call.
-proxies.xmlhttp = null; // The current active xmlhttp object.
-
-
-// ----- global variable for the ajax engine. -----
-
-var ajax = {
- /// <summary>The root object for the ajax engine implementation.</summary>
- /// <field name="current" type="ajax.Action">The current active AJAX action.</field>
- current: null,
- /// <field name="option" type="Object">The options for the current active AJAX action.</field>
- option: null,
-
- /// <field name="queue" type="Array">The pending AJAX actions.</field>
- queue: [],
- /// <field name="options" type="Array">The options for the pending AJAX actions.</field>
- options: [],
-
- /// <field name="isIE" type="Boolean">Detect InternetExplorer for some specific implementation differences.</field>
- isIE: (window.navigator.userAgent.indexOf("MSIE") > 0)
-
-};
-
-if (window.OpenAjax && window.OpenAjax.hub) {
- OpenAjax.hub.registerLibrary("ajax", "http://www.mathertel.de/ajax", "1.5", {});
-} // if
-
-ajax.timer = null; /// The timer for delayed actions.
-
-ajax.progress = false; /// show a progress indicator
-ajax.progressTimer = null; /// a timer-object that help displaying the progress indicator not too often.
-
-// ----- AJAX engine and actions implementation -----
-
-ajax.Action = {
- /// <summary>An action object with default values for declaring the details of ajax actions.</summary>
- /// <field name="queueClear" type="Boolean">If set to true, the queue will be cleard before this action is added.</field>
- queueClear:false,
- queueTop:false,
- queueMultiple:true,
- /// <field name="call" type="Function">The call that invokes some action on the server.</field>
- call: null,
- prepare: null,
- finish: null
-}; // Action
-
-
-ajax.Start = function(action, options) {
- ///<summary>Start an AJAX action by entering it into the queue</summary>
- ///<param name="action" type="ajax.Action">An object declaring the ajax action that should be executed.</param>
- ///<param name="options" type="Object">A optional parameter that is passed to the action methods.</param>
-
- ajax.Add(action, options);
- // check if the action should start
- if ((!ajax.current) && (!ajax.timer)) {
- ajax._next(false);
- } // if
-}; // ajax.Start
-
-
-ajax.StartLocalAction = function(method, options) {
- ///<summary>Start an non-AJAX action that actls only locally in the browser by entering it into the queue</summary>
- ///<param name="method" type="Function">The method that will be called.</param>
- ///<param name="options" type="Object">A optional parameter that is passed to the action methods.</param>
- var a = { queueClear: false, queueTop: false, queueMultiple: true }; // simple action
- a.delay = 1;
- a.prepare = method;
- ajax.Start(a, options);
-}; // ajax.StartLocalAction
-
-
-ajax.Add = function(action, options) {
- ///<summary>Add an AJAX action by entering it into the queue without starting it.</summary>
- ///<param name="action" type="Action">An object declaring the ajax action that should be executed.</param>
- ///<param name="options" type="Object">A optional parameter that is passed to the action methods.</param>
- if (!action) {
- alert("ajax.Start: Argument action must be set.");
- return;
- } // if
-
- // enable the late binding of the methods by using a string that is evaluated.
- if (typeof (action.call) == "string") action.call = ajax._resolve(action.call);
- if (typeof (action.prepare) == "string") action.prepare = ajax._resolve(action.prepare);
- if (typeof (action.finish) == "string") action.finish = ajax._resolve(action.finish);
-
- if ((action.queueClear) && (action.queueClear == true)) {
- ajax.queue = [];
- ajax.options = [];
-
- } else if ((ajax.queue.length > 0) && ((!action.queueMultiple) || (action.queueMultiple == false))) {
- // remove existing action entries from the queue and clear a running timer
- if ((ajax.timer) && (ajax.queue[0] == action)) {
- window.clearTimeout(ajax.timer);
- ajax.timer = null;
- } // if
-
- var n = 0;
- while (n < ajax.queue.length) {
- if (ajax.queue[n] == action) {
- ajax.queue.splice(n, 1);
- ajax.options.splice(n, 1);
- } else {
- n++;
- } // if
- } // while
- } // if
-
- if ((!action.queueTop) || (action.queueTop == false)) {
- // to the end.
- ajax.queue.push(action);
- ajax.options.push(options);
-
- } else {
- // to the top
- ajax.queue.unshift(action);
- ajax.options.unshift(options);
- } // if
-}; // ajax.Add
-
-
-ajax._next = function(forceStart) {
- ///<summary>Check, if the next AJAX action can start.
- ///This is an internal method that should not be called from external.</summary>
- ///<remarks>for private use only.<remarks>
- var ca = null; // current action
- var co = null; // current opptions
- var data = null;
-
- if (ajax.current)
- return; // a call is active: wait more time
-
- if (ajax.timer)
- return; // a call is pendig: wait more time
-
- if (ajax.queue.length == 0)
- return; // nothing to do.
-
- ca = ajax.queue[0];
- co = ajax.options[0];
- if ((forceStart == true) || (!ca.delay) || (ca.delay == 0)) {
- // start top action
- ajax.current = ca;
- ajax.queue.shift();
- ajax.option = co;
- ajax.options.shift();
-
- // get the data
- if (ca.prepare) {
- try {
- data = ca.prepare(co);
- } catch (ex) { }
- } // if
-
- if (ca.call) {
- ajax.StartProgress();
-
- // start the call
- ca.call.func = ajax.Finish;
- ca.call.onException = ajax.Exception;
- if ((data.constructor == Array) && (data.multi)) // 19.05.2007
- ca.call.apply(ca, data);
- else
- ca.call(data);
- // start timeout timer
- if (ca.timeout) {
- ajax.timer = window.setTimeout(ajax.Cancel, ca.timeout * 1000);
- } // if
-
- } else if (ca.postUrl) {
- // post raw data to URL
-
- } else {
- // no call
- ajax.Finish(data);
- } // if
-
- } else {
- // start a timer and wait
- ajax.timer = window.setTimeout(ajax.EndWait, ca.delay);
- } // if
-}; // ajax._next
-
-
-ajax.EndWait = function() {
- ///<summary>The delay time of an action is over.</summary>
- ajax.timer = null;
- ajax._next(true);
-}; // ajax.EndWait
-
-
-ajax.Cancel = function() {
- ///<summary>The current action timed out.</summary>
- proxies.cancel(false); // cancel the current webservice call.
- ajax.timer = null;
- ajax.current = null;
- ajax.option = null;
- ajax.EndProgress();
- window.setTimeout(ajax._next, 200); // give some to time to cancel the http connection.
-}; // ajax.Cancel
-
-
-ajax.Finish = function(data) {
- ///<summary>Finish an AJAX Action the normal way</summary>
- // clear timeout timer if set
- if (ajax.timer) {
- window.clearTimeout(ajax.timer);
- ajax.timer = null;
- } // if
-
- // use the data
- try {
- if ((ajax.current) && (ajax.current.finish))
- ajax.current.finish(data, ajax.option);
- } catch (ex) { }
- // reset the running action
- ajax.current = null;
- ajax.option = null;
- ajax.EndProgress();
- ajax._next(false);
-}; // ajax.Finish
-
-
-ajax.Exception = function(ex) {
- ///<summary>Finish an AJAX Action with an exception</summary>
- // use the data
- if (ajax.current.onException)
- ajax.current.onException(ex, ajax.option);
-
- // reset the running action
- ajax.current = null;
- ajax.option = null;
- ajax.EndProgress();
-}; // ajax.Exception
-
-
-ajax.CancelAll = function() {
- ///<summary>Clear the current and all pending AJAX actions.</summary>
- ajax.Cancel();
- // clear all pending AJAX actions in the queue.
- ajax.queue = [];
- ajax.options = [];
-}; // ajax.CancelAll
-
-
-// ----- show or hide a progress indicator -----
-
-ajax.StartProgress = function() {
- ///<summary>Show a progress indicator if it takes longer...</summary>
- ajax.progress = true;
- if (ajax.progressTimer)
- window.clearTimeout(ajax.progressTimer);
- ajax.progressTimer = window.setTimeout(ajax.ShowProgress, 220);
-}; // ajax.StartProgress
-
-
-ajax.EndProgress = function() {
- ///<summary>Hide any progress indicator soon.</summary>
- ajax.progress = false;
- if (ajax.progressTimer)
- window.clearTimeout(ajax.progressTimer);
- ajax.progressTimer = window.setTimeout(ajax.ShowProgress, 20);
-}; // ajax.EndProgress
-
-
-ajax.ShowProgress = function() {
- ///<summary>This function is called by a timer to show or hide a progress indicator.</summary>
- ajax.progressTimer = null;
- var a = document.getElementById("AjaxProgressIndicator");
- var s;
- if (ajax.progress && (a)) {
- // just display the existing object
- a.style.top = document.documentElement.scrollTop + 2 + "px";
- a.style.display = "";
-
- } else if (ajax.progress) {
-
- // find a relative link to the ajaxcore folder containing ajax.js
- var path = "../ajaxcore/";
- for (var n in document.scripts) {
- s = document.scripts[n].src;
- if ((s) && (s.length >= 7) && (s.substr(s.length - 7).toLowerCase() == "ajax.js"))
- path = s.substr(0, s.length - 7);
- } // for
-
- // create new standard progress object
- a = document.createElement("div");
- a.id = "AjaxProgressIndicator";
- a.style.position = "absolute";
- a.style.right = "2px";
- a.style.top = document.documentElement.scrollTop + 2 + "px";
- a.style.width = "98px";
- a.style.height = "16px";
- a.style.padding = "2px";
- a.style.verticalAlign = "bottom";
- a.style.backgroundColor = "#51c77d";
-
- a.innerHTML = "<img style='vertical-align:bottom' src='" + path + "ajax-loader.gif'> please wait...";
- document.body.appendChild(a);
-
- } else if (a) {
- a.style.display = "none";
- } // if
-}; // ajax.ShowProgress
-
-
-ajax._resolve = function(s) {
- ///<summary>Resolve a method reference given as a string
- /// by following the objects from the window object down to the concrete method.</summary>
- var ref = null;
- if ((s) && (s.length != 0)) {
- ref = window;
- s = s.split('.');
- for (var n = 0; (n < s.length) && (ref); n++)
- ref = ref[s[n]];
- } // if
- return (ref);
-}; // _resolve
-
-
-// ----- simple http-POST server call -----
-
-ajax.postData = function(url, data, func) {
- var x = proxies._getXHR();
-
- // enable cookieless sessions:
- var cs = document.location.href.match(/\/\(.*\)\//);
- if (cs) {
- url = url.split('/');
- url[3] += cs[0].substr(0, cs[0].length - 1);
- url = url.join('/');
- } // if
-
- x.open("POST", url, (func));
-
- if (func) {
- // async call with xmlhttp-object as parameter
- x.onreadystatechange = func;
- x.send(data);
-
- } else {
- // sync call
- x.send(data);
- return (x.responseText);
- } // if
-}; // ajax.postData
-
-
-proxies.callSoap = function(args) {
- ///<summary>Execute a soap call.
- ///Build the xml for the call of a soap method of a webservice and post it to the server.</summary>
- var p = args.callee;
- var x = null;
- var n;
- // check for existing cache-entry
- if (p._cache) {
- if ((p.params.length == 1) && (args.length == 1) && (p._cache[args[0]])) {
- if (p.func) {
- p.func(p._cache[args[0]]);
- return (null);
- } else {
- return (p._cache[args[0]]);
- } // if
- } else {
- p._cachekey = args[0];
- } // if
- } // if
-
- proxies.current = p;
- x = proxies._getXHR();
- proxies.xmlhttp = x;
-
- // envelope start
- var soap = "<?xml version='1.0' encoding='utf-8'?>"
- + "<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"
- + "<soap:Body>"
- + "<" + p.fname + " xmlns='" + p.service.ns + "'>";
-
- // parameters
- for (n = 0; (n < p.params.length) && (n < args.length); n++) {
- var val = args[n];
- var typ = p.params[n].split(':');
-
- if ((typ.length == 1) || (typ[1] == "string")) {
- val = String(args[n]).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
-
- } else switch (typ[1]) {
- case "int":
- val = parseInt(args[n], 10);
- break;
- case "float":
- val = parseFloat(args[n]);
- break;
- case "x":
- if (typeof (args[n]) == "string") {
- val = args[n];
- } else if (typeof (XMLSerializer) != "undefined") {
- val = (new XMLSerializer()).serializeToString(args[n].firstChild);
- } else if (args[n]) {
- val = args[n].xml;
- } // if
- break;
- case "ds": // 12.10.2007 complex parameter support
- val = "";
- if (typeof (args[n]) == "string") {
- val = args[n]; // inner xml
-
- } else if (args[n].constructor == Object) {
- var obj = args[n];
- for (var prop in obj) {
- val += "<" + prop + ">";
- val += String(obj[prop]).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
- val += "</" + prop + ">";
- }
-
- } else if (args[n]) {
- var xprop = args[n].documentElement.firstChild;
- while (xprop != null) {
- val += "<" + xprop.tagName + ">";
- val += String(xprop.text || xprop.textContent).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
- val += "</" + xprop.tagName + ">";
- xprop = xprop.nextSibling;
- } // for
-
- } // if
- break;
- case "bool":
- if (typeof (args[n]) == "string") {
- val = args[n].toLowerCase();
- } else {
- val = String(args[n]).toLowerCase();
- } // if
- break;
- case "date":
- // calculate the xml format for datetime objects from a javascript date object
- var s, ret;
- ret = String(val.getFullYear());
- ret += "-";
- s = String(val.getMonth() + 1);
- ret += (s.length == 1 ? "0" + s : s);
- ret += "-";
- s = String(val.getDate());
- ret += (s.length == 1 ? "0" + s : s);
- ret += "T";
- s = String(val.getHours());
- ret += (s.length == 1 ? "0" + s : s);
- ret += ":";
- s = String(val.getMinutes());
- ret += (s.length == 1 ? "0" + s : s);
- ret += ":";
- s = String(val.getSeconds());
- ret += (s.length == 1 ? "0" + s : s);
- val = ret;
- break;
- case "s[]":
- val = proxies._wrapArray2Xml(args[n], "string");
- break;
- case "int[]":
- val = proxies._wrapArray2Xml(args[n], "int");
- break;
- case "float[]":
- val = proxies._wrapArray2Xml(args[n], "float");
- break;
- case "bool[]":
- val = proxies._wrapArray2Xml(args[n], "boolean");
- break;
- } // switch
- soap += "<" + typ[0] + ">" + val + "</" + typ[0] + ">";
- } // for
-
- // envelope end
- soap += "</" + p.fname + ">"
- + "</soap:Body>"
- + "</soap:Envelope>";
-
- // enable cookieless sessions:
- var u = p.service.url;
- var cs = document.location.href.match(/\/\(.*\)\//);
- if (cs) {
- u = p.service.url.split('/');
- u[3] += cs[0].substr(0, cs[0].length - 1);
- u = u.join('/');
- } // if
-
- x.open("POST", u, (p.func != null));
- x.setRequestHeader("SOAPAction", p.action);
- x.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
-
- if (p.corefunc) {
- // async call with xmlhttp-object as parameter
- x.onreadystatechange = p.corefunc;
- x.send(soap);
-
- } else if (p.func) {
- // async call
- x.onreadystatechange = proxies._response;
- x.send(soap);
-
- } else {
- // sync call
- x.send(soap);
- return (proxies._response());
- } // if
-}; // proxies.callSoap
-
-
-proxies.cancel = function(raise) {
- ///<summary>Cancel the running webservice call.</summary>
- //<param name="raise" type="Boolean">If set to true an exception will be thrown through the onException function.</param>
- var cc = proxies.current;
- var cx = proxies.xmlhttp;
-
- if (!raise) raise == true;
-
- if (cx) {
- cx.onreadystatechange = function() { };
- cx.abort();
- if (raise && (cc.onException))
- cc.onException("WebService call was canceled.");
- proxies.current = null;
- proxies.xmlhttp = null;
- } // if
-}; // proxies.cancel
-
-
-proxies.EnableCache = function(px) {
- ///<summary>Attach an empty _cache object.</summary>
- ///<param name="px" type="Function">A proxies.service.func object.</param>
- px._cache = {};
-}; // proxies.EnableCache
-
-
-proxies.IsActive = function() {
- ///<summary>Check, if a call is currently waiting for a result.</summary>
- return (proxies.xmlhttp);
-}; // proxies.IsActive
-
-
-proxies._response = function() {
- ///<summary>Callback method for a webservice call that dispatches the response to servive.func or service.onException.</summary>
- ///<remarks>for private use only.<remarks>
- var ret = null;
- var n = null;
- var x = proxies.xmlhttp;
- var cc = proxies.current;
- var rtype = null;
-
- if ((cc.rtype.length > 0) && (cc.rtype[0]))
- rtype = cc.rtype[0].split(':');
-
- if ((x) && (x.readyState == 4)) {
- if (x.status == 200) {
- var xNode = null;
-
- if (rtype) {
- // doc->(envelope)->(body)->(response)->RESULT (avoiding namespace alias problems
- if (ajax.isIE) {
- x.responseXML.setProperty("SelectionLanguage", "XPath");
- xNode = x.responseXML.selectSingleNode("//*[local-name()='" + rtype[0] + "']");
- } else {
- //FireFox
- xNode = x.responseXML.getElementsByTagName(rtype[0])[0];
- } // if
- } // if
-
- if (!xNode) {
- ret = null;
-
- } else if (!xNode.firstChild) { // 27.12.2005: empty string return values
- ret = ((rtype.length == 1) || (rtype[1] == "string") ? "" : null);
-
- } else if ((rtype.length == 1) || (rtype[1] == "string")) {
- ret = proxies._getAnyXmlText(xNode);
-
- } else switch (rtype[1]) {
- case "bool":
- ret = proxies._getAnyXmlText(xNode);
- ret = (ret == "true");
- break;
- case "int":
- ret = proxies._getAnyXmlText(xNode);
- ret = parseInt(ret, 10);
- break;
- case "float":
- ret = proxies._getAnyXmlText(xNode);
- ret = parseFloat(ret);
- break;
- case "x":
- if (window.XMLSerializer) {
- ret = (new window.XMLSerializer()).serializeToString(xNode.firstChild);
- ret = ajax._getXMLDOM(ret);
- } else {
- ret = xNode.firstChild.xml;
- ret = ajax._getXMLDOM(ret);
- } // if
- break;
- case "ds":
- if (window.XMLSerializer) {
- ret = (new window.XMLSerializer()).serializeToString(xNode);
- ret = ajax._getXMLDOM(ret);
- } else {
- ret = xNode.xml;
- ret = ajax._getXMLDOM(ret);
- } // if
- break;
- case "s[]":
- // Array of strings
- ret = [];
- xNode = xNode.firstChild;
- while (xNode) {
- ret.push(proxies._getAnyXmlText(xNode));
- xNode = xNode.nextSibling;
- } // while
- break;
- case "int[]":
- // Array of int
- ret = [];
- xNode = xNode.firstChild;
- while (xNode) {
- ret.push(parseInt(proxies._getAnyXmlText(xNode)));
- xNode = xNode.nextSibling;
- } // while
- break;
- case "float[]":
- // Array of float
- ret = [];
- xNode = xNode.firstChild;
- while (xNode) {
- ret.push(parseFloat(proxies._getAnyXmlText(xNode)));
- xNode = xNode.nextSibling;
- } // while
- break;
- case "bool[]":
- // Array of bool
- ret = [];
- xNode = xNode.firstChild;
- while (xNode) {
- ret.push((proxies._getAnyXmlText(xNode)).toLowerCase() == "true");
- xNode = xNode.nextSibling;
- } // while
- break;
- default:
- ret = proxies._getAnyXmlText(xNode);
- break;
- } // switch
-
- // store to _cache
- if ((cc._cache) && (cc._cachekey)) {
- cc._cache[cc._cachekey] = ret;
- cc._cachekey = null;
- } // if
-
- proxies.xmlhttp = null;
- proxies.current = null;
-
- if (!cc.func) {
- return (ret); // sync
- } else {
- cc.func(ret); // async
- return (null);
- } // if
-
- } else if (!proxies.current.onException) {
- // no exception
-
- } else {
- // raise an exception
- ret = new Error();
-
- if (x.status == 404) {
- ret.message = "The webservice could not be found.";
-
- } else if (x.status == 500) {
- ret.name = "SoapException";
-
- if (ajax.isIE)
- x.responseXML.setProperty("SelectionLanguage", "XPath");
-
- n = x.responseXML.selectSingleNode("//*[local-name()='Fault']/faultcode");
- if (n) ret.message = n.firstChild.nodeValue;
- n = x.responseXML.selectSingleNode("//*[local-name()='Fault']/faultstring");
- if (n) ret.description = n.firstChild.nodeValue;
-
- } else if ((x.status == 502) || (x.status == 12031)) {
- ret.message = "The server could not be found.";
-
- } else {
- // no classified response.
- ret.message = "Result-Status:" + x.status + "\n" + x.responseText;
- } // if
- proxies.current.onException(ret);
- } // if
-
- proxies.xmlhttp = null;
- proxies.current = null;
- } // if
-}; // proxies._response
-
-
-proxies.alertResult = function() {
- ///<summary>Callback method to show the result of a soap call in an alert box.</summary>
- ///<remarks>To set up a debug output in an alert box use:
- ///proxies.service.method.corefunc = proxies.alertResult;</remarks>
- var x = proxies.xmlhttp;
-
- if (x.readyState == 4) {
- if (x.status == 200) {
- if (!x.responseXML.documentElement.firstChild.firstChild.firstChild)
- alert("(no result)");
- else
- alert(x.responseXML.documentElement.firstChild.firstChild.firstChild.firstChild.nodeValue);
-
- } else if (x.status == 404) {
- alert("Error!\n\nThe webservice could not be found.");
-
- } else if (x.status == 500) {
- // a SoapException
- var ex = new Error();
- ex.name = "SoapException";
- var n = x.responseXML.documentElement.firstChild.firstChild.firstChild;
- while (n) {
- if (n.nodeName == "faultcode") ex.message = n.firstChild.nodeValue;
- if (n.nodeName == "faultstring") ex.description = n.firstChild.nodeValue;
- n = n.nextSibling;
- } // while
- alert("The server threw an exception.\n\n" + ex.message + "\n\n" + ex.description);
-
- } else if (x.status == 502) {
- alert("Error!\n\nThe server could not be found.");
-
- } else {
- // no classified response.
- alert("Result-Status:" + x.status + "\n" + x.responseText);
- } // if
-
- proxies.xmlhttp = null;
- proxies.current = null;
- } // if
-}; // proxies.alertResult
-
-
-proxies.alertResponseText = function() {
- ///<summary>Show all the details of the returned data of a webservice call.
- ///Use this method for debugging transmission problems.</summary>
- ///<remarks>To set up a debug output in an alert box use:
- ///proxies.service.method.corefunc = proxies.alertResponseText;</remarks>
- if (proxies.xmlhttp.readyState == 4)
- alert("Status:" + proxies.xmlhttp.status + "\nRESULT:" + proxies.xmlhttp.responseText);
-}; // proxies.alertResponseText
-
-
-proxies.alertException = function(ex) {
- ///<summary>Show the details about an exception.</summary>
- var s = "Exception:\n\n";
-
- if (ex.constructor == String) {
- s = ex;
- } else {
- if ((ex.name) && (ex.name != ""))
- s += "Type: " + ex.name + "\n\n";
-
- if ((ex.message) && (ex.message != ""))
- s += "Message:\n" + ex.message + "\n\n";
-
- if ((ex.description) && (ex.description != "") && (ex.message != ex.description))
- s += "Description:\n" + ex.description + "\n\n";
- } // if
- alert(s);
-}; // proxies.alertException
-
-
-proxies._getXHR = function() {
- ///<summary>Get a browser specific implementation of the XMLHttpRequest object.</summary>
- // from http://blogs.msdn.com/ie/archive/2006/01/23/516393.aspx
- var x = null;
- if (window.XMLHttpRequest) {
- // if IE7, Mozilla, Safari, etc: Use native object
- x = new XMLHttpRequest();
-
- } else if (window.ActiveXObject) {
- // ...otherwise, use the ActiveX control for IE5.x and IE6
- try { x = new ActiveXObject("Msxml2.XMLHTTP"); } catch (ex1) { }
- if (!x) {
- try { x = new ActiveXObject("Microsoft.XMLHTTP"); } catch (ex2) { }
- } // if
- } // if
- return (x);
-}; // proxies._getXHR
-
-
-ajax._getXMLDOM = function(xmlText) {
- ///<summary>Get a browser specific implementation of the XMLDOM object, containing a XML document.</summary>
- ///<param name="xmlText">the xml document as string.</param>
- var obj = null;
-
- if ((document.implementation) && (typeof document.implementation.createDocument == "function")) {
- // Gecko / Mozilla / Firefox
- var parser = new DOMParser();
- obj = parser.parseFromString(xmlText, "text/xml");
-
- } else {
- // IE
- try {
- obj = new ActiveXObject("MSXML2.DOMDocument");
- } catch (ex1) { }
-
- if (!obj) {
- try {
- obj = new ActiveXObject("Microsoft.XMLDOM");
- } catch (ex2) { }
- } // if
-
- if (obj) {
- obj.async = false;
- obj.validateOnParse = false;
- } // if
- obj.loadXML(xmlText);
- } // if
- return (obj);
-}; // _getXMLDOM
-
-
-proxies.xml2json = function(xObj) {
- ///<summary>Convert complex XML structures to JavaScript objects (JSON).</summary>
- var ret = {};
- if (xObj.nodeType == 9)
- return (this.xml2json(xObj.documentElement));
-
- var n = xObj.firstChild;
- if (n == null) {
- if (xObj.getAttribute("xsi:nil") == "true") {
- ret = null;
- } else {
- ret = "";
- } // if
-
- } else if (n.nodeType == 3) {
- // just a text node.
- ret = n.nodeValue;
-
- } else {
- // a complex node: analyse all subnodes
- while (n) {
- var nn = n.nodeName;
- // strip namespace aliases from node names: n1:<varname> --> <varname>
- if (nn.indexOf(':') > 0) {
- nn = nn.split(":")[1];
- } // if
-
- var nv = this.xml2json(n); // recursion !
- if (!ret[nn]) {
- // maybe just a simple nested value
- ret[nn] = nv;
- } else if (ret[nn].constructor == Array) {
- // nn is already an array, now with another value
- ret[nn].push(nv);
- } else {
- // if more than 1 element with the same name is present
- // an array is used to collect them all.
- var tmp = [];
- tmp[0] = ret[nn];
- tmp[1] = nv;
- ret[nn] = tmp;
- } // if
- n = n.nextSibling;
- } // while
- } // if
- return (ret);
-}; // xml2json
-
-
-proxies._wrapArray2Xml = function(arr, tagname) {
- ///<summary>Wrap array in xml tags helper.</summary>
- ///<param name="arr" type="Array">An array containing values.</param>
- ///<param name="tagname" type="String">The tagname used in the array.</param>
- var ts = "<" + tagname + ">";
- var te = "</" + tagname + ">";
- var tm = te + ts;
- return (ts + arr.join(tm) + te);
-};
-
-
-proxies._getAnyXmlText = function(node) {
- ///<summary>Factoring out getting text from a node.</summary>
- return (node.textContent || node.innerText || node.text || node.childNodes[0].nodeValue);
-};
-
-
-function inspectObj(obj) {
- ///<summary>Show the details of a javascript object using an alert box.</summary>
- ///<remarks>This helps a lot while developing and debugging.</remarks>
- alert(inspectText(obj));
-}; // inspectObj
-
-
-window.inspectText = function(obj) {
- ///<summary>Create a textual view of the details of a javascript object.</summary>
- var s = "InspectObj:";
- var n, p;
-
- if (!obj) {
- s = "(null)"; return (s);
- } else if (obj.constructor == String) {
- s = "\"" + obj + "\"";
- } else if (obj.constructor == Array) {
- s += " _ARRAY";
- } else if (typeof (obj) == "function") {
- s += " [function]" + obj;
-
- } else if ((typeof (XMLSerializer) != "undefined") && (obj.constructor == XMLDocument)) {
- s = "[XMLDocument]:\n" + (new XMLSerializer()).serializeToString(obj.firstChild);
- return (s);
-
- } else if ((typeof (obj) == "object") && (obj.xml)) {
- s = "[XML]:\n" + obj.xml;
- return (s);
- }
-
- for (p in obj) {
- try {
- if (!obj[p]) {
- s += "\n" + String(p) + " (...)";
-
- } else if (typeof (obj[p]) == "function") {
- s += "\n" + String(p) + " [function]";
-
- } else if (obj[p].constructor == Array) {
- s += "\n" + String(p) + " [ARRAY]: " + obj[p];
- for (n = 0; n < obj[p].length; n++)
- s += "\n " + n + ": " + obj[p][n];
-
- } else {
- s += "\n" + String(p) + " [" + typeof (obj[p]) + "]: " + obj[p];
- } // if
- } catch (e) { s += e; }
- } // for
- return (s);
-}; // inspectObj
-
-
-// ----- make FF more IE compatible -----
-if (!ajax.isIE) {
- // ----- XML objects -----
-
- // select the first node that matches the XPath expression
- // xPath: the XPath expression to use
- if (!XMLDocument.selectSingleNode) {
- XMLDocument.prototype.selectSingleNode = function(xPath) {
- var doc = this;
- if (doc.nodeType != 9)
- doc = doc.ownerDocument;
- if (doc.nsResolver == null) doc.nsResolver = function(prefix) { return (null); };
- var node = doc.evaluate(xPath, this, doc.nsResolver, XPathResult.ANY_UNORDERED_NODE_TYPE, null);
- if (node) node = node.singleNodeValue;
- return (node);
- }; // selectSingleNode
- } // if
-} // if
-
-// ----- End -----
-
+++ /dev/null
-PROJECT(xsd)
-SUBDIRS(src)
-
-INCLUDE_DIRECTORIES("${aebutils_SOURCE_DIR}")
-#
-# Some usfull options
-#
-OPTION(WSD_WITH_BOOST "Build libxsd with boost dependency" OFF)
-OPTION(XSD_WITH_AEB "Build libxsd with aeb shared pointer" ON)
-CONFIGURE_FILE(${xsd_SOURCE_DIR}/include/xsd/config.h.cmake
- ${xsd_SOURCE_DIR}/include/xsd/config.h)
+++ /dev/null
-#ifndef XML_SERIALIZE_H
-#define XML_SERIALIZE_H
-
-class xmlSerialiser;
-class xmlSerializer
-{
- public:
- xmlSerializer() : m_withNamespace(false),me_any(NULL) {};
- ~xmlSerializer() {};
- inline void use_namespace(bool b) {m_withNamespace=b;};
- virtual void serialize_any(std::ostream &os) {std::cout<<"bad if here"<<std::endl;};
- virtual void serialize_attributes(std::ostream &os) {;};
- void any(xmlSerializer *v) {me_any=v;};
- protected:
- bool m_withNamespace;
- xmlSerializer *me_any;
-};
-
-
-/* :vim:et:sw=2:ts=2:*/
-#endif
+++ /dev/null
-#ifndef XMLPARSER_H__
-#define XMLPARSER_H__
-
-#include <expat.h>
-#include <cstring>
-#include <iostream>
-
-#define XML_BUFFER_SIZE 16384
-
-namespace xml {
-
- namespace sax {
-
- /**
- *
- *
- */
- template <typename T>
- class parser {
- public:
- parser() : m_parser(NULL) {}
- //
- void onStartElement(const CML_Char *name,const XML_Char **attr)
- {
- T *_cls = dynamic_cast< T *>(this);
- if (_cls)
- _cls->onStartElement(name,attr);
- }
- //
- void onEndElement(const XML_Char *name)
- {
- T *_cls = dynamic_cast< T *>(this);
- if (_cls)
- _cls->onEndElement(name,attr);
- }
- //
- void onCharacters(const XML_Char *name,size_t sz)
- {
- T *_cls = dynamic_cast< T *>(this);
- if (_cls)
- _cls->onCharacters(name,sz);
- }
-
- void parse(std::istream &is)
- {
- void *buf = NULL;
- m_parser = XML_ParserCreateNS(0,XML_Char(' '));
-
- parser_init();
-
- do
- {
- buf = XML_GetBuffer(m_parser,XML_BUFFER_SIZE);
-
- is.read(buf,XML_BUFFER_SIZE);
-
- if (is.bad() || (is.fail() && !is.eof()))
- {
- break; /* End of parsing */
- }
- if (XML_Parse ( m_parser,buf,is.gcount(),is.eof()) == XML_STATUS_ERROR)
- {
- break;
- }
- }
- while (! is.eof());
-
- parser_clear();
- }
- }
- //
- void parse(const std::string &str);
- /**
- * Global functions registers
- * during template instanciation
- *
- */
- static void XMLCALL startElement_glb(void *user_data, const XML_Char *,const XML_Char **attr)
- {
- parser &doc = (*reinterpret_cast<parser *>(d));
- doc.startElement(ns,attr);
- }
-
- static void XMLCALL endElement_glb(void *user_data,const XML_Char *name)
- {
- }
-
- static void XMLCALL characters_glb(void *user_data,const XML_Char *ns,int dt)
- {
- }
-
- static void XMLCALL startNamespace_glb(void *user_data, const XML_Char *prefix,const XML_Char *uri)
- {
- }
-
- static void XMLCALL endNamespace_glb(void *user_data, const XML_Char *prefix)
- {
- }
- /*
- *
- */
- void parser_init()
- {
- XML_SetUserData(m_parser,this);
-
- XML_SetStartElementHandler(m_parser,startElement_glb);
-
- XML_SetEndElementHandler(m_parser,endElement_glb);
-
- XML_SetCharacterDataHandler(m_parser,characters_glb);
-
- XML_SetNamespaceDeclHandler(m_parser,startNamespace_glb,endNamespace_glb);
- }
- /**
- *
- *
- */
- void parser_clear()
- {
- XML_SetUserData(m_parser,0);
- XML_SetStartElementHandler(m_parser,0);
- XML_SetEndElementHandler(m_parser,0);
- XML_SetNamespaceDeclHandler(m_parser,0,0);
- }
-
- protected:
- XML_Parser *m_parser;
- };
- }
- };
-
-
- /**
- *
- *
- */
- class parserImpl : parser<ParserImpl>
- {
- public:
- parserImpl() {};
- virtual void onStartElement(const CML_Char *name,const XML_Char **attr)
- {
- }
- virtual void onEndElement(const XML_Char *name)
- {
- }
- virtual void onCharacters(const XML_Char *name,size_t sz)
- {
- }
- protected:
- };
- };
-
-};
-
-#endif
+++ /dev/null
-#ifndef XSD_CONFIG_H
-#define XSD_CONFIG_H
-
-#cmakedefine XSD_WITH_BOOST
-#cmakedefine XSD_WITH_AEB
-#cmakedefine WITH_MALLOC
-
-#ifdef XSD_WITH_BOOST
-# define SHARED_PTR boost::shared_ptr
-#elif defined(XSD_WITH_AEB)
-# define SHARED_PTR aeb::shared_ptr
-#endif
-
-#endif
+++ /dev/null
-#ifndef XSD_PARSER_DOC_H
-#define XSD_PARSER_DOC_H
-#include <iostream>
-namespace xsd
-{
-
- namespace parser
- {
-
-
- class Document
- {
- public:
- Document(ParserBase &p,const char *root) : m_depth(0) , m_root_parser(p),m_name(root) {};
- virtual ~Document() {};
-
- virtual void startElement(std::string &ns,std::string &name,std::string tp){};
- protected:
- ParserBase &m_root_parser;
- std::size_t m_depth;
- std::string m_name; /* Root name of the document */
- };
-
- }
-}
-#endif
+++ /dev/null
-#ifndef XSD_PARSER_ELEMENTS_H
-#define XSD_PARSER_ELEMENTS_H
-#include <iostream>
-namespace xsd
-{
- namespace parser {
-#if 0
- /**
- * \brief This class must be used for optional Elements
- * It's a way to check is they are present or not.
- *
- */
- class Optional
- {
- public:
- Optional() :m_present(false) {};
- virtual Set() = 0;
- bool present() {return m_present;};
- protected:
- bool m_present;
- };
-#endif
- /**
- * \brief Abstract class to implement the parser
- *
- */
- class ParserBase
- {
- public:
- ParserBase() {};
-
- virtual void pre() {};
- virtual void post() {};
-
- virtual void preInternal() {};
- virtual void postInternal() {};
-
- virtual void preImpl() {preInternal();};
- virtual void postImpl() {postInternal();};
-
- //
- virtual void startAnyElement(const std::string &ns , const std::string &name) {};
- virtual void endAnyElement(const std::string &ns,const std::string &name) {};
- virtual void anyAttribute(const std::string &ns,const std::string &name,const std::string &val) {};
-
- // post functions
- virtual void post(std::string &) {std::cout<<"Should not behere\n";};
- virtual void post(xsd::decimal &) {std::cout<<"Should not behere\n";};
- virtual void post(float &) {std::cout<<"Should not behere\n";};
- virtual void post(double &) {std::cout<<"Should not behere\n";};
- virtual void post(int &) {};
- virtual void post(short &) {};
-
- // They should nnot be here
- // Implementation function automatically generated
-#if 0
- virtual bool startElementImpl(const std::string &ns,const std::string &name,const std::string &type) {return false;};
- virtual bool endElementImpl(const std::string &ns,const std::string &name) {return false;};
- //virtual bool CharactersImpl(const std::string &ns){return false;};
- virtual bool AttributeImpl(const std::string &ns,const std::string &name,const std::string &val) {};
-#endif
- // Function coded once
- virtual void _startElement(const std::string &ns,const std::string &name,const std::string &type) = 0;
- virtual void _endElement(const std::string &ns,const std::string &name) = 0;
- virtual void _Characters(const std::string &) = 0;
- virtual void _Attribute(const std::string &ns,const std::string &name,const std::string &value) = 0;
-
- virtual const std::string &dynamicType() {static std::string s="base";return s;};
- };
-
- }
-
-
-}
-
-#endif
+++ /dev/null
-#ifndef XSD_PARSER_EXPAT_H
-#define XSD_PARSER_EXPAT_H
-
-#include <expat.h>
- #include <xsd/parser/document.h>
- #include <xsd/parser/elements.h>
-
-
-namespace xsd {
- namespace parser {
- namespace expat {
-
- struct parser_auto_ptr
- {
- ~parser_auto_ptr()
- {
- if (m_parser!= 0)
- {
- XML_ParserFree(m_parser);
- }
- };
- parser_auto_ptr(XML_Parser p = 0) :m_parser(p) {};
-
- parser_auto_ptr& operator =(XML_Parser p)
- {
- if(m_parser != 0) XML_ParserFree(m_parser);
- m_parser = p;
- return *this;
- }
- public:
- operator XML_Parser()
- {
- return m_parser;
- };
- private:
- XML_Parser m_parser;
- };
-
- /**
- * \brief First try to parse an xml document
- * I do not yet have all the information.
- *
- * \author EBERSOLD Andre
- * \date 11/09/09
- */
- class Document : public xsd::parser::Document {
- public:
- /**
- * \brief default constructor, see ParseBase
- * \param root, is the root element we want to parse
- * \param root_element_name is the name of the root element
- */
- Document( ParserBase &root,const char *root_element_name) : xsd::parser::Document(root,root_element_name) {};
- /* What do I realy need */
- ~Document() { };
- bool parse(std::string filename);
- /**
- *
- */
- bool parse(std::istream &is);
- protected:
- void split_name(const XML_Char *s,const char *&ns,size_t &ns_s, const char *&name,size_t &name_s);
- /* For expact we need static functions .... */
-
- static void XMLCALL startElement_glb(void *, const XML_Char *,const XML_Char **attr);
- static void XMLCALL endElement_glb(void *,const XML_Char *name);
- static void XMLCALL characters_glb(void *d,const XML_Char *ns,int dt);
-
- static void XMLCALL startNamespace_glb(void *, const XML_Char *prefix,const XML_Char *uri);
- static void XMLCALL endNamespace_glb(void *, const XML_Char *prefix);
- /*
- *
- */
- void parser_init();
- /**
- *
- *
- */
- void parser_clear();
-
- void startElement(const XML_Char *name,const XML_Char **attr);
- void endElement(const XML_Char *name);
- void Characters(const XML_Char *name,size_t sz);
- void Attribute(const std::string &ns,const std::string &name,const std::string &val);
- protected:
- XML_Parser m_parser;
- };
- }
- }
-}
-#endif
+++ /dev/null
-#ifndef XSD_PARSER_PARSER_H
-#define XSD_PARSER_PARSER_H
-#include <xsd/parser/elements.h>
-#include <vector>
-
-#include <stdlib.h>
-
-namespace xsd
-{
- namespace parser
- {
- class EmptyElement : public xsd::parser::ParserBase
- {
- public:
- EmptyElement() :m_str(""){};
- virtual ~EmptyElement() {};
-
- virtual void preImpl() {m_str.clear(); };
-
- virtual void postImpl() {};
- // Any Elements
- //
- virtual void startAnyElement(const std::string &ns , const std::string &name) {
- std::cout<<"EmptyElement::startAny: "<<name<<"\n";
- };
- virtual void endAnyElement(const std::string &ns,const std::string &name) {
- std::cout<<"EmptyElement::end Any: "<<name<<"\n";
- };
- virtual void anyAttribute(const std::string &ns,const std::string &name,const std::string &val) {};
-
- //
- // Implementation start functions ....
- //
-
- virtual void post(std::string &m) {m.swap(m_str);};
- virtual void post(int &v) {v = atoi(m_str.c_str());};
- virtual void post(short &v) {v = atoi(m_str.c_str());};
- virtual void post(unsigned long &v) {v = atoi(m_str.c_str());};
- virtual void post(unsigned int &v) {v = atoi(m_str.c_str());};
- virtual void post(unsigned short &v) {v = atoi(m_str.c_str());};
- virtual void post(unsigned char &v) {v = atoi(m_str.c_str());};
- /* byte */
- virtual void post(signed char &v) {v = (signed char) atoi(m_str.c_str()); };
- virtual void post(float &v) {v = atof(m_str.c_str());};
- virtual void post(double &v) {v = atof(m_str.c_str());};
- virtual void post(bool &v) {
- if (m_str[0] == '0') {
- v = 0;
- } else if (m_str[0] == '1') {
- v = 1;
- } else if (!m_str.compare("true")) {
- v = 1;
- } else if (!m_str.compare("false")) {
- v = 0;
- } else {
- std::cerr<<"post(bool) with bad value:"<<m_str<<std::endl;
- }
-
- };
- virtual void post(xsd::decimal &v) {v = atoi(m_str.c_str());};
- //
- // Called by document parse ...
- //
-
-
- virtual bool startElementImpl(const std::string &ns,const std::string &name,const std::string &type) {return false;};
- virtual bool endElementImpl(const std::string &ns,const std::string &name) {return false;};
- virtual bool AttributeImpl(const std::string &ns,const std::string &name,const std::string &val) {return false;};
- virtual bool _CharactersImpl(const std::string &c) {return false;};
-//
-
- virtual void _startElement(const std::string &ns,const std::string &name,const std::string &type){startElementImpl(ns,name,type);};
- virtual void _endElement(const std::string &ns,const std::string &name) {endElementImpl(ns,name);};
-
- virtual void _Characters(const std::string &c) {if (!_CharactersImpl(c)) m_str+=c;};
- virtual void _Attribute(const std::string &ns,const std::string &name,const std::string &value) ;
- protected:
- /** Characters in element */
- std::string m_str;
- };
-
- /**
- * \brief
- *
- * \author EBERSOLD Andre
- * \date
- * \param
- *
- */
- class SimpleElement : public EmptyElement
- {
- public:
- SimpleElement() : EmptyElement() {};
- virtual ~SimpleElement() { };
- virtual void pre() {this->preInternal();};
- virtual void preInternal() {m_str.clear();};
- virtual bool _CharactersImpl(const std::string &c) { m_str+=c;return true;};
- virtual void _Characters(const std::string &c);
- virtual void _Attribute(const std::string &ns,const std::string &name,const std::string &val);
-
-
- };
-
- /**
- * \brief Complex Elements have choice, sequence, extension...
- * This is probably the most complicated case
- *
- *
- * \author EBERSOLD Andre
- * \date
- * \param
- *
- */
- class ComplexElement : public virtual ::xsd::parser::EmptyElement
- {
- public:
- ComplexElement() : ::xsd::parser::EmptyElement() {};
- virtual ~ComplexElement() {};
-
- virtual void preImpl() ;
-
- virtual void postImpl();
-
- virtual void _startElement(const std::string &ns,const std::string &name,const std::string &type) ;
- virtual void _endElement(const std::string &ns,const std::string &name) ;
-
- virtual void _Attribute(const std::string &ns,const std::string &name,const std::string &val);
- virtual void _Characters(const std::string &c);
- protected:
- struct State {
- public:
- State() : m_any(0),m_depth(0),m_parser(0),m_data(0) {
-#ifdef DEBUG
- std::cout<<"State::State"<<std::endl;
-#endif
- };
- State(const State &p) : m_any(p.m_any),m_depth(p.m_depth),m_parser(p.m_parser),m_data(p.m_data) {};
- virtual ~State() { if (m_data) {std::cerr<<"State::~State Bad m_data!=null \n";}};
- bool m_any;
- int m_depth;
- xsd::parser::ParserBase *m_parser;
- void *m_data; /* To solve recurse issue ....*/
- };
- //std::vector<xsd::parser::ComplexElement::state> m_context;
- //static std::vector<State> m_context;
- std::vector<State> m_context;
- };
- }
-}
-
-
-#endif
+++ /dev/null
-#ifndef XML_SCHEMA_H__
-#define XML_SCHEMA_H__
-
-#include <iostream>
-#include <string>
-#include <vector>
-
-#include <xsd/config.h>
-#ifdef XSD_WITH_BOOST
-#include <boost/shared_ptr.hpp>
-#elif defined (XSD_WITH_AEB)
-#include <aeb/shared_ptr.h>
-#endif
-
-
-namespace xsd {
-namespace schema {
-
- template <typename T>
- struct element_traits {
- typedef T element_type;
-#ifdef XSD_WITH_BOOST
- typedef typename boost::shared_ptr<element_type> element_sptr;
-#elif defined(XSD_WITH_AEB)
- typedef typename aeb::shared_ptr<element_type> element_sptr;
-#else
- typedef typename aeb::shared_ptr<element_type> element_sptr;
-#endif
- typedef typename std::vector<element_sptr> element_sequence;
- };
-
- template <typename T>
- struct attribute ;
-
- template <typename T>
- std::ostream &operator << (std::ostream &os,const attribute<T> &a);
-
- template <typename T>
- struct attribute {
- typedef typename element_traits<T>::element_type t_type;
- typedef typename element_traits<T>::element_sptr t_sptr;
- public:
- attribute() : m_present(false) {} ;
- attribute(const attribute<T> &a) : m_present(a.m_present) {};
- attribute(const t_sptr &a) : m_present(a->m_present){};
- attribute(const T &a) : m_present(true) , m_content(new T(a)) {};
- attribute<T> & operator =(const attribute<T> &a) {};
- attribute<T> & operator =(const T &a) { };
-
- friend std::ostream &operator << <T>(std::ostream &os,const attribute<T> &a);
-
- protected:
- t_sptr m_content;
- bool m_present;
- };
-
-
-};
-};
-
-#endif
+++ /dev/null
-#ifndef XSD_H
-#define XSD_H
-
-#include <iostream>
-#include <string>
-#include <vector>
-
-#include <xsd/config.h>
-#ifdef XSD_WITH_BOOST
-#include <boost/shared_ptr.hpp>
-#elif defined (XSD_WITH_AEB)
-#include <aeb/shared_ptr.h>
-#endif
-
-namespace xsd {
- typedef unsigned long PositiveInteger;
- typedef ::std::string string;
- typedef long decimal;
- typedef bool boolean;
- typedef std::vector<unsigned char> base64_binary;
- typedef ::std::string QName;
- typedef ::std::string IDREF;
-
-
- template <typename T>
- struct element_traits {
- typedef T element_type;
-#ifdef XSD_WITH_BOOST
- typedef typename boost::shared_ptr<element_type> element_sptr;
-#elif defined(XSD_WITH_AEB)
- typedef typename aeb::shared_ptr<element_type> element_sptr;
-#else
- typedef typename aeb::shared_ptr<element_type> element_sptr;
-#endif
- typedef typename std::vector<element_sptr> element_sequence;
- };
-
- template <typename T,bool ns>
- struct element {
- typedef typename element_traits<T>::element_type t_type;
- typedef typename element_traits<T>::element_sptr t_sptr;
- public:
- };
-
- template <typename T>
- struct element<T,true > {
- typedef typename element_traits<T>::element_type t_type;
- typedef typename element_traits<T>::element_sptr t_sptr;
- element(const t_sptr &s,const char *n) : m_content(s) ,m_name(n){};
- friend std::ostream & operator <<(std::ostream &os,const element &e)
- {
- os<<"<:"<<e.m_name;
- e.m_content->serialize_attributes(os);
- os<<">";
- os<<*(e.m_content);
- os<<"</:"<<e.m_name<<">";
- };
- t_sptr m_content;
- const char *m_name;
- };
-
- template <typename T>
- struct element<T,false> {
- typedef typename element_traits<T>::element_type t_type;
- typedef typename element_traits<T>::element_sptr t_sptr;
- element(const t_sptr &s,const char *n) : m_content(s) ,m_name(n){};
- friend std::ostream & operator <<(std::ostream &os,const element &e)
- {
- os<<"<"<<e.m_name;
- e.m_content->serialize_attributes(os);
- os<<">";
- os<<*(e.m_content);
- os<<"<"<<e.m_name<<">";
- };
- t_sptr m_content;
- const char *m_name;
- };
-
-}
-#include <xsd/parser/elements.h>
-#include <xsd/parser/parser.h>
-
-#endif
+++ /dev/null
-PROJECT(libxsd)
-
-INCLUDE_DIRECTORIES(${libxsd_SOURCE_DIR}/../include)
-INCLUDE_DIRECTORIES(/usr/local/include)
-
-FIND_PACKAGE(EXPAT REQUIRED)
-INCLUDE_DIRECTORIES(${EXPAT_INCLUDE_DIR})
-ADD_LIBRARY(libxsd STATIC elements.cpp parser.cpp document_expat.cpp)
-EXPORT(TARGETS libxsd FILE libxsdLibraries.cmake)
-
-ADD_LIBRARY(xsdd STATIC elements.cpp parser.cpp document_expat.cpp)
-SET_TARGET_PROPERTIES(xsdd
- PROPERTIES
- CLEAN_DIRECT_OUTPUT 1
- COMPILE_FLAGS "-DDEBUG -DPARSER_DEBUG=1"
- )
-#
-# Install stuff
-#
-
-INSTALL(TARGETS libxsd
- EXPORT libxsd
- ARCHIVE
- DESTINATION lib
- COMPONENT Libraries)
-INSTALL(EXPORT libxsd DESTINATION lib)
-
-INSTALL(TARGETS xsdd
- EXPORT xsdd
- ARCHIVE
- DESTINATION lib
- COMPONENT Libraries)
-INSTALL(EXPORT xsdd DESTINATION lib)
-
-INSTALL(FILES
- ${libxsd_SOURCE_DIR}/document_expat.cpp
- ${libxsd_SOURCE_DIR}/elements.cpp
- ${libxsd_SOURCE_DIR}/parser.cpp
- DESTINATION lib/src
- COMPONENT Headers
- )
-INSTALL(FILES
- ${libxsd_SOURCE_DIR}/../include/xsd/xsd.h
- DESTINATION include/xsd
- COMPONENT Headers
- )
-INSTALL(FILES
- ${libxsd_SOURCE_DIR}/../include/xsd/parser/parser.h
- ${libxsd_SOURCE_DIR}/../include/xsd/parser/elements.h
- ${libxsd_SOURCE_DIR}/../include/xsd/parser/document.h
- ${libxsd_SOURCE_DIR}/../include/xsd/parser/xml-schema.h
- DESTINATION include/xsd/parser
- COMPONENT Headers
- )
-INSTALL(FILES
- ${libxsd_SOURCE_DIR}/../include/xsd/parser/expat/elements.h
- DESTINATION include/xsd/parser/expat
- COMPONENT Headers
- )
-
-INSTALL(FILES
- ${libxsd_SOURCE_DIR}/../include/xmlSerialize.h
- DESTINATION include/
- COMPONENT Headers
- )
+++ /dev/null
-
-#include <expat.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-#include <cstring>
-#include <iostream>
-
-namespace xsd
-{
- namespace parser
- {
-
- namespace expat
- {
-
- /**
- * Funny fact to parse a xml entity....
- */
- bool Document::parse(std::istream &is)
- {
- char buf[16384];
- parser_auto_ptr parser = XML_ParserCreateNS(0,XML_Char(' '));
- m_parser = parser;
- parser_init();
- do
- {
- is.read(buf,sizeof(buf));
- if (is.bad() || (is.fail() && !is.eof()))
- {
- break; /* End of parsing */
- }
- if (XML_Parse ( m_parser,buf,is.gcount(),is.eof()) == XML_STATUS_ERROR)
- {
- break;
- }
- } while (! is.eof());
- parser_clear();
- }
-
- void Document::parser_init()
- {
- XML_SetUserData(m_parser,this);
- XML_SetStartElementHandler(m_parser,startElement_glb);
- XML_SetEndElementHandler(m_parser,endElement_glb);
- XML_SetCharacterDataHandler(m_parser,characters_glb);
- /**
- * XML_SetNamespaveDecHandler(m_parser,start,end);
- */
- XML_SetNamespaceDeclHandler(m_parser,startNamespace_glb,endNamespace_glb);
- }
-
- void Document::parser_clear()
- {
- XML_SetUserData(m_parser,0);
- XML_SetStartElementHandler(m_parser,0);
- XML_SetEndElementHandler(m_parser,0);
- XML_SetNamespaceDeclHandler(m_parser,0,0);
- }
-
- void Document::startElement_glb(void *d,const XML_Char *ns, const XML_Char **attr)
- {
- Document &doc = (*reinterpret_cast<Document*>(d));
- doc.startElement(ns,attr);
- }
-
- void Document::endElement_glb(void *d,const XML_Char *ns)
- {
- Document &doc = (*reinterpret_cast<Document*>(d));
- doc.endElement(ns);
- }
-
- void Document::characters_glb(void *d,const XML_Char *ns,int ds)
- {
- Document &doc = (*reinterpret_cast<Document*>(d));
- doc.Characters(ns,ds);
- }
-
- void Document::split_name(const XML_Char *s,const char *&ns,size_t &ns_s,
- const char *&name,size_t &name_s)
- {
- const char *p = std::strchr(s,' ');
- ns=s;
- if (p)
- {
- ns_s=p-s;
- name=p+1;
- } else
- {
- ns_s =0;
- name=s;
- }
- name_s = strlen(name);
-
- }
- /**
- * Well first see how it works. Right now, I do not really now
- * But it's important for soap.
- *
- */
- void Document::startNamespace_glb(void *d,const XML_Char *prefix, const XML_Char *uri)
- {
- Document &doc = (*reinterpret_cast<Document*>(d));
- }
- void Document::endNamespace_glb(void *d,const XML_Char *prefix)
- {
- Document &doc = (*reinterpret_cast<Document*>(d));
- }
-
- /* Ok, call the parser objects with the given events ... */
- void Document::startElement(const XML_Char *name,const XML_Char **attr)
- {
- const char *ns;
- const char *nm;
- size_t ns_s,nm_s;
-
- split_name(name,ns,ns_s,nm,nm_s);
-
- if (m_depth++ > 0 )
- {
- /* under root */
- m_root_parser._startElement(std::string(ns,ns_s),std::string(nm,nm_s),std::string(""));
-#ifdef DEBUG
-std::cout<<"\n\t**** Document after having called _startElement *****\n";
-#endif
- } else
- {
-#ifdef DEBUG
- std::cout<<"Start of "<<name<<"\n";
-#endif
- /* root element */
- std::string n(nm,nm_s);
- if (n == m_name)
- {
- /* Yes we are right */
- //std::cout<<" Yes, start root "<<m_name<<std::endl;
- m_root_parser.preImpl();
- } else
- {
- std::cout<<"hohoho root node false : "<<m_name<<" - "<<n<<std::endl;
- }
- /* I think I shoud proceed with the attributes now */
- }
- const XML_Char **p = attr;
- for (p ; *p != 0 ; p+=2)
- {
- split_name(*p,ns,ns_s,nm,nm_s);
- Attribute(std::string(ns,ns_s),std::string(nm,nm_s),std::string(*(p+1)));
- }
- }
- void Document::endElement(const XML_Char *name)
- {
- const char *ns;
- const char *nm;
- size_t ns_s,nm_s;
- split_name(name,ns,ns_s,nm,nm_s);
- if (--m_depth > 0)
- {
- m_root_parser._endElement(std::string(ns,ns_s),std::string(nm,nm_s));
- } else
- {
- /* end root element */
- m_root_parser.postImpl();
- }
- }
- void Document::Characters(const XML_Char *name,size_t sz)
- {
- m_root_parser._Characters(std::string(name,sz));
- }
- void Document::Attribute(const std::string &ns,const std::string &n,const std::string &val)
- {
- m_root_parser._Attribute(ns,n,val);
- }
- } /* end ns expat */
- } /* end ns parser */
-}
+++ /dev/null
-#include <string>
-#include <xsd/xsd.h>
-
-
-
+++ /dev/null
-#include <istream>
-#include <ios>
-#include <iostream>
-#include <xsd/xsd.h>
-#include <xsd/parser/parser.h>
-
-//#define PARSER_DEBUG 1
-namespace xsd {
- namespace parser {
-
-//std::vector<ComplexElement::State> ComplexElement::m_context;
-
- void EmptyElement::_Attribute(const std::string &ns,const std::string &name,const std::string &val)
- {
- if( !this->AttributeImpl(ns,name,val) )
- {
- std::cout<<"Any attribute "<<name<<" val="<<val<<std::endl;
- anyAttribute(ns,name,val);
- }
- }
-
- /**
- * Implement SimpleElement parsing function
- */
-
-
-void SimpleElement::_Characters(const std::string &val)
-{
- if (! _CharactersImpl(val))
- m_str+=val;
-}
-
-void SimpleElement::_Attribute(const std::string &ns,const std::string &name,const std::string &val)
-{
- if (!this->AttributeImpl(ns,name,val))
- {
- anyAttribute(ns,name,val);
- std::cout<<" SimpleElement::_Attribute unknown attr "<<name<<"\n";
- } else {
- }
-}
-/**
- * Implement ComplexElement parsing function
- */
-
-void ComplexElement::preImpl()
-{
-#ifdef PARSER_DEBUG
- //std::cout<<"Cplx::preImpl before m_context size="<<m_context.size();
- //if (m_context.size() > 0) std::cout<<" m_depth="<<m_context.back().m_depth;
-#endif
- m_context.push_back(State());
-#ifdef PARSER_DEBUG
- std::cout<<"Cplx::preImpl m_context size="<<m_context.size()<<std::endl;
-#endif
- this->preInternal();
-}
-
-void ComplexElement::postImpl()
-{
- this->postInternal();
-#ifdef PARSER_DEBUG
- std::cout<<"Cplx::postImpl m_context size="<<m_context.size();
-#endif
- m_context.pop_back();
-#ifdef PARSER_DEBUG
- std::cout<<" after m_context size="<<m_context.size()<<std::endl;
-#endif
-}
-
-void ComplexElement::_startElement(const std::string &ns,const std::string &name,const std::string &type)
-{
- State &s(m_context.back());
-#ifdef PARSER_DEBUG
- if (m_context.back().m_depth > 0)
- for (int i=m_context.back().m_depth; i > 0; i--)
- std::cout<<" ";
- std::cout<<"CplxE::_startElement : "<<name<<" s.m_depth="<<s.m_depth<<" ctx.size="<<m_context.size()<<std::endl;
-#endif
- if (s.m_depth++ > 0)
- {
- //Should check if it's any first
- if (s.m_parser)
- {
-#ifdef PARSER_DEBUG
- std::cout<<"CplxE::_startElement call s.m_parser->m_start : "<<name<<std::endl;
-#endif
- s.m_parser->_startElement(ns,name,type);
- } else {
-#ifdef PARSER_DEBUG
- std::cout<<"CplxE::_startElement no parser staked (s.parser=NULL): "<<name<<std::endl;
-#endif
- }
- } else {
-#ifdef PARSER_DEBUG
- std::cout<<"CplxE::_startElement call startElementImpl : "<<name<<" m_parser="<<s.m_parser<<std::endl;
-#endif
- if (!startElementImpl(ns,name,type))
- {
-#ifdef PARSER_DEBUG
- std::cout<<"\tcplx _start call Any : unknown "<<name<<std::endl;
-#endif
- // Unexpectect element
- //this->startAnyElement(ns,name);
- /* Element not recogized by us*/
- } else
- {
-#ifdef PARSER_DEBUG
- std::cout<<"\tcplx _start called startElementImpl with ctx size="<<m_context.size()<<"- : "<<name<<std::endl;
-#endif
- if (s.m_parser != 0)
- {
- s.m_parser->preImpl();
- /* Need to call pre */
-#ifdef PARSER_DEBUG
- std::cout<<"\tcplx _start Need to call pre- : "<<name<<std::endl;
-#endif
- }
- }
- }
-}
-
-
-void ComplexElement::_endElement(const std::string &ns,const std::string &name)
-{
-#if PARSER_DEBUG
- std::string space;
- State &s(m_context.back());
- for (int i = 0 ; i < s.m_depth ; i++ ) space+=" ";
- std::cout<<space<<"CplxE::_endElement Enter this="<<this<<" "<<name<<" s.depth="<<s.m_depth<<" sz="<<m_context.size()<<" \n";
-#endif
- if (m_context.back().m_depth==0)
- {
- State &ss(m_context[m_context.size()-2]);
- if (--ss.m_depth > 0) {
- // Indirect
-#if PARSER_DEBUG
- std::cout<<space<<"CplxE::_endElement 1 name=";
- std::cout<<name<<" ss.m_depth="<<ss.m_depth<<" m_context.size="<<m_context.size()<<std::endl;
-#endif
- if (ss.m_parser)
- {
- ss.m_parser->_endElement(ns,name);
- } else
- std::cout<<"No parser ? "<<name<<std::endl;
-
- } else
- {
- // Direct recursion
-#ifdef PARSER_DEBUG
- std::cout<<space<<"CplxE::_endElement 2 WARNING I pass by here Direct recursion: "<<name<<std::endl;
-#endif
- if (this == ss.m_parser)
- {
-#ifdef PARSER_DEBUG
- std::cout<<space<<"CplxE::_endE good this==ss.m_parser "<<name<<" @this"<<this<<" p @"<<ss.m_parser<<std::endl;
-#endif
-
- this->postImpl();
- if (!endElementImpl(ns,name)) {
-#ifdef PARSER_DEBUG
- std::cout<<space<<"CplxE::_end failed call endElementImpl"<<std::endl;
-#endif
- std::cout<<"cplx::_endElement What's wrong ? with :"<<name<<std::endl;
- }
- } else
- {
- std::cout<<"MUST NOT HAPPEN cplx::_endElement"<<"\n";
- }
- }
- }
- else
- {
- State &s(m_context.back());
- if (--s.m_depth > 0)
- {
-#if PARSER_DEBUG
- std::cout<<space<<"cplxE::_endElement 3 "<<name<<" this="<<this<<" s.m_parser="<<s.m_parser<<" ";
- std::cout<<" m_depth="<<s.m_depth<<" stk size="<<m_context.size()<<std::endl;
-#endif
- if (s.m_parser)
- {
- s.m_parser->_endElement(ns,name);
- } else
- std::cout<<"No parser here\n";
-
- } else {
-#if PARSER_DEBUG
- std::cout<<space<<"CplxE::endElement 4 name="<<name<<" ";
- if (this == s.m_parser)
- {
- std::cout<<space<<"Same parser then this "<<name<<std::endl;
- }
-#endif
- if (s.m_parser )
- {
-#if PARSER_DEBUG
- std::cout<<space<<"Call postImpl "<<name<<std::endl;
-#endif
- s.m_parser->postImpl();
- }
-
- // std::cout<<" endElementImpl "<<name<<std::endl;
- if (!endElementImpl(ns,name))
- {
-#if PARSER_DEBUG
- std::cout<<space<<"Failed call endElementImpl "<<name<<std::endl;
-#endif
- // Wrong
- //this->endAnyElement(ns,name);
- }
- }
- }
-#ifdef PARSER_DEBUG
- std::cout<<space<<"CplxE::_endElement Leave this="<<this<<" "<<name<<" s.depth="<<s.m_depth<<" sz="<<m_context.size()<<" \n";
-#endif
-}
-/**
- *
- *
- */
- void ComplexElement::_Attribute(const std::string &ns,const std::string &name,const std::string &val)
-{
- if (m_context.back().m_depth > 0)
- {
- State &s(m_context.back());
- if (s.m_any) {
- std::cout<<"CplxE::_Attribute Any\n";
- anyAttribute(ns,name,val);
- } else if (s.m_parser) {
-#ifdef PARSER_DEBUG
- std::cout<<"CplxE::_Attribute "<<name<<"\n";
-#endif
- s.m_parser->_Attribute(ns,name,val);
- }
- } else
- {
-#ifdef PARSER_DEBUG
- std::cout<<"CplxE::_Attribute call this-AttributeImpl "<<name<<"\n";
-#endif
- this->AttributeImpl(ns,name,val);
- }
-}
-
-/**
- *
- *
- */
-void ComplexElement::_Characters(const std::string &val)
-{
- State &s(m_context.back());
- if (s.m_depth > 0)
- {
- if (s.m_parser) {
-#ifdef PARSER_DEBUG_CHARACTER
- std::cout<<"CplxE::_characters"<<val<<" sz="<<m_context.size()<<"call parser@ "<<s.m_parser<<"\n";
-#endif
- if (s.m_parser == this)
- {
- std::cerr<<"CplxE::_Characters ERROR: I have serious trouble treating -("<<val<<")"<<s.m_depth<<"\n";
- if (!_CharactersImpl(val))
- {
- // Call any characters
-#ifdef PARSER_DEBUG_CHARATER
- std::cout<<"CplxE::_Characters what to do? call any_characters :"<<val<<" depth="<<s.m_depth<<std::endl;
-#endif
- }
- } else
- s.m_parser->_Characters(val);
- } else {
- std::cout<<"CplxE::_characters... what to do with char ("<<val<<") "<<m_context.size()<<" parser@="<<s.m_parser<<"\n";
- }
-
- } else {
- if (!_CharactersImpl(val))
- {
- // Call any characters
-#ifdef PARSER_DEBUG_CHARATER
- std::cout<<"CplxE::_Characters what to do? call any_characters :"<<val<<" depth="<<s.m_depth<<std::endl;
-#endif
- }
- }
-}
-
-}
-}
+++ /dev/null
-SUBDIRS(basic dependencies svg umf soap cwmp api t8000 uml2 ics_notifier pgml xpdl x3d kml
- xmldsig xslt)
+++ /dev/null
-PROJECT(telapi)
-
-ENABLE_TESTING()
-
-FIND_LIBRARY(EXPAT_LIB expat /usr/local/lib /usr/lib)
-FIND_LIBRARY(CPPUNIT_LIB cppunit /usr/local/lib /usr/lib)
-FIND_LIBRARY(DL_LIB dl /usr/local/lib usr/lib)
-
-INCLUDE_DIRECTORIES("${xml-t_SOURCE_DIR}/libxsd/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/")
-INCLUDE_DIRECTORIES(".")
-INCLUDE_DIRECTORIES("/usr/local/include")
-
-SET(SAXON CACHE STRING "~/Tools/saxon/saxon9.jar")
-SET(XSD2CPP "${CMAKE_CURRENT_SOURCE_DIR}/../../xsd2cpp.xsl")
-SET(API "${telapi_SOURCE_DIR}/api.xsd")
-
-
-ADD_CUSTOM_COMMAND(
- SOURCE ${API}
- COMMAND java
- ARGS -jar ${SAXON} -s ${API} -xsl:${XSD2CPP} target="release" rootdir="./parser/"
- incdir="/../include" srcdir="./" root-element="simple"
- OUTPUT
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_api.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/api.cpp
- COMMENT "Transform "
- )
-
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/parser/p_api.cpp
- GENERATED)
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/parser/api.cpp
- GENERATED)
-
-IF(COMMAND cmake_policy)
- cmake_policy(SET CMP0003 NEW)
-ENDIF(COMMAND cmake_policy)
-
- #main_parser.cpp
-ADD_EXECUTABLE(sapi
- ${CMAKE_CURRENT_BINARY_DIR}/parser/api.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_api.cpp
- main.cpp
- )
-TARGET_LINK_LIBRARIES(sapi libxsd ${EXPAT_LIB})
-
-ADD_EXECUTABLE(sapid
- ${CMAKE_CURRENT_BINARY_DIR}/parser/api.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_api.cpp
- main.cpp
- )
-
-SET_TARGET_PROPERTIES(sapid
- PROPERTIES
- CLEAN_DIRECT_OUTPUT 1
- COMPILE_FLAGS "-DDEBUG -DPARSER_DEBUG=1"
- )
-TARGET_LINK_LIBRARIES(sapid xsdd ${EXPAT_LIB})
-
-#
-# Test Stuff
-#
-IF(NOT ${CPPUNIT_LIB})
- TARGET_LINK_LIBRARIES(sapi
- libxsd
- ${EXPAT_LIB}
- ${CPPUNIT_LIB}
- )
- IF(NOT ${DL_LIB})
- TARGET_LINK_LIBRARIES(sapi ${DL_LIB})
- ENDIF(NOT ${DL_LIB})
-ELSE(NOT ${CPPUNIT_LIB})
- MESSAGE("I do not have cppunit library ${CPPUNIT_LIB} ")
-ENDIF(NOT ${CPPUNIT_LIB})
-
-
-#
-# Install stuff
-#
-INSTALL(TARGETS sapi
- ARCHIVE
- RUNTIME DESTINATION examples/api
- COMPONENT Examples)
-
-INSTALL(FILES
- ${telapi_SOURCE_DIR}/api.xsd
- DESTINATION examples/api/
- COMPONENT Examples
- )
-INSTALL(FILES
- ${telapi_SOURCE_DIR}/main.cpp
- DESTINATION examples/api/
- COMPONENT Examples
- )
-INSTALL(FILES
- ${telapi_SOURCE_DIR}/parser/api.cpp
- ${telapi_SOURCE_DIR}/parser/p_api.cpp
- DESTINATION examples/api/parser
- COMPONENT Examples
- )
-INSTALL(FILES
- ${telapi_SOURCE_DIR}/include/api.h
- ${telapi_SOURCE_DIR}/include/p_api.h
- DESTINATION examples/api/include
- COMPONENT Examples
- )
-#
-# Packaging stuff
-#
-INCLUDE(InstallRequiredSystemLibraries)
-
-SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "My funky project")
-SET(CPACK_PACKAGE_VENDOR "Me, myself, and I")
-#SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
-#SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
-SET(CPACK_PACKAGE_VERSION_MAJOR "1")
-SET(CPACK_PACKAGE_VERSION_MINOR "0")
-SET(CPACK_PACKAGE_VERSION_PATCH "0")
-SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
-IF(WIN32 AND NOT UNIX)
- # There is a bug in NSI that does not handle full unix paths properly. Make
- # sure there is at least one set of four (4) backlasshes.
- SET(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp")
- SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\MyExecutable.exe")
- SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} My Famous Project")
- SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.my-project-home-page.org")
- SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.my-personal-home-page.com")
- SET(CPACK_NSIS_CONTACT "me@my-personal-home-page.com")
- SET(CPACK_NSIS_MODIFY_PATH ON)
-ELSE(WIN32 AND NOT UNIX)
- # SET(CPACK_STRIP_FILES "bin/MyExecutable")
- SET(CPACK_SOURCE_STRIP_FILES "")
-ENDIF(WIN32 AND NOT UNIX)
-
-SET(CPACK_PACKAGE_EXECUTABLES "sapi")
-
-INCLUDE(CPack)
+++ /dev/null
-<!--
-a chaque ajout, il
-faut editer le fichier types.h pour redefinir les types gsoap
-editer le fichier le fichier service_msg.c pour le support
-des nouveaux messages
-et le fichier xmlserialize.c pour la serialization du message
--->
-
-<xsd:schema targetNamespace="http://www.telapi.com"
- xmlns:tapi="http://www.telapi.com"
- xmlns="http://www.telapi.com"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified">
-
- <xsd:simpleType name="sessionid">
- <xsd:restriction base="xsd:integer"/>
- </xsd:simpleType>
-
- <!--
- call status definition
- -->
- <xsd:simpleType name="callstatus">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="trying"/>
- <xsd:enumeration value="ringing"/>
- <xsd:enumeration value="opened"/>
- <xsd:enumeration value="hangup"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!--
- call type definition
- -->
- <xsd:simpleType name="calltype">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="voice"/>
- <xsd:enumeration value="data"/>
- <xsd:enumeration value="fax"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-
- <xsd:simpleType name="calldirection">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="in"/>
- <xsd:enumeration value="out"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!--
- call definition
- -->
- <xsd:complexType name="call">
- <xsd:sequence>
- <xsd:element name="channelname" type="xsd:string"/>
- <xsd:element name="peerchannelname" type="xsd:string" use="optional"/>
- <xsd:element name="caller" type="xsd:string"/>
- <xsd:element name="callee" type="xsd:string"/>
- <xsd:element name="status" type="callstatus"/>
- <xsd:element name="type" type="calltype"/>
- <xsd:element name="direction" type="calldirection"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!--
- invocation id
- -->
- <xsd:simpleType name="invokeid">
- <xsd:restriction base="xsd:positiveInteger"/>
- </xsd:simpleType>
-
- <!--
- result definition
- -->
- <xsd:simpleType name="result">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="success"/>
- <xsd:enumeration value="failure"/>
- <xsd:enumeration value="trying"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!--
- request create a session
- -->
- <xsd:element name="req_createsession">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="user" type="xsd:string" use="required"/>
- <xsd:element name="password" type="xsd:string" minOccurs="0"/>
- <xsd:element name="key" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <!--
- response create session
- -->
- <xsd:element name="res_createsession">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="session" type="sessionid" use="required"/>
- <xsd:element name="code" type="result" use="required"/>
- <xsd:element name="cause" type="xsd:string" use="optional"/>
- <xsd:element name="key" type="xsd:string" use="required"/>
- </xsd:sequence>
- <xsd:attribute name="rid" type="invokeid" use="required"/>
- <xsd:attribute name="f" type="xsd:positiveInteger"/>
- <xsd:attribute name="np" type="xsd:positiveInteger"/>
- </xsd:complexType>
- </xsd:element>
-
-
-
- <xsd:element name="req_attachdevice">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="session" type="sessionid" use="required"/>
- <xsd:element name="device" type="xsd:string" use="required"/>
- </xsd:sequence>
- <xsd:attribute name="iid" type="invokeid" use="required"/>
- </xsd:complexType>
- </xsd:element>
-
-
-
- <xsd:element name="res_attachdevice">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="session" type="sessionid" use="required"/>
- <xsd:element name="code" type="result" use="required"/>
- <xsd:element name="cause" type="xsd:string" use="optional"/>
- <xsd:element name="device" type="xsd:string" use="optional"/>
- </xsd:sequence>
- <xsd:attribute name="rid" type="invokeid" use="required"/>
- </xsd:complexType>
- </xsd:element>
-
-
- <xsd:element name="req_update_device_state">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="session" type="sessionid" use="required"/>
- <xsd:element name="device" type="xsd:string" use="required"/>
- </xsd:sequence>
- <xsd:attribute name="iid" type="invokeid" use="required"/>
- </xsd:complexType>
- </xsd:element>
-
- <!--
- request update
- -->
- <xsd:element name="req_update">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="session" type="sessionid" use="required"/>
- </xsd:sequence>
- <xsd:attribute name="iid" type="invokeid" use="required"/>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="res_update">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="session" type="sessionid" use="required"/>
- <xsd:element name="code" type="result" use="required"/>
- <xsd:element name="cause" type="xsd:string" use="optional"/>
- </xsd:sequence>
- <xsd:attribute name="rid" type="invokeid" use="required"/>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="res_update_device_state">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="session" type="sessionid" use="required"/>
- <xsd:element name="device" type="xsd:string" use="required"/>
- <xsd:element name="code" type="result" use="required"/>
- <xsd:element name="cause" type="xsd:string" use="optional"/>
- </xsd:sequence>
- <xsd:attribute name="rid" type="invokeid" use="required"/>
- </xsd:complexType>
- </xsd:element>
-
-
- <xsd:element name="evt_update_device_state">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="session" type="sessionid" use="required"/>
- <xsd:element name="device" type="xsd:string" use="required"/>
- <xsd:element name="call" type="call" use="required"/>
- </xsd:sequence>
- <xsd:attribute name="rid" type="invokeid" use="required"/>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="req_closesession">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="session" type="sessionid" use="required"/>
- </xsd:sequence>
- <xsd:attribute name="iid" type="invokeid" use="required"/>
- </xsd:complexType>
- </xsd:element>
-
-
- <xsd:element name="res_closesession">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="session" type="sessionid" use="required"/>
- <xsd:element name="date" type="xsd:string" use="required"/>
- <xsd:element name="code" type="result" use="required"/>
- <xsd:element name="cause" type="xsd:string" use="optional"/>
- </xsd:sequence>
- <xsd:attribute name="rid" type="invokeid" use="required"/>
- <xsd:attribute name="f" type="xsd:positiveInteger"/>
- <xsd:attribute name="np" type="xsd:positiveInteger"/>
- </xsd:complexType>
- </xsd:element>
-
-
- <xsd:element name="req_call">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="session" type="sessionid" use="required"/>
- <xsd:element name="called" type="xsd:string" use="required"/>
- </xsd:sequence>
- <xsd:attribute name="iid" type="invokeid" use="required"/>
- </xsd:complexType>
- </xsd:element>
-
-
- <xsd:element name="res_call">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="session" type="sessionid" use="required"/>
- <xsd:element name="code" type="result" use="required"/>
- <xsd:element name="cause" type="xsd:string" use="optional"/>
- </xsd:sequence>
- <xsd:attribute name="rid" type="invokeid" use="required"/>
- <xsd:attribute name="f" type="xsd:positiveInteger"/>
- <xsd:attribute name="np" type="xsd:positiveInteger"/>
- </xsd:complexType>
- </xsd:element>
-
-
- <xsd:element name="req_transfer">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="session" type="sessionid" use="required"/>
- <xsd:element name="channelname" type="xsd:string" use="required"/>
- <xsd:element name="transferto" type="xsd:string" use="required"/>
- </xsd:sequence>
- <xsd:attribute name="iid" type="invokeid" use="required"/>
- </xsd:complexType>
- </xsd:element>
-
-
- <xsd:element name="res_transfer">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="session" type="sessionid" use="required"/>
- <xsd:element name="code" type="result" use="required"/>
- <xsd:element name="cause" type="xsd:string" use="optional"/>
- </xsd:sequence>
- <xsd:attribute name="rid" type="invokeid" use="required"/>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="res_update_call">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="session" type="sessionid" use="required"/>
- <xsd:element name="status" type="callstatus" use="required"/>
- </xsd:sequence>
- <xsd:attribute name="rid" type="invokeid" use="required"/>
- <xsd:attribute name="f" type="xsd:positiveInteger"/>
- <xsd:attribute name="np" type="xsd:positiveInteger"/>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="res_retry_later">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="session" type="sessionid" use="required"/>
- <xsd:element name="duration" type="xsd:positiveInteger" use="required"/>
- </xsd:sequence>
- <xsd:attribute name="rid" type="invokeid" use="required"/>
- </xsd:complexType>
- </xsd:element>
-
-
- <xsd:element name="req_users_config">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="session" type="sessionid" use="required"/>
- </xsd:sequence>
- <xsd:attribute name="iid" type="invokeid" use="required"/>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="res_users_config">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="session" type="sessionid" use="required"/>
- <xsd:element name="code" type="result" use="required"/>
- <xsd:element name="cause" type="xsd:string" use="optional"/>
- <xsd:element name="userconf" type="user_config" use="required"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="rid" type="invokeid" use="required"/>
-
- </xsd:complexType>
- </xsd:element>
-
-
-
-<!-- ccccccccccccccccccoooooooooooonffffffffffffffiiiiiiiiiiggggggggggggggggggg -->
-
-
-<xsd:simpleType name="device_type">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="SIP"/>
- <xsd:enumeration value="csta_device"/>
- </xsd:restriction>
-</xsd:simpleType>
-
-<xsd:simpleType name="backend_type">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="asterisk"/>
- <xsd:enumeration value="csta"/>
- </xsd:restriction>
-</xsd:simpleType>
-
-<xsd:complexType name="backend_asterisk_config">
- <xsd:sequence>
- <xsd:element name="sipdevicescontext" type="xsd:string" use="required"/>
- </xsd:sequence>
-</xsd:complexType>
-
-
-<xsd:complexType name="backend_device">
- <xsd:sequence>
- <xsd:element name="type" type="device_type"/>
- <xsd:element name="name" type="xsd:string"/>
- <xsd:element name="asteriskextensionname" type="xsd:string" use="optional"/>
- </xsd:sequence>
-</xsd:complexType>
-
-<xsd:complexType name="backend_user">
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string"/>
- <xsd:element name="password" type="xsd:string"/>
- </xsd:sequence>
-</xsd:complexType>
-
- <xsd:complexType name="user_config">
- <xsd:sequence>
- <xsd:element name="device" type="xsd:string" use="required"/>
- </xsd:sequence>
- <xsd:attribute name="user" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-
- <xsd:complexType name="backend_config">
- <xsd:sequence>
- <xsd:element name="type" type="backend_type" use="required"/>
- <xsd:element name="asteriskconfig" type="backend_asterisk_config" use="optional"/>
- <xsd:element name="device" type="backend_device" minOccurs="1" maxOccurs="unbounded" />
- <xsd:element name="user" type="backend_user" minOccurs="1" maxOccurs="unbounded"/>
- <xsd:element name="userconfig" type="user_config" minOccurs="1" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
-
-
-<xsd:complexType name="main_config">
- <xsd:sequence>
- <xsd:element name="backend" type="backend_config" minOccurs="1" maxOccurs="unbounded" />
- </xsd:sequence>
-</xsd:complexType>
-
-
-
-</xsd:schema>
-
-
+++ /dev/null
-#include <string>
-#include <iostream>
-#include <sstream>
-
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-#include <include/api.h>
-#include <include/p_api.h>
-
-using namespace std;
-
-/**
- *
- *
- */
-class TestP : public wwwtelapicom::p_call_skel
-{
- public:
- TestP() {};
- virtual void onElchannelname(std::string &v)
- {
- wwwtelapicom::p_call_skel::onElchannelname(v);
- cout<<"Got channel Name:"<<v<<endl;
- };
- virtual void onEldirection(wwwtelapicom::calldirection_skel &v)
- {
- wwwtelapicom::p_call_skel::onEldirection(v);
- cout<<"Got call direction:"<<v.content()<<" or : "<<v<<endl;
- };
-};
-
-/**
- *
- *
- */
-void test()
-{
- std::string st="<tapi:call xmlns:tapi=\"http://www.telapi.com\"><tapi:channelname>ch1</tapi:channelname><tapi:peerchannelname>bon alors</tapi:peerchannelname><tapi:caller></tapi:caller><tapi:callee></tapi:callee><tapi:callstatus></tapi:callstatus><tapi:calltype></tapi:calltype><tapi:direction>out</tapi:direction></tapi:call>";
- std::istringstream iss1(st,std::istringstream::in);
-
-//wwwtelapicom::p_call_skel call;
- TestP call;
- wwwtelapicom::p_calldirection_skel calld;
- ::xsd::parser::SimpleElement cn,pcn;
- wwwtelapicom::call_skel s_call;
-
- call.channelname_parser(cn);
- call.peerchannelname_parser(pcn);
- call.direction_parser(calld);
-
- std::cout<<"Parsing Check"<<std::endl;
- xsd::parser::expat::Document doc(call,"call");
- doc.parse(iss1);
- //call.postImpl();
- call.post(s_call);
- std::cout<<"Result after Parsing:"<<std::endl;
- cout<<"Channel name is: "<<s_call.channelname()<<"\texpected : ch1"<<std::endl;
- cout<<"Peer Channel name is: "<<s_call.peerchannelname()<<"\texpected : bon alors"<<std::endl;
- cout<<"Direction is: "<<s_call.direction().content()<<"\texpected : out"<<std::endl;
- s_call.use_namespace(true);
- cout<<"Reserialize is:\n"<<s_call<<endl;
- }
-
-int main(int argv,char **argc)
-{
- wwwtelapicom::sessionid_skel s;
- wwwtelapicom::call_skel call;
- wwwtelapicom::calldirection_skel dir;
- std::string tmp;
- tmp="ch1";
- s=10;
- std::cout<<s<<std::endl;
- std::cout<<"Call display complet"<<std::endl;
- call.channelname(tmp);
- call.peerchannelname(tmp);
- tmp="in";
- dir=tmp;
- call.direction(dir);
- std::cout<<call<<"\nand now?"<<std::endl;
-
- std::cout<<"Call test"<<std::endl;
- test();
-}
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/basic_type"
- xmlns:h="http://www.webobject.dyndns.org/basic_type"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
- <xsd:attribute name='link' type="xsd:byte"/>
-
- <!-- Wrong definition should fail at compilation time-->
- <xsd:simpleType name='SimpleChaine'>
- <xsd:restriction base="xsd:string">
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:element name="name" type="h:SimpleChaine"/>
-
- <xsd:simpleType name='SimpleDecimal'>
- <xsd:restriction base="xsd:decimal">
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:element name="sdec" type="h:SimpleDecimal"/>
-
- <xsd:simpleType name='LimitDecimal'>
- <xsd:restriction base="xsd:integer">
- <xsd:minInclusive value='0'/>
- <xsd:maxInclusive value='100'/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name='bikes'>
- <xsd:restriction base='xsd:string'>
- <xsd:enumeration value='small'/>
- <xsd:enumeration value='medium'/>
- <xsd:enumeration value='large'/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:complexType name='Simple'>
- <xsd:sequence>
- <xsd:element name="greeting" type="xsd:string"/>
- <xsd:element name="nbr" type="xsd:decimal"/>
- <xsd:element name="name" type="h:SimpleChaine" minOccurs="1" maxOccurs="unbounded"/>
- <xsd:choice maxOccurs="1">
- <xsd:element name="_decimal" type="xsd:decimal"/>
- <xsd:element name="_string" type="xsd:string"/>
- <xsd:element name="_int" type="xsd:int"/>
- <xsd:element name="_bool" type="xsd:boolean"/>
- <xsd:element name="_double" type="xsd:double"/>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name='version' type="xsd:string"/>
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:Simple" form="unqualified"/>
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/hello02"
- xmlns:h="http://www.webobject.dyndns.org/hello02"
- xmlns="http://www.webobject.dyndns.org/hello02"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified">
-
- <xsd:attribute name='link' type="xsd:byte"/>
-
- <xsd:simpleType name='XMI.description'>
- <xsd:restriction base="xsd:string">
- </xsd:restriction>
- </xsd:simpleType>
-
-
- <xsd:complexType name="XMIfirmware_ref">
- <xsd:choice minOccurs="1" maxOccurs="1">
- <xsd:element name="PkgURL" type='xsd:string'/>
- </xsd:choice>
- </xsd:complexType>
-
- <xsd:complexType name="XMIfirmware">
- <xsd:sequence minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="pkgName" type="xsd:string">
- </xsd:element>
- <xsd:element name="pkgVersion" type="xsd:positiveInteger"/>
- <xsd:element name="Download" type="h:XMIfirmware_ref"/>
- <xsd:element name="Update" type="xsd:date"/>
- <xsd:element name="DownloadAndUpdate" type="h:XMIfirmware_ref"/>
- <xsd:element name="State" type="xsd:date"/>
- <xsd:element name="Ext" type="xsd:string"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="XMI_service">
- <xsd:sequence minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="host" type="xsd:string">
- </xsd:element>
- <xsd:element name="port" type="xsd:positiveInteger"/>
- <xsd:element name="lastUpdate" type="xsd:date"/>
- </xsd:sequence>
- <xsd:attribute name='version' type='xsd:string'/>
- <xsd:attribute ref="link"/>
- </xsd:complexType>
-
- <xsd:complexType name="XMI_content">
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name='name' type="xsd:string"/>
- <xsd:attribute name='amount' type="xsd:double"/>
- <xsd:attribute form='qualified' name='taille' type="xsd:long"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:complexType name='CType'>
- <xsd:sequence>
- <xsd:element name="greeting" type="xsd:string"/>
- <xsd:element form='qualified' name="nbr" type="xsd:decimal"/>
- <xsd:element name="name" type="h:XMI_content" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name='version' type="xsd:string"/>
- </xsd:complexType>
-
- <xsd:element name="main" type="h:CType"/>
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/basic03"
- xmlns:h="http://www.webobject.dyndns.org/basic03"
- xmlns="http://www.webobject.dyndns.org/basic03"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <xsd:attribute name='link' type="xsd:byte"/>
-
- <xsd:simpleType name='XMI.description'>
- <xsd:restriction base="xsd:string">
- </xsd:restriction>
- </xsd:simpleType>
-
-
- <xsd:element name='XmiFirmware' type='h:XMIfirmwareLocation'/>
- <xsd:complexType name="XMIfirmwareLocation">
- <xsd:choice minOccurs="1" maxOccurs="1">
- <xsd:element name="PkgURL" type='xsd:string'/>
- <xsd:element ref="h:XmiFirmware" maxOccurs='unbounded'/>
- </xsd:choice>
- <xsd:attribute name='version' type="xsd:string"/>
- </xsd:complexType>
-
- <xsd:complexType name="XMIfirmware">
- <xsd:sequence minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="pkgName" type="xsd:string">
- </xsd:element>
- <xsd:element name="pkgVersion" type="xsd:positiveInteger"/>
- <xsd:element name="Download" type="h:XMIfirmware"/>
- <xsd:element name="Update" type="xsd:date"/>
- <xsd:element name="DownloadAndUpdate" type="h:XMIfirmwareLocation"/>
- <xsd:element name="State" type="xsd:date"/>
- <xsd:element name="Ext" type="xsd:string"/>
- </xsd:sequence>
- <xsd:attribute name='version' type='xsd:string'/>
- <xsd:attribute ref="link"/>
- </xsd:complexType>
-
- <xsd:complexType name="XMI_service">
- <xsd:sequence minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="host" type="xsd:string">
- </xsd:element>
- <xsd:element name="port" type="xsd:positiveInteger"/>
- <xsd:element name="lastUpdate" type="xsd:date"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="XMI_content">
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name='name' type="xsd:string"/>
- <xsd:attribute name='amount' type="xsd:double"/>
- <xsd:attribute form='qualified' name='taille' type="xsd:long"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:complexType name='XMI'>
- <xsd:choice maxOccurs="1">
- <xsd:element ref="h:XmiFirmware" maxOccurs="unbounded"/>
- <xsd:element name="nbr" type="xsd:decimal"/>
- <xsd:element name="name" type="h:XMI_content" maxOccurs="unbounded"/>
- </xsd:choice>
- <xsd:attribute name='version' type="xsd:string"/>
- </xsd:complexType>
-
- <xsd:element name="XMI" type="h:XMI"/>
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/all05"
- xmlns:h="http://www.webobject.dyndns.org/all05"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
-
- <!-- Wrong definition should fail at compilation time-->
-
-
- <xsd:complexType name='Simple'>
- <xsd:all>
- <xsd:element name="elem1" type="xsd:string"/>
- <xsd:element name="elem2" type="xsd:NCName"/>
- </xsd:all>
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:Simple" />
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/all06"
- xmlns:h="http://www.webobject.dyndns.org/all06"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
-
- <!-- Wrong definition should fail at compilation time-->
-
- <xsd:element name="elem1" type="xsd:string"/>
- <xsd:element name="elem2" type="xsd:NCName"/>
-
- <xsd:complexType name='Simple'>
- <xsd:all>
- <xsd:element ref="h:elem1"/>
- <xsd:element ref="h:elem2"/>
- </xsd:all>
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:Simple" />
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/all05"
- xmlns:h="http://www.webobject.dyndns.org/all05"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
- <xsd:annotation>
- <xsd:documentation>Base structure with an all element. Used by Simple to test extension of all</xsd:documentation>
- </xsd:annotation>
-
- <!-- Wrong definition should fail at compilation time-->
-
- <xsd:complexType name='Base'>
- <xsd:annotation>
- <xsd:documentation>Base structure with an all element. Used by Simple to test extension of all</xsd:documentation>
- </xsd:annotation>
- <xsd:all>
- <xsd:element name="elem1" type="xsd:string"/>
- <xsd:element name="elem2" type="xsd:NCName"/>
- </xsd:all>
- </xsd:complexType>
-
- <xsd:element name="base" type="h:Base" />
-
- <xsd:complexType name='Simple'>
- <xsd:complexContent>
- <xsd:extension base="@base">
- <xsd:all>
- <xsd:element name="elem3" type="xsd:hexBinary"/>
- </xsd:all>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:Simple" />
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/all06"
- xmlns:h="http://www.webobject.dyndns.org/all06"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
-
- <!-- Wrong definition should fail at compilation time-->
-
- <xsd:group name='GroupAll'>
- <xsd:all>
- <xsd:element name="elem1" type="xsd:string"/>
- <xsd:element name="elem2" type="xsd:NCName"/>
- </xsd:all>
- </xsd:group>
-
- <xsd:complexType name='Simple'>
- <xsd:group ref='h:GroupAll'/>
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:Simple" />
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/group10"
- xmlns:h="http://www.webobject.dyndns.org/group10"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
- <xsd:attribute name='link' type="xsd:byte"/>
-
- <!-- Wrong definition should fail at compilation time-->
- <xsd:element name="elem1" type="xsd:string"/>
- <xsd:element name="elem2" type="xsd:string"/>
-
- <xsd:group name="First">
- <xsd:sequence>
- <xsd:element ref="h:elem1"/>
- <xsd:element ref="h:elem2"/>
- </xsd:sequence>
- </xsd:group>
-
- <xsd:complexType name='Simple'>
- <xsd:group ref="h:First"/>
- <xsd:attribute name='version' type="xsd:string"/>
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:Simple" form="qualified"/>
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/group11"
- xmlns:h="http://www.webobject.dyndns.org/group11"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
- <xsd:attribute name='link' type="xsd:byte"/>
-
- <!-- Wrong definition should fail at compilation time-->
- <xsd:element name="elem1" type="xsd:string"/>
- <xsd:element name="elem2" type="xsd:string"/>
-
- <xsd:group name="First">
- <xsd:choice>
- <xsd:element ref="h:elem1"/>
- <xsd:element ref="h:elem2"/>
- </xsd:choice>
- </xsd:group>
-
- <xsd:complexType name='Simple'>
- <xsd:group ref="h:First"/>
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:Simple" form="qualified"/>
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/group12"
- xmlns:h="http://www.webobject.dyndns.org/group12"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
-
- <!-- Wrong definition should fail at compilation time-->
- <xsd:element name="elem1" type="xsd:string"/>
- <xsd:element name="elem2" type="xsd:string"/>
-
- <xsd:group name="First">
- <xsd:sequence>
- <xsd:element name="name">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element ref="h:elem2"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element ref="h:elem2"/>
- </xsd:sequence>
- </xsd:group>
-
- <xsd:complexType name='Simple'>
- <xsd:group ref="h:First"/>
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:Simple" form="qualified"/>
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/restriction20"
- xmlns:h="http://www.webobject.dyndns.org/restriction20"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
- <xsd:attribute name='link' type="xsd:byte"/>
-
- <!-- Wrong definition should fail at compilation time-->
- <xsd:simpleType name='SimpleChaine'>
- <xsd:restriction base="xsd:string">
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:element name="name" type="h:SimpleChaine"/>
-
- <xsd:simpleType name='SimpleDecimal'>
- <xsd:restriction base="xsd:decimal">
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:element name="sdec" type="h:SimpleDecimal"/>
-
- <xsd:simpleType name='LimitDecimal'>
- <xsd:restriction base="xsd:integer">
- <xsd:minInclusive value='0'/>
- <xsd:maxInclusive value='100'/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name='Bikes'>
- <xsd:restriction base='xsd:string'>
- <xsd:enumeration value='small'/>
- <xsd:enumeration value='medium'/>
- <xsd:enumeration value='large'/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:complexType name='Simple'>
- <xsd:sequence>
- <xsd:element name='bike' type='h:Bikes'/>
- <xsd:element name='limit' type='h:LimitDecimal'/>
- </xsd:sequence>
- <xsd:attribute name='version' type="xsd:string"/>
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:Simple" form="qualified"/>
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/restriction21"
- xmlns:h="http://www.webobject.dyndns.org/restriction21"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
- <xsd:attribute name='link' type="xsd:byte"/>
-
- <!-- Wrong definition should fail at compilation time-->
- <xsd:simpleType name='SimpleChaine'>
- <xsd:restriction base="xsd:string">
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:element name="name" type="h:SimpleChaine"/>
-
- <xsd:simpleType name='SimpleDecimal'>
- <xsd:restriction base="xsd:decimal">
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:element name="sdec" type="h:SimpleDecimal"/>
-
- <xsd:simpleType name='LimitDecimal'>
- <xsd:restriction base="xsd:integer">
- <xsd:minInclusive value='0'/>
- <xsd:maxInclusive value='100'/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name='Bikes'>
- <xsd:restriction base='xsd:string'>
- <xsd:enumeration value='small'/>
- <xsd:enumeration value='medium'/>
- <xsd:enumeration value='large'/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:complexType name='Simple'>
- <xsd:simpleContent>
- <xsd:restriction base="h:Bikes">
- <xsd:enumeration value='small'/>
- <xsd:enumeration value='medium'/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:Simple"/>
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/restriction22"
- xmlns:h="http://www.webobject.dyndns.org/restriction22"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
- <xsd:attribute name='link' type="xsd:byte"/>
-
- <!-- Wrong definition should fail at compilation time-->
-
- <xsd:complexType name='Address'>
- <xsd:sequence base='xsd:string'>
- <xsd:element name="street" type='xsd:string'/>
- <xsd:element name="zipcode" type='xsd:integer'/>
- <xsd:element name="country" type='xsd:string'/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name='USAddress'>
- <xsd:complexContent>
- <xsd:restriction base="h:Address">
- <xsd:sequence base='xsd:string'>
- <xsd:element name="street" type='xsd:string'/>
- <xsd:element name="zipcode" type='xsd:integer'/>
- <xsd:element name="country" type='xsd:string' fixed="USA"/>
- </xsd:sequence>
- </xsd:restriction>
- </xsd:complexContent>
- <xsd:attribute ref='h:link'/>
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:USAddress" form="qualified"/>
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/extension30"
- xmlns:h="http://www.webobject.dyndns.org/extension30"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
- <xsd:attribute name='link' type="xsd:byte"/>
-
- <!-- Wrong definition should fail at compilation time-->
- <xsd:simpleType name='SimpleChaine'>
- <xsd:restriction base="xsd:string">
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:element name="name" type="h:SimpleChaine"/>
-
- <xsd:complexType name='Date'>
- <xsd:simpleContent>
- <xsd:extension base="xsd:date">
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
- <xsd:element name="sdec" type="h:Date"/>
-
- <xsd:complexType name='Day'>
- <xsd:simpleContent>
- <xsd:extension base="xsd:gDay">
- <xsd:attribute ref="h:link"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:complexType name='Bool'>
- <xsd:simpleContent>
- <xsd:extension base='xsd:boolean'>
- <xsd:attribute ref="h:link"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:complexType name='Simple'>
- <xsd:sequence>
- <xsd:element name="date" type="h:Date"/>
- <xsd:element name="boolean" type="h:Bool"/>
- <xsd:element name="name" type="h:SimpleChaine" minOccurs="1" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name='version' type="xsd:string"/>
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:Simple"/>
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/extension31"
- xmlns:h="http://www.webobject.dyndns.org/extension31"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
-
- <xsd:simpleType name="ChecksumType">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="md5" />
- <xsd:enumeration value="sha1" />
- <xsd:enumeration value="sha256" />
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:complexType name='Simple'>
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name='type' type='h:ChecksumType'/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:Simple"/>
-
-
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/list40"
- xmlns:h="http://www.webobject.dyndns.org/list40"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
- <xsd:attribute name='link' type="xsd:byte"/>
-
- <!-- Wrong definition should fail at compilation time-->
- <xsd:simpleType name='SimpleChaine'>
- <xsd:restriction base="xsd:string">
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:element name="name" type="h:SimpleChaine"/>
-
- <xsd:simpleType name='SimpleDecimal'>
- <xsd:restriction base="xsd:decimal">
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:element name="sdec" type="h:SimpleDecimal"/>
-
- <xsd:simpleType name='Bikes'>
- <xsd:list itemType='xsd:string'>
- </xsd:list>
- </xsd:simpleType>
-
- <xsd:complexType name='Simple'>
- <xsd:sequence>
- <xsd:element name="bikes" type="h:Bikes"/>
- </xsd:sequence>
- <xsd:attribute name='version' type="xsd:string"/>
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:Simple" />
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/list41"
- xmlns:h="http://www.webobject.dyndns.org/list41"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
- <!-- Wrong definition should fail at compilation time-->
- <xsd:simpleType name='SimpleChaine'>
- <xsd:restriction base="xsd:string">
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:element name="name" type="h:SimpleChaine"/>
-
- <xsd:simpleType name='Bikes'>
- <xsd:list itemType='h:SimpleChaine'>
- </xsd:list>
- </xsd:simpleType>
-
- <xsd:complexType name='Simple'>
- <xsd:sequence>
- <xsd:element name="bikes" type="h:Bikes"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:Simple" />
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/tcunion50"
- xmlns:h="http://www.webobject.dyndns.org/tcunion50"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
- <xsd:attribute name='link' type="xsd:byte"/>
-
- <!-- Wrong definition should fail at compilation time-->
- <xsd:simpleType name='fontNumber'>
- <xsd:restriction base="xsd:positiveInteger">
- <xsd:maxInclusive value="72"/>
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:element name="name" type="h:fontNumber"/>
-
- <xsd:simpleType name='fontSize'>
- <xsd:restriction base="xsd:integer">
- <xsd:minInclusive value='0'/>
- <xsd:maxInclusive value='100'/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name='UnionMemberType'>
- <!--
- <xsd:union memberTypes="h:fontNumber xsd:string">
- -->
- <xsd:union memberTypes="h:fontNumber xsd:string">
- </xsd:union>
- </xsd:simpleType>
- <xsd:element name="sumt" type="h:UnionMemberType"/>
-
- <xsd:simpleType name='UnionMixed'>
- <xsd:union memberTypes="positiveInteger">
- <xsd:simpleType>
- <xsd:restriction base="xsd:integer">
- <xsd:minInclusive value='0'/>
- <xsd:maxInclusive value='100'/>
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:union>
- </xsd:simpleType>
-
- <xsd:simpleType name='bikes'>
- <xsd:restriction base='xsd:string'>
- <xsd:enumeration value='small'/>
- <xsd:enumeration value='medium'/>
- <xsd:enumeration value='large'/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="UnionSimpleTypes">
- <xsd:union>
- <xsd:simpleType>
- <xsd:restriction base='xsd:positiveInteger'>
- <xsd:enumeration value='1'/>
- <xsd:enumeration value='2'/>
- <xsd:enumeration value='3'/>
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType>
- <xsd:restriction base='xsd:positiveInteger'>
- <xsd:enumeration value='10'/>
- <xsd:enumeration value='20'/>
- <xsd:enumeration value='30'/>
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:union>
- </xsd:simpleType>
-
- <xsd:complexType name='Simple'>
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
- <xsd:choice maxOccurs="1">
- <xsd:element name="union_members" type="h:UnionMemberType"/>
- <xsd:element name="union_mixed" type="h:UnionMixed"/>
- <xsd:element name="union_stype" type="h:UnionSimpleTypes"/>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name='version' type="xsd:string"/>
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:Simple" form="qualified"/>
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/abstract"
- xmlns:h="http://www.webobject.dyndns.org/abstract"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
- <xsd:attribute name='link' type="xsd:byte"/>
-
- <!-- Wrong definition should fail at compilation time-->
-
-
- <xsd:simpleType name='bikes'>
- <xsd:restriction base='xsd:string'>
- <xsd:enumeration value='small'/>
- <xsd:enumeration value='medium'/>
- <xsd:enumeration value='large'/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:element name="instruction" abstract="true" form="qualified"/>
-
- <xsd:complexType name='actions'>
- <xsd:sequence>
- <xsd:element ref="h:instruction" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name='version' type="xsd:string"/>
- </xsd:complexType>
-
- <xsd:element name='choose' type='xsd:string' equivClass="instruction"/>
- <xsd:element name='when' type='xsd:int' equivClass="instruction"/>
- <xsd:element name='otherwise' type='h:bikes' equivClass="instruction"/>
- <xsd:element name='text' type='xsd:double' equivClass="instruction"/>
- <!--
- <xsd:element name='value-of' type='xsd:string' equivClass="instruction"/>
- -->
-
-
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/sequence70"
- xmlns:h="http://www.webobject.dyndns.org/sequence70"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
- <xsd:attribute name='link' type="xsd:byte"/>
-
- <!-- Wrong definition should fail at compilation time-->
- <xsd:element name="elem1" type="xsd:string"/>
- <xsd:element name="elem2" type="xsd:string"/>
-
- <xsd:group name="First">
- <xsd:sequence>
- <xsd:element ref="h:elem1"/>
- <xsd:element ref="h:elem2"/>
- </xsd:sequence>
- </xsd:group>
-
- <xsd:complexType name='Simple'>
- <xsd:group ref="h:First"/>
- <xsd:attribute name='version' type="xsd:string"/>
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:Simple" form="qualified"/>
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/sequence70"
- xmlns:h="http://www.webobject.dyndns.org/sequence70"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
- <!-- Wrong definition should fail at compilation time-->
-
- <xsd:complexType name='Simple'>
- <xsd:sequence>
- <xsd:sequence minOccurs="0">
- <xsd:element name="a" type="xsd:string"/>
- <xsd:element name="b" type="xsd:string"/>
- </xsd:sequence>
- <xsd:element name="x" type="xsd:string" minOccurs="0"/>
- <xsd:element name="y" type="xsd:string"/>
- <xsd:element name="z" type="xsd:string" minOccurs="0"/>
- <xsd:sequence minOccurs="0">
- <xsd:element name="d" type="xsd:string"/>
- </xsd:sequence>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:Simple" form="qualified"/>
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/choice80"
- xmlns:h="http://www.webobject.dyndns.org/choice80"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
- <!-- Wrong definition should fail at compilation time-->
- <xsd:element name="elem1" type="xsd:string"/>
-
- <xsd:complexType name='Simple'>
- <xsd:choice>
- <xsd:element ref="h:elem1"/>
- <xsd:element name="logic" type="xsd:boolean"/>
- <xsd:element name="prive">
- <xsd:simpleType>
- <xsd:restriction base="xsd:date">
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:Simple"/>
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/choice81"
- xmlns:h="http://www.webobject.dyndns.org/choice81"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
- <!-- Wrong definition should fail at compilation time-->
- <xsd:element name="elem1" type="xsd:string"/>
-
- <xsd:complexType name='Simple'>
- <xsd:choice>
- <xsd:sequence>
- <xsd:element name="id" type="xsd:base64Binary"/>
- <xsd:element name="key" type="xsd:base64Binary"/>
- </xsd:sequence>
- <xsd:sequence>
- <xsd:element name="key1" type="xsd:base64Binary"/>
- </xsd:sequence>
- </xsd:choice>
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:Simple"/>
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/attribute90"
- xmlns:h="http://www.webobject.dyndns.org/attribute90"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
- <xsd:attribute name='link' type="xsd:byte"/>
-
-
- <!-- Wrong definition should fail at compilation time-->
-
- <xsd:complexType name='Simple'>
- <xsd:attribute name='versiono' type="xsd:string"/>
- <xsd:attribute name='versionf' type="xsd:string" fixed="1.0"/>
- <xsd:attribute name='versiond' type="xsd:string" default="1.5"/>
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:Simple" />
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/attribute91"
- xmlns:h="http://www.webobject.dyndns.org/attribute91"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
-
-
- <!-- Wrong definition should fail at compilation time-->
-
- <xsd:complexType name="A">
- <xsd:attribute name="x" type="xsd:NCName"/>
- <xsd:attribute name="y" type="xsd:QName"/>
- </xsd:complexType>
- <xsd:element name="a" type="h:A" />
-
- <xsd:complexType name='Simple'>
- <xsd:complexContent>
- <xsd:restriction base='h:A'>
- <xsd:attribute name="x" type="xsd:NCName" use="prohibited"/>
- <xsd:attribute name="y" type="xsd:QName" use="required"/>
- </xsd:restriction>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:Simple" />
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/attribute92"
- xmlns:h="http://www.webobject.dyndns.org/attribute92"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
- <xsd:attribute name='link' use='optional'>
- <xsd:simpleType>
- <xsd:restriction base="xsd:byte">
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:attribute>
-
-
- <!-- Wrong definition should fail at compilation time-->
-
- <xsd:complexType name='Simple'>
- <xsd:attribute name='versiono' type="xsd:string" use="optional"/>
- <xsd:attribute ref="h:link" use="optional"/>
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:Simple" />
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/attribute92"
- xmlns:h="http://www.webobject.dyndns.org/attribute92"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
- <xsd:attribute name='link' use='optional'>
- <xsd:simpleType>
- <xsd:restriction base="xsd:byte">
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:attribute>
-
-
- <!-- Wrong definition should fail at compilation time-->
-
- <xsd:complexType name='Simple'>
- <xsd:attribute name='versiono' type="xsd:string" use="optional"/>
- <xsd:attribute ref="h:link" use="optional"/>
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:Simple" />
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/attributeGroup95"
- xmlns:h="http://www.webobject.dyndns.org/attributeGroup95"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
- <xsd:attribute name='link' use='optional'>
- <xsd:simpleType>
- <xsd:restriction base="xsd:byte">
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:attribute>
-
-
-
- <xsd:attributeGroup name="stdAttrs">
- <xsd:annotation>
- <xsd:documentation>All elements have an ID</xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="id" type="xsd:ID" use="optional"/>
- <xsd:attribute ref="h:link" use="optional"/>
- </xsd:attributeGroup>
- <!-- Wrong definition should fail at compilation time-->
-
- <xsd:complexType name='Simple'>
- <xsd:attributeGroup ref="h:stdAttrs" />
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:Simple" />
-</xsd:schema>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/attributeGroup96"
- xmlns:h="http://www.webobject.dyndns.org/attributeGroup96"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
- <xsd:attribute name='link' use='optional'>
- <xsd:simpleType>
- <xsd:restriction base="xsd:byte">
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:attribute>
-
-
-
- <xsd:attributeGroup name="stdAttrs">
- <xsd:annotation>
- <xsd:documentation>All elements have an ID</xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="id" type="xsd:ID" use="optional"/>
- <xsd:attribute ref="h:link" use="optional"/>
- <xsd:attribute name="ano">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="visible"/>
- <xsd:enumeration value="alive"/>
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:attribute>
- </xsd:attributeGroup>
- <!-- Wrong definition should fail at compilation time-->
-
- <xsd:complexType name='Simple'>
- <xsd:attributeGroup ref="h:stdAttrs" />
- </xsd:complexType>
-
- <xsd:element name="simple" type="h:Simple" />
-</xsd:schema>
+++ /dev/null
-PROJECT(tbasic)
-
-ENABLE_TESTING()
-
-INCLUDE(${rules_SOURCE_DIR}/saxon.cmake)
-
-FIND_LIBRARY(EXPAT_LIB expat "/usr/local/lib:/usr/lib")
-FIND_LIBRARY(CPPUNIT_LIB cppunit PATHS /usr/local/lib /usr/lib /Users/aeb/External/lib/ /Users/aeb/External/bin/)
-FIND_LIBRARY(DL_LIB ltdl "/lib:/usr/local/lib:/usr/lib")
-
-FIND_PACKAGE(CPPUNIT REQUIRED)
-INCLUDE_DIRECTORIES(${CPPUNIT_INCLUDE_DIRS})
-
-INCLUDE_DIRECTORIES("${xml-t_SOURCE_DIR}/libxsd/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/include")
-INCLUDE_DIRECTORIES(".")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}")
-INCLUDE_DIRECTORIES("/usr/local/include")
-
-SET(SAXON CACHE STRING "~/Tools/saxon/saxon9.jar")
-#SET(XSD2CPP "${CMAKE_CURRENT_SOURCE_DIR}/../../xsd2cpp.xsl")
-SET(XMI "${tbasic_SOURCE_DIR}/basic.xsd")
-SET(BASIC01 "${tbasic_SOURCE_DIR}/01basic.xsd")
-SET(BASIC02 "${tbasic_SOURCE_DIR}/02basic.xsd")
-SET(BASIC03 "${tbasic_SOURCE_DIR}/03basic.xsd")
-
-MACRO(TESTCASE)
- PARSE_ARGUMENTS(THIS_TC
- "SOURCE;XSD;ROOT-ELEMENT;XSDDIRS;NAMESPACE;DEPENDS;OUTPUT;TEST"
- "DEBUG"
- ${ARGN}
- )
-
- IF (NOT "${THIS_TC_XSD}" STREQUAL "")
- XSD2CPP(
- SOURCE ${tbasic_SOURCE_DIR}/${THIS_TC_XSD}.xsd
- OUTPUT ${THIS_TC_XSD}
- ROOT-ELEMENT simple
- XSDDIRS "./../\;../../data-models/\;"
- )
- ENDIF (NOT "${THIS_TC_XSD}" STREQUAL "")
- IF (NOT "${THIS_TC_TEST}" STREQUAL "")
- ADD_TEST(${THIS_TC_TEST} ${THIS_TC_OUTPUT})
- ENDIF (NOT "${THIS_TC_TEST}" STREQUAL "")
- ADD_EXECUTABLE(${THIS_TC_OUTPUT}
- ${THIS_TC_SOURCE}
- ${CMAKE_CURRENT_BINARY_DIR}/parser/${THIS_TC_XSD}.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_${THIS_TC_XSD}.cpp
- # TestCaseSimpleType.cpp
- main_test.cpp
- )
- TARGET_LINK_LIBRARIES(${THIS_TC_OUTPUT}
- libxsd
- ${EXPAT_LIB}
- ${CPPUNIT_LIB}
- )
- # DEbug versiob
- ADD_EXECUTABLE(${THIS_TC_OUTPUT}d
- ${THIS_TC_SOURCE}
- ${CMAKE_CURRENT_BINARY_DIR}/parser/${THIS_TC_XSD}.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_${THIS_TC_XSD}.cpp
- main_test.cpp
- )
- SET_TARGET_PROPERTIES(${THIS_TC_OUTPUT}d
- PROPERTIES
- CLEAN_DIRECT_OUTPUT 1
- COMPILE_FLAGS "-DDEBUG -DPARSER_DEBUG=1"
- )
- TARGET_LINK_LIBRARIES(${THIS_TC_OUTPUT}d xsdd
- ${CPPUNIT_LIB}
- ${EXPAT_LIB})
-
- IF(${DL_LIB})
- TARGET_LINK_LIBRARIES(${THIS_TC_OUTPUT} ${DL_LIB})
- TARGET_LINK_LIBRARIES(${THIS_TC_OUTPUT}d ${DL_LIB})
- ENDIF(${DL_LIB})
-
-ENDMACRO(TESTCASE)
-
-XSD2CPP(
- SOURCE ${XMI}
- OUTPUT basic
- XSDDIRS "./../\;../../data-models/\;"
- )
-
-XSD2CPP(
- SOURCE ${BASIC02}
- OUTPUT 02basic
- ROOT-ELEMENT main
- XSDDIRS "./../\;../../data-models/\;"
- )
-
-XSD2CPP(
- SOURCE ${BASIC03}
- OUTPUT 03basic
- ROOT-ELEMENT simple
- XSDDIRS "./../\;../../data-models/\;"
- )
-#XSD2CPP(
-# SOURCE ${tbasic_SOURCE_DIR}/50union.xsd
-# OUTPUT 50union
-# ROOT-ELEMENT simple
-# XSDDIRS "./../\;../../data-models/\;"
-# )
-
-#XSD2CPP(
-# SOURCE ${tbasic_SOURCE_DIR}/60abstract.xsd
-# OUTPUT 60abstract
-# ROOT-ELEMENT actions
-# XSDDIRS "./../\;../../data-models/\;"
-# )
-
-
-#
-#
-#
-ADD_EXECUTABLE(tbasic
- ${CMAKE_CURRENT_BINARY_DIR}/parser/basic.cpp
- main.cpp )
-IF(COMMAND cmake_policy)
- cmake_policy(SET CMP0003 NEW)
-ENDIF(COMMAND cmake_policy)
-
-ADD_EXECUTABLE(tparser_basic
- ${CMAKE_CURRENT_BINARY_DIR}/parser/basic.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_basic.cpp
- main_parser.cpp
- )
-TARGET_LINK_LIBRARIES(tparser_basic libxsd ${EXPAT_LIB})
-#
-# Test Stuff
-#
-IF(NOT ${CPPUNIT_LIB})
-
- TESTCASE(
- XSD 20restriction
- OUTPUT restriction20
- SOURCE
- TestCaseSimpleTypeRestriction.cpp
- TEST TestSimpleTypeRestriction
- )
-
- TESTCASE(
- XSD 21restriction
- OUTPUT restriction21
- SOURCE
- TestCaseSimpleContentRestriction.cpp
- TEST TestSimpleContentRestriction
- )
-
- TESTCASE(
- XSD 22restriction
- OUTPUT restriction22
- SOURCE
- TEST 22ComplexContentRestriction
- )
-
- TESTCASE(
- XSD 30extension
- OUTPUT extension30
- SOURCE
- TEST 30SimpleContentExtension
- )
- TESTCASE(
- XSD 31extension
- OUTPUT extension31
- SOURCE
- TestCaseSimpleContentExtensionAttribute.cpp
- TEST 31SimpleContentExtensionAttribute
- )
-
- # TESTCASE(
- # XSD 60abstract
- # OUTPUT abstract
- # SOURCE
- # TEST TestAbstract
- # )
- TESTCASE(
- XSD 40list
- OUTPUT list40
- SOURCE
- TestCaseList.cpp
- TEST TestList
- )
-
- TESTCASE(
- XSD 41list
- OUTPUT list41
- SOURCE
- TEST ListSimpleType
- )
-
- TESTCASE(
- XSD 50union
- OUTPUT union50
- SOURCE
- TestCase50union.cpp
- TEST TestCaseUnions
- )
- TESTCASE(
- XSD 10group
- OUTPUT group10
- SOURCE
- TestCaseGroup.cpp
- TEST GroupSequence
- )
- TESTCASE(
- XSD 11group
- OUTPUT group11
- SOURCE
- TEST GroupChoice
- )
- TESTCASE(
- XSD 12group
- OUTPUT group12
- SOURCE
- TEST GroupAnoElement
- )
-
- TESTCASE(
- XSD 01basic
- OUTPUT TestCaseSimpleType
- SOURCE
- TestCaseSimpleType.cpp
- TEST TestSimpleType
- )
-
- TESTCASE(
- XSD 03basic
- OUTPUT tcrecursion
- SOURCE
- TestCaseRecurse.cpp
- TEST TestRecursion
- )
-
- TESTCASE(
- XSD 70sequence
- OUTPUT sequence70
- SOURCE
- TestCaseComplexTypeSequence.cpp
- TEST TestComplexTypeSequence
- )
- TESTCASE(
- XSD 80choice
- OUTPUT choice80
- SOURCE
- TestCaseComplexTypeChoice.cpp
- TEST TestComplexTypeChoice
- )
-
- TESTCASE(
- XSD 81choice
- OUTPUT choice81
- SOURCE
- TestCaseCplxTpChoiceSequence.cpp
- TEST TestCplxTpChoiceSequence
- )
-
- TESTCASE(
- XSD 90attribute
- OUTPUT attribute90
- SOURCE
- TestCaseAttribute.cpp
- TEST TestComplexTypeAttribute
- )
-
-TESTCASE(
- XSD 91attribute
- OUTPUT attribute91
- SOURCE
- TestCaseAttributeRestricted.cpp
- TEST 91ComplexTypeAttributeRestricted
- )
-
- TESTCASE(
- XSD 92attribute
- OUTPUT attribute92
- SOURCE
- TestCaseAttributeOptional.cpp
- TEST 92ComplexTypeAttributeOptional
- )
-
- TESTCASE(
- XSD 95attributeGroup
- OUTPUT attributeGroup95
- SOURCE
- TestCaseAttributeGroup.cpp
- TEST 95AttributeGroup
- )
-
- TESTCASE(
- XSD 96attributeGroup
- OUTPUT attributeGroup96
- SOURCE
- TestCaseAnoAttributeGroup.cpp
- TEST 96AttributeGroup
- )
-
- TESTCASE(
- XSD 05all
- OUTPUT all05
- SOURCE
- TestCaseAllBase.cpp
- TEST 05AllBase
- )
-
- TESTCASE(
- XSD 06all
- OUTPUT all06
- SOURCE
- TestCaseAllRef.cpp
- TEST 06AllRef
- )
-
- ADD_EXECUTABLE(sr_basic01
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_01basic.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/01basic.cpp
- TestCaseSimpleSerialize.cpp
- main_test.cpp
- )
- TARGET_LINK_LIBRARIES(sr_basic01
- libxsd
- ${EXPAT_LIB}
- ${CPPUNIT_LIB}
- )
- ADD_EXECUTABLE(sr_basic02
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_02basic.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/02basic.cpp
- main_test.cpp
- )
-
- MESSAGE("Found Library ${DL_LIB}")
- IF(NOT ${DL_LIB})
- TARGET_LINK_LIBRARIES(sr_basic01 ${DL_LIB})
- TARGET_LINK_LIBRARIES(sr_basic02 ${DL_LIB})
- ENDIF(NOT ${DL_LIB})
-
-
- TARGET_LINK_LIBRARIES(sr_basic02
- libxsd
- ${EXPAT_LIB}
- ${CPPUNIT_LIB}
- )
- ADD_TEST(SimpleTypeSerialize sr_basic01 Hello)
- ADD_TEST(SimpleTypeNativeTypes sr_basic02 Hello)
- ADD_TEST(SimpleTypeRef tparser_basic Hello)
- ADD_TEST(SimpleTypeEnumaration tparser_basic Hello)
- ADD_TEST(SimpleTypeExtesion tparser_basic Hello)
- ADD_TEST(ComplexType tparser_basic Hello)
- ADD_TEST(ComplexTypeNamespace tparser_basic Hello)
- # ADD_TEST(ComplexRecursion tc_03basic Hello)
-ELSE(NOT ${CPPUNIT_LIB})
- MESSAGE("I do not have cppunit library ${CPPUNIT_LIB} ")
-ENDIF(NOT ${CPPUNIT_LIB})
-
-
-#
-# Install stuff
-#
-INSTALL(TARGETS tbasic tparser_basic
- ARCHIVE
- RUNTIME DESTINATION examples/basic
- COMPONENT Examples)
-
-INSTALL(FILES
- ${tbasic_SOURCE_DIR}/basic.xsd
- DESTINATION examples/basic
- COMPONENT Examples
- )
-INSTALL(FILES
- ${tbasic_SOURCE_DIR}/main.cpp
- DESTINATION examples/basic
- COMPONENT Examples
- )
-INSTALL(FILES
- ${tbasic_BINARY_DIR}/parser/basic.cpp
- ${tbasic_BINARY_DIR}/parser/p_basic.cpp
- DESTINATION examples/basic/parser
- COMPONENT Examples
- )
-INSTALL(FILES
- ${tbasic_BINARY_DIR}/include/basic.h
- ${tbasic_BINARY_DIR}/include/p_basic.h
- DESTINATION examples/basic/include
- COMPONENT Examples
- )
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-#include <%CLASS%.h>
-#include <fstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( %CLASS%);
-
-class TestResult : public Simple_skel
-{
- public:
-};
-
-void %CLASS%::setUp()
-{
- //m_root.bike_parser(m_name);
- m_xmlsourcepath= "./xmlsources/";
-}
-
-/**
- *
- */
-void %CLASS%::parse_bike()
-{
- TestResult s;
- char r[128];
- signed char c=(signed char)60;
- std::string test="<simple>small</simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
- std::cout<<" "<<s.content().content()<<" ";
- CPPUNIT_ASSERT(s.content().content()=="small");
-}
-
-/**
- *
- */
-void %CLASS%::serialize_bike()
-{
- Bikes_skel bike("small");
- Simple_skel s;
- s = bike;
- std::string test="<simple>small</simple>";
-
- std::cout<<" ("<<bike<<") ";
- CPPUNIT_ASSERT(bike.content()=="small");
-}
-
-/**
- *
- */
+++ /dev/null
-#ifndef TESTCASE_SIMPLETYPE_H
-#define TESTCASE_SIMPLETYPE_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-#include <include/%SRC%.h>
-#include <include/p_%SRC%.h>
-
-using namespace %NAMESPACE%;
-
-class %CLASS% : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( %CLASS% );
- CPPUNIT_TEST(parse_bike);
-
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void setUp();
- protected:
- p_Simple_skel m_root;
- std::string m_xmlsourcepath;
- protected:
- void parse_bike();
-};
-#endif
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-#include <TestCase50union.h>
-#include <fstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestCase50union);
-
-class TestResult : public Simple_skel
-{
- public:
- std::string version() {std::string s= me_attr_version.content();return s;};
-};
-
-void TestCase50union::setUp()
-{
- m_root.union_stype_parser(m_ust);
- m_root.union_mixed_parser(m_umixed);
- m_root.union_members_parser(m_umember);
- // m_root.version_parser(m_version);
- m_root.name_parser(m_name);
- m_xmlsourcepath= "./xmlsources/";
-}
-
-/**
- *
- */
-void TestCase50union::test_stype()
-{
- TestResult s;
- char r[128];
- std::string test="<h:Simple xmlns:h=\"http://www.webobject.dyndns.org/tcunion50\" version=\"1.0\"><name>andre</name><union_stype>10</union_stype></h:Simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- //CPPUNIT_ASSERT(s.version()=="1.0");
- std::cout<<" s.union_stype="<<s.union_stype()<<" ";
- CPPUNIT_ASSERT(s.union_stype().content().m_positiveInteger == 10);
-#if 0
- CPPUNIT_ASSERT(s.greeting()=="Marc");
- CPPUNIT_ASSERT(s.nbr()==12);
- CPPUNIT_ASSERT( ( s.name())[0]!= NULL);
- sprintf(r,"Why is name=%s\n",s.name()[0]->content().c_str());
- CPPUNIT_ASSERT_MESSAGE( r , s.name()[0]->content() == "andre");
-#endif
-}
-
-void TestCase50union::test_mixed()
-{
- TestResult s;
- std::string test="<h:Simple xmlns:h=\"http://www.webobject.dyndns.org/tcunion50\" version=\"2.0\"><name>andre</name><union_mixed>10</union_mixed></h:Simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- //CPPUNIT_ASSERT(s.version()=="1.0");
- std::cout<<" v="<<s.version()<<" ";
- switch (s.union_mixed().m_union_kind)
- {
- case UnionMixed_skel::CHOICE_positiveInteger:
- CPPUNIT_ASSERT(s.union_mixed().content().m_positiveInteger == 10);
- std::cout<<" s.union_mixed pi ="<<s.union_mixed()<<" ";
- break;
- case UnionMixed_skel::CHOICE_integer:
- std::cout<<" s.union_mixed i ="<<s.union_mixed()<<" ";
- CPPUNIT_ASSERT(s.union_mixed().content().m_integer == 10);
- break;
- default:
- CPPUNIT_ASSERT(0 == 10);
- break;
- }
-
-}
-
-void TestCase50union::test_member()
-{
- TestResult s;
- char r[128];
- std::string test="<h:Simple xmlns:h=\"http://www.webobject.dyndns.org/tcunion50\" version=\"3.0\"><name>andre</name><union_members>11</union_members></h:Simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- std::cout<<" v="<<s.version()<<" ";
- switch(s.union_members().m_union_kind)
- {
- case UnionMemberType_skel::CHOICE_fontNumber:
- std::cout<<" s.union_members fontNumber ="<<s.union_members()<<" ";
- CPPUNIT_ASSERT(s.union_members().content().m_fontNumber.content() == 11);
- break;
- case UnionMemberType_skel::CHOICE_string:
- std::cout<<" s.union_members string ="<<s.union_members()<<" ";
- CPPUNIT_ASSERT(s.union_members().content().m_string == "10");
- break;
- default:
- CPPUNIT_ASSERT(0 == 10);
- break;
-
- }
-}
-#if 0
-/**
- *
- */
-void TestCase50union::parse_02()
-{
- TestResult s;
- std::string test="<Simple version=\"1.0\"><name version=\"first test\" link=\"1.2\">andre</name><greeting>Marc</greeting><nbr>12</nbr></Simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s.version()=="1.0");
- CPPUNIT_ASSERT(s.nbr()==12);
-}
-
-/**
- *
- */
-void TestCase50union::parse_03()
-{
- TestResult s;
- std::string test="<Simple version=\"1.0\"><name version=\"first test\" link=\"A\">andre</name><greeting>Marc</greeting><nbr>12</nbr></Simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s.version()=="1.2");
-}
-
-/**
- *
- */
-void TestCaseSimpleType::parse_file_01int()
-{
- basic_type::Simple_skel s;
- std::ifstream iss1;
- std::string filename = m_xmlsourcepath + "01basic_01int.xml";
- iss1.open(filename.c_str(),std::ifstream::in);
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s._int()==454);
-}
-#endif
+++ /dev/null
-#ifndef TESTCASE_50UNION_H
-#define TESTCASE_50UNION_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-#include <include/50union.h>
-#include <include/p_50union.h>
-
-using namespace tcunion50;
-
-class TestCase50union : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestCase50union );
- CPPUNIT_TEST(test_stype);
- CPPUNIT_TEST(test_mixed);
- CPPUNIT_TEST(test_member);
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void setUp();
- protected:
- xsd::parser::SimpleElement m_name,m_version;
- p_UnionSimpleTypes_skel m_ust;
- p_UnionMixed_skel m_umixed;
- p_UnionMemberType_skel m_umember;
- p_Simple_skel m_root;
- std::string m_xmlsourcepath;
- protected:
- void test_stype();
- void test_mixed();
- void test_member();
-};
-#endif
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-#include <TestCaseAllBase.h>
-#include <fstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestCaseAllBase);
-
-class TestResult : public Simple_skel
-{
- public:
-};
-
-void TestCaseAllBase::setUp()
-{
- m_root.elem1_parser(m_elem1);
- m_root.elem2_parser(m_elem2);
- m_xmlsourcepath= "./xmlsources/";
-}
-
-/**
- *
- */
-void TestCaseAllBase::parse_bike()
-{
- TestResult s;
- char r[128];
- signed char c=(signed char)60;
- std::string test="<simple><elem1>e1</elem1><elem2>e2</elem2></simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
- std::cout<<" "<<s.elem1()<<" ";
- CPPUNIT_ASSERT(s.elem1()=="e1");
-}
-
-/**
- *
- */
-
-/**
- *
- */
+++ /dev/null
-#ifndef TESTCASE_SIMPLETYPE_H
-#define TESTCASE_SIMPLETYPE_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-#include <include/05all.h>
-#include <include/p_05all.h>
-
-using namespace all05;
-
-class TestCaseAllBase : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestCaseAllBase );
- CPPUNIT_TEST(parse_bike);
-
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void setUp();
- protected:
- ::xsd::parser::SimpleElement m_elem1,m_elem2;
- p_Simple_skel m_root;
- std::string m_xmlsourcepath;
- protected:
- void parse_bike();
-};
-#endif
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-#include <TestCaseAllExtension.h>
-#include <fstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestCaseAllExtension);
-
-class TestResult : public Simple_skel
-{
- public:
-};
-
-void TestCaseAllExtension::setUp()
-{
- //m_root.bike_parser(m_name);
- m_xmlsourcepath= "./xmlsources/";
-}
-
-/**
- *
- */
-void TestCaseAllExtension::parse_bike()
-{
- TestResult s;
- char r[128];
- signed char c=(signed char)60;
- std::string test="<simple>small</simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
- std::cout<<" "<<s.content().content()<<" ";
- CPPUNIT_ASSERT(s.content().content()=="small");
-}
-
-/**
- *
- */
-void TestCaseAllExtension::serialize_bike()
-{
- Bikes_skel bike("small");
- Simple_skel s;
- s = bike;
- std::string test="<simple>small</simple>";
-
- std::cout<<" ("<<bike<<") ";
- CPPUNIT_ASSERT(bike.content()=="small");
-}
-
-/**
- *
- */
+++ /dev/null
-#ifndef TESTCASE_SIMPLETYPE_H
-#define TESTCASE_SIMPLETYPE_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-#include <include/07all.h>
-#include <include/p_07all.h>
-
-using namespace all07;
-
-class TestCaseAllExtension : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestCaseAllExtension );
- CPPUNIT_TEST(parse_bike);
-
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void setUp();
- protected:
- p_Simple_skel m_root;
- std::string m_xmlsourcepath;
- protected:
- void parse_bike();
-};
-#endif
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-#include <TestCaseAllGroup.h>
-#include <fstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestCaseAllGroup);
-
-class TestResult : public Simple_skel
-{
- public:
-};
-
-void TestCaseAllGroup::setUp()
-{
- //m_root.bike_parser(m_name);
- m_xmlsourcepath= "./xmlsources/";
-}
-
-/**
- *
- */
-void TestCaseAllGroup::parse_bike()
-{
- TestResult s;
- char r[128];
- signed char c=(signed char)60;
- std::string test="<simple>small</simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
- std::cout<<" "<<s.content().content()<<" ";
- CPPUNIT_ASSERT(s.content().content()=="small");
-}
-
-/**
- *
- */
-void TestCaseAllGroup::serialize_bike()
-{
- Bikes_skel bike("small");
- Simple_skel s;
- s = bike;
- std::string test="<simple>small</simple>";
-
- std::cout<<" ("<<bike<<") ";
- CPPUNIT_ASSERT(bike.content()=="small");
-}
-
-/**
- *
- */
+++ /dev/null
-#ifndef TESTCASE_SIMPLETYPE_H
-#define TESTCASE_SIMPLETYPE_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-#include <include/08all.h>
-#include <include/p_08all.h>
-
-using namespace all08;
-
-class TestCaseAllGroup : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestCaseAllGroup );
- CPPUNIT_TEST(parse_bike);
-
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void setUp();
- protected:
- p_Simple_skel m_root;
- std::string m_xmlsourcepath;
- protected:
- void parse_bike();
-};
-#endif
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-#include <TestCaseAllRef.h>
-#include <fstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestCaseAllRef);
-
-class TestResult : public Simple_skel
-{
- public:
-};
-
-void TestCaseAllRef::setUp()
-{
- m_root.elem1_parser(m_elem1);
- m_root.elem2_parser(m_elem2);
- m_xmlsourcepath= "./xmlsources/";
-}
-
-/**
- *
- */
-void TestCaseAllRef::parse_bike()
-{
- TestResult s;
- std::string test="<simple><elem1>small</elem1><elem2>e2</elem2></simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
- std::cout<<" "<<s.elem1()<<" ";
- CPPUNIT_ASSERT(s.elem2()=="e2");
-}
-
-/**
- *
- */
+++ /dev/null
-#ifndef TESTCASE_SIMPLETYPE_H
-#define TESTCASE_SIMPLETYPE_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-#include <include/06all.h>
-#include <include/p_06all.h>
-
-using namespace all06;
-
-class TestCaseAllRef : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestCaseAllRef );
- CPPUNIT_TEST(parse_bike);
-
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void setUp();
- protected:
- ::xsd::parser::SimpleElement m_elem1,m_elem2;
- p_Simple_skel m_root;
- std::string m_xmlsourcepath;
- protected:
- void parse_bike();
-};
-#endif
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-#include <TestCaseAnoAttributeGroup.h>
-#include <fstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestCaseAnoAttributeGroup);
-
-class TestResult : public Simple_skel
-{
- public:
-};
-
-void TestCaseAnoAttributeGroup::setUp()
-{
- //m_root.bike_parser(m_name);
- m_xmlsourcepath= "./xmlsources/";
-}
-
-/**
- *
- */
-void TestCaseAnoAttributeGroup::parse_id()
-{
- TestResult s;
- std::string test="<simple id=\"dede\"></simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
- std::cout<<" "<<s.attr_id()<<" ";
- CPPUNIT_ASSERT(s.attr_id()=="dede");
-}
-/**
- *
- */
-void TestCaseAnoAttributeGroup::parse_link()
-{
- TestResult s;
- std::string test="<simple link=\"45\"></simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
-#if 0
- std::cout<<" "<<s.attr_link()<<" ";
- CPPUNIT_ASSERT(s.attr_link()==45);
-#endif
-}
-
-/**
- *
- */
-void TestCaseAnoAttributeGroup::parse_ano()
-{
- TestResult s;
- std::string test="<simple ano=\"dede\"></simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
-#if 0
- std::cout<<" "<<s.attr_ano().content()<<" ";
- CPPUNIT_ASSERT(s.attr_ano().content()=="dede");
-#endif
-}
-
-
-/**
- *
- */
-void TestCaseAnoAttributeGroup::serialize_id()
-{
-#if 0
- Bikes_skel bike("small");
- Simple_skel s;
- s = bike;
- std::string test="<simple>small</simple>";
-
- std::cout<<" ("<<bike<<") ";
- CPPUNIT_ASSERT(bike.content()=="small");
-#endif
-}
-
-/**
- *
- */
+++ /dev/null
-#ifndef TESTCASE_SIMPLETYPE_H
-#define TESTCASE_SIMPLETYPE_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-#include <include/96attributeGroup.h>
-#include <include/p_96attributeGroup.h>
-
-using namespace attributeGroup96;
-
-class TestCaseAnoAttributeGroup : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestCaseAnoAttributeGroup );
- CPPUNIT_TEST(parse_id);
- CPPUNIT_TEST(parse_link);
- CPPUNIT_TEST(parse_ano);
- CPPUNIT_TEST(serialize_id);
-
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void setUp();
- protected:
- p_Simple_skel m_root;
- std::string m_xmlsourcepath;
- protected:
- void parse_id();
- void parse_link();
- void parse_ano();
- void serialize_id();
-};
-#endif
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-#include <TestCaseAttribute.h>
-#include <fstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestCaseAttribute);
-
-typedef double joe;
-namespace xsd {
-namespace schema {
-
-template<>
-std::ostream &
-operator << (std::ostream &os, const xsd::schema::attribute<long> &c)
-{
- if (c.m_present)
- {
- os<<" toto=\""<<*c.m_content<<"\"";
- }
- return os;
-}
-
-template<>
-std::ostream &
-operator << (std::ostream &os, const xsd::schema::attribute<joe> &c)
-{
- if (c.m_present)
- {
- os<<" joe=\""<<*c.m_content<<"\"";
- }
- return os;
-}
-
-
-}
-}
-
-class TestResult : public Simple_skel
-{
- public:
-};
-
-void TestCaseAttribute::setUp()
-{
- //m_root.bike_parser(m_name);
- m_xmlsourcepath= "./xmlsources/";
-}
-
-/**
- *
- */
-void TestCaseAttribute::parse_bike()
-{
- TestResult s;
- std::string test="<simple>small</simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
- // CPPUNIT_ASSERT(s.content().content()=="small");
-}
-
-
-
-void TestCaseAttribute::test_template()
-{
- typedef xsd::schema::attribute<long> m_attr;
- typedef xsd::schema::attribute<joe> m_joe;
- m_attr toto;
- m_attr dix(10);
- m_joe jo(1);
- std::cout<<"("<<toto<<")"<<"("<<dix<<")";
-
-}
-
-/**
- *
- */
-
-/**
- *
- */
+++ /dev/null
-#ifndef TESTCASE_SIMPLETYPE_H
-#define TESTCASE_SIMPLETYPE_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/xmlschema.h>
-#include <xsd/parser/expat/elements.h>
-#include <include/90attribute.h>
-#include <include/p_90attribute.h>
-
-using namespace attribute90;
-
-class TestCaseAttribute : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestCaseAttribute );
- CPPUNIT_TEST(parse_bike);
- CPPUNIT_TEST(test_template);
-
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void setUp();
- protected:
- p_Simple_skel m_root;
- std::string m_xmlsourcepath;
- protected:
- void parse_bike();
- void test_template();
-};
-#endif
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-#include <TestCaseAttributeGroup.h>
-#include <fstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestCaseAttributeGroup);
-
-class TestResult : public Simple_skel
-{
- public:
-};
-
-void TestCaseAttributeGroup::setUp()
-{
- //m_root.bike_parser(m_name);
- m_xmlsourcepath= "./xmlsources/";
-}
-
-/**
- *
- */
-void TestCaseAttributeGroup::parse_group()
-{
- TestResult s;
- std::string test="<simple id=\"3\" link=\"61\"></simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
- std::cout<<" id="<<s.attr_id()<<" ";
- std::cout<<" link=("<<s.attr_link().content()<<") ";
- //CPPUNIT_ASSERT(s.attr_link().content()==61);
- //CPPUNIT_ASSERT(0==12);
-}
-
-
-/**
- *
- */
+++ /dev/null
-#ifndef TESTCASE_SIMPLETYPE_H
-#define TESTCASE_SIMPLETYPE_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-#include <include/95attributeGroup.h>
-#include <include/p_95attributeGroup.h>
-
-using namespace attributeGroup95;
-
-class TestCaseAttributeGroup : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestCaseAttributeGroup );
- CPPUNIT_TEST(parse_group);
-
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void setUp();
- protected:
- p_Simple_skel m_root;
- std::string m_xmlsourcepath;
- protected:
- void parse_group();
-};
-#endif
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-#include <TestCaseAttributeOptional.h>
-#include <fstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestCaseAttributeOptional);
-
-class TestResult : public Simple_skel
-{
- public:
-};
-
-void TestCaseAttributeOptional::setUp()
-{
- //m_root.bike_parser(m_name);
- m_xmlsourcepath= "./xmlsources/";
-}
-
-/**
- *
- */
-void TestCaseAttributeOptional::parse_link()
-{
- TestResult s;
- char r[128];
- signed char c=(signed char)60;
- std::string test="<simple link=\"61\"></simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
-#if 0
- std::cout<<" "<<s.attr_link()<<" ";
- CPPUNIT_ASSERT(s.attr_link()==10);
-#else
- std::cout<<" link=("<<s.attr_link()<<") ";
- CPPUNIT_ASSERT(s.attr_link().present()==true);
-#endif
-}
-
-void TestCaseAttributeOptional::parse_versiono()
-{
- TestResult s;
- char r[128];
- signed char c=(signed char)60;
- std::string test="<simple versiono=\"10\"></simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
- std::cout<<" "<<s.attr_versiono()<<" ";
-#if 0
- std::cout<<" "<<s.attr_link()<<" ";
- CPPUNIT_ASSERT(s.attr_link()==10);
-#else
- CPPUNIT_ASSERT(s.attr_versiono()=="10");
-#endif
-}
-
-/**
- *
- */
+++ /dev/null
-#ifndef TESTCASE_SIMPLETYPE_H
-#define TESTCASE_SIMPLETYPE_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-#include <include/92attribute.h>
-#include <include/p_92attribute.h>
-
-using namespace attribute92;
-
-class TestCaseAttributeOptional : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestCaseAttributeOptional );
- CPPUNIT_TEST(parse_link);
- CPPUNIT_TEST(parse_versiono);
-
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void setUp();
- protected:
- p_Simple_skel m_root;
- std::string m_xmlsourcepath;
- protected:
- void parse_link();
- void parse_versiono();
-};
-#endif
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-#include <TestCaseAttributeRestricted.h>
-#include <fstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestCaseAttributeRestricted);
-
-class TestResult : public Simple_skel
-{
- public:
-};
-
-void TestCaseAttributeRestricted::setUp()
-{
- //m_root.bike_parser(m_name);
- m_xmlsourcepath= "./xmlsources/";
-}
-
-/**
- *
- */
-void TestCaseAttributeRestricted::parse_A()
-{
- A_skel s;
- std::string test="<a x=\"1\" y=\"2\"></a>";
- std::istringstream iss1(test,std::istringstream::in);
- std::ostringstream result(std::ostringstream::out);
- xsd::parser::expat::Document doc(m_A_root,"a");
- doc.parse(iss1);
- m_A_root.post(s);
- std::cout<<"(x="<<s.attr_x()<<" y="<<s.attr_y()<<") ";
- CPPUNIT_ASSERT(s.attr_y()=="2");
-}
-
-/**
- *
- */
-void TestCaseAttributeRestricted::parse_bike()
-{
- TestResult s;
- std::string test="<simple x=\"1\" y=\"2\">small</simple>";
- std::istringstream iss1(test,std::istringstream::in);
- std::ostringstream result(std::ostringstream::out);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
- std::cout<<"(x="<<s.attr_x()<<" y="<<s.attr_y()<<") ";
- // CPPUNIT_ASSERT(s.content().content()=="small");
-}
-
-/**
- * Should failed. x is not allowed
- */
-void TestCaseAttributeRestricted::parse_simple_x()
-{
- TestResult s;
- std::string test="<simple x=\"1\" y=\"2\">small</simple>";
- std::istringstream iss1(test,std::istringstream::in);
- std::ostringstream result(std::ostringstream::out);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
- std::cout<<"(x="<<s.attr_x()<<" y="<<s.attr_y()<<") ";
- // CPPUNIT_ASSERT(s.content().content()=="small");
-}
-
-/**
- *
- */
-void TestCaseAttributeRestricted::parse_simple_y()
-{
- TestResult s;
- std::string test="<simple y=\"7\">small</simple>";
- std::istringstream iss1(test,std::istringstream::in);
- std::ostringstream result(std::ostringstream::out);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
- std::cout<<"(x="<<s.attr_x()<<" y="<<s.attr_y()<<") ";
- CPPUNIT_ASSERT(s.attr_y()== "7");
-}
-
-/**
- *
- */
+++ /dev/null
-#ifndef TESTCASE_SIMPLETYPE_H
-#define TESTCASE_SIMPLETYPE_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-#include <include/91attribute.h>
-#include <include/p_91attribute.h>
-
-using namespace attribute91;
-
-class TestCaseAttributeRestricted : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestCaseAttributeRestricted );
- CPPUNIT_TEST(parse_A);
- CPPUNIT_TEST(parse_bike);
- CPPUNIT_TEST(parse_simple_x);
- CPPUNIT_TEST(parse_simple_y);
-
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void setUp();
- protected:
- p_Simple_skel m_root;
- p_A_skel m_A_root;
- std::string m_xmlsourcepath;
- protected:
- void parse_bike();
- void parse_A();
- void parse_simple_x();
- void parse_simple_y();
-};
-#endif
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-#include <TestCaseComplexContentRestriction.h>
-#include <fstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestCaseComplexContentRestriction);
-
-class TestResult : public basic_type::Simple_skel
-{
- public:
- std::string &version() {return me_attr_version.m_content;};
- long nbr() {return *me_nbr;}
-};
-
-void TestCaseComplexContentRestriction::setUp()
-{
- m_root.name_parser(m_name);
- m_root.greeting_parser(m_greeting);
- m_root.nbr_parser(m_nbr);
- m_root._int_parser(m__int);
- m_root._double_parser(m__double);
- m_xmlsourcepath= "./xmlsources/";
-}
-
-/**
- *
- */
-void TestCaseComplexContentRestriction::parse_01()
-{
- TestResult s;
- char r[128];
- signed char c=(signed char)60;
- std::string test="<Simple version=\"1.0\"><name>andre</name><greeting>Marc</greeting><nbr>12</nbr></Simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(1==1);
- CPPUNIT_ASSERT(s.version()=="1.0");
- CPPUNIT_ASSERT(s.greeting()=="Marc");
- CPPUNIT_ASSERT(s.nbr()==12);
- //CPPUNIT_ASSERT( s.name()[0]!= NULL);
- sprintf(r,"Why is name=%s\n",s.name()[0]->content().c_str());
- CPPUNIT_ASSERT_MESSAGE( r , s.name()[0]->content() == "andre");
-}
-
-/**
- *
- */
-void TestCaseComplexContentRestriction::parse_02()
-{
- TestResult s;
- std::string test="<Simple version=\"1.0\" link=\"1.2\"><name>andre</name><greeting>Marc</greeting><nbr>12</nbr></Simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s.version()=="1.0");
- CPPUNIT_ASSERT(s.nbr()==12);
-}
-
-/**
- * must return failed because 1.0 != 1.2
- */
-void TestCaseComplexContentRestriction::parse_03()
-{
- TestResult s;
- std::string test="<Simple version=\"1.0\"><name>andre</name><greeting>Marc</greeting><nbr>12</nbr></Simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s.version()=="1.2");
-}
-
-/**
- *
- */
-void TestCaseComplexContentRestriction::parse_04()
-{
- TestResult s;
- char r[128];
- signed char c=(signed char)60;
- std::string test="<Simple version=\"1.0\"><name>andre</name><greeting>Marc</greeting><nbr>12</nbr></Simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT( ( s.name().size() == 1));
- sprintf(r,"Why is name=%s\n",s.name()[0]->content().c_str());
- CPPUNIT_ASSERT_MESSAGE( r , s.name()[0]->content() == "andre");
-}
-/**
- *
- */
-void TestCaseComplexContentRestriction::parse_file_01int()
-{
- basic_type::Simple_skel s;
-#if 0
- std::ifstream iss1;
- std::string filename = m_xmlsourcepath + "01basic_01int.xml";
- iss1.open(filename.c_str(),std::ifstream::in);
-#else
- std::string test="<Simple version=\"1.0\"><name>andre</name><greeting>Marc</greeting><nbr>12</nbr><_int>454</_int></Simple>";
- std::istringstream iss1(test,std::istringstream::in);
-#endif
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s._int()==454);
-}
+++ /dev/null
-#ifndef TESTCASE_SIMPLETYPE_H
-#define TESTCASE_SIMPLETYPE_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-#include <include/01basic.h>
-#include <include/p_01basic.h>
-
-
-class TestCaseComplexContentRestriction : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestCaseComplexContentRestriction );
- CPPUNIT_TEST(parse_01);
- CPPUNIT_TEST(parse_02);
- CPPUNIT_TEST_FAIL(parse_03);
- CPPUNIT_TEST(parse_04);
- CPPUNIT_TEST(parse_file_01int);
-
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void setUp();
- protected:
- xsd::parser::SimpleElement m_nbr,m_greeting,m__int,m__double,m__string;
- basic_type::p_SimpleChaine_skel m_name;
- basic_type::p_Simple_skel m_root;
- std::string m_xmlsourcepath;
- protected:
- void parse_01();
- void parse_02();
- void parse_03();
- void parse_04();
- void parse_file_01int();
-};
-#endif
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-#include <TestCaseComplexTypeChoice.h>
-#include <fstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestCaseComplexTypeChoice);
-
-class TestResult : public Simple_skel
-{
- public:
-};
-
-void TestCaseComplexTypeChoice::setUp()
-{
- m_root.elem1_parser(m_elem1);
- m_root.logic_parser(m_logic);
- m_root.prive_parser(m_prive);
- m_xmlsourcepath= "./xmlsources/";
-}
-
-/**
- *
- */
-void TestCaseComplexTypeChoice::parse_elem1()
-{
- TestResult s;
- char r[128];
- signed char c=(signed char)60;
- std::string test="<simple><elem1>small</elem1></simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
- simple_elem_type e(new Simple_skel(s));
- std::cout<<" "<<e<<" ";
-// CPPUNIT_ASSERT(s.content().content()=="small");
-}
-
-/**
- *
- */
-void TestCaseComplexTypeChoice::parse_logic()
-{
- TestResult s;
- std::string test="<simple><logic>true</logic></simple>";
- std::istringstream iss1(test,std::istringstream::in);
- std::ostringstream result(std::ostringstream::out);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
- simple_elem_type e(new Simple_skel(s));
- std::cout<<" ("<<e<<") ";
- result<<e;
- CPPUNIT_ASSERT(result.str() == "<simple><logic>1</logic></simple>");
-}
-
-/**
- *
- */
-void TestCaseComplexTypeChoice::parse_prive()
-{
- TestResult s;
- std::ostringstream result(std::ostringstream::out);
- std::string test="<simple><prive>2011</prive></simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
- simple_elem_type e(new Simple_skel(s));
- std::cout<<" "<<e<<" ";
- result<<e;
- CPPUNIT_ASSERT(false == result.str().compare("<simple><prive>2011</prive></simple>"));
-// CPPUNIT_ASSERT(s.content().content()=="small");
-}
-
-/**
- *
- */
-
-/**
- *
- */
+++ /dev/null
-#ifndef TESTCASE_SIMPLETYPE_H
-#define TESTCASE_SIMPLETYPE_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-#include <include/80choice.h>
-#include <include/p_80choice.h>
-
-using namespace choice80;
-
-class TestCaseComplexTypeChoice : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestCaseComplexTypeChoice );
- CPPUNIT_TEST(parse_elem1);
- CPPUNIT_TEST(parse_logic);
- CPPUNIT_TEST(parse_prive);
-
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void setUp();
- protected:
- xsd::parser::SimpleElement m_logic;
- p_elem1_skel m_elem1;
- p_Simple_skel::p_prive_skel m_prive;
- p_Simple_skel m_root;
- std::string m_xmlsourcepath;
- protected:
- void parse_elem1();
- void parse_logic();
- void parse_prive();
-};
-#endif
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-#include <TestCaseComplexTypeSequence.h>
-#include <fstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestCaseComplexTypeSequence);
-
-class TestResult : public Simple_skel
-{
- public:
-};
-
-void TestCaseComplexTypeSequence::setUp()
-{
- //m_root.bike_parser(m_name);
- m_xmlsourcepath= "./xmlsources/";
-}
-
-/**
- *
- */
-void TestCaseComplexTypeSequence::parse_bike()
-{
- TestResult s;
- char r[128];
- signed char c=(signed char)60;
- std::string test="<simple>small</simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
-// std::cout<<" "<<s.content().content()<<" ";
-// CPPUNIT_ASSERT(s.content().content()=="small");
-}
-
-
-/**
- *
- */
+++ /dev/null
-#ifndef TESTCASE_SIMPLETYPE_H
-#define TESTCASE_SIMPLETYPE_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-#include <include/70sequence.h>
-#include <include/p_70sequence.h>
-
-using namespace sequence70;
-
-class TestCaseComplexTypeSequence : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestCaseComplexTypeSequence );
- CPPUNIT_TEST(parse_bike);
-
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void setUp();
- protected:
- p_Simple_skel m_root;
- std::string m_xmlsourcepath;
- protected:
- void parse_bike();
-};
-#endif
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-#include <TestCaseCplxTpChoiceSequence.h>
-#include <fstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestCaseCplxTpChoiceSequence);
-
-class TestResult : public Simple_skel
-{
- public:
-};
-
-void TestCaseCplxTpChoiceSequence::setUp()
-{
- //m_root.bike_parser(m_name);
- m_xmlsourcepath= "./xmlsources/";
-}
-
-/**
- *
- */
-void TestCaseCplxTpChoiceSequence::parse_bike()
-{
- TestResult s;
- char r[128];
- signed char c=(signed char)60;
- std::string test="<simple>small</simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
- //std::cout<<" "<<s.content().content()<<" ";
- //CPPUNIT_ASSERT(s.content().content()=="small");
- CPPUNIT_ASSERT(0==1);
-}
-
-
-/**
- *
- */
+++ /dev/null
-#ifndef TESTCASE_SIMPLETYPE_H
-#define TESTCASE_SIMPLETYPE_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-#include <include/81choice.h>
-#include <include/p_81choice.h>
-
-using namespace choice81;
-
-class TestCaseCplxTpChoiceSequence : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestCaseCplxTpChoiceSequence );
- CPPUNIT_TEST(parse_bike);
-
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void setUp();
- protected:
- p_Simple_skel m_root;
- std::string m_xmlsourcepath;
- protected:
- void parse_bike();
-};
-#endif
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-#include <TestCaseGroup.h>
-#include <fstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestCaseGroup);
-
-class TestResult : public Simple_skel
-{
- public:
- std::string version() {std::string s = me_attr_version.content();return s;};
-};
-
-void TestCaseGroup::setUp()
-{
- // m_root.union_stype_parser(m_ust);
- // m_root.version_parser(m_version);
- m_root.elem1_parser(m_elem1);
- m_root.elem2_parser(m_elem2);
- m_xmlsourcepath= "./xmlsources/";
-}
-
-/**
- *
- */
-void TestCaseGroup::ParseVersion()
-{
- TestResult s;
- char r[128];
- signed char c=(signed char)60;
- std::string test="<h:Simple xmlns:h=\"http://www.webobject.dyndns.org/group10\" version=\"2.0\"><elem1>andre</elem1><elem2>sophie</elem2></h:Simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s.version()=="2.0");
-#if 0
- CPPUNIT_ASSERT(s.greeting()=="Marc");
- CPPUNIT_ASSERT(s.nbr()==12);
- CPPUNIT_ASSERT( ( s.name())[0]!= NULL);
- sprintf(r,"Why is name=%s\n",s.name()[0]->content().c_str());
- CPPUNIT_ASSERT_MESSAGE( r , s.name()[0]->content() == "andre");
-#endif
-}
-
-
-/**
- *
- */
-void TestCaseGroup::ParseElem1()
-{
- TestResult s;
- std::string test="<h:Simple xmlns:h=\"http://www.webobject.dyndns.org/group10\" version=\"2.0\"><elem1>andre</elem1><elem2>sophie</elem2></h:Simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s.elem1()=="andre");
-}
-/**
- *
- */
-void TestCaseGroup::ParseElem2()
-{
- TestResult s;
- std::string test="<h:Simple xmlns:h=\"http://www.webobject.dyndns.org/group10\" version=\"2.0\"><elem1>andre</elem1><elem2>sophie</elem2></h:Simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s.elem2()=="sophie");
-}
-
-#if 0
-/**
- *
- */
-void TestCaseGroup::parse_03()
-{
- TestResult s;
- std::string test="<Simple version=\"1.0\"><name version=\"first test\" link=\"A\">andre</name><greeting>Marc</greeting><nbr>12</nbr></Simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s.version()=="1.2");
-}
-
-/**
- *
- */
-void TestCaseSimpleType::parse_file_01int()
-{
- basic_type::Simple_skel s;
- std::ifstream iss1;
- std::string filename = m_xmlsourcepath + "01basic_01int.xml";
- iss1.open(filename.c_str(),std::ifstream::in);
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s._int()==454);
-}
-#endif
+++ /dev/null
-#ifndef TESTCASE_50UNION_H
-#define TESTCASE_50UNION_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-#include <include/10group.h>
-#include <include/p_10group.h>
-
-using namespace group10;
-
-class TestCaseGroup : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestCaseGroup );
- CPPUNIT_TEST(ParseVersion);
- CPPUNIT_TEST(ParseElem1);
- CPPUNIT_TEST(ParseElem2);
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void setUp();
- protected:
- xsd::parser::SimpleElement m_elem1,m_elem2,m_version;
- p_Simple_skel m_root;
- std::string m_xmlsourcepath;
- protected:
- void ParseVersion();
- void ParseElem1();
- void ParseElem2();
-};
-#endif
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-#include <TestCaseList.h>
-#include <fstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestCaseList);
-
-class TestResult : public Simple_skel
-{
- public:
-};
-
-void TestCaseList::setUp()
-{
- m_root.bikes_parser(m_bikes);
- m_xmlsourcepath= "./xmlsources/";
-}
-
-/**
- *
- */
-void TestCaseList::parse_bike()
-{
- TestResult s;
- char r[128];
- signed char c=(signed char)60;
- std::string test="<simple><bikes>bike1 bike2 bike3 bike4</bikes></simple>";
- std::istringstream iss1(test,std::istringstream::in);
- std::ostringstream result(std::ostringstream::out);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
- simple_elem_type e(new Simple_skel(s));
- std::cout<<" ("<<e<<") ";
- // CPPUNIT_ASSERT(s.content().content()=="small");
-}
-
-
-/**
- *
- */
+++ /dev/null
-#ifndef TESTCASE_SIMPLETYPE_H
-#define TESTCASE_SIMPLETYPE_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-#include <include/40list.h>
-#include <include/p_40list.h>
-
-using namespace list40;
-
-class TestCaseList : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestCaseList );
- CPPUNIT_TEST(parse_bike);
-
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void setUp();
- protected:
- p_Bikes_skel m_bikes;
- p_Simple_skel m_root;
- std::string m_xmlsourcepath;
- protected:
- void parse_bike();
-};
-#endif
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-#include <TestCaseRecurse.h>
-#include <fstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestCaseRecurse);
-
-class TestResult : public basic03::XMI_skel
-{
- public:
- std::string version() {std::string s= me_attr_version.content();return s;};
-};
-
-void TestCaseRecurse::setUp()
-{
- m_root.XmiFirmware_parser(m_XmiFirmware);
- m_root.name_parser(m_XMI_content);
- m_root.nbr_parser(m_nbr);
- m_XmiFirmware.PkgURL_parser(m_PkgURL);
- m_XmiFirmware.XmiFirmware_parser(m_XmiFirmware);
- m_xmlsourcepath= "./xmlsources/";
-}
-
-/**
- *
- */
-void TestCaseRecurse::parse_01()
-{
- TestResult s;
- char r[128];
- signed char c=(signed char)60;
- std::string test="<XMI version=\"1.0\"><name name=\"andre\"></name><nbr>12</nbr></XMI>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"XMI");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s.version()=="1.0");
- CPPUNIT_ASSERT(s.name()[0]->attr_name()=="andre");
- CPPUNIT_ASSERT(s.nbr()==12);
-#if 0
- CPPUNIT_ASSERT( ( s.name())[0]!= NULL);
- CPPUNIT_ASSERT( ( s.name())[0]->version()=="first test");
- sprintf(r,"Why is c=%d and s.name.link %d vers=%s",c,s.name()[0]->link(),s.name()[0]->version().c_str());
- CPPUNIT_ASSERT_MESSAGE( r , s.name()[0]->link() == c);
-#endif
-}
-
-/**
- *
- */
-void TestCaseRecurse::parse_02()
-{
- TestResult s;
- std::ifstream iss1;
- std::string filename = m_xmlsourcepath + "03basic_recurse_01.xml";
- iss1.open(filename.c_str(),std::ifstream::in);
- xsd::parser::expat::Document doc(m_root,"XMI");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s.version()=="1.0");
- CPPUNIT_ASSERT(s.XmiFirmware()[0]->attr_version()=="12");
-}
-
-/**
- *
- */
-void TestCaseRecurse::parse_03()
-{
- TestResult s;
- std::string test="<XMI version=\"1.2\"><name name=\"A\">andre</name><name name=\"marc\"/><nbr>12</nbr></XMI>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"XMI");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s.version()=="1.2");
- CPPUNIT_ASSERT(s.name()[0]->attr_name()!="andre");
- CPPUNIT_ASSERT(s.name()[1]->attr_name()=="marc");
-}
-
-/**
- *
- */
-void TestCaseRecurse::parse_04()
-{
- TestResult s;
- std::ifstream iss1;
- std::string filename = m_xmlsourcepath + "03basic_recurse_02.xml";
- iss1.open(filename.c_str(),std::ifstream::in);
- xsd::parser::expat::Document doc(m_root,"XMI");
- doc.parse(iss1);
- m_root.post(s);
- std::cout<<s<<std::endl;
- CPPUNIT_ASSERT(s.version()==std::string("1.0"));
-// CPPUNIT_ASSERT(s.XmiFirmware()[0]->attr_version()=="22");
- CPPUNIT_ASSERT(s.XmiFirmware()[0]->XmiFirmware()[0]->attr_version()=="22");
-}
-
-/**
- *
- */
-void TestCaseRecurse::parse_05()
-{
- TestResult s;
- std::ifstream iss1;
- std::string filename = m_xmlsourcepath + "03basic_recurse_02.xml";
- iss1.open(filename.c_str(),std::ifstream::in);
- xsd::parser::expat::Document doc(m_root,"XMI");
- doc.parse(iss1);
- m_root.post(s);
- std::cout<<s<<" version="<<s.attr_version()<<std::endl;
- CPPUNIT_ASSERT(s.attr_version()==std::string("1.0"));
- CPPUNIT_ASSERT(s.XmiFirmware()[0]->attr_version()=="12");
-// CPPUNIT_ASSERT(s.XmiFirmware()[0]->XmiFirmware()[0]->version()=="12");
-}
-
-/**
- *
- */
-#if 0
-void TestCaseRecurse::parse_file_01int()
-{
- basic_type::Simple_skel s;
- std::ifstream iss1;
- std::string filename = m_xmlsourcepath + "01basic_01int.xml";
- iss1.open(filename.c_str(),std::ifstream::in);
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s._int()==454);
-}
-#endif
+++ /dev/null
-#ifndef TESTCASE_SIMPLETYPE_H
-#define TESTCASE_SIMPLETYPE_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-#include <include/03basic.h>
-#include <include/p_03basic.h>
-
-
-class TestCaseRecurse : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestCaseRecurse );
-#if 0
- CPPUNIT_TEST(parse_01);
- CPPUNIT_TEST(parse_02);
- CPPUNIT_TEST(parse_03);
-#endif
- CPPUNIT_TEST(parse_04);
- CPPUNIT_TEST(parse_05);
-
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void setUp();
- protected:
- xsd::parser::SimpleElement m_name,m_nbr,m_PkgURL;
- basic03::p_XMIfirmwareLocation_skel m_XmiFirmware;
- basic03::p_XMI_skel m_root;
- basic03::p_XMI_content_skel m_XMI_content;
- std::string m_xmlsourcepath;
- protected:
- void parse_01();
- void parse_02();
- void parse_03();
- void parse_04();
- void parse_05();
-};
-#endif
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-#include <TestCaseSimpleContentExtensionAttribute.h>
-#include <fstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestCaseSimpleContentExtensionAttribute);
-
-class TestResult : public Simple_skel
-{
- public:
-};
-
-void TestCaseSimpleContentExtensionAttribute::setUp()
-{
- m_root.type_parser(m_checksum);
- m_xmlsourcepath= "./xmlsources/";
-}
-
-/**
- *
- */
-void TestCaseSimpleContentExtensionAttribute::parse_type()
-{
- TestResult s;
- char r[128];
- signed char c=(signed char)60;
- std::string test="<simple type=\"md5\">small</simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
- std::cout<<" "<<s.attr_type().content()<<" ";
- CPPUNIT_ASSERT(s.attr_type().content()=="md5");
-}
-
-/**
- *
- */
+++ /dev/null
-#ifndef TESTCASE_SIMPLETYPE_H
-#define TESTCASE_SIMPLETYPE_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-#include <include/31extension.h>
-#include <include/p_31extension.h>
-
-using namespace extension31;
-
-class TestCaseSimpleContentExtensionAttribute : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestCaseSimpleContentExtensionAttribute );
- CPPUNIT_TEST(parse_type);
-
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void setUp();
- protected:
- p_ChecksumType_skel m_checksum;
- p_Simple_skel m_root;
- std::string m_xmlsourcepath;
- protected:
- void parse_type();
-};
-#endif
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-#include <TestCaseSimpleContentRestriction.h>
-#include <fstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestCaseSimpleContentRestriction);
-
-class TestResult : public Simple_skel
-{
- public:
-};
-
-void TestCaseSimpleContentRestriction::setUp()
-{
- //m_root.bike_parser(m_name);
- m_xmlsourcepath= "./xmlsources/";
-}
-
-/**
- *
- */
-void TestCaseSimpleContentRestriction::parse_bike()
-{
- TestResult s;
- char r[128];
- signed char c=(signed char)60;
- std::string test="<simple>small</simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
- std::cout<<" "<<s.content().content()<<" ";
- CPPUNIT_ASSERT(s.content().content()=="small");
-}
-
-/**
- *
- */
-void TestCaseSimpleContentRestriction::serialize_bike()
-{
- Bikes_skel bike("small");
- Simple_skel s;
- s = bike;
- std::string test="<simple>small</simple>";
-
- std::cout<<" ("<<bike<<") ";
- CPPUNIT_ASSERT(bike.content()=="small");
-}
-
-/**
- *
- */
-void TestCaseSimpleContentRestriction::serialize_simple()
-{
- Bikes_skel bike("small");
- Simple_skel s;
- s = bike;
- std::string test="<simple>small</simple>";
-
- std::cout<<" ("<<s<<") ";
- CPPUNIT_ASSERT(s.content().content()=="small");
-}
-/**
- *
- */
-void TestCaseSimpleContentRestriction::serialize_simple_element()
-{
- std::ostringstream result(std::ostringstream::out);
- Bikes_skel bike("small");
- simple_sptr s(new Simple_skel());
- *s = bike;
- std::string test="<simple>small</simple>";
- result<<simple_elem_type(s);
- std::cout<<" ("<<simple_elem_type(s)<<") ";
- CPPUNIT_ASSERT(result.str()=="<simple>small</simple>");
-}
+++ /dev/null
-#ifndef TESTCASE_SIMPLETYPE_H
-#define TESTCASE_SIMPLETYPE_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-#include <include/21restriction.h>
-#include <include/p_21restriction.h>
-
-using namespace restriction21;
-
-class TestCaseSimpleContentRestriction : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestCaseSimpleContentRestriction );
- CPPUNIT_TEST(parse_bike);
- CPPUNIT_TEST(serialize_bike);
- CPPUNIT_TEST(serialize_simple);
- CPPUNIT_TEST(serialize_simple_element);
-
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void setUp();
- protected:
- p_Bikes_skel m_bike;
- p_Simple_skel m_root;
- std::string m_xmlsourcepath;
- protected:
- void parse_bike();
- void serialize_bike();
- void serialize_simple();
- void serialize_simple_element();
-};
-#endif
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-#include <TestCaseSimpleSerialize.h>
-
-CPPUNIT_TEST_SUITE_REGISTRATION( TestCaseSimpleSerialize);
-
-class TestResult : public basic_type::Simple_skel
-{
- public:
- std::string version() {std::string s = me_attr_version.content();return s;};
- long nbr() {return *me_nbr;}
-};
-
-void TestCaseSimpleSerialize::setUp()
-{
- m_root.name_parser(m_name);
- m_root.greeting_parser(m_greeting);
- m_root.nbr_parser(m_nbr);
-}
-
-/**
- *
- */
-void TestCaseSimpleSerialize::serialize_simple()
-{
- char r[1024];
- std::string v;
- long n=412;
- signed char c=(signed char)30;
- std::string test="<h:simple xmlns:h=\"http://www.webobject.dyndns.org/basic_type\" version=\"2.0\"><greeting>Marc</greeting><nbr>412</nbr><name>andre</name></h:simple>";
- std::ostringstream result(std::ostringstream::out);
- CPPUNIT_ASSERT( 1 == 1);
- basic_type::Simple_skel *s = new basic_type::Simple_skel();
- basic_type::simple_sptr ss(s);
- struct basic_type::simple_elem_type es(ss);
- basic_type::SimpleChaine_skel name;
- v="2.0";
- basic_type::Simple_skel::version_attr_type_ ats = v;
- basic_type::Simple_skel::version_optional vo(ats);
- s->attr_version(vo);
- CPPUNIT_ASSERT( s->attr_version() == "2.0");
- v="1.5";
- name="andre";
- result<<name;
- sprintf(r,"What is expected=\n<name>andre</name>\n result=\n%s\n",result.str().c_str());
- CPPUNIT_ASSERT_MESSAGE( r ,"andre" == result.str());
- s->name(name);
- basic_type::Simple_skel::name_sequence names;
- names = s->name();
- CPPUNIT_ASSERT(names.size() ==1);
- v="Marc";
- s->greeting(v);
- s->nbr(n);
- result.seekp(0); //rewind
- result<<es;
- sprintf(r,"What is expected=\n(%s)\n result=\n(%s)\n",test.c_str(),result.str().c_str());
- CPPUNIT_ASSERT_MESSAGE( r ,(test.c_str() == result.str()));
-}
-
-
-void TestCaseSimpleSerialize::serialize_template()
-{
- basic_type::Simple_skel *s = new basic_type::Simple_skel();
- basic_type::simple_sptr ss(s);
- typedef xsd::element<basic_type::Simple_skel,true> ns;
- typedef xsd::element<basic_type::Simple_skel,false> nsf;
- std::string v("2.0");
- basic_type::Simple_skel::version_attr_type_ ats = v;
- basic_type::Simple_skel::version_optional vo(ats);
- s->attr_version(vo);
-
- ns es(ss,"sim");
- nsf esf(ss,"sim");
-
- std::cout<<es<<"\n";
- std::cout<<esf<<"\n";
-
-}
-/**
- *
- */
-void TestCaseSimpleSerialize::serialize_simple_and_name()
-{
- TestResult s;
- std::string test="<Simple version=\"1.0\"><name>andre</name><greeting>Marc</greeting><nbr>12</nbr></Simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s.version()=="1.0");
- CPPUNIT_ASSERT(s.nbr()==12);
-}
-
-/**
- *
- */
-/*
-void TestCaseSimpleSerialize::parse_03()
-{
- TestResult s;
- std::string test="<Simple version=\"1.0\"><name version=\"first test\" link=\"A\">andre</name><greeting>Marc</greeting><nbr>12</nbr></Simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s.version()=="1.2");
-}
-*/
+++ /dev/null
-#ifndef TESTCASE_SIMPLESERIALIZE_H
-#define TESTCASE_SIMPLESERILAIZE_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-#include <include/01basic.h>
-#include <include/p_01basic.h>
-
-
-class TestCaseSimpleSerialize : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestCaseSimpleSerialize );
- CPPUNIT_TEST( serialize_simple);
- CPPUNIT_TEST( serialize_template);
- CPPUNIT_TEST( serialize_simple_and_name);
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void setUp();
- protected:
- xsd::parser::SimpleElement m_nbr,m_greeting;
- basic_type::p_SimpleChaine_skel m_name;
- basic_type::p_Simple_skel m_root;
- protected:
- void serialize_simple();
- void serialize_template();
- void serialize_simple_and_name();
-};
-#endif
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-#include <TestCaseSimpleType.h>
-#include <fstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestCaseSimpleType);
-
-class TestResult : public basic_type::Simple_skel
-{
- public:
- std::string version() {std::string s=me_attr_version.content(); return s;};
- long nbr() {return *me_nbr;}
-};
-
-void TestCaseSimpleType::setUp()
-{
- m_root.name_parser(m_name);
- m_root.greeting_parser(m_greeting);
- m_root.nbr_parser(m_nbr);
- m_root._int_parser(m__int);
- m_root._double_parser(m__double);
- m_xmlsourcepath= "./xmlsources/";
-}
-
-/**
- *
- */
-void TestCaseSimpleType::parse_01()
-{
- TestResult s;
- char r[128];
- signed char c=(signed char)60;
- std::string test="<Simple version=\"1.0\"><name>andre</name><greeting>Marc</greeting><nbr>12</nbr></Simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(1==1);
- CPPUNIT_ASSERT(s.version()=="1.0");
- CPPUNIT_ASSERT(s.greeting()=="Marc");
- CPPUNIT_ASSERT(s.nbr()==12);
- //CPPUNIT_ASSERT( s.name()[0]!= NULL);
- sprintf(r,"Why is name=%s\n",s.name()[0]->content().c_str());
- CPPUNIT_ASSERT_MESSAGE( r , s.name()[0]->content() == "andre");
-}
-
-/**
- *
- */
-void TestCaseSimpleType::parse_02()
-{
- TestResult s;
- std::string test="<Simple version=\"1.0\" link=\"1.2\"><name>andre</name><greeting>Marc</greeting><nbr>12</nbr></Simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s.version()=="1.0");
- CPPUNIT_ASSERT(s.nbr()==12);
-}
-
-/**
- * must return failed because 1.0 != 1.2
- */
-void TestCaseSimpleType::parse_03()
-{
- TestResult s;
- std::string test="<Simple version=\"1.0\"><name>andre</name><greeting>Marc</greeting><nbr>12</nbr></Simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s.version()=="1.2");
-}
-
-/**
- *
- */
-void TestCaseSimpleType::parse_04()
-{
- TestResult s;
- char r[128];
- signed char c=(signed char)60;
- std::string test="<Simple version=\"1.0\"><name>andre</name><greeting>Marc</greeting><nbr>12</nbr></Simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT( ( s.name().size() == 1));
- sprintf(r,"Why is name=%s\n",s.name()[0]->content().c_str());
- CPPUNIT_ASSERT_MESSAGE( r , s.name()[0]->content() == "andre");
-}
-/**
- *
- */
-void TestCaseSimpleType::parse_file_01int()
-{
- basic_type::Simple_skel s;
-#if 0
- std::ifstream iss1;
- std::string filename = m_xmlsourcepath + "01basic_01int.xml";
- iss1.open(filename.c_str(),std::ifstream::in);
-#else
- std::string test="<Simple version=\"1.0\"><name>andre</name><greeting>Marc</greeting><nbr>12</nbr><_int>454</_int></Simple>";
- std::istringstream iss1(test,std::istringstream::in);
-#endif
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s._int()==454);
-}
+++ /dev/null
-#ifndef TESTCASE_SIMPLETYPE_H
-#define TESTCASE_SIMPLETYPE_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-#include <include/01basic.h>
-#include <include/p_01basic.h>
-
-
-class TestCaseSimpleType : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestCaseSimpleType );
- CPPUNIT_TEST(parse_01);
- CPPUNIT_TEST(parse_02);
- CPPUNIT_TEST_FAIL(parse_03);
- CPPUNIT_TEST(parse_04);
- CPPUNIT_TEST(parse_file_01int);
-
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void setUp();
- protected:
- xsd::parser::SimpleElement m_nbr,m_greeting,m__int,m__double,m__string;
- basic_type::p_SimpleChaine_skel m_name;
- basic_type::p_Simple_skel m_root;
- std::string m_xmlsourcepath;
- protected:
- void parse_01();
- void parse_02();
- void parse_03();
- void parse_04();
- void parse_file_01int();
-};
-#endif
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-#include <TestCaseSimpleTypeRestriction.h>
-#include <fstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestCaseSimpleTypeRestriction);
-
-class TestResult : public Simple_skel
-{
- public:
- std::string version() {std::string s = me_attr_version.content();return s;};
-};
-
-void TestCaseSimpleTypeRestriction::setUp()
-{
- m_root.bike_parser(m_bike);
- m_root.limit_parser(m_limit);
- m_xmlsourcepath= "./xmlsources/";
-}
-
-/**
- *
- */
-void TestCaseSimpleTypeRestriction::parse_bike()
-{
- TestResult s;
- char r[128];
- signed char c=(signed char)60;
- std::string test="<h:simple xmlns:h=\"http://www.webobject.dyndns.org/restriction20\" version=\"1.0\"><bike>small</bike><limit>12</limit></h:simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s.bike().content()=="small");
-}
-
-/**
- *
- */
-void TestCaseSimpleTypeRestriction::parse_version()
-{
- TestResult s;
- std::string test="<h:simple xmlns:h=\"http://www.webobject.dyndns.org/restriction20\" version=\"1.0\"><bike>medium</bike><limit>110</limit></h:simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s.version()=="1.0");
-}
-
-/**
- * must return failed because 1.0 != 1.2
- */
-void TestCaseSimpleTypeRestriction::parse_03()
-{
- TestResult s;
- std::string test="<h:simple xmlns:h=\"http://www.webobject.dyndns.org/restriction20\" version=\"1.2\"><bike>Marc</bike><limit>110</limit></h:simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
- std::cout<<" Got Version=("<<s.version()<<") ";
- CPPUNIT_ASSERT( !s.version().compare("1.0") );
-}
-
-/**
- *
- */
-void TestCaseSimpleTypeRestriction::parse_limit()
-{
- Simple_skel s;
- char r[128];
- signed char c=(signed char)60;
- std::string test="<h:simple xmlns:h=\"http://www.webobject.dyndns.org/restriction20\" version=\"1.0\"><bike>Marc</bike><limit>0</limit></h:simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s.limit().content()==0);
-}
-/**
- *
- */
+++ /dev/null
-#ifndef TESTCASE_SIMPLETYPE_H
-#define TESTCASE_SIMPLETYPE_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-#include <include/20restriction.h>
-#include <include/p_20restriction.h>
-
-using namespace restriction20;
-
-class TestCaseSimpleTypeRestriction : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestCaseSimpleTypeRestriction );
- CPPUNIT_TEST(parse_bike);
- CPPUNIT_TEST(parse_version);
- CPPUNIT_TEST_FAIL(parse_03);
- CPPUNIT_TEST(parse_limit);
-
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void setUp();
- protected:
- p_Bikes_skel m_bike;
- p_LimitDecimal_skel m_limit;
- p_Simple_skel m_root;
- std::string m_xmlsourcepath;
- protected:
- void parse_bike();
- void parse_version();
- void parse_03();
- void parse_limit();
-};
-#endif
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/hello"
- xmlns="http://www.webobject.dyndns.org/hello"
- xmlns:h="http://www.webobject.dyndns.org/hello"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <xsd:attribute name='link' type="xsd:byte"/>
-
- <xsd:simpleType name='XMI.description'>
- <xsd:restriction base="xsd:string">
- </xsd:restriction>
- </xsd:simpleType>
-
-
- <xsd:complexType name="XMIfirmware_ref">
- <xsd:choice minOccurs="1" maxOccurs="1">
- <xsd:element name="PkgURL" type='xsd:string'/>
- </xsd:choice>
- <xsd:attribute name='version' type='xsd:string'/>
- <xsd:attribute ref="link"/>
- </xsd:complexType>
-
- <xsd:complexType name="XMIfirmware">
- <xsd:sequence minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="pkgName" type="xsd:string">
- </xsd:element>
- <xsd:element name="pkgVersion" type="xsd:positiveInteger"/>
- <xsd:element name="Download" type="h:XMIfirmware_ref"/>
- <xsd:element name="Update" type="xsd:date"/>
- <xsd:element name="DownloadAndUpdate" type="h:XMIfirmware_ref"/>
- <xsd:element name="State" type="xsd:date"/>
- <xsd:element name="Ext" type="xsd:string"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="XMI_service">
- <xsd:sequence minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="host" type="xsd:string">
- </xsd:element>
- <xsd:element name="port" type="xsd:positiveInteger"/>
- <xsd:element name="lastUpdate" type="xsd:date"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="XMI_content">
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name='name' type="xsd:string"/>
- <xsd:attribute name='amount' type="xsd:double"/>
- <xsd:attribute form='qualified' name='taille' type="xsd:long"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:complexType name='XMI'>
- <xsd:choice>
- <xsd:element name="greeting" type="xsd:string"/>
- <xsd:element form='qualified' name="nbr" type="xsd:decimal"/>
- <xsd:element name="name" type="h:XMI_content" maxOccurs="unbounded"/>
- </xsd:choice>
- <xsd:attribute name='version' type="xsd:string"/>
- </xsd:complexType>
-
- <xsd:element name="XMI" type="h:XMI"/>
-</xsd:schema>
+++ /dev/null
-#include <stdio.h>
-
-#include <string>
-#include <iostream>
-#include <xsd/xsd.h>
-#include <basic.h>
-
-using namespace std;
-
-int main(int argc,char **argv)
-{
- hello::XMI_skel xmi;
- printf("Hello owrd\n");
-
- // xmi.label=string("dede");
- cout<<xmi<<endl;
-
-}
-
+++ /dev/null
-#include <stdio.h>
-
-#include <string>
-#include <iostream>
-#include <sstream>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-
-#include <basic.h>
-#include <p_basic.h>
-
-using namespace std;
-using namespace hello;
-
-class myContent : public virtual p_XMI_content_skel
-{
- public:
- myContent() {std::cout<<"create myContent\n";};
- ~myContent() {};
- protected:
- // virtual void onAttramount(const std::string &v) {std::cout<<" Got ammount : "<<v<<" - "<<m_attr_amount<<std::endl;};
- //virtual void onAttrtaille(const std::string &v) {std::cout<<" Got taille : "<<v<<" - "<<m_attr_taille<<std::endl;};
- // virtual void onAttrname(const std::string &v) {std::cout<<" Got name : "<<v<<std::endl;};
-};
-
-class myXMI : public p_XMI_skel
-{
- public:
- myXMI() {};
- ~myXMI() {};
- // virtual void onElgreeting(std::string &dede) {std::cout<<" XMI Got greeting : "<<dede<<"\n";};
- // virtual void onElname(XMI_content_skel &dede) {std::cout<<" XMI Got name : "<<dede<<"\n";};
- // virtual void onAttrversion(const std::string &v) {std::cout<<" Attribute Version works :"<<v<<"\n";};
-};
-
-/**
- *
- */
-int test1(xsd::parser::ParserBase &p)
-{
- std::string test="<XMI><Test>andre</Test><Test name=\"andre\">Marc</Test></XMI>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(p,"XMI");
- doc.parse(iss1);
-}
-
-
-int test2(xsd::parser::ParserBase &p)
-{
- std::string test="<XMI version=\"1.0\"><name name=\"attr_nm\" amount=\"1.2\">andre</name><greeting>Marc</greeting><nbr>12</nbr></XMI>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(p,"XMI");
- doc.parse(iss1);
-}
-
-int test3(xsd::parser::ParserBase &p)
-{
- std::string test="<XMI xmlns:hm='http://www.webobject.dyndns.org/hello' version=\"1.0\"><name name=\"attr_nm\" amount=\"1.2\" hm:taille=\"5\">andre</name><greeting>Marc</greeting><hm:nbr>12</hm:nbr></XMI>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(p,"XMI");
- doc.parse(iss1);
-}
-
-
-int main(int argc,char **argv)
-{
- XMI_skel xmi;
- //p_XMI_skel pxmi;
- myXMI pxmi;
- //p_XMI_content_skel pxmi_c;
- myContent pxmi_c;
-
- xsd::parser::SimpleElement s,msg,nbr,taille;
- pxmi.name_parser(pxmi_c);
- pxmi.greeting_parser(msg);
- pxmi.nbr_parser(nbr);
-
- printf("\n\tHello world ... test 1\n\n");
- test1(pxmi);
- pxmi.post(xmi);
- printf("\n\tHello world ... test 2\n\n");
- test2(pxmi);
- pxmi.post(xmi);
- std::cout<<"Result="<<xmi<<"\n";
- printf("\n\tHello world ... test 3\n\n");
- test3(pxmi);
-
- test3(pxmi);
- pxmi.post(xmi);
- std::cout<<xmi<<"\n";
-}
-
+++ /dev/null
-#include <iostream>
-
-#include <cppunit/BriefTestProgressListener.h>
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/TestResult.h>
-#include <cppunit/TestResultCollector.h>
-#include <cppunit/TestRunner.h>
-
-
-
-int main(int argc,char **argv)
-{
- // Create the event manager and test controller
- CPPUNIT_NS::TestResult controller;
-
- // Add a listener that colllects test result
- CPPUNIT_NS::TestResultCollector result;
- controller.addListener( &result );
-
- // Add a listener that print dots as test run.
- CPPUNIT_NS::BriefTestProgressListener progress;
- controller.addListener( &progress );
-
- // Add the top suite to the test runner
- CPPUNIT_NS::TestRunner runner;
- runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
- runner.run( controller );
-
- // Print test in a compiler compatible format.
- CPPUNIT_NS::CompilerOutputter outputter( &result, CPPUNIT_NS::stdCOut() );
- outputter.write();
-
- return result.wasSuccessful() ? 0 : 1;
-
-}
+++ /dev/null
-#!/bin/sh
-
-TMP=TCTmpl
-NEWTMPL=${1}
-NAMESPACE=$2
-SRC=$3
-
-cat ${TMP}.h | sed -e "s/%CLASS%/${NEWTMPL}/" -e "s/%NAMESPACE%/${NAMESPACE}/" -e "s/%SRC%/${SRC}/" > ${NEWTMPL}.h
-cat ${TMP}.cpp | sed -e "s/%CLASS%/${NEWTMPL}/" -e "s/%NAMESPACE%/${NAMESPACE}/" -e "s/%SRC%/${SRC}/" > ${NEWTMPL}.cpp
-
-
+++ /dev/null
-<?xml version="1.0" ?>
-<Simple version="1.0">
- <name version="first test" link="A">andre</name>
- <greeting>Marc</greeting>
- <nbr>12</nbr>
- <_int>454</_int>
-</Simple>"
+++ /dev/null
-<?xml version="1.0" ?>
-<Simple version="1.0">
- <name version="first test" link="A">andre</name>
- <greeting>Marc</greeting>
- <nbr>12</nbr>
- <_int>454</_int>
-</Simple>"
+++ /dev/null
-<?xml version="1.0" ?>
-<Simple version="1.0">
- <name version="first test" link="A">andre</name>
- <greeting>Marc</greeting>
- <nbr>12</nbr>
- <_int>454</_int>
-</Simple>"
+++ /dev/null
-<?xml version="1.0" ?>
-<Simple version="1.0">
- <name version="first test" link="A">andre</name>
- <greeting>Marc</greeting>
- <nbr>12</nbr>
- <_int>454</_int>
-</Simple>"
+++ /dev/null
-<?xml version="1.0" ?>
-<Simple version="1.0">
- <name version="first test" link="A">andre</name>
- <greeting>Marc</greeting>
- <nbr>12</nbr>
- <_int>454</_int>
-</Simple>"
+++ /dev/null
-<?xml version="1.0" ?>
-<Simple version="1.0">
- <name version="first test" link="A">andre</name>
- <greeting>Marc</greeting>
- <nbr>12</nbr>
- <_int>454</_int>
-</Simple>"
+++ /dev/null
-<?xml version="1.0" ?>
-<Simple version="1.0">
- <name version="first test" link="A">andre</name>
- <greeting>Marc</greeting>
- <nbr>12</nbr>
- <_int>454</_int>
-</Simple>"
+++ /dev/null
-<?xml version="1.0" ?>
-<Simple version="1.0">
- <name version="first test" link="A">andre</name>
- <greeting>Marc</greeting>
- <nbr>12</nbr>
- <_int>454</_int>
-</Simple>"
+++ /dev/null
-<?xml version="1.0" ?>
-<Simple version="1.0">
- <name version="first test" link="A">andre</name>
- <greeting>Marc</greeting>
- <nbr>12</nbr>
- <_int>454</_int>
-</Simple>"
+++ /dev/null
-<?xml version="1.0" ?>
-<Simple version="1.0">
- <name version="first test" link="A">andre</name>
- <greeting>Marc</greeting>
- <nbr>12</nbr>
- <_int>454</_int>
-</Simple>"
+++ /dev/null
-<?xml version="1.0" ?>
-<Simple version="1.0">
- <name version="first test" link="A">andre</name>
- <greeting>Marc</greeting>
- <nbr>12</nbr>
- <_int>454</_int>
-</Simple>"
+++ /dev/null
-<?xml version="1.0" ?>
-<Simple version="1.0">
- <name version="first test" link="A">andre</name>
- <greeting>Marc</greeting>
- <nbr>12</nbr>
- <_int>454</_int>
-</Simple>"
+++ /dev/null
-<?xml version="1.0" ?>
-<Simple version="1.0">
- <name version="first test" link="A">andre</name>
- <greeting>Marc</greeting>
- <nbr>12</nbr>
- <_int>454</_int>
-</Simple>"
+++ /dev/null
-<?xml version="1.0" ?>
-<Simple version="1.0">
- <name version="first test" link="A">andre</name>
- <greeting>Marc</greeting>
- <nbr>12</nbr>
- <_int>454</_int>
-</Simple>"
+++ /dev/null
-<?xml version="1.0" ?>
-<Simple version="1.0">
- <name version="first test" link="A">andre</name>
- <greeting>Marc</greeting>
- <nbr>12</nbr>
- <_int>454</_int>
-</Simple>"
+++ /dev/null
-<?xml version="1.0" ?>
-<Simple version="1.0">
- <name version="first test" link="A">andre</name>
- <greeting>Marc</greeting>
- <nbr>12</nbr>
- <_int>454</_int>
-</Simple>"
+++ /dev/null
-<?xml version="1.0" ?>
-<Simple version="1.0">
- <name version="first test" link="A">andre</name>
- <greeting>Marc</greeting>
- <nbr>12</nbr>
- <_int>454</_int>
-</Simple>"
+++ /dev/null
-<?xml version="1.0" ?>
-<Simple version="1.0">
- <name version="first test" link="A">andre</name>
- <greeting>Marc</greeting>
- <nbr>12</nbr>
- <_int>454</_int>
-</Simple>"
+++ /dev/null
-<?xml version="1.0" ?>
-<Simple version="1.0">
- <name version="first test" link="A">andre</name>
- <greeting>Marc</greeting>
- <nbr>12</nbr>
- <_int>454</_int>
-</Simple>"
+++ /dev/null
-<?xml version="1.0" ?>
-<Simple version="1.0">
- <name version="first test" link="A">andre</name>
- <greeting>Marc</greeting>
- <nbr>12</nbr>
- <_int>454</_int>
-</Simple>"
+++ /dev/null
-<?xml version="1.0" ?>
-<Simple version="1.0">
- <name version="first test" link="A">andre</name>
- <greeting>Marc</greeting>
- <nbr>12</nbr>
- <_int>454</_int>
-</Simple>"
+++ /dev/null
-<?xml version="1.0" ?>
-<Simple version="1.0">
- <name version="first test" link="A">andre</name>
- <greeting>Marc</greeting>
- <nbr>12</nbr>
- <_int>454</_int>
-</Simple>"
+++ /dev/null
-<?xml version="1.0" ?>
-<Simple version="1.0">
- <name version="first test" link="A">andre</name>
- <greeting>Marc</greeting>
- <nbr>12</nbr>
- <_int>454</_int>
-</Simple>"
+++ /dev/null
-<?xml version="1.0" ?>
-<XMI version="1.0">
- <XmiFirmware version="12" >
- <PkgURL>http://www.dede.home/test1</PkgURL>
- </XmiFirmware>
-</XMI>
+++ /dev/null
-<?xml version="1.0" ?>
-<XMI version="1.0">
- <XmiFirmware version="12" >
- <XmiFirmware version="22" >
- <XmiFirmware version="32" >
- <PkgURL>http://www.dede.home/test3</PkgURL>
- </XmiFirmware>
- <PkgURL>http://www.dede.home/test2</PkgURL>
- </XmiFirmware>
- <PkgURL>http://www.dede.home/test1</PkgURL>
- </XmiFirmware>
-</XMI>
+++ /dev/null
-PROJECT(cwmp)
-
-INCLUDE(${xml-t_SOURCE_DIR}/../../rules/saxon.cmake)
-INCLUDE(${xml-t_SOURCE_DIR}/../../rules/tr069.cmake)
-
-FIND_LIBRARY(EXPAT_LIB expat "/usr/local/lib:/usr/lib")
-
-INCLUDE_DIRECTORIES("${xml-t_SOURCE_DIR}/libxsd/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/")
-INCLUDE_DIRECTORIES("/usr/local/include")
-
-SET(SAXON CACHE STRING "~/Tools/saxon/saxon9.jar")
-SET(XSD2CPP "${CMAKE_CURRENT_SOURCE_DIR}/../../xsd2cpp.xsl")
-SET(CWMP "${xml-t_SOURCE_DIR}/../../data-models/cwmp-1-0.xsd")
-SET(SOAPENV "${xml-t_SOURCE_DIR}/../../data-models/soap-envelope.xsd")
-SET(SOAPENC "${xml-t_SOURCE_DIR}/../../data-models/soap-encoding.xsd")
-
-IF(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/parser/parser.cmake)
- #include(${CMAKE_CURRENT_BINARY_DIR}/parser/parser.cmake)
- #ADD_LIBRARY(xml_parser STATIC ${XML_PARSER})
-ELSE(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/parser/parser.cmake)
-ENDIF(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/parser/parser.cmake)
-
-
-
-
-#
-#
-#
-CWMP2CPP(
-SOURCE ${xml-t_SOURCE_DIR}/../../data-models/cwmp/tr-069-1-0-0.xml
-OUTPUT tr_069
-XSDDIRS "./../\;../../data-models/\;"
-)
-ADD_EXECUTABLE(cwmp_tr069
- ${CMAKE_CURRENT_BINARY_DIR}/parser/tr_069.cpp
-
- )
-
-#
-# Model parser ...
-#
-XSD2CPP(
-SOURCE ${xml-t_SOURCE_DIR}/../../data-models/cwmp-datamodel-1-0.xsd
-OUTPUT cwmp-datamodel-1-0
-DEPS cwmp-deps.xsd
-ROOT-ELEMENT "document"
-XSDDIRS "./../\;../../data-models/\;"
-)
-
-ADD_EXECUTABLE(cwmp-model
- ${CMAKE_CURRENT_BINARY_DIR}/parser/cwmp-datamodel-1-0.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_cwmp-datamodel-1-0.cpp
-
- )
-
-#
-#
-#
-ADD_CUSTOM_COMMAND(
- SOURCE ${CWMP}
- COMMAND java
- ARGS -jar ${SAXON} -s ${CWMP} -xsl:${XSD2CPP} target="release" rootdir="./parser/"
- xsddir="./\;/home/aeb/Devs/home/data-models/\;../../data-models/\;./../\;"
- incdir="/../include" srcdir="./"
- xsddir="./\;./../\;./../../\;./../../data-models/\;"
- OUTPUT
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_cwmp-1-0.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/include/p_cwmp-1-0.h
- COMMENT "Transform ${CWMP}"
- )
-
-ADD_CUSTOM_COMMAND(
- SOURCE ${SOAPENV}
- COMMAND java
- ARGS -jar ${SAXON} -s ${SOAPENV} -xsl:${XSD2CPP} target="release" rootdir="./psoap-e/"
- incdir="/../include" srcdir="./"
- OUTPUT
- ${CMAKE_CURRENT_BINARY_DIR}/psoap-e/p_soap-envelope.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/psoap-e/soap-envelope.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/include/p_soap-envelope.h
- ${CMAKE_CURRENT_BINARY_DIR}/include/soap-envelope.h
- COMMENT "Transform ${SOAPENV}"
- )
-
-ADD_CUSTOM_COMMAND(
- SOURCE ${SOAPENC}
- COMMAND java
- ARGS -jar ${SAXON} -s ${SOAPENC} -xsl:${XSD2CPP} target="release" rootdir="./psoap-e/"
- incdir="/../include" srcdir="./"
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/psoap-e/p_soap-encoding.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/psoap-e/soap-encoding.cpp
- COMMENT "Transform ${SOAPENC}"
- )
-
-#SOURCE ${xml-t_SOURCE_DIR}/../../../data-models/xmi.xsd
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/psoap-e/p_soap-envelope.cpp
- GENERATED)
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/psoap-e/soap-envelope.cpp
- GENERATED)
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/psoap-e/p_soap-encoding.cpp
- GENERATED)
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/psoap-e/soap-encoding.cpp
- GENERATED)
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/parser/p_cwmp-1-0.cpp
- GENERATED)
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/parser/cwmp-1-0.cpp
- GENERATED)
-
-ADD_EXECUTABLE(tcwmp
- ${CMAKE_CURRENT_BINARY_DIR}/psoap-e/p_soap-envelope.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/psoap-e/p_soap-encoding.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/psoap-e/soap-envelope.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/psoap-e/soap-encoding.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_cwmp-1-0.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/cwmp-1-0.cpp
- main.cpp )
-IF(COMMAND cmake_policy)
- cmake_policy(SET CMP0003 NEW)
-ENDIF(COMMAND cmake_policy)
-
-ADD_EXECUTABLE(tparser_cwmp
- main.cpp
- )
-
-ADD_EXECUTABLE(cwmp_test
- main_test.cpp
- TCElements.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/psoap-e/soap-envelope.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/psoap-e/soap-encoding.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/cwmp-1-0.cpp
- )
-TARGET_LINK_LIBRARIES(cwmp_test
- ${CPPUNIT_LIB}
- )
- IF(NOT ${DL_LIB})
- TARGET_LINK_LIBRARIES(cwmp_test ${DL_LIB})
- ENDIF(NOT ${DL_LIB})
-
-IF(WIN32)
-TARGET_LINK_LIBRARIES(tparser_cwmp libxsd ${EXPAT_LIB})
-TARGET_LINK_LIBRARIES(tcwmp libxsd ${EXPAT_LIB})
-ELSE(WIN32)
-TARGET_LINK_LIBRARIES(tparser_cwmp libxsd expat)
-TARGET_LINK_LIBRARIES(tcwmp libxsd ${EXPAT_LIB})
-ENDIF(WIN32)
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-
-#include "TCElements.h"
-
-CPPUNIT_TEST_SUITE_REGISTRATION( TCElements );
-
-/**
- *
- */
-void TCElements::ID()
-{
- std::ostringstream result(std::ostringstream::out);
- ID_sptr id(new ID_skel());
- std::string s("coucou");
- envelope::mustUnderstand_attr_type mu(true);// mu = true;
- (*id)=s;
- id->attr_mustUnderstand(mu);
- ID_elem_type et(id);
- result<<et;
- std::cout<<" Res="<<et<<" ";
- std::string expected("<ID mustUnderstand=\"1\">coucou</ID>");
- CPPUNIT_ASSERT(result.str() == expected);
-}
-
-/**
- *
- *
- */
-void TCElements::HoldRequestsTrue()
-{
- std::ostringstream result(std::ostringstream::out);
- HoldRequests_sptr hr(new HoldRequests_skel);
- envelope::mustUnderstand_attr_type mu(true);// mu = true;
-
- *hr = true;
- hr->attr_mustUnderstand(mu);
- //std::cout<<" Res="<<*hr<<" "<<HoldRequests_elem_type(hr)<<std::endl;
- result << HoldRequests_elem_type(hr);
- std::cout<<" Res="<<result.str()<<" ";
- CPPUNIT_ASSERT(result.str() =="<HoldRequests mustUnderstand=\"1\">true</HoldRequests>");
-}
-/**
- *
- *
- */
-void TCElements::HoldRequestsFalse()
-{
- std::ostringstream result(std::ostringstream::out);
- HoldRequests_sptr hr(new HoldRequests_skel);
- envelope::mustUnderstand_attr_type mu(true);// mu = true;
-
- hr->attr_mustUnderstand(mu);
- *hr = false;
- result << HoldRequests_elem_type(hr);
- std::cout<<" Res="<<result.str();
- CPPUNIT_ASSERT(result.str() =="<HoldRequests mustUnderstand=\"1\">false</HoldRequests>");
-}
-/**
- *
- */
-void TCElements::Fault()
-{
- std::ostringstream result(std::ostringstream::out);
- std::string fs("dede");
- Fault_sptr fault(new Fault_skel);
- FaultCodeType_skel fc;
- fc = 400;
- fault->FaultCode(fc);
- fault->FaultString(fs);
- result << Fault_elem_type(fault);
- std::cout<<" Res="<<result.str()<<" ";
- CPPUNIT_ASSERT(result.str() =="<Fault><FaultCode>400</FaultCode><FaultString>dede</FaultString></Fault>");
-}
-/**
- *
- */
-void TCElements::GetRPCMethods()
-{
- std::string s1("mA");
- std::ostringstream result(std::ostringstream::out);
- GetRPCMethods_sptr grpc(new GetRPCMethods_skel);
- result << GetRPCMethods_elem_type(grpc);
- //std::cout<<" Res="<<result.str()<<" ";
- CPPUNIT_ASSERT(result.str() =="<GetRPCMethods></GetRPCMethods>");
-}
-/**
- *
- */
-void TCElements::GetRPCMethodsResponse()
-{
- std::string at("xsi:string[2]");
- MethodList_skel::string_type s1;
- std::ostringstream result(std::ostringstream::out);
- GetRPCMethodsResponse_sptr grpc(new GetRPCMethodsResponse_skel);
- GetRPCMethodsResponse_skel::MethodList_sptr l(new MethodList_skel);
- s1=std::string("andre"); l->string(s1);
- s1=std::string("eloise"); l->string(s1);
- l->attr_arrayType(at);
- grpc->MethodList(l);
- result << GetRPCMethodsResponse_elem_type(grpc);
- //std::cout<<" Res1="<<result.str()<<std::endl;
- CPPUNIT_ASSERT(result.str()=="<GetRPCMethodsResponse><MethodList arrayType=\"xsi:string[2]\"><string>andre</string><string>eloise</string></MethodList></GetRPCMethodsResponse>");
-}
-/**
- *
- */
-void TCElements::SetParameterValues()
-{
- std::ostringstream result(std::ostringstream::out);
- SetParameterValues_sptr grpc(new SetParameterValues_skel);
-
- SetParameterValues_skel::ParameterList_sptr lst(
- new ParameterValueList_skel);
- grpc->ParameterList(lst);
-
- result << SetParameterValues_elem_type(grpc);
- std::cout<<" Res1="<<result.str()<<std::endl;
-}
-/**
- *
- */
-void TCElements::GetParameterValues()
-{
- std::ostringstream result(std::ostringstream::out);
- GetParameterValues_sptr grpc(new GetParameterValues_skel);
- result << GetParameterValues_elem_type(grpc);
- std::cout<<" Res1="<<result.str()<<std::endl;
-}
-/**
- *
- */
-void TCElements::GetParameterNames()
-{
- std::ostringstream result(std::ostringstream::out);
- GetParameterNames_sptr grpc(new GetParameterNames_skel);
-// GetParameterNames_skel::ParameterPath_sptr(new GetParameterNames_skel:ParameterPath_type());
-
- result << GetParameterNames_elem_type(grpc);
- std::cout<<" Res1="<<result.str()<<std::endl;
-}
-/**
- *
- */
-void TCElements::GetParameterNamesResponse()
-{
-}
-/**
- *
- */
-void TCElements::SetParameterAttributes()
-{
-}
+++ /dev/null
-#ifndef TCELEMENTS_H
-#define TCELEMENTS_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-
-#include <xmlSerialize.h>
-#include "include/cwmp-1-0.h"
-
-using namespace urndslforumorgcwmp10;
-
-class TCElements : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TCElements );
- CPPUNIT_TEST( ID );
- CPPUNIT_TEST( HoldRequestsTrue );
- CPPUNIT_TEST( HoldRequestsFalse );
- CPPUNIT_TEST( Fault );
- CPPUNIT_TEST( GetRPCMethods );
- CPPUNIT_TEST( GetRPCMethodsResponse );
- CPPUNIT_TEST( SetParameterValues );
- CPPUNIT_TEST( GetParameterValues );
- CPPUNIT_TEST( GetParameterNames );
- CPPUNIT_TEST( GetParameterNamesResponse );
- CPPUNIT_TEST( SetParameterAttributes );
- CPPUNIT_TEST_SUITE_END();
-
- public:
- protected:
- void ID();
- void HoldRequestsTrue();
- void HoldRequestsFalse();
- void Fault();
- void GetRPCMethods();
- void GetRPCMethodsResponse();
- void SetParameterValues();
- void GetParameterValues();
- void GetParameterNames();
- void GetParameterNamesResponse();
- void SetParameterAttributes();
-};
-
-#endif
-
+++ /dev/null
-#include <stdio.h>
-#include <iostream>
-/*vim:et:sw=2:ts=2:bs=2*/
-
-int main(int argc,char **argv)
-{
-
-}
+++ /dev/null
-#include <iostream>
-
-#include <cppunit/BriefTestProgressListener.h>
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/TestResult.h>
-#include <cppunit/TestResultCollector.h>
-#include <cppunit/TestRunner.h>
-
-
-
-int main(int argc,char **argv)
-{
- // Create the event manager and test controller
- CPPUNIT_NS::TestResult controller;
-
- // Add a listener that colllects test result
- CPPUNIT_NS::TestResultCollector result;
- controller.addListener( &result );
-
- // Add a listener that print dots as test run.
- CPPUNIT_NS::BriefTestProgressListener progress;
- controller.addListener( &progress );
-
- // Add the top suite to the test runner
- CPPUNIT_NS::TestRunner runner;
- runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
- runner.run( controller );
-
- // Print test in a compiler compatible format.
- CPPUNIT_NS::CompilerOutputter outputter( &result, CPPUNIT_NS::stdCOut() );
- outputter.write();
-
- return result.wasSuccessful() ? 0 : 1;
-
-}
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/element01"
- xmlns:h="http://www.webobject.dyndns.org/element01"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
-
- <xsd:simpleType name='Vector'>
- <xsd:restriction base='xsd:long'>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:complexType name='Simple'>
- <xsd:sequence>
- <xsd:element name='a' type='xsd:string'/>
- <xsd:element name='b' type='h:Vector'/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:element name='simple' type='h:Simple'/>
-</xsd:schema>
-
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/element02"
- xmlns:h="http://www.webobject.dyndns.org/element02"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
-
-
-
- <xsd:element name='simple' >
- <xsd:complexType>
- <xsd:choice>
- <xsd:element name='a' type='h:Matrix'/>
- <xsd:element name='b' type='h:Vector'/>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:complexType name='Matrix'>
- <xsd:sequence>
- <xsd:element name='a' type='xsd:string'/>
- <xsd:element name='b' type='h:Vector'/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:simpleType name='Vector'>
- <xsd:restriction base='xsd:long'>
- </xsd:restriction>
- </xsd:simpleType>
-</xsd:schema>
-
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/element02"
- xmlns:h="http://www.webobject.dyndns.org/element02"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
-
-
-
- <xsd:element name='simple' >
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name='a' type='h:Matrix'/>
- <xsd:element name='b' type='h:Vector'/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:complexType name='Matrix'>
- <xsd:sequence>
- <xsd:element name='a' type='xsd:string'/>
- <xsd:element name='b' type='h:Vector'/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:simpleType name='Vector'>
- <xsd:restriction base='xsd:long'>
- </xsd:restriction>
- </xsd:simpleType>
-</xsd:schema>
-
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/element02"
- xmlns:h="http://www.webobject.dyndns.org/element02"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
-
-
-
- <xsd:element name='simple' >
- <xsd:complexType>
- <xsd:all>
- <xsd:element name='a' type='h:Matrix'/>
- <xsd:element name='b' type='h:Vector'/>
- </xsd:all>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:complexType name='Matrix'>
- <xsd:sequence>
- <xsd:element name='a' type='xsd:string'/>
- <xsd:element name='b' type='h:Vector'/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:simpleType name='Vector'>
- <xsd:restriction base='xsd:long'>
- </xsd:restriction>
- </xsd:simpleType>
-</xsd:schema>
-
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/element02"
- xmlns:h="http://www.webobject.dyndns.org/element02"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
-
-
-
- <xsd:element name='simple' >
- <xsd:complexType>
- <xsd:group ref="h:gSphere">
- </xsd:group>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:group name="gSphere">
- <xsd:sequence>
- <xsd:element name='a' type='h:Matrix'/>
- <xsd:element name='b' type='h:Vector'/>
- </xsd:sequence>
- </xsd:group>
-
- <xsd:complexType name='Matrix'>
- <xsd:sequence>
- <xsd:element name='a' type='xsd:string'/>
- <xsd:element name='b' type='h:Vector'/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:simpleType name='Vector'>
- <xsd:restriction base='xsd:long'>
- </xsd:restriction>
- </xsd:simpleType>
-</xsd:schema>
-
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/element06"
- xmlns:h="http://www.webobject.dyndns.org/element06"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
-
-
-
- <xsd:element name='simple' >
- <xsd:complexType>
- <xsd:choice>
- <xsd:element ref='h:a'/>
- <xsd:element ref='h:b'/>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name='a'>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name='as' type='xsd:string'/>
- <xsd:element name='bv' type='h:Vector'/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name='b'>
- <xsd:simpleType>
- <xsd:restriction base='xsd:long'>
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
-
- <xsd:simpleType name='Vector'>
- <xsd:restriction base='xsd:long'>
- </xsd:restriction>
- </xsd:simpleType>
-</xsd:schema>
-
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/element07"
- xmlns:h="http://www.webobject.dyndns.org/element07"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
-
-
-
-
- <xsd:element name='simple' >
- <xsd:complexType>
- <xsd:choice>
- <xsd:element name='a' type='h:Cube'/>
- <xsd:element name='sphere' type='h:Sphere'/>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:complexType name='Cube'>
- <xsd:complexContent>
- <xsd:extension base='h:Node'>
- <xsd:sequence>
- <xsd:element name='a' type='xsd:string'/>
- <xsd:element name='b' type='h:Vector'/>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
-
- <xsd:complexType name='Node' abstract='yes'>
- <xsd:attribute name='fake' type='xsd:string'/>
- </xsd:complexType>
-
- <xsd:complexType name='Sphere'>
- <xsd:complexContent>
- <xsd:extension base='h:Node'>
- <xsd:sequence>
- <xsd:element name='p' type='h:Point'/>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name='Point'>
- <xsd:attributeGroup ref='h:Coordonnee'/>
- </xsd:complexType>
-
- <xsd:complexType name='Vector'>
- <xsd:attributeGroup ref='h:Coordonnee'/>
- </xsd:complexType>
-
- <xsd:attributeGroup name='Coordonnee'>
- <xsd:attribute name='x' type='xsd:int'/>
- <xsd:attribute name='y' type='xsd:int'/>
- <xsd:attribute name='z' type='xsd:int'/>
- </xsd:attributeGroup>
-</xsd:schema>
-
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/element08"
- xmlns:h="http://www.webobject.dyndns.org/element08"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
-
-
-
-
- <xsd:element name='simple' >
- <xsd:complexType>
- <xsd:complexContent>
- <xsd:extension base='SceneGraphStructureNodeType'>
- <xsd:choice>
- <xsd:element name='a' type='h:Cube'/>
- <xsd:element ref="h:Scene"/>
- </xsd:choice>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:complexType name='Cube'>
- <xsd:complexContent>
- <xsd:extension base='h:Node'>
- <xsd:sequence>
- <xsd:element name='a' type='xsd:string'/>
- <xsd:element name='b' type='h:Vector'/>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:element name='cube' type='h:Cube'/>
-
- <xsd:complexType name='Node' abstract='yes'>
- <xsd:attribute name='fake' type='xsd:string'/>
- </xsd:complexType>
- <xsd:element name='sphere' type='h:Sphere'/>
-
- <xsd:complexType name='Sphere'>
- <xsd:complexContent>
- <xsd:extension base='h:Node'>
- <xsd:sequence>
- <xsd:element name='p' type='h:Point'/>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name='Point'>
- <xsd:attributeGroup ref='h:Coordonnee'/>
- </xsd:complexType>
-
- <xsd:complexType name='Vector'>
- <xsd:attributeGroup ref='h:Coordonnee'/>
- </xsd:complexType>
-
- <xsd:attributeGroup name='Coordonnee'>
- <xsd:attribute name='x' type='xsd:int'/>
- <xsd:attribute name='y' type='xsd:int'/>
- <xsd:attribute name='z' type='xsd:int'/>
- </xsd:attributeGroup>
-
- <xsd:element name="Scene">
- <xsd:complexType mixed="false">
- <xsd:complexContent mixed="false">
- <xsd:extension base="SceneGraphStructureNodeType">
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:group ref="h:ChildContentModelCore"/>
- <xsd:group ref="h:GroupingNodeChildContentModel"/>
- </xsd:choice>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:group name="ChildContentModelCore">
- <xsd:choice>
- <!-- ChildContentModelCore omitted here since included in X3DNode type definition -->
- <xsd:group ref="ChildContentModelInterchange" minOccurs="0"/>
- <xsd:group ref="ChildContentModelInteractive" minOccurs="0"/>
- <xsd:group ref="ChildContentModelImmersive" minOccurs="0"/>
- <!--
- <xs:group ref="ChildContentModelFull" minOccurs="0"/>
- <xs:group ref="ChildContentModelDIS" minOccurs="0"/>
- <xs:group ref="ChildContentModelGeoSpatial" minOccurs="0"/>
- <xs:group ref="ChildContentModelHumanoidAnimation" minOccurs="0"/>
- <xs:group ref="ChildContentModelNurbs" minOccurs="0"/>
- <xs:group ref="ChildContentModelProtoInstance" minOccurs="0"/>
- -->
- </xsd:choice>
- </xsd:group>
-
- <xsd:group name='ChildContentModelInterchange'>
- <xsd:choice>
- <xsd:sequence>
- <xsd:element ref='h:sphere'/>
- </xsd:sequence>
- </xsd:choice>
- </xsd:group>
-
- <xsd:group name='ChildContentModelInteractive'>
- <xsd:choice>
- <xsd:sequence>
- <xsd:element ref='h:cube'/>
- </xsd:sequence>
- </xsd:choice>
- </xsd:group>
-
- <xsd:group name="GroupingNodeChildContentModel">
- <xsd:sequence>
- <xsd:element ref='h:cube'/>
- </xsd:sequence>
- </xsd:group>
-
-
-
- <xsd:group name='ChildContentModelImmersive'>
- <xsd:choice>
- <xsd:sequence>
- <xsd:element ref='h:cube'/>
- </xsd:sequence>
- </xsd:choice>
- </xsd:group>
-
-
- <xsd:complexType name="SceneGraphStructureNodeType" abstract="false" mixed="false">
- </xsd:complexType>
-</xsd:schema>
-
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- Try to used this schema for examples and tests
--->
-<xsd:schema
- targetNamespace="http://www.webobject.dyndns.org/element08"
- xmlns:h="http://www.webobject.dyndns.org/element08"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified">
-
-
-
-
-
- <xsd:element name='simple' >
- <xsd:complexType>
- <xsd:complexContent>
- <xsd:extension base='SceneGraphStructureNodeType'>
- <xsd:choice>
- <!--
- <xsd:element ref='h:Cube'/>
- -->
- <xsd:element ref="h:Scene"/>
- </xsd:choice>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name='Cube'>
- <xsd:complexType>
- <xsd:complexContent>
- <xsd:extension base='h:Node'>
- <xsd:sequence>
- <xsd:element name='a' type='xsd:string'/>
- <xsd:element name='b' type='h:Vector'/>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
-
-
- <xsd:complexType name='Node' abstract='yes'>
- <xsd:attribute name='fake' type='xsd:string'/>
- </xsd:complexType>
- <xsd:element name='Sphere'>
- <xsd:complexType>
- <xsd:complexContent>
- <xsd:extension base='h:Node'>
- <xsd:sequence>
- <xsd:element name='p' type='h:Point'/>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:complexType name='Point'>
- <xsd:attributeGroup ref='h:Coordonnee'/>
- </xsd:complexType>
-
- <xsd:complexType name='Vector'>
- <xsd:attributeGroup ref='h:Coordonnee'/>
- </xsd:complexType>
-
- <xsd:attributeGroup name='Coordonnee'>
- <xsd:attribute name='x' type='xsd:int'/>
- <xsd:attribute name='y' type='xsd:int'/>
- <xsd:attribute name='z' type='xsd:int'/>
- </xsd:attributeGroup>
-
- <xsd:element name="Scene">
- <xsd:complexType mixed="false">
- <xsd:complexContent mixed="false">
- <xsd:extension base="SceneGraphStructureNodeType">
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:group ref="h:ChildContentModelCore"/>
- <xsd:group ref="h:GroupingNodeChildContentModel"/>
- </xsd:choice>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:group name="ChildContentModelCore">
- <xsd:choice>
- <!-- ChildContentModelCore omitted here since included in X3DNode type definition -->
- <xsd:group ref="ChildContentModelInterchange" minOccurs="0"/>
- <xsd:group ref="ChildContentModelInteractive" minOccurs="0"/>
- <xsd:group ref="ChildContentModelImmersive" minOccurs="0"/>
- <!--
- <xs:group ref="ChildContentModelFull" minOccurs="0"/>
- <xs:group ref="ChildContentModelDIS" minOccurs="0"/>
- <xs:group ref="ChildContentModelGeoSpatial" minOccurs="0"/>
- <xs:group ref="ChildContentModelHumanoidAnimation" minOccurs="0"/>
- <xs:group ref="ChildContentModelNurbs" minOccurs="0"/>
- <xs:group ref="ChildContentModelProtoInstance" minOccurs="0"/>
- -->
- </xsd:choice>
- </xsd:group>
-
- <xsd:group name="GroupingNodeChildContentModel">
- <xsd:sequence>
- <xsd:element ref='h:Cube'/>
- </xsd:sequence>
- </xsd:group>
-
- <xsd:group name='ChildContentModelInterchange'>
- <xsd:choice>
- <xsd:sequence>
- <xsd:element ref='h:Sphere'/>
- </xsd:sequence>
- </xsd:choice>
- </xsd:group>
-
- <xsd:group name='ChildContentModelInteractive'>
- <xsd:choice>
- <xsd:sequence>
- <xsd:element ref='h:Cube'/>
- <xsd:choice>
- <xsd:choice>
- <xsd:group ref='ChildContentModelInterchange'/>
- </xsd:choice>
- <xsd:element ref='h:Cube'/>
- </xsd:choice>
- </xsd:sequence>
- </xsd:choice>
- </xsd:group>
-
-
- <xsd:group name='ChildContentModelImmersive'>
- <xsd:choice>
- <xsd:sequence>
- <xsd:element ref='h:Cube'/>
- </xsd:sequence>
- </xsd:choice>
- </xsd:group>
-
-
- <xsd:complexType name="SceneGraphStructureNodeType" abstract="false" mixed="false">
- </xsd:complexType>
-</xsd:schema>
-
+++ /dev/null
-PROJECT(dependencies)
-
-ENABLE_TESTING()
-
-INCLUDE(${xml-t_SOURCE_DIR}/../../rules/saxon.cmake)
-
-FIND_LIBRARY(EXPAT_LIB expat "/usr/local/lib:/usr/lib")
-FIND_LIBRARY(CPPUNIT_LIB cppunit PATHS /usr/local/lib /usr/lib /Users/aeb/External/lib/ /Users/aeb/External/bin/)
-FIND_LIBRARY(DL_LIB ltdl "/lib:/usr/local/lib:/usr/lib")
-
-INCLUDE_DIRECTORIES("${xml-t_SOURCE_DIR}/libxsd/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/include")
-INCLUDE_DIRECTORIES(".")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}")
-INCLUDE_DIRECTORIES("/usr/local/include")
-
-SET(SAXON CACHE STRING "~/Tools/saxon/saxon9.jar")
-#SET(XSD2CPP "${CMAKE_CURRENT_SOURCE_DIR}/../../xsd2cpp.xsl")
-SET(XMI "${tbasic_SOURCE_DIR}/basic.xsd")
-
-MACRO(TESTCASE)
- PARSE_ARGUMENTS(THIS_TC
- "SOURCE;XSD;ROOT-ELEMENT;XSDDIRS;NAMESPACE;DEPENDS;OUTPUT;TEST;DEPS"
- "DEBUG"
- ${ARGN}
- )
-
- IF (NOT "${THIS_TC_ROOT-ELEMENT}" STREQUAL "")
- SET(THIS_TC_ROOT-ELEMENT "simple")
- ELSE(NOT "${THIS_TC_ROOT-ELEMENT}" STREQUAL "")
- ENDIF(NOT "${THIS_TC_ROOT-ELEMENT}" STREQUAL "")
-
-
- IF (NOT "${THIS_TC_XSD}" STREQUAL "")
- IF (NOT "${THIS_TC_DEPS}" STREQUAL "")
- XSD2CPP(
- SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/${THIS_TC_XSD}.xsd
- OUTPUT ${THIS_TC_XSD}
- DEPS ${THIS_TC_DEPS}
- ROOT-ELEMENT ${THIS_TC_ROOT-ELEMENT}
- XSDDIRS "./../\;../../data-models/\;"
- )
- ELSE(NOT "${THIS_TC_DEPS}" STREQUAL "")
- XSD2CPP(
- SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/${THIS_TC_XSD}.xsd
- OUTPUT ${THIS_TC_XSD}
- ROOT-ELEMENT ${THIS_TC_ROOT-ELEMENT}
- XSDDIRS "./../\;../../data-models/\;"
- )
- ENDIF(NOT "${THIS_TC_DEPS}" STREQUAL "")
- ENDIF (NOT "${THIS_TC_XSD}" STREQUAL "")
-
-
-
- IF (NOT "${THIS_TC_TEST}" STREQUAL "")
- ADD_TEST(${THIS_TC_TEST} ${THIS_TC_OUTPUT})
- ENDIF (NOT "${THIS_TC_TEST}" STREQUAL "")
- ADD_EXECUTABLE(${THIS_TC_OUTPUT}
- ${THIS_TC_SOURCE}
- ${CMAKE_CURRENT_BINARY_DIR}/parser/${THIS_TC_XSD}.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_${THIS_TC_XSD}.cpp
- # ${CMAKE_CURRENT_BINARY_DIR}/parser/p_01basic.cpp
- # ${CMAKE_CURRENT_BINARY_DIR}/parser/01basic.cpp
- # TestCaseSimpleType.cpp
- main_test.cpp
- )
- TARGET_LINK_LIBRARIES(${THIS_TC_OUTPUT}
- libxsd
- ${EXPAT_LIB}
- ${CPPUNIT_LIB}
- )
- IF (${THIS_TC_DEBUG})
- # DEbug versiob
- ADD_EXECUTABLE(${THIS_TC_OUTPUT}d
- ${THIS_TC_SOURCE}
- main_test.cpp
- )
- SET_TARGET_PROPERTIES(${THIS_TC_OUTPUT}d
- PROPERTIES
- CLEAN_DIRECT_OUTPUT 1
- COMPILE_FLAGS "-DDEBUG -DPARSER_DEBUG=1"
- )
- TARGET_LINK_LIBRARIES(${THIS_TC_OUTPUT}d xsdd
- ${CPPUNIT_LIB}
- ${EXPAT_LIB})
-
- ENDIF (${THIS_TC_DEBUG})
- IF(NOT ${DL_LIB})
- TARGET_LINK_LIBRARIES(${THIS_TC_OUTPUT} ${DL_LIB})
- IF (${THIS_TC_DEBUG})
- TARGET_LINK_LIBRARIES(${THIS_TC_OUTPUT}d ${DL_LIB})
- ENDIF (${THIS_TC_DEBUG})
- ENDIF(NOT ${DL_LIB})
-
-ENDMACRO(TESTCASE)
-
-#
-# Test Stuff
-#
-IF(NOT ${CPPUNIT_LIB})
-
- TESTCASE(
- XSD 01element
- OUTPUT element01
- ROOT-ELEMENT simple
- DEPS 01element_deps.xml
- # SOURCE ${CMAKE_CURRENT_BINARY_DIR}/parser/01element.cpp
- # ${CMAKE_CURRENT_BINARY_DIR}/parser/p_01element.cpp
- TEST TestSimpleTypeRestriction
- )
-
- TESTCASE(
- XSD 02element
- OUTPUT element02
- ROOT-ELEMENT simple
- DEPS 02element_deps.xml
- TEST ElementChoice
- )
- TESTCASE(
- XSD 03element
- OUTPUT element03
- ROOT-ELEMENT simple
- DEPS 03element_deps.xml
- TEST ElementSequence
- )
- TESTCASE(
- XSD 04element
- OUTPUT element04
- ROOT-ELEMENT simple
- DEPS 04element_deps.xml
- TEST ElementAll
- )
- TESTCASE(
- XSD 05element
- OUTPUT element05
- ROOT-ELEMENT simple
- DEPS 05element_deps.xml
- TEST ElementGroup
- )
-
- TESTCASE(
- XSD 06element
- OUTPUT element06
- ROOT-ELEMENT simple
- DEPS 06element_deps.xml
- TEST ElementRefs
- )
-
- TESTCASE(
- XSD 07element
- OUTPUT element07
- ROOT-ELEMENT simple
- DEPS 07element_deps.xml
- TEST ElementRefs
- )
-
- TESTCASE(
- XSD 08element
- OUTPUT element08
- ROOT-ELEMENT simple
- DEPS 08element_deps.xml
- TEST ElementRefs
- )
- TESTCASE(
- XSD 09element
- OUTPUT element09
- ROOT-ELEMENT simple
- DEPS 09element_deps.xml
- TEST ElementRefs
- )
-
- MESSAGE("Found Library ${DL_LIB}")
-
-
-ELSE(NOT ${CPPUNIT_LIB})
- MESSAGE("I do not have cppunit library ${CPPUNIT_LIB} ")
-ENDIF(NOT ${CPPUNIT_LIB})
-
-
-#
-# Install stuff
-#
+++ /dev/null
-#include <iostream>
-
-#include <cppunit/BriefTestProgressListener.h>
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/TestResult.h>
-#include <cppunit/TestResultCollector.h>
-#include <cppunit/TestRunner.h>
-
-
-
-int main(int argc,char **argv)
-{
- // Create the event manager and test controller
- CPPUNIT_NS::TestResult controller;
-
- // Add a listener that colllects test result
- CPPUNIT_NS::TestResultCollector result;
- controller.addListener( &result );
-
- // Add a listener that print dots as test run.
- CPPUNIT_NS::BriefTestProgressListener progress;
- controller.addListener( &progress );
-
- // Add the top suite to the test runner
- CPPUNIT_NS::TestRunner runner;
- runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
- runner.run( controller );
-
- // Print test in a compiler compatible format.
- CPPUNIT_NS::CompilerOutputter outputter( &result, CPPUNIT_NS::stdCOut() );
- outputter.write();
-
- return result.wasSuccessful() ? 0 : 1;
-
-}
+++ /dev/null
-PROJECT(ics_notifier)
-
-FIND_LIBRARY(EXPAT_LIB expat "/usr/local/lib:/usr/lib")
-INCLUDE_DIRECTORIES("${xml-t_SOURCE_DIR}/libxsd/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/")
-INCLUDE_DIRECTORIES("/usr/local/include")
-
-INCLUDE(${xml-t_SOURCE_DIR}/../../rules/saxon.cmake)
-INCLUDE(${xml-t_SOURCE_DIR}/../../rules/wsdl.cmake)
-
-#SET(SAXON CACHE STRING "~/Tools/saxon/saxon9.jar")
-#SET(WSDL2 "${CMAKE_CURRENT_SOURCE_DIR}/../../wsdl2.xsl")
-#SET(XSD2CPP "${CMAKE_CURRENT_SOURCE_DIR}/../../xsd2cpp.xsl")
-
-SET(MODEL "${xml-t_SOURCE_DIR}/../../data-models/alcatel-lucent/ics70/")
-
-SET(XMI "${xml-t_SOURCE_DIR}/../../data-models/soap-envelope.xsd")
-SET(SOAPENC "${xml-t_SOURCE_DIR}/../../data-models/soap-encoding.xsd")
-SET(ICSNS "${xml-t_SOURCE_DIR}/../../data-models/oxo_wsdl/IcsNotifier/NotifierService.xsd")
-SET(ICSSF
- "${xml-t_SOURCE_DIR}/../../data-models/oxo_wsdl/IcsNotifier/SubscriptionFilter.xsd")
-SET(ICSNOTIFIER "${xml-t_SOURCE_DIR}/../../data-models/oxo_wsdl/IcsNotifier/IcsNotifier.wsdl")
-SET(ICSAPI
- "${xml-t_SOURCE_DIR}/../../data-models/alcatel-lucent/ics70/IcsApiFramework.wsdl")
-SET(WSDL_TYPES "NotifierService")
-
-
-#
-# Try to manage wsdl....
-#
-ADD_CUSTOM_COMMAND(
- SOURCE ${ICSNOTIFIER}
- COMMAND java
- ARGS -jar ${SAXON} -s ${ICSNOTIFIER} -xsl:${WSDL2} rootdir="./parser/"
- target="soap" output="parser/IcsNotifierService"
- incdir="./include" srcdir="./parser" types="${WSDL_TYPES}.h" root-element="Envelope"
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/parser/IcsNotifierService.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/include/IcsNotifierService.h
- COMMENT "Transform wsdl to soap IcsNotifierService.cpp and h"
- )
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/parser/IcsNotifierService.cpp
- GENERATED)
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/include/IcsNotifierService.h
- GENERATED)
-
-WSDL2CPP(
- SOURCE ${ICSAPI}
- OUTPUT IcsApiFrameworkService
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/parser/ApiFrameworkService.cpp
- )
-#
-# Handler xsds
-#
-
-ADD_CUSTOM_COMMAND(
- SOURCE ${ICSNOTIFIER}
- COMMAND java
- ARGS -jar ${SAXON} -s ${ICSNOTIFIER} -xsl:${WSDL2} rootdir="./parser/"
- target="soap" output="icsNotifier"
- incdir="./include" srcdir="./parser" types="${WSDL_TYPES}.h" root-element="Envelope"
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/icsNotifier.cpp
- COMMENT "Transform wsdl to soap service icsNotifier.cpp"
- )
-
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/icsNotifier.cpp
- GENERATED)
-
-#
-#
-#
-XSD2CPP(
- SOURCE ${ICSNS}
- OUTPUT NotifierService
- ROOT-ELEMENT Envelope
- NAMEPSACE test/ics_notifier/nsmap.xml
- XSDDIRS "./\;/home/aeb/Devs/home/data-models/oxo_wsdl/\;../../data-models/oxo_wsdl/\;./../\;"
- DEPENDS ${ICSNS}
- ${CMAKE_CURRENT_BINARY_DIR}/parser/SubscriptionFilter.cpp
- )
-
-XSD2CPP(
- SOURCE ${MODEL}/ApiFrameworkService.xsd
- OUTPUT ApiFrameworkService
- ROOT-ELEMENT
- NAMEPSACE test/ics_notifier/nsmap.xml
- XSDDIRS "./\;/home/aeb/Devs/home/data-models/oxo_wsdl/\;../../data-models/oxo_wsdl/\;./../\;"
- DEPENDS ${ICSNS}
- )
-
-XSD2CPP_BOTH(${ICSSF} SubscriptionFilter "" "./../\;"
- "tests/ics_notifier/nsmap.xml")
-
-XSD2CPP_BOTH(${XMI} soap-envelope "" "./../\;"
- "tests/ics_notifier/nsmap.xml")
-#
-
-XSD2CPP_BOTH(${SOAPENC} soap-encoding "" "./../\;"
- "tests/ics_notifier/nsmap.xml")
-
-
-IF(COMMAND cmake_policy)
- cmake_policy(SET CMP0003 NEW)
-ENDIF(COMMAND cmake_policy)
-
-
-ADD_EXECUTABLE(icsns_soap_serialize
- main_test.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/NotifierService.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/IcsNotifierService.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/soap-envelope.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/soap-encoding.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/SubscriptionFilter.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/IcsApiFrameworkService.cpp
- TCSoapNotifier.cpp
- )
-
-TARGET_LINK_LIBRARIES(icsns_soap_serialize libxsd ${EXPAT_LIB}
- ${CPPUNIT_LIB}
- ${DL_LIB}
- )
-
-ADD_EXECUTABLE(icsns_test_serialize
- main_test.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/soap-envelope.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/soap-encoding.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/NotifierService.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/SubscriptionFilter.cpp
- TCNotifier.cpp
- )
-
-TARGET_LINK_LIBRARIES(icsns_test_serialize libxsd ${EXPAT_LIB}
- ${CPPUNIT_LIB}
- ${DL_LIB}
- )
-
-ADD_EXECUTABLE(icsns_test_parse
- main_test.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/SubscriptionFilter.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_SubscriptionFilter.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/NotifierService.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_NotifierService.cpp
- TCParseSubscribe.cpp
- )
-
-TARGET_LINK_LIBRARIES(icsns_test_parse libxsd ${EXPAT_LIB}
- ${CPPUNIT_LIB}
- ${DL_LIB}
- )
-
-
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-
-
-#include "TCNotifier.h"
-#include "SubscriptionFilter.h"
-#include "soap-encoding.h"
-#include "soap-envelope.h"
-
-
-CPPUNIT_TEST_SUITE_REGISTRATION( TCNotifier );
-
-using namespace subscriptionFilter;
-using namespace envelope;
-/**
- *
- */
-void TCNotifier::subscribe()
-{
- std::ostringstream result(std::ostringstream::out);
- subscribeRequest_sptr id(new subscribeRequest_skel());
- SubscriptionFilter_skel::selector_sptr selector( new Selector_skel());
- filter_sptr filter(new SubscriptionFilter_skel());
-
- std::string name("onOne");
- std::string nu("http://localhost/ic70");
- std::string sid("12");
- selector->name(name);
- selector->id(sid);
- selector->family(nu);
- filter->selector(selector);
- id->fwSessionId(sid);
- id->notificationUrl(nu);
- id->filter(filter);
- id->expires(new int(200));
- result<<*id;
- std::cout<<" Res="<<result.str()<<" "<<std::endl;
- Envelope_sptr e(new Envelope_skel());
- Body_sptr b(new Body_skel());
- b->any(&*id);
- e->Body(b);
- std::cout<<" Complete E="<<Envelope_elem_type(e)<<" "<<std::endl;
-
- std::string expected("<ID soapenv:mustUnderstand=\"1\">coucou</ID>");
- CPPUNIT_ASSERT(result.str() == expected);
-}
-
-/**
- *
- *
- */
-void TCNotifier::unsubscribe()
-{
- std::ostringstream result(std::ostringstream::out);
- unsubscribeRequest_sptr hr(new unsubscribeRequest_skel);
-
- //std::cout<<" Res="<<*hr<<" "<<HoldRequests_elem_type(hr)<<std::endl;
- result << *hr;
- std::cout<<" Res="<<result.str()<<std::endl;
- //CPPUNIT_ASSERT(result.str() =="<HoldRequests>true</HoldRequests>");
- result.seekp(0);
- //std::cout<<" Res1="<<result.str()<<std::endl;
- //CPPUNIT_ASSERT(result.str() =="<HoldRequests mustUnderstand=\"1\">false</HoldRequests>");
-}
+++ /dev/null
-#ifndef TCELEMENTS_H
-#define TCELEMENTS_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-
-#include <xmlSerialize.h>
-#include "include/NotifierService.h"
-
-using namespace notifierServiceSchema;
-
-class TCNotifier : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TCNotifier );
- CPPUNIT_TEST( subscribe );
- CPPUNIT_TEST( unsubscribe );
- CPPUNIT_TEST_SUITE_END();
-
- public:
- protected:
- void subscribe();
- void unsubscribe();
-};
-
-#endif
-
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-
-
-#include "TCParseSubscribe.h"
-#include "SubscriptionFilter.h"
-#include "p_SubscriptionFilter.h"
-#include "NotifierService.h"
-#include "p_NotifierService.h"
-
-#include "soap-encoding.h"
-#include "soap-envelope.h"
-
-
-CPPUNIT_TEST_SUITE_REGISTRATION( TCParseSubscribe );
-
-using namespace notifierServiceSchema;
-using namespace subscriptionFilter;
-using namespace envelope;
-/**
- *
- */
-void TCParseSubscribe::subscribe()
-{
-
- std::string test="<filter xmlns=\"http://www.alcatel-lucent.com/wsp/ns/2009/10/15/ics/subscriptionFilter\"><selector><id>100</id><name>onMakeCall</name></selector><selector><name>onCallModified</name></selector></filter>";
- std::istringstream iss1(test,std::istringstream::in);
-
- p_SubscriptionFilter_skel filter;
- SubscriptionFilter_skel r;
- p_Selector_skel sel;
- ::xsd::parser::SimpleElement name,id,family,org;
- sel.name_parser(name);
- sel.id_parser(id);
- sel.family_parser(family);
- filter.selector_parser(sel);
-
- xsd::parser::expat::Document doc(filter,"filter");
- doc.parse(iss1);
- filter.post(r);
- std::cout<<" Size ="<<r.selector().size()<<"\n";
- std::cout<<*(r.selector()[0]->name()[0])<<"\n";
- std::cout<<*(r.selector()[1]->name()[0])<<"\n";
-
-}
-
-/**
- *
- */
-void TCParseSubscribe::subscribeRequest()
-{
-
- std::string test="<subscribeRequest xmlns=\"http://www.alcatel-lucent.com/wsp/ns/2009/10/01/ics/notifierServiceSchema\"><fwSessionId>xxAA</fwSessionId><notificationUrl>http://www.x.fr/</notificationUrl><filter xmlns:f=\"http://www.alcatel-lucent.com/wsp/ns/2009/10/15/ics/subscriptionFilter\"><f:selector><f:id>100</f:id><f:name>onMakeCall</f:name></f:selector><f:selector><f:name>onCallModified</f:name></f:selector></filter></subscribeRequest>";
- std::istringstream iss1(test,std::istringstream::in);
-
- subscribeRequest_skel s;
- p_subscribeRequest_skel sr;
- p_SubscriptionFilter_skel filter;
- p_Selector_skel sel;
- ::xsd::parser::SimpleElement name,id,family,org,fws,notif;
- sel.name_parser(name);
- sel.id_parser(id);
- sel.family_parser(family);
- filter.selector_parser(sel);
- sr.fwSessionId_parser(fws);
- sr.notificationUrl_parser(notif);
- sr.filter_parser(filter);
- xsd::parser::expat::Document doc(sr,"subscribeRequest");
- doc.parse(iss1);
- sr.post(s);
- std::cout<<" Size = "<<s.filter().selector().size()<<"\n";
- std::cout<<" SessionId = "<<s.fwSessionId()<<"\n";
- std::cout<<" notifUrl = "<<s.notificationUrl()<<"\n";
- std::cout<<*(s.filter().selector()[0]->name()[0])<<"\n";
- std::cout<<*(s.filter().selector()[1]->name()[0])<<"\n";
-
-}
-
-
-/**
- *
- *
- */
-void TCParseSubscribe::unsubscribe()
-{
-}
+++ /dev/null
-#ifndef TCELEMENTS_H
-#define TCELEMENTS_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-
-#include <xmlSerialize.h>
-#include "include/NotifierService.h"
-#include "include/IcsNotifierService.h"
-#include "include/SubscriptionFilter.h"
-#include "include/p_SubscriptionFilter.h"
-
-using namespace notifierServiceSchema;
-
-class TCParseSubscribe : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TCParseSubscribe );
- CPPUNIT_TEST( subscribe );
- CPPUNIT_TEST( subscribeRequest );
- CPPUNIT_TEST( unsubscribe );
- CPPUNIT_TEST_SUITE_END();
-
- public:
- protected:
- void subscribe();
- void subscribeRequest();
- void unsubscribe();
-};
-
-#endif
-
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-
-
-#include "TCSoapNotifier.h"
-#include "SubscriptionFilter.h"
-#include "soap-encoding.h"
-#include "soap-envelope.h"
-
-
-CPPUNIT_TEST_SUITE_REGISTRATION( TCSoapNotifier );
-
-using namespace subscriptionFilter;
-using namespace envelope;
-/**
- *
- */
-void TCSoapNotifier::subscribe()
-{
- std::ostringstream result(std::ostringstream::out);
- subscribeRequest_sptr id(new subscribeRequest_skel());
- SubscriptionFilter_skel::selector_sptr selector( new Selector_skel());
- filter_sptr filter(new SubscriptionFilter_skel());
-
- std::string name("onOne");
- std::string nu("http://localhost/ic70");
- std::string sid("12");
- selector->name(name);
- selector->id(sid);
- selector->family(nu);
- filter->selector(selector);
- id->fwSessionId(sid);
- id->notificationUrl(nu);
- id->filter(filter);
- id->expires(new int(200));
- Op_subscribe req;
- req.send(std::cout,id);
- req.send(result,id);
- std::cout<<"\nRes="<<result.str()<<" "<<std::endl;
- // Missing namespaces in Envelope, should have element subscribeRequest in
- // Body.
- std::string expected("<soapenv:Envelope xmlns:tns=\"http://schemas.xmlsoap.org/soap/envelope/\"><soapenv:Body xmlns:tns=\"http://schemas.xmlsoap.org/soap/envelope/\"><IcsNs:fwSessionId>12</IcsNs:fwSessionId><IcsNs:notificationUrl>http://localhost/ic70</IcsNs:notificationUrl><IcsNs:filter><filter:selector><filter:name>onOne</filter:name><filter:id>12</filter:id><filter:family>http://localhost/ic70</filter:family></filter:selector></IcsNs:filter><IcsNs:expires>200</IcsNs:expires></soapenv:Body></soapenv:Envelope>");
- CPPUNIT_ASSERT(result.str() == expected);
-}
-
-/**
- *
- *
- */
-void TCSoapNotifier::unsubscribe()
-{
- std::ostringstream result(std::ostringstream::out);
- unsubscribeRequest_sptr hr(new unsubscribeRequest_skel);
-
- //std::cout<<" Res="<<*hr<<" "<<HoldRequests_elem_type(hr)<<std::endl;
- result << *hr;
- std::cout<<" Res="<<result.str()<<std::endl;
- //CPPUNIT_ASSERT(result.str() =="<HoldRequests>true</HoldRequests>");
- result.seekp(0);
- //std::cout<<" Res1="<<result.str()<<std::endl;
- //CPPUNIT_ASSERT(result.str() =="<HoldRequests mustUnderstand=\"1\">false</HoldRequests>");
-}
+++ /dev/null
-#ifndef TCELEMENTS_H
-#define TCELEMENTS_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-
-#include <xmlSerialize.h>
-#include "include/NotifierService.h"
-#include "include/IcsNotifierService.h"
-
-using namespace notifierServiceSchema;
-
-class TCSoapNotifier : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TCSoapNotifier );
- CPPUNIT_TEST( subscribe );
- CPPUNIT_TEST( unsubscribe );
- CPPUNIT_TEST_SUITE_END();
-
- public:
- protected:
- void subscribe();
- void unsubscribe();
-};
-
-#endif
-
+++ /dev/null
-#include <iostream>
-
-#include <cppunit/BriefTestProgressListener.h>
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/TestResult.h>
-#include <cppunit/TestResultCollector.h>
-#include <cppunit/TestRunner.h>
-
-
-
-int main(int argc,char **argv)
-{
- // Create the event manager and test controller
- CPPUNIT_NS::TestResult controller;
-
- // Add a listener that colllects test result
- CPPUNIT_NS::TestResultCollector result;
- controller.addListener( &result );
-
- // Add a listener that print dots as test run.
- CPPUNIT_NS::BriefTestProgressListener progress;
- controller.addListener( &progress );
-
- // Add the top suite to the test runner
- CPPUNIT_NS::TestRunner runner;
- runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
- runner.run( controller );
-
- // Print test in a compiler compatible format.
- CPPUNIT_NS::CompilerOutputter outputter( &result, CPPUNIT_NS::stdCOut() );
- outputter.write();
-
- return result.wasSuccessful() ? 0 : 1;
-
-}
+++ /dev/null
-<?xml version="1.0" ?>
-<maps>
- <map name="IcsNs" ns="http://www.alcatel-lucent.com/wsp/ns/2009/10/01/ics/notifierServiceSchema"/>
- <map name="soapenv" ns="http://schemas.xmlsoap.org/soap/envelope/"/>
- <map name="soapenc" ns="http://schema.xmlsoap.org/encoding/"/>
- <map name="filter" ns="http://www.alcatel-lucent.com/wsp/ns/2009/10/15/ics/subscriptionFilter"/>
- <map name="xsd" ns="http://www.w3.org/2001/XMLSchema"/>
-</maps>
+++ /dev/null
-PROJECT(kml)
-
-FIND_LIBRARY(EXPAT_LIB expat "/usr/local/lib:/usr/lib")
-INCLUDE_DIRECTORIES("${xml-t_SOURCE_DIR}/libxsd/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/")
-INCLUDE_DIRECTORIES("/usr/local/include")
-
-INCLUDE(${xml-t_SOURCE_DIR}/../../rules/saxon.cmake)
-
-
-SET(KML21
- "${xml-t_SOURCE_DIR}/../../data-models/kml21.xsd")
-
-
-#
-
-XSD2CPP(SOURCE ${KML21}
- OUTPUT kml21
- XSDDIRS "./../\;../../data-models/\;"
-)
-
-
-IF(COMMAND cmake_policy)
- cmake_policy(SET CMP0003 NEW)
-ENDIF(COMMAND cmake_policy)
-
-#
-#
-#
-ADD_EXECUTABLE(kml
- main_test.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/kml21.cpp
- )
-
-TARGET_LINK_LIBRARIES(kml libxsd ${EXPAT_LIB}
- ${CPPUNIT_LIB}
- ${DL_LIB}
- )
-
-
+++ /dev/null
-#include <iostream>
-
-#include <cppunit/BriefTestProgressListener.h>
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/TestResult.h>
-#include <cppunit/TestResultCollector.h>
-#include <cppunit/TestRunner.h>
-
-
-
-int main(int argc,char **argv)
-{
- // Create the event manager and test controller
- CPPUNIT_NS::TestResult controller;
-
- // Add a listener that colllects test result
- CPPUNIT_NS::TestResultCollector result;
- controller.addListener( &result );
-
- // Add a listener that print dots as test run.
- CPPUNIT_NS::BriefTestProgressListener progress;
- controller.addListener( &progress );
-
- // Add the top suite to the test runner
- CPPUNIT_NS::TestRunner runner;
- runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
- runner.run( controller );
-
- // Print test in a compiler compatible format.
- CPPUNIT_NS::CompilerOutputter outputter( &result, CPPUNIT_NS::stdCOut() );
- outputter.write();
-
- return result.wasSuccessful() ? 0 : 1;
-
-}
+++ /dev/null
-PROJECT(pgml)
-
-FIND_LIBRARY(EXPAT_LIB expat "/usr/local/lib:/usr/lib")
-INCLUDE_DIRECTORIES("${xml-t_SOURCE_DIR}/libxsd/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/")
-INCLUDE_DIRECTORIES("/usr/local/include")
-
-INCLUDE(${xml-t_SOURCE_DIR}/../../rules/saxon.cmake)
-
-#SET(SAXON CACHE STRING "~/Tools/saxon/saxon9.jar")
-#SET(WSDL2 "${CMAKE_CURRENT_SOURCE_DIR}/../../wsdl2.xsl")
-#SET(XSD2CPP "${CMAKE_CURRENT_SOURCE_DIR}/../../xsd2cpp.xsl")
-
-SET(PGML
- "${xml-t_SOURCE_DIR}/../../data-models/pgml.xsd")
-
-
-#
-
-XSD2CPP_BOTH(${PGML} pgml "" "./../\;"
- "tests/pgml/nsmap.xml")
-
-
-IF(COMMAND cmake_policy)
- cmake_policy(SET CMP0003 NEW)
-ENDIF(COMMAND cmake_policy)
-
-#
-#
-#
-ADD_EXECUTABLE(pgml_serialize
- main_test.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/pgml.cpp
- )
-
-TARGET_LINK_LIBRARIES(pgml_serialize libxsd ${EXPAT_LIB}
- ${CPPUNIT_LIB}
- ${DL_LIB}
- )
-
-#
-ADD_EXECUTABLE(pgml_parse
- main_test.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/pgml.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_pgml.cpp
- )
-
-TARGET_LINK_LIBRARIES(pgml_parse libxsd ${EXPAT_LIB}
- ${CPPUNIT_LIB}
- ${DL_LIB}
- )
-
-
+++ /dev/null
-#include <iostream>
-
-#include <cppunit/BriefTestProgressListener.h>
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/TestResult.h>
-#include <cppunit/TestResultCollector.h>
-#include <cppunit/TestRunner.h>
-
-
-
-int main(int argc,char **argv)
-{
- // Create the event manager and test controller
- CPPUNIT_NS::TestResult controller;
-
- // Add a listener that colllects test result
- CPPUNIT_NS::TestResultCollector result;
- controller.addListener( &result );
-
- // Add a listener that print dots as test run.
- CPPUNIT_NS::BriefTestProgressListener progress;
- controller.addListener( &progress );
-
- // Add the top suite to the test runner
- CPPUNIT_NS::TestRunner runner;
- runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
- runner.run( controller );
-
- // Print test in a compiler compatible format.
- CPPUNIT_NS::CompilerOutputter outputter( &result, CPPUNIT_NS::stdCOut() );
- outputter.write();
-
- return result.wasSuccessful() ? 0 : 1;
-
-}
+++ /dev/null
-PROJECT(soap)
-
-FIND_LIBRARY(EXPAT_LIB expat "/usr/local/lib:/usr/lib")
-INCLUDE_DIRECTORIES("${xml-t_SOURCE_DIR}/libxsd/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}")
-INCLUDE_DIRECTORIES("/usr/local/include")
-
-SET(SAXON CACHE STRING "~/Tools/saxon/saxon9.jar")
-SET(WSDL2 "${CMAKE_CURRENT_SOURCE_DIR}/../../wsdl2.xsl")
-SET(XSD2CPP "${CMAKE_CURRENT_SOURCE_DIR}/../../xsd2cpp.xsl")
-
-SET(XMI "${xml-t_SOURCE_DIR}/../../data-models/soap-envelope.xsd")
-SET(SOAPENC "${xml-t_SOURCE_DIR}/../../data-models/soap-encoding.xsd")
-SET(OXO "${xml-t_SOURCE_DIR}/../../data-models/oxo_wsdl/oxo_web_services.wsdl")
-
-SET(WSDL_TYPES "oxo_ws")
-MESSAGE("OK read : ${OXO}")
-
-ADD_CUSTOM_COMMAND(
- SOURCE ${OXO}
- COMMAND java
- ARGS -jar ${SAXON} -s ${OXO} -xsl:${WSDL2} rootdir="./parser/"
- target="release" output="${WSDL_TYPES}.xsd"
- incdir="/../include" srcdir="./" root-element="Envelope"
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${WSDL_TYPES}.xsd
- COMMENT "Transform wsdl to xsd ${WSDL_TYPES}.xsd"
- )
-
-ADD_CUSTOM_COMMAND(
- SOURCE ${OXO}
- COMMAND java
- ARGS -jar ${SAXON} -s ${OXO} -xsl:${WSDL2} rootdir="./parser/"
- target="soap" output="oxo_web_services"
- incdir="./include" srcdir="./" types="${WSDL_TYPES}.h" root-element="Envelope"
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/oxo_web_services.cpp
- COMMENT "Transform wsdl to soap service oxo_web_services.cpp"
- )
-
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/oxo_web_services.cpp
- GENERATED)
-#ADD_CUSTOM_TARGET(${WSDL_TYPES}.xsd ALL)
-
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/${WSDL_TYPES}.xsd
- GENERATED)
-SET_SOURCE_FILES_PROPERTIES(${WSDL_TYPES}.xsd
- GENERATED)
-
-ADD_CUSTOM_COMMAND(
- SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${WSDL_TYPES}.xsd
- COMMAND java
- ARGS -jar ${SAXON} -s ${CMAKE_CURRENT_BINARY_DIR}/${WSDL_TYPES}.xsd -xsl:${XSD2CPP} rootdir="./parser/"
- target="release"
- incdir="/../include" srcdir="./" root-element="Envelope"
- xsddir="./\;/home/aeb/Devs/home/data-models/oxo_wsdl/\;../../data-models/oxo_wsdl/\;./../\;${xml-t_SOURCE_DIR}/../../data-models/\;"
- OUTPUT
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_${WSDL_TYPES}.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/${WSDL_TYPES}.cpp
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${WSDL_TYPES}.xsd
- COMMENT "Transform ${WSDL_TYPES}.xsd"
- )
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/parser/p_${WSDL_TYPES}.cpp
- GENERATED)
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/parser/${WSDL_TYPES}.cpp
- GENERATED)
-ADD_CUSTOM_COMMAND(
- SOURCE ${XMI}
- COMMAND java
- ARGS -jar ${SAXON} -s ${XMI} -xsl:${XSD2CPP} rootdir="./parser/"
- target="release"
- incdir="/../include" srcdir="./" root-element="Envelope"
- xsddir="/home/aeb/Devs/tools/data-models"
- OUTPUT
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_soap-envelope.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/soap-envelope.cpp
- COMMENT "Transform ${XMI}"
- )
-
-# xsddir="xsl:nodeset\(/home/aeb/Devs/tools/data-models\)"
-
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/parser/p_soap-envelope.cpp
- GENERATED)
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/parser/soap-envelope.cpp
- GENERATED)
-
-
-ADD_CUSTOM_COMMAND(
- SOURCE ${SOAPENC}
- COMMAND java
- ARGS -jar ${SAXON} -s ${SOAPENC} -xsl:${XSD2CPP} rootdir="./parser/"
- target="release"
- incdir="/../include" srcdir="./" root-element="Envelope"
- OUTPUT
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_soap-encoding.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/soap-encoding.cpp
- COMMENT "Transform ${SOAPENC}"
- )
-
-
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/parser/p_soap-encoding.cpp
- GENERATED)
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/parser/soap-encoding.cpp
- GENERATED)
-
-
-IF(COMMAND cmake_policy)
- cmake_policy(SET CMP0003 NEW)
-ENDIF(COMMAND cmake_policy)
-
-ADD_EXECUTABLE(tparser_soap
- main.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/soap-envelope.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_soap-envelope.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/soap-encoding.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_soap-encoding.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_${WSDL_TYPES}.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/${WSDL_TYPES}.cpp
- )
-
-TARGET_LINK_LIBRARIES(tparser_soap libxsd ${EXPAT_LIB})
-
-ADD_EXECUTABLE(oxo_web_service
- main_soap.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/oxo_web_services.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/soap-envelope.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/soap-encoding.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/${WSDL_TYPES}.cpp
- )
-TARGET_LINK_LIBRARIES(oxo_web_service libxsd ${EXPAT_LIB})
-
-ADD_EXECUTABLE(soap_test_serialize
- main_test.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/oxo_web_services.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/soap-envelope.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/soap-encoding.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/${WSDL_TYPES}.cpp
- TCSoapSerialize.cpp
- )
-
-TARGET_LINK_LIBRARIES(soap_test_serialize libxsd ${EXPAT_LIB}
- ${CPPUNIT_LIB}
- ${DL_LIB}
- )
-
-
-
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-
-#include "TCSoapSerialize.h"
-using namespace envelope;
-
-CPPUNIT_TEST_SUITE_REGISTRATION( TCSoapSerialize );
-
-/**
- *
- */
-void TCSoapSerialize::login()
-{
- std::ostringstream result(std::ostringstream::out);
- std::string name("dede");
- std::string pwd("yes");
- Envelope_sptr e(new Envelope_skel());
- Body_sptr b(new Body_skel());
- login_skel l;
- login_skel::invoke_sptr login(new UserLogin_skel());
- login->loginName(name);
- login->password(pwd);
- l.invoke(login);
- //result<<login_skel::invoke_elem_type(login);
- result<<l;
- std::cout<<" Res="<<result.str()<<" "<<std::endl;
- b->any(&l);
- e->Body(b);
- std::cout<<" Complete E="<<Envelope_elem_type(e)<<" "<<std::endl;
-#if 0
- std::string s("coucou");
- (*id)=s;
- ID_elem_type et(id);
- result<<et;
- std::cout<<" Res="<<et<<" "<<id<<std::endl;
-#endif
- // CPPUNIT_ASSERT(result.str() =="<ID>coucou</ID>");
-}
-
-/**
- *
- *
- */
-void TCSoapSerialize::User()
-{
- std::ostringstream result(std::ostringstream::out);
- std::string name("ebersold");
- std::string ln("aeb");
- std::string pwd("andre");
- std::string firstname("yes");
- std::string main_number("1234");
-
- User_skel user;
-
- user.name(name);
- user.loginName(ln);
- user.firstName(pwd);
- user.mainNumber(main_number);
-
- std::cout<<" Res="<<user<<std::endl;
- result << user;
- CPPUNIT_ASSERT(result.str() =="<name>ebersold</name><firstName>andre</firstName><loginName>aeb</loginName><mainNumber>1234</mainNumber>");
-#if 0
- *hr = false;
- result << HoldRequests_elem_type(hr);
- CPPUNIT_ASSERT(result.str() =="<HoldRequests>false</HoldRequests>");
-#endif
-}
-#if 0
-void TCSoapSerialize::Fault()
-{
- std::ostringstream result(std::ostringstream::out);
- Fault_skel fault;
-}
-void TCSoapSerialize::GetRPCMethods()
-{
-}
-void TCSoapSerialize::SetParameterValues()
-{
-}
-void TCSoapSerialize::GetParameterValues()
-{
-}
-void TCSoapSerialize::GetParameterNames()
-{
-}
-void TCSoapSerialize::GetParameterNamesResponse()
-{
-}
-void TCElements::SetParameterAttributes()
-{
-}
-#endif
+++ /dev/null
-#ifndef TCSOAPSERIALIZE_H
-#define TCSOAPSERILIAZE_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-
-#include <xmlSerialize.h>
-#include "include/soap-encoding.h"
-#include "include/soap-envelope.h"
-#include "include/oxo_ws.h"
-
-using namespace urncomalcatelotssoftphone;
-
-class TCSoapSerialize : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TCSoapSerialize );
- CPPUNIT_TEST( login );
- CPPUNIT_TEST( User );
-/*
- CPPUNIT_TEST( HoldRequests );
- CPPUNIT_TEST( Fault );
- CPPUNIT_TEST( GetRPCMethods );
- CPPUNIT_TEST( SetParameterValues );
- CPPUNIT_TEST( GetParameterValues );
- CPPUNIT_TEST( GetParameterNames );
- CPPUNIT_TEST( GetParameterNamesResponse );
- CPPUNIT_TEST( SetParameterAttributes );
-*/
- CPPUNIT_TEST_SUITE_END();
-
- public:
- protected:
- void login();
- void User();
-};
-
-#endif
-
+++ /dev/null
-#include <stdio.h>
-
-#include <iostream>
-#include <sstream>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-
-#include <soap-envelope.h>
-#include <p_soap-envelope.h>
-
-#include <soap-encoding.h>
-#include <p_soap-encoding.h>
-
-#include <oxo_ws.h>
-using namespace envelope;
-void test2(xsd::parser::ParserBase &p)
-{
- std::string test="<Envelope xmlns=\"http://schemas.xmlsoap.org/soap/envelope/\"><Header name=\"attr_nm\" amount=\"1.2\">andre</Header><Body name=\"attr_andre\"><dede>Marc</dede></Body></Envelope>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(p,"Envelope");
- doc.parse(iss1);
-}
-
-void test1(xsd::parser::ParserBase &p)
-{
- std::string test="<?xml version=\"1.0\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Header soap:name=\"attr_nm\" soap:amount=\"1.2\"></soap:Header><soap:Body><m:Trans xmlns:m=\"http://dede\"/>dede</m:Trans></soap:Body></soap:Envelope>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(p,"Envelope");
- doc.parse(iss1);
-}
-
-class BodyParser : public virtual envelope::p_Body_skel
-{
- public:
- BodyParser() {};
- ~BodyParser() {};
-
-
- virtual void startAnyElement(const std::string &ns,const std::string &n)
- {
- std::cout<<"My BodyParser start Any: "<<n<<std::endl;
- };
- virtual void endAnyElement(const std::string &ns,const std::string &n)
- {
- std::cout<<"My BodyParser end Any: "<<n<<std::endl;
- };
-};
-
-
-int main(int argc, char **argv)
-{
- envelope::p_Envelope_skel soap_env;
- envelope::p_Header_skel soap_header;
- envelope::Body_sptr body(new envelope::Body_skel());
- BodyParser soap_body;
- envelope::Envelope_sptr e(new Envelope_skel);
- std::string ln="installer";
- urncomalcatelotssoftphone::UserLogin_skel login;
- urncomalcatelotssoftphone::login_skel l;
- xsd::parser::SimpleElement s,msg,nbr;
- soap_env.Body_parser(soap_body);
- soap_env.Header_parser(soap_header);
-
- printf("\n\tHello world parser ... test1\n");
- test1(soap_env);
- soap_env.post(*e);
- std::cout<<Envelope_elem_type(e)<<std::endl;
- printf("\n\tHello world parser ... test 2\n");
- test2(soap_env);
- soap_env.post(*e);
- login.loginName(ln);
- ln="dede";
- login.password(ln);
- login.use_namespace(true);
- l.invoke(login);
- printf("\n\tDisplay Envelope Body for Login\n");
- (*e).Body(body);
- (*e).Body().any(&l);
- std::cout<<Envelope_elem_type(e)<<std::endl;
-
-}
-
+++ /dev/null
-#include <iostream>
-
-#include <sstream>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-
-#include <soap-envelope.h>
-//#include <p_soap-envelope.h>
-
-#include <soap-encoding.h>
-//#include <p_soap-encoding.h>
-
-#include <oxo_ws.h>
-
-using namespace envelope;
-using namespace std;
-using namespace urncomalcatelotssoftphone;
-
-int main(int argc,char **argv)
-{
- cout<<"Hello world"<<endl;
-}
-/*
- * vim:et:sw=2:ts=2:
- */
+++ /dev/null
-#include <iostream>
-
-#include <cppunit/BriefTestProgressListener.h>
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/TestResult.h>
-#include <cppunit/TestResultCollector.h>
-#include <cppunit/TestRunner.h>
-
-
-
-int main(int argc,char **argv)
-{
- // Create the event manager and test controller
- CPPUNIT_NS::TestResult controller;
-
- // Add a listener that colllects test result
- CPPUNIT_NS::TestResultCollector result;
- controller.addListener( &result );
-
- // Add a listener that print dots as test run.
- CPPUNIT_NS::BriefTestProgressListener progress;
- controller.addListener( &progress );
-
- // Add the top suite to the test runner
- CPPUNIT_NS::TestRunner runner;
- runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
- runner.run( controller );
-
- // Print test in a compiler compatible format.
- CPPUNIT_NS::CompilerOutputter outputter( &result, CPPUNIT_NS::stdCOut() );
- outputter.write();
-
- return result.wasSuccessful() ? 0 : 1;
-
-}
+++ /dev/null
-PROJECT(svg)
-
-FIND_LIBRARY(EXPAT_LIB expat "/usr/local/lib:/usr/lib")
-INCLUDE_DIRECTORIES("${xml-t_SOURCE_DIR}/libxsd/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/")
-INCLUDE_DIRECTORIES("/usr/local/include")
-
-INCLUDE(${xml-t_SOURCE_DIR}/../../rules/saxon.cmake)
-
-#SET(SAXON CACHE STRING "~/Tools/saxon/saxon9.jar")
-#SET(WSDL2 "${CMAKE_CURRENT_SOURCE_DIR}/../../wsdl2.xsl")
-#SET(XSD2CPP "${CMAKE_CURRENT_SOURCE_DIR}/../../xsd2cpp.xsl")
-
-SET(SVG
- "${xml-t_SOURCE_DIR}/../../data-models/svg.xsd")
-SET(XLINK
- "${xml-t_SOURCE_DIR}/../../data-models/xlink-1999.xsd")
-SET(XML
- "${xml-t_SOURCE_DIR}/../../data-models/namespace.xsd")
-
-
-
-
-#
-
-XSD2CPP_BOTH(${SVG} svg "" "./../\;../../data-models/\;"
- "tests/svg/nsmap.xml")
-
-XSD2CPP_BOTH(${XML} namespace "" "./../\;../../data-models/\;"
- "tests/svg/nsmap.xml")
-
-XSD2CPP_BOTH(${XLINK} xlink-1999 "" "./../\;../../data-models/\;"
- "tests/svg/nsmap.xml")
-
-
-
-
-IF(COMMAND cmake_policy)
- cmake_policy(SET CMP0003 NEW)
-ENDIF(COMMAND cmake_policy)
-
-#
-#
-#
-ADD_EXECUTABLE(svg_serialize
- main_test.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/xlink-1999.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/namespace.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/svg.cpp
- )
-
-TARGET_LINK_LIBRARIES(svg_serialize libxsd ${EXPAT_LIB}
- ${CPPUNIT_LIB}
- ${DL_LIB}
- )
-
-#
-ADD_EXECUTABLE(svg_parse
- main_test.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/xlink-1999.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/namespace.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_svg.cpp
- )
-
-TARGET_LINK_LIBRARIES(svg_parse libxsd ${EXPAT_LIB}
- ${CPPUNIT_LIB}
- ${DL_LIB}
- )
-
-
+++ /dev/null
-#include <iostream>
-
-#include <cppunit/BriefTestProgressListener.h>
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/TestResult.h>
-#include <cppunit/TestResultCollector.h>
-#include <cppunit/TestRunner.h>
-
-
-
-int main(int argc,char **argv)
-{
- // Create the event manager and test controller
- CPPUNIT_NS::TestResult controller;
-
- // Add a listener that colllects test result
- CPPUNIT_NS::TestResultCollector result;
- controller.addListener( &result );
-
- // Add a listener that print dots as test run.
- CPPUNIT_NS::BriefTestProgressListener progress;
- controller.addListener( &progress );
-
- // Add the top suite to the test runner
- CPPUNIT_NS::TestRunner runner;
- runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
- runner.run( controller );
-
- // Print test in a compiler compatible format.
- CPPUNIT_NS::CompilerOutputter outputter( &result, CPPUNIT_NS::stdCOut() );
- outputter.write();
-
- return result.wasSuccessful() ? 0 : 1;
-
-}
+++ /dev/null
-PROJECT(t8000)
-
-#ENABLE_TESTING()
-
-FIND_LIBRARY(EXPAT_LIB expat "/usr/local/lib:/usr/lib")
-FIND_LIBRARY(CPPUNIT_LIB cppunit "/usr/local/lib:/usr/lib")
-FIND_LIBRARY(DL_LIB dl "/lib:/usr/local/lib:/usr/lib")
-
-INCLUDE_DIRECTORIES("${xml-t_SOURCE_DIR}/libxsd/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/include")
-INCLUDE_DIRECTORIES(".")
-INCLUDE_DIRECTORIES("${aebutils_SOURCE_DIR}")
-INCLUDE_DIRECTORIES("/usr/local/include")
-
-SET(SAXON CACHE STRING "~/Tools/saxon/saxon9.jar")
-SET(XSD2CPP "${CMAKE_CURRENT_SOURCE_DIR}/../../xsd2cpp.xsl")
-#SET(XMI "${xml-t_SOURCE_DIR}/../../data-models/xmi.xsd")
-SET(PROFILE "${xml-t_SOURCE_DIR}/../../data-models/alcatel-lucent/t8000_profile.xsd")
-SET(INDEX "${xml-t_SOURCE_DIR}/../../data-models/alcatel-lucent/t8000_index.xsd")
-
-
-ADD_CUSTOM_COMMAND(
- SOURCE ${PROFILE}
- COMMAND java
- ARGS -jar ${SAXON} -s ${PROFILE} -xsl:${XSD2CPP} rootdir="./parser/"
- target="release" root-element="profile" shared-ptr="aeb" incdir="/../include" srcdir="./"
- OUTPUT
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_t8000_profile.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/t8000_profile.cpp
- COMMENT "Transform t8000_profile.xsd"
- )
-
-ADD_CUSTOM_COMMAND(
- SOURCE ${INDEX}
- COMMAND java
- ARGS -jar ${SAXON} -s ${INDEX} -xsl:${XSD2CPP} rootdir="./parser/"
- target="release" generate-print="no" root-element="signed-component" incdir="/../include" srcdir="./"
- OUTPUT
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_t8000_index.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/t8000_index.cpp
- COMMENT "Transform t8000_index.xsd"
- )
-
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/parser/t8000_profile.cpp
- GENERATED)
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/parser/p_t8000_profile.cpp
- GENERATED)
-
-IF(COMMAND cmake_policy)
- cmake_policy(SET CMP0003 NEW)
-ENDIF(COMMAND cmake_policy)
-
-ADD_EXECUTABLE(profile
- ${CMAKE_CURRENT_BINARY_DIR}/parser/t8000_profile.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_t8000_profile.cpp
- main.cpp
- )
-TARGET_LINK_LIBRARIES(profile libxsd ${EXPAT_LIB})
-
-
-ADD_EXECUTABLE(t8000_index
- ${CMAKE_CURRENT_BINARY_DIR}/parser/t8000_index.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_t8000_index.cpp
- main_index.cpp
- )
-TARGET_LINK_LIBRARIES(t8000_index libxsd ${EXPAT_LIB})
-
-ADD_EXECUTABLE(merge_index
- ${CMAKE_CURRENT_BINARY_DIR}/parser/t8000_index.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_t8000_index.cpp
- merge_index.cpp
- )
-TARGET_LINK_LIBRARIES(merge_index libxsd ${EXPAT_LIB})
-
-
-#
-# Test Stuff
-#
-IF(NOT ${CPPUNIT_LIB})
- # ADD_TEST(SimpleType tp_basic01 Hello)
- #ADD_TEST(SimpleTypeSerialize sr_basic01 Hello)
- # ADD_TEST(SimpleTypeNativeTypes tparser_basic Hello)
- # ADD_TEST(SimpleTypeRef tparser_basic Hello)
- # ADD_TEST(SimpleTypeUnion tparser_basic Hello)
- # ADD_TEST(SimpleTypeEnumaration tparser_basic Hello)
- # ADD_TEST(SimpleTypeExtesion tparser_basic Hello)
- # ADD_TEST(SimpleTypeRestriction tparser_basic Hello)
- # ADD_TEST(ComplexType tparser_basic Hello)
- # ADD_TEST(ComplexTypeSequence tparser_basic Hello)
- # ADD_TEST(ComplexTypeChoice tparser_basic Hello)
- # ADD_TEST(ComplexTypeAll tparser_basic Hello)
- # ADD_TEST(ComplexTypeNamespace tparser_basic Hello)
-ELSE(NOT ${CPPUNIT_LIB})
- MESSAGE("I do not have cppunit library ${CPPUNIT_LIB} ")
-ENDIF(NOT ${CPPUNIT_LIB})
-
-
-#
-# Install stuff
-#
-INSTALL(TARGETS profile merge_index t8000_index
- ARCHIVE
- RUNTIME DESTINATION examples/t8000
- COMPONENT Examples)
-
-INSTALL(FILES
- ${PROFILE}
- DESTINATION examples/t8000
- COMPONENT Examples
- )
-INSTALL(FILES
- ${t8000_SOURCE_DIR}/main.cpp
- ${t8000_SOURCE_DIR}/main_index.cpp
- ${t8000_SOURCE_DIR}/merge_index.cpp
- DESTINATION examples/t8000
- COMPONENT Examples
- )
-INSTALL(FILES
- ${t8000_BINARY_DIR}/parser/t8000_profile.cpp
- ${t8000_BINARY_DIR}/parser/p_t8000_profile.cpp
- DESTINATION examples/t8000/parser
- COMPONENT Examples
- )
-INSTALL(FILES
- ${t8000_BINARY_DIR}/include/t8000_profile.h
- ${t8000_BINARY_DIR}/include/p_t8000_profile.h
- DESTINATION examples/t8000/include
- COMPONENT Examples
- )
+++ /dev/null
-#include <stdio.h>
-
-#include <string>
-#include <iostream>
-#include <sstream>
-#include <fstream>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-
-#include <t8000_profile.h>
-#include <p_t8000_profile.h>
-
-using namespace std;
-using namespace profile;
-
-class myContent : public virtual p_Component_skel
-{
- public:
- myContent() {std::cout<<"create myContent\n";};
- ~myContent() {};
- protected:
- // virtual void onAttramount(const std::string &v) {std::cout<<" Got ammount : "<<v<<" - "<<m_attr_amount<<std::endl;};
- //virtual void onAttrtaille(const std::string &v) {std::cout<<" Got taille : "<<v<<" - "<<m_attr_taille<<std::endl;};
- // virtual void onAttrname(const std::string &v) {std::cout<<" Got name : "<<v<<std::endl;};
- // virtual void onElname(std::string &dede) {std::cout<<" Got Name : "<<dede<<"\n";};
- // virtual void onElversion(std::string &dede) {std::cout<<" Got version : "<<dede<<"\n";};
- // virtual void onElchecksum(Checksum_skel &dede) {std::cout<<" Got checksum : "<<dede<<"\n";};
-};
-
-class myXMI : public virtual p_Profile_skel
-{
- public:
- myXMI() :p_Profile_skel() {std::cout<<"Build profile parser\n";};
- virtual ~myXMI() {};
-#if 0
- virtual void postImpl()
- {
- State &s(m_context.back());
- Component_skel &v=*(static_cast<Component_skel *>(s.m_data));
- std::cout<<"postImpl to avoid removing from ... stack_size="<<m_context.size()<<"\n";
- //std::cout<<m_component;
- }
- virtual void preImpl()
- {
- m_context.push_back(State());
- std::cout<<"Called my preImpl stack size="<<m_context.size()<<"\n";
- State &s(m_context.back());
- s.m_data = new Component_skel;
-
- }
-#endif
- // virtual void onElgreeting(std::string &dede) {std::cout<<" XMI Got greeting : "<<dede<<"\n";};
- virtual void onElcomponent(Component_skel &dede) {p_Profile_skel::onElcomponent(dede);std::cout<<" Profile Got Component : "<<dede<<"\n";};
- virtual void onElname(std::string &dede) {p_Profile_skel::onElname(dede);std::cout<<" Profile name : "<<dede<<"\n";};
- // virtual void onAttrversion(const std::string &v) {std::cout<<" Attribute Version works :"<<v<<"\n";};
-};
-
-
-/**
- *
- */
-int test1(const char *filename,xsd::parser::ParserBase &p)
-{
-
- std::ifstream iss1;
- iss1.open(filename,std::ifstream::in);
- xsd::parser::expat::Document doc(p,"profile");
- doc.parse(iss1);
-}
-
-
-
-
-
-int main(int argc,char **argv)
-{
- printf("\n\tHello world ... test 1 sizeof p_VIEW=%d\n\n",sizeof(p_Profile_skel));
- //p_VIEW_skel pxmi;
- myXMI pxmi;
- profile_sptr v(new Profile_skel);
- ::xsd::parser::SimpleElement name_parser,n1,version;
-
-#if 1
- myContent pxmi_c;
- p_Url_skel url;
- p_UrlType_skel url_type;
-
- p_Checksum_skel checksum;
- p_ChecksumType_skel checksum_type;
-
- pxmi.component_parser(pxmi_c); /* Panel in View*/
-
- pxmi.name_parser(name_parser); /* p1 is Panel in Panel from view second panel */
- pxmi_c.name_parser(n1); /* p1 is Panel in Panel from view second panel */
- pxmi_c.checksum_parser(checksum);
- checksum.type_parser(checksum_type);
- pxmi_c.version_parser(version);
- pxmi_c.url_parser(url);
- url.type_parser(url_type);
- test1("/users/aebersol/Documents/t8000_profile.xml",pxmi);
-#endif
- //pxmi.postInternal();
- pxmi.post(*v);
- std::cout<<"Final Result:\n"<<profile_elem_type(v)<<"\n";
- printf("\n\tGood bye ... test 1\n\n");
-}
-
+++ /dev/null
-#include <stdio.h>
-
-#include <string>
-#include <iostream>
-#include <sstream>
-#include <fstream>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-
-#include <t8000_index.h>
-#include <p_t8000_index.h>
-
-using namespace std;
-using namespace index;
-
-class myContent : public virtual p_Component_skel
-{
- public:
- myContent() {std::cout<<"create myContent\n";};
- ~myContent() {};
- protected:
- // virtual void onAttrname(const std::string &v) {std::cout<<" Got name : "<<v<<std::endl;};
- virtual void onElname(std::string &dede) {p_Component_skel::onElname(dede);std::cout<<" Got Name : "<<dede<<"\n";};
- //virtual void onElversion(std::string &dede) {p_Component_skel::onElversion(dede);std::cout<<" Got version : "<<dede<<"\n";};
- //virtual void onElchecksum(Checksum_skel &dede) {p_Component_skel::onElchecksum(dede);std::cout<<" Got checksum : "<<dede<<"\n";};
- virtual void onElrpm(Rpm_skel &dede) {p_Component_skel::onElrpm(dede);std::cout<<" Got rpm : "<<dede<<"\n";};
-};
-
-/**
- *
- */
-class myXMI : public virtual p_SComponent_skel
-{
- public:
- myXMI() :p_SComponent_skel() {std::cout<<"Build profile parser\n";};
- virtual ~myXMI() {};
- virtual void onElcomponent(Component_skel &d)
- {
- p_SComponent_skel::onElcomponent(d);
- std::cout<<" Profile Got Component : "<<d<<"\n";
- };
- //virtual void onElname(std::string &dede) {p_SComponent_skel::onElname(dede);std::cout<<" Profile name : "<<dede<<"\n";};
- // virtual void onAttrversion(const std::string &v) {std::cout<<" Attribute Version works :"<<v<<"\n";};
-};
-
-
-/**
- *
- */
-int test1(const char *filename,xsd::parser::ParserBase &p)
-{
-
- std::ifstream iss1;
- iss1.open(filename,std::ifstream::in);
- xsd::parser::expat::Document doc(p,"signed-component");
- doc.parse(iss1);
-}
-
-
-
-
-
-int main(int argc,char **argv)
-{
- printf("\n\tHello world ... test 1 sizeof p_VIEW=%d\n\n",sizeof(p_Rpm_skel));
- //p_VIEW_skel pxmi;
- myXMI pxmi;
- ::xsd::parser::SimpleElement release,name_parser,n1,version,path,epoch,arch;
- ::xsd::parser::SimpleElement rpm_size,i_size;
-
- p_Category_skel cat;
- p_Requires_skel req;
- signed_component_sptr v(new SComponent_skel); // Final result
- SComponent_skel::component_sptr component(new Component_skel);
- Component_skel::rpm_sequence rpms;
-
- v->component(component);
-#if 1
- //p_Component_skel pxmi_c;
- myContent pxmi_c;
- p_Checksum_skel checksum;
- p_ChecksumType_skel checksum_type;
- p_Rpm_skel rpm;
- // p1.TextField_parser(tf);
- pxmi.component_parser(pxmi_c); /* Panel in View*/
-
- rpm.name_parser(name_parser); /* p1 is Panel in Panel from view second panel */
- //p2.TextField_parser(tf);
- pxmi_c.name_parser(n1); /* p1 is Panel in Panel from view second panel */
- checksum.type_parser(checksum_type);
- rpm.checksum_parser(checksum);
- rpm.version_parser(version);
- rpm.path_parser(path);
- rpm.epoch_parser(epoch);
- rpm.arch_parser(arch);
- rpm.rpm_size_parser(rpm_size);
- rpm.installed_size_parser(i_size);
- rpm.release_parser(release);
- rpm.requires_parser(req);
- rpm.category_parser(cat);
- pxmi_c.rpm_parser(rpm);
- //test1("WbmUser/views/UserEdit.gml",pxmi);
- test1("/users/aebersol/Documents/ts8000_upgrade_index.xml",pxmi);
-#endif
-
- pxmi.post(*v);
- std::cout<<"Final Result:\n";
- std::cout<<signed_component_elem_type(v)<<"\n";
- std::cout<<"Final Result 1:\n";
- rpms = v->component().rpm();
- std::cout<<"Number of rpms = "<<rpms.size()<<"\n";
-}
-
+++ /dev/null
-#include <stdio.h>
-
-#include <string>
-#include <iostream>
-#include <sstream>
-#include <fstream>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-
-#include <t8000_index.h>
-#include <p_t8000_index.h>
-
-#include <getopt.h>
-
-using namespace std;
-using namespace index;
-
-class myComponent : public virtual p_Component_skel
-{
- public:
- myComponent() {};
- ~myComponent() {};
- protected:
- virtual void onElname(std::string &dede) {std::cout<<" Got Name : "<<dede<<"\n";};
- virtual void onElversion(std::string &dede) {std::cout<<" Got version : "<<dede<<"\n";};
- virtual void onElchecksum(Checksum_skel &dede) {std::cout<<" Got checksum : "<<dede<<"\n";};
- //virtual void onElrpm(Rpm_skel &dede) {std::cout<<" Got rpm : "<<dede.name()<<" "<<dede.version()<<"\n";};
-};
-
-class mySignedComponent : public virtual p_SComponent_skel
-{
- public:
- mySignedComponent() :p_SComponent_skel() {};
- virtual ~mySignedComponent() {};
- virtual void postImpl()
- {
- State &s(m_context.back());
- Component_skel &v=*(static_cast<Component_skel *>(s.m_data));
- // std::cout<<"postImpl to avoid removing from ... stack_size="<<m_context.size()<<"\n";
- }
- void reset()
- {
- if (m_context.size()>0 )m_context.pop_back();
- }
- virtual void preImpl()
- {
- m_context.push_back(State());
- //std::cout<<"Called my preImpl stack size="<<m_context.size()<<"\n";
- State &s(m_context.back());
- s.m_data = new Component_skel;
-
- }
- virtual void onElcomponent(Component_skel &dede) {std::cout<<" Index Got Component : "<<dede.name()<<"\n";};
- virtual void onElname(std::string &dede) {std::cout<<" Index name : "<<dede<<"\n";};
-};
-
-
-/**
- * \brief parse the file given in parameter, I should also chek
- * if file exists
- *
- * \return -1 on failure 0 if OK
- */
-int test1(const char *filename,xsd::parser::ParserBase &p)
-{
-
- std::ifstream iss1;
- iss1.open(filename,std::ifstream::in);
- if (iss1.good())
- {
- xsd::parser::expat::Document doc(p,"signed-component");
- doc.parse(iss1);
- return 0;
- } else return -1;
-}
-
-
-void usage(char *name)
-{
- std::cout<<name<<" [--vhe indexfname --mr index fname --le fname --d ] "<<std::endl;
-}
-
-/**
- *
- *
- *
- */
-int main(int argc,char **argv)
-{
- int c;
- static struct option long_options[] =
- {
- {"mr",required_argument,0,'m'},
- {"vhe",required_argument,0,'h'},
- {"le",required_argument,0,'l'},
- {"help",no_argument,0,'?'},
- {"file",no_argument,0,'f'},
- {NULL,0,0,0}
- };
-
- mySignedComponent signed_comp;
- ::xsd::parser::SimpleElement bd,key,sig,official_r,release,name_parser,n1,version,path,epoch,arch;
- ::xsd::parser::SimpleElement rpm_size,i_size;
-
- p_Category_skel cat;
- p_Requires_skel req;
- SComponent_skel vle,vhe,le,result; // Final result
- Component_skel component;
- Component_skel::rpm_sequence rpms,ref_rpms;
-
- myComponent pxmi_c;
-
- p_Checksum_skel checksum;
- p_ChecksumType_skel checksum_type;
- p_Rpm_skel rpm;
- signed_comp.component_parser(pxmi_c); /* Panel in View*/
- signed_comp.signature_parser(sig);
-
- rpm.name_parser(name_parser); /* p1 is Panel in Panel from view second panel */
- checksum.type_parser(checksum_type);
- rpm.checksum_parser(checksum);
- rpm.version_parser(version);
- rpm.path_parser(path);
- rpm.epoch_parser(epoch);
- rpm.arch_parser(arch);
- rpm.rpm_size_parser(rpm_size);
- rpm.installed_size_parser(i_size);
- rpm.release_parser(release);
- rpm.requires_parser(req);
- rpm.category_parser(cat);
- pxmi_c.build_date_parser(bd);
- pxmi_c.key_parser(key);
- pxmi_c.rpm_parser(rpm);
- pxmi_c.official_release_parser(official_r);
- pxmi_c.name_parser(n1); /* p1 is Panel in Panel from view second panel */
-
- int option_index = 0;
-
- while ( (c = getopt_long(argc,argv,"m:h:l:?",long_options,&option_index)) != -1)
- {
- switch(c)
- {
- case 0:
- std::cout<<" What to do here ?"<<std::endl;
- break;
- case 'l':
- case 'h':
- case 'm':
- std::cout<<"Try to read "<<long_options[option_index].name<<" terminal index ?"<<std::endl;
- if (!test1(optarg,signed_comp))
- {
- std::cout<<"Yes parser vle index file";
- signed_comp.post(vle);
- rpms = vle.component().rpm();
- std::cout<<"Number of rpms = "<<rpms.size()<<"\n";
- for (Component_skel::rpm_sequence::iterator it = rpms.begin() ; it !=rpms.end(); ++it)
- {
- bool found = false;
- for (Component_skel::rpm_sequence::iterator rit = ref_rpms.begin() ; rit != ref_rpms.end();++rit)
- {
- if ((*it)->name() == (*rit)->name())
- {
- found = true;
- break;
- }
- }
- /* If not found add found */
- if (!found)
- {
- Rpm_skel *r = new Rpm_skel();
- *r = *(*it);
- ref_rpms.push_back(Component_skel::rpm_sptr(r));
- }
- }
- std::cout<<"Number of rpms in ref rpms = "<<ref_rpms.size()<<"\n";
- component.rpm(ref_rpms);
- result.component(component);
- std::cout<<result;
- signed_comp.reset();
- } else
- {
- std::cout<<"Failed wrong file "<<std::endl;
- }
- break;
- case '?':
- usage(argv[0]);
- exit(1);
- break;
- default:
- ;
- }
- }
-
-#if 0
- test1("/users/aebersol/Documents/ts8000_upgrade_index.xml",signed_comp);
-
- signed_comp.post(vle);
- rpms = vle.component().rpm();
- std::cout<<"Number of rpms = "<<rpms.size()<<"\n";
-#endif
-}
-
+++ /dev/null
-PROJECT(umf)
-
-#ENABLE_TESTING()
-
-FIND_LIBRARY(EXPAT_LIB expat "/usr/local/lib:/usr/lib")
-FIND_LIBRARY(CPPUNIT_LIB cppunit "/usr/local/lib:/usr/lib")
-FIND_LIBRARY(DL_LIB dl "/lib:/usr/local/lib:/usr/lib")
-
-INCLUDE_DIRECTORIES("${xml-t_SOURCE_DIR}/libxsd/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/include")
-INCLUDE_DIRECTORIES(".")
-INCLUDE_DIRECTORIES("/usr/local/include")
-
-SET(SAXON CACHE STRING "~/Tools/saxon/saxon9.jar")
-SET(XSD2CPP "${CMAKE_CURRENT_SOURCE_DIR}/../../xsd2cpp.xsl")
-#SET(XMI "${xml-t_SOURCE_DIR}/../../data-models/xmi.xsd")
-SET(VIEW "${xml-t_SOURCE_DIR}/../../data-models/view.xsd")
-
-
-ADD_CUSTOM_COMMAND(
- SOURCE ${VIEW}
- COMMAND java
- ARGS -jar ${SAXON} -s ${VIEW} -xsl:${XSD2CPP} rootdir="./parser/"
- target="release" root-element="View" incdir="/../include" srcdir="./"
- OUTPUT
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_view.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/view.cpp
- COMMENT "Transform view.xsd"
- )
-
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/parser/view.cpp
- GENERATED)
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/parser/p_view.cpp
- GENERATED)
-
-IF(COMMAND cmake_policy)
- cmake_policy(SET CMP0003 NEW)
-ENDIF(COMMAND cmake_policy)
-
-ADD_EXECUTABLE(view
- ${CMAKE_CURRENT_BINARY_DIR}/parser/view.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_view.cpp
- main.cpp
- )
-TARGET_LINK_LIBRARIES(view libxsd ${EXPAT_LIB})
-#
-# Test Stuff
-#
-IF(NOT ${CPPUNIT_LIB})
- # ADD_TEST(SimpleType tp_basic01 Hello)
- #ADD_TEST(SimpleTypeSerialize sr_basic01 Hello)
- # ADD_TEST(SimpleTypeNativeTypes tparser_basic Hello)
- # ADD_TEST(SimpleTypeRef tparser_basic Hello)
- # ADD_TEST(SimpleTypeUnion tparser_basic Hello)
- # ADD_TEST(SimpleTypeEnumaration tparser_basic Hello)
- # ADD_TEST(SimpleTypeExtesion tparser_basic Hello)
- # ADD_TEST(SimpleTypeRestriction tparser_basic Hello)
- # ADD_TEST(ComplexType tparser_basic Hello)
- # ADD_TEST(ComplexTypeSequence tparser_basic Hello)
- # ADD_TEST(ComplexTypeChoice tparser_basic Hello)
- # ADD_TEST(ComplexTypeAll tparser_basic Hello)
- # ADD_TEST(ComplexTypeNamespace tparser_basic Hello)
-ELSE(NOT ${CPPUNIT_LIB})
- MESSAGE("I do not have cppunit library ${CPPUNIT_LIB} ")
-ENDIF(NOT ${CPPUNIT_LIB})
-
-
-#
-# Install stuff
-#
-INSTALL(TARGETS view
- ARCHIVE
- RUNTIME DESTINATION examples/umf
- COMPONENT Examples)
-
-INSTALL(FILES
- ${xml-t_SOURCE_DIR}/../../data-models/view.xsd
- DESTINATION examples/umf
- COMPONENT Examples
- )
-INSTALL(FILES
- ${umf_SOURCE_DIR}/main.cpp
- DESTINATION examples/umf
- COMPONENT Examples
- )
-INSTALL(FILES
- ${umf_BINARY_DIR}/parser/view.cpp
- ${umf_BINARY_DIR}/parser/p_view.cpp
- DESTINATION examples/umf/parser
- COMPONENT Examples
- )
-INSTALL(FILES
- ${umf_BINARY_DIR}/include/view.h
- ${umf_BINARY_DIR}/include/p_view.h
- DESTINATION examples/umf/include
- COMPONENT Examples
- )
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:GatewayDns="http://www.alu.com/ebg/angie/sobo/config/telephony/ars/GatewayDns"
- modelInstance="-1">
-
- <xv:Panel id="GatewayDnsForm" width="400" height="200" labelWidth="200">
- <xv:Title>
- <xv:Label>gatewayDnsTitleKey</xv:Label>
- </xv:Title>
- <xv:TextField id="primaryDnsServer" maxLength="15" width="150" value="/GatewayDns:GatewayDns/primaryDnsServer" onChange="#{ArsGatewayDnsBean.onPrimaryDnsServerChange}">
- <xv:Label>primDnsServerKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="secondaryDnsServer" maxLength="15" width="150" value="/GatewayDns:GatewayDns/secondaryDnsServer" onChange="#{ArsGatewayDnsBean.onSecondaryDnsServerChange}">
- <xv:Label>secDnsServerKey</xv:Label>
- </xv:TextField>
-
- <xv:Footer>
- <xv:Button id="OkButton" action="#{ArsGatewayDnsBean.submit}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{ArsGatewayDnsBean.cancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
- </xv:Panel>
-</xv:View>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:GatewayParameters="http://www.alu.com/ebg/angie/sobo/config/telephony/ars/GatewayParameters"
- modelInstance="-1">
-
-
- <xv:Panel id="SipPublicNumberingGrid" height="440" labelWidth="150" border="false">
- <xv:Title>
- <xv:Label>GatewayParametersTitleKey</xv:Label>
- </xv:Title>
- <xv:ToolBar id="GatewayParametersToolBar">
- <xv:Button id="AddButton" action="#{ArsGatewayParametersBean.add}">
- <xv:Label>AddKey</xv:Label>
- </xv:Button>
- <xv:Separator></xv:Separator>
- <xv:Button id="DeleteButton" action="#{ArsGatewayParametersBean.delete}">
- <xv:Label>DeleteKey</xv:Label>
- </xv:Button>
- <xv:Separator></xv:Separator>
- <xv:Button id="ModifyButton" action="#{ArsGatewayParametersBean.modify}">
- <xv:Label>ModifyKey</xv:Label>
- </xv:Button>
- </xv:ToolBar>
-
- <xv:Panel id="GridPanel">
- <xv:Grid id="gatewayGrid" width="700" height="200" value="/GatewayParameters:GatewayParameters/GatewayParametersGrid/GatewayParametersLine">
- <xv:Column mapping="hiddenRowId" sortable="true" hidden="true"><xv:Label>gwayHiddenRowId</xv:Label></xv:Column>
- <xv:Column mapping="gwayName" sortable="true"><xv:Label>gwayNameKey</xv:Label></xv:Column>
- <xv:Column mapping="ipType" sortable="true"><xv:Label>gwayipTypeKey</xv:Label></xv:Column>
- <xv:Column mapping="ipAddress" sortable="true"><xv:Label>gwayipAddressKey</xv:Label></xv:Column>
- <xv:Column mapping="hostname" sortable="true"><xv:Label>gwayhostnameKey</xv:Label></xv:Column>
- <xv:Column mapping="gwayAliveProtocol" sortable="true"><xv:Label>gwayAliveProtocolKey</xv:Label></xv:Column>
- <xv:Column mapping="gwayAliveTimeout" sortable="true"><xv:Label>gwayAliveTimeoutKey</xv:Label></xv:Column>
- <xv:Column mapping="gwayBandwidth" sortable="true"><xv:Label>gwayBandwidthKey</xv:Label></xv:Column>
- <xv:Column mapping="codecFraming" sortable="true"><xv:Label>codecFramingKey</xv:Label></xv:Column>
- <xv:Column mapping="gwayAliveStatus" sortable="true"><xv:Label>gwayAliveStatusKey</xv:Label></xv:Column>
- <xv:Column mapping="login" sortable="true" hidden="true"><xv:Label>gwayloginKey</xv:Label></xv:Column>
- <xv:Column mapping="password" sortable="true" hidden="true"><xv:Label>gwaypasswordKey</xv:Label></xv:Column>
- <xv:Column mapping="domainName" sortable="true" hidden="true"><xv:Label>gwaydomainNameKey</xv:Label></xv:Column>
- <xv:Column mapping="realm" sortable="true" hidden="true"><xv:Label>gwayrealmKey</xv:Label></xv:Column>
- <xv:Column mapping="rfc" sortable="true" hidden="true"><xv:Label>gwayrfcKey</xv:Label></xv:Column>
- <xv:Column mapping="remoteSipPort" sortable="true" hidden="true"><xv:Label>gwayremoteSipPortKey</xv:Label></xv:Column>
- <xv:Column mapping="dns" sortable="true" hidden="true"><xv:Label>gwaydnsKey</xv:Label></xv:Column>
- <xv:Column mapping="outBoundProxy" sortable="true" hidden="true"><xv:Label>gwayoutBoundProxyKey</xv:Label></xv:Column>
- <xv:Column mapping="sipNumbersFmtIndex" sortable="true" hidden="true"><xv:Label>gwaysipNumbersFmtIndexKey</xv:Label></xv:Column>
- </xv:Grid>
- </xv:Panel>
-
- <xv:Panel id="dnsServer" width="700" >
- <xv:WrapPanel >
- <xv:TextField id="primDnsServer" value="/GatewayParameters:GatewayParameters/primaryDnsServer" readOnly="true">
- <xv:Label>primDnsServerKey</xv:Label>
- </xv:TextField>
- <xv:Button id="modifyDnsServer" action="#{ArsGatewayParametersBean.modifyDns}">
- <xv:Label>ModifyKey</xv:Label>
- </xv:Button>
- </xv:WrapPanel>
- <xv:WrapPanel>
- <xv:TextField id="secDnsServer" width="150" value="/GatewayParameters:GatewayParameters/secondaryDnsServer" readOnly="true">
- <xv:Label>secDnsServerKey</xv:Label>
- </xv:TextField>
- </xv:WrapPanel>
- </xv:Panel>
-
-
- </xv:Panel>
-</xv:View>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:GatewayParametersAdd="http://www.alu.com/ebg/angie/sobo/config/telephony/ars/GatewayParametersAdd"
- modelInstance="-1">
- <xv:Panel id="GatewayParametersAdd" width="410">
- <xv:Title>
- <xv:Label>GatewayParametersAddKey</xv:Label>
- </xv:Title>
- <xv:TabPanel id="GatewayParametersAddTabPanel" height="300" width="400">
- <xv:Panel id="GatewayParametersAddForm" width="400" labelWidth="150">
- <xv:Title>
- <xv:Label>GatewayParametersKey</xv:Label>
- </xv:Title>
- <xv:TextField id="gwayName" maxLength="50" width="150" value="/GatewayParametersAdd:GatewayParametersAdd/gwayName">
- <xv:Label>gwayNameKey</xv:Label>
- </xv:TextField>
- <xv:ComboBox id="ipType" width="150" value="/GatewayParametersAdd:GatewayParametersAdd/ipType">
- <xv:Label>gwayipTypeKey</xv:Label>
- </xv:ComboBox>
- <xv:TextField id="ipAddress" maxLength="15" width="150" value="/GatewayParametersAdd:GatewayParametersAdd/ipAddress" onChange="#{ArsGatewayParametersAddBean.onIpAddressChange}">
- <xv:Label>gwayipAddressKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="hostname" maxLength="51" width="150" value="/GatewayParametersAdd:GatewayParametersAdd/hostname">
- <xv:Label>gwayhostnameKey</xv:Label>
- </xv:TextField>
- <xv:ComboBox id="gwayAliveProtocol" width="150" value="/GatewayParametersAdd:GatewayParametersAdd/gwayAliveProtocol">
- <xv:Label>gwayAliveProtocolKey</xv:Label>
- </xv:ComboBox>
- <xv:TextField id="gwayAliveTimeout" maxLength="4" width="150" value="/GatewayParametersAdd:GatewayParametersAdd/gwayAliveTimeout" onChange="#{ArsGatewayParametersAddBean.onTimeoutChange}">
- <xv:Label>gwayAliveTimeoutKey</xv:Label>
- </xv:TextField>
- <xv:ComboBox id="gwayBandwidth" width="150" value="/GatewayParametersAdd:GatewayParametersAdd/gwayBandwidth">
- <xv:Label>gwayBandwidthKey</xv:Label>
- </xv:ComboBox>
- <xv:ComboBox id="codecFraming" width="150" value="/GatewayParametersAdd:GatewayParametersAdd/codecFraming">
- <xv:Label>codecFramingKey</xv:Label>
- </xv:ComboBox>
- <xv:ComboBox id="gwayAliveStatus" width="150" value="/GatewayParametersAdd:GatewayParametersAdd/gwayAliveStatus">
- <xv:Label>gwayAliveStatusKey</xv:Label>
- </xv:ComboBox>
- </xv:Panel>
-
- <xv:Panel id="GatewayAdvancedParametersAddForm" width="400" labelWidth="150">
- <xv:Title>
- <xv:Label>GatewayAdvancedParametersTitleKey</xv:Label>
- </xv:Title>
- <xv:TextField id="login" maxLength="50" width="150" value="/GatewayParametersAdd:GatewayParametersAdd/login" onChange="#{ArsGatewayParametersAddBean.checkLogin}">
- <xv:Label>gwayloginKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="password" maxLength="32" width="150" value="/GatewayParametersAdd:GatewayParametersAdd/password" onChange="#{ArsGatewayParametersAddBean.checkPasswordMaxLength}">
- <xv:Label>gwaypasswordKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="domainName" maxLength="50" width="150" value="/GatewayParametersAdd:GatewayParametersAdd/domainName">
- <xv:Label>gwaydomainNameKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="realm" maxLength="20" width="150" value="/GatewayParametersAdd:GatewayParametersAdd/realm">
- <xv:Label>gwayrealmKey</xv:Label>
- </xv:TextField>
- <xv:ComboBox id="rfc" width="150" value="/GatewayParametersAdd:GatewayParametersAdd/rfc">
- <xv:Label>gwayrfcKey</xv:Label>
- </xv:ComboBox>
- <xv:TextField id="remoteSipPort" maxLength="5" width="150" value="/GatewayParametersAdd:GatewayParametersAdd/remoteSipPort" onChange="#{ArsGatewayParametersAddBean.onRemoteSipPortChange}">
- <xv:Label>gwayremoteSipPortKey</xv:Label>
- </xv:TextField>
- <xv:ComboBox id="dns" width="150" value="/GatewayParametersAdd:GatewayParametersAdd/dns" listener="#{ArsGatewayParametersAddBean}">
- <xv:Label>gwaydnsKey</xv:Label>
- </xv:ComboBox>
- <xv:TextField id="outBoundProxy" maxLength="50" width="150" value="/GatewayParametersAdd:GatewayParametersAdd/outBoundProxy" onChange="#{ArsGatewayParametersAddBean.checkOutboundProxySyntax}">
- <xv:Label>gwayoutBoundProxyKey</xv:Label>
- </xv:TextField>
-
- <xv:ComboBox id="sipNumbersFmtIndex" width="150" value="/GatewayParametersAdd:GatewayParametersAdd/sipNumbersFmtIndex">
- <xv:Label>gwaysipNumbersFmtIndexKey</xv:Label>
- </xv:ComboBox>
- </xv:Panel>
- </xv:TabPanel>
-
- <xv:Footer>
- <xv:Button id="OkButton" action="#{ArsGatewayParametersAddBean.submit}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{ArsGatewayParametersAddBean.cancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
- </xv:Panel>
-</xv:View>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:GatewayParametersDelete="http://www.alu.com/ebg/angie/sobo/config/telephony/ars/GatewayParametersDelete"
- modelInstance="-1">
-
- <xv:Panel id="GatewayParametersDeleteForm" height="170" width="410" labelWidth="140" border="true">
- <xv:Title>
- <xv:Label>GatewayParametersDeleteTitleKey</xv:Label>
- </xv:Title>
-
- <xv:FieldSet id="FSContainerLabelWidth" width="400" padding="10px 0 0 10px">
- <xv:Title>
- <xv:Label>ConfirmDeletionKey</xv:Label>
- </xv:Title>
- <xv:Label>ArsConfirmDeletionMessageKey</xv:Label>
- <xv:TextField id="hiddenRowId" value="/GatewayParametersDelete:GatewayParametersDelete/listOfRowsToDelete/GatewayToDelete/hiddenRowId">
- <xv:Label>hiddenRowId</xv:Label>
- </xv:TextField>
- </xv:FieldSet>
-
- <xv:Footer>
- <xv:Button id="OkButton" action="#{ArsGatewayParametersDeleteBean.submit}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{ArsGatewayParametersDeleteBean.cancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
- </xv:Panel>
-
-</xv:View>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:GatewayParametersModify="http://www.alu.com/ebg/angie/sobo/config/telephony/ars/GatewayParametersModify"
- modelInstance="-1">
-
- <xv:Panel id="GatewayParametersModify" width="410">
- <xv:Title>
- <xv:Label>GatewayParametersModifyKey</xv:Label>
- </xv:Title>
-
- <xv:TabPanel id="GatewayParametersModifyTabPanel" height="300" width="400">
- <xv:Panel id="GatewayParametersModifyForm" width="400" labelWidth="150">
- <xv:Title>
- <xv:Label>GatewayParametersKey</xv:Label>
- </xv:Title>
- <xv:TextField id="gwayName" maxLength="50" width="150" value="/GatewayParametersModify:GatewayParametersModify/gwayName">
- <xv:Label>gwayNameKey</xv:Label>
- </xv:TextField>
- <xv:ComboBox id="ipType" width="150" value="/GatewayParametersModify:GatewayParametersModify/ipType">
- <xv:Label>gwayipTypeKey</xv:Label>
- </xv:ComboBox>
- <xv:TextField id="ipAddress" maxLength="15" width="150" value="/GatewayParametersModify:GatewayParametersModify/ipAddress" onChange="#{ArsGatewayParametersModifyBean.onIpAddressChange}">
- <xv:Label>gwayipAddressKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="hostname" maxLength="51" width="150" value="/GatewayParametersModify:GatewayParametersModify/hostname">
- <xv:Label>gwayhostnameKey</xv:Label>
- </xv:TextField>
- <xv:ComboBox id="gwayAliveProtocol" width="150" value="/GatewayParametersModify:GatewayParametersModify/gwayAliveProtocol">
- <xv:Label>gwayAliveProtocolKey</xv:Label>
- </xv:ComboBox>
- <xv:TextField id="gwayAliveTimeout" maxLength="4" width="150" value="/GatewayParametersModify:GatewayParametersModify/gwayAliveTimeout" onChange="#{ArsGatewayParametersModifyBean.onTimeoutChange}">
- <xv:Label>gwayAliveTimeoutKey</xv:Label>
- </xv:TextField>
- <xv:ComboBox id="gwayBandwidth" width="150" value="/GatewayParametersModify:GatewayParametersModify/gwayBandwidth">
- <xv:Label>gwayBandwidthKey</xv:Label>
- </xv:ComboBox>
- <xv:ComboBox id="codecFraming" width="150" value="/GatewayParametersModify:GatewayParametersModify/codecFraming">
- <xv:Label>codecFramingKey</xv:Label>
- </xv:ComboBox>
- <xv:ComboBox id="gwayAliveStatus" width="150" value="/GatewayParametersModify:GatewayParametersModify/gwayAliveStatus">
- <xv:Label>gwayAliveStatusKey</xv:Label>
- </xv:ComboBox>
- </xv:Panel>
-
- <xv:Panel id="GatewayAdvancedParametersModifyForm" width="400" labelWidth="150">
- <xv:Title>
- <xv:Label>GatewayAdvancedParametersTitleKey</xv:Label>
- </xv:Title>
- <xv:TextField id="login" maxLength="50" width="150" value="/GatewayParametersModify:GatewayParametersModify/login" onChange="#{ArsGatewayParametersModifyBean.checkLogin}">
- <xv:Label>gwayloginKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="password" maxLength="32" width="150" value="/GatewayParametersModify:GatewayParametersModify/password" onChange="#{ArsGatewayParametersModifyBean.checkPasswordMaxLength}">
- <xv:Label>gwaypasswordKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="domainName" maxLength="50" width="150" value="/GatewayParametersModify:GatewayParametersModify/domainName">
- <xv:Label>gwaydomainNameKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="realm" maxLength="20" width="150" value="/GatewayParametersModify:GatewayParametersModify/realm">
- <xv:Label>gwayrealmKey</xv:Label>
- </xv:TextField>
- <xv:ComboBox id="rfc" width="150" value="/GatewayParametersModify:GatewayParametersModify/rfc">
- <xv:Label>gwayrfcKey</xv:Label>
- </xv:ComboBox>
- <xv:TextField id="remoteSipPort" maxLength="5" width="150" value="/GatewayParametersModify:GatewayParametersModify/remoteSipPort" onChange="#{ArsGatewayParametersModifyBean.onRemoteSipPortChange}">
- <xv:Label>gwayremoteSipPortKey</xv:Label>
- </xv:TextField>
- <xv:ComboBox id="dns" width="150" value="/GatewayParametersModify:GatewayParametersModify/dns" listener="#{ArsGatewayParametersModifyBean}">
- <xv:Label>gwaydnsKey</xv:Label>
- </xv:ComboBox>
- <xv:TextField id="outBoundProxy" maxLength="50" width="150" value="/GatewayParametersModify:GatewayParametersModify/outBoundProxy" onChange="#{ArsGatewayParametersModifyBean.checkOutboundProxySyntax}">
- <xv:Label>gwayoutBoundProxyKey</xv:Label>
- </xv:TextField>
-
- <xv:ComboBox id="sipNumbersFmtIndex" width="150" value="/GatewayParametersModify:GatewayParametersModify/sipNumbersFmtIndex">
- <xv:Label>gwaysipNumbersFmtIndexKey</xv:Label>
- </xv:ComboBox>
- </xv:Panel>
- </xv:TabPanel>
-
- <xv:Footer>
- <xv:Button id="OkButton" action="#{ArsGatewayParametersModifyBean.submit}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{ArsGatewayParametersModifyBean.cancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
- </xv:Panel>
-</xv:View>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:Prefixes="http://www.alu.com/ebg/angie/sobo/config/telephony/ars/Prefixes"
- modelInstance="-1">
-
-
- <xv:Panel id="SipPublicNumberingGrid" height="440" labelWidth="150" border="false">
- <xv:Title>
- <xv:Label>prefixesTitleKey</xv:Label>
- </xv:Title>
- <xv:ToolBar id="PrefixesToolBar">
- <xv:Button id="AddButton" action="#{ArsPrefixesBean.add}">
- <xv:Label>AddKey</xv:Label>
- </xv:Button>
- <xv:Button id="AddSublineButton" action="#{ArsPrefixesBean.addSubline}">
- <xv:Label>AddSublineKey</xv:Label>
- </xv:Button>
- <xv:Separator></xv:Separator>
- <xv:Button id="DeleteButton" action="#{ArsPrefixesBean.delete}">
- <xv:Label>DeleteKey</xv:Label>
- </xv:Button>
- <xv:Separator></xv:Separator>
- <xv:Button id="ModifyButton" action="#{ArsPrefixesBean.modify}">
- <xv:Label>ModifyKey</xv:Label>
- </xv:Button>
- </xv:ToolBar>
-
- <xv:Panel id="GridPanel">
- <xv:Grid id="prefixesGrid" width="700" height="200" value="/Prefixes:Prefixes/PrefixesGrid/PrefixesLine">
- <xv:Column mapping="hiddenRowId" sortable="true" hidden="true"><xv:Label>prefHiddenRowId</xv:Label></xv:Column>
- <xv:Column mapping="listId" sortable="true" hidden="true"><xv:Label>prefListIdKey</xv:Label></xv:Column>
- <xv:Column mapping="activation" sortable="true"><xv:Label>prefActivation</xv:Label></xv:Column>
- <xv:Column mapping="network" sortable="true"><xv:Label>prefNetwork</xv:Label></xv:Column>
- <xv:Column mapping="prefix" sortable="true"><xv:Label>prefPrefix</xv:Label></xv:Column>
- <xv:Column mapping="ranges" sortable="true"><xv:Label>prefRanges</xv:Label></xv:Column>
- <xv:Column mapping="substitute" sortable="true"><xv:Label>prefSubstitute</xv:Label></xv:Column>
- <xv:Column mapping="trGpList" sortable="true"><xv:Label>prefTrGpList</xv:Label></xv:Column>
- <xv:Column mapping="userComment" sortable="true"><xv:Label>prefUserComment</xv:Label></xv:Column>
- <xv:Column mapping="destination" sortable="true"><xv:Label>prefDestination</xv:Label></xv:Column>
- <xv:Column mapping="metering" sortable="true" hidden="true"><xv:Label>prefMetering</xv:Label></xv:Column>
- <xv:Column mapping="called" sortable="true" hidden="true"><xv:Label>prefCalled</xv:Label></xv:Column>
- <xv:Column mapping="calling" sortable="true" hidden="true"><xv:Label>prefCalling</xv:Label></xv:Column>
- <xv:Column mapping="ppCalled" sortable="true" hidden="true"><xv:Label>prefppCalled</xv:Label></xv:Column>
- </xv:Grid>
- </xv:Panel>
-
-
- </xv:Panel>
-</xv:View>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:PrefixesAdd="http://www.alu.com/ebg/angie/sobo/config/telephony/ars/PrefixesAdd"
- modelInstance="-1">
-
- <xv:Panel id="PrefixesAddForm" width="400" labelWidth="100">
- <xv:Title>
- <xv:Label>prefixesAddTitleKey</xv:Label>
- </xv:Title>
- <xv:TextField id="hiddenRowId" value="/PrefixesAdd:PrefixesAdd/hiddenRowId" readOnly="true">
- <xv:Label>prefHiddenRowId</xv:Label>
- </xv:TextField>
- <xv:TextField id="listId" maxLength="3" width="150" value="/PrefixesAdd:PrefixesAdd/listId">
- <xv:Label>prefListIdKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="activation" width="150" value="/PrefixesAdd:PrefixesAdd/activation" readOnly="true">
- <xv:Label>prefActivation</xv:Label>
- </xv:TextField>
- <xv:ComboBox id="network" width="150" value="/PrefixesAdd:PrefixesAdd/network" listener="#{ArsPrefixesAddBean}">
- <xv:Label>prefNetwork</xv:Label>
- </xv:ComboBox>
- <xv:TextField id="prefix" maxLength="16" width="150" value="/PrefixesAdd:PrefixesAdd/prefix">
- <xv:Label>prefPrefix</xv:Label>
- </xv:TextField>
- <xv:TextField id="ranges" width="150" maxLength="16" value="/PrefixesAdd:PrefixesAdd/ranges" onChange="#{ArsPrefixesAddBean.onRangesChange}">
- <xv:Label>prefRanges</xv:Label>
- </xv:TextField>
- <xv:TextField id="substitute" width="150" maxLength="16" value="/PrefixesAdd:PrefixesAdd/substitute" onChange="#{ArsPrefixesAddBean.checkIpRangesAndSubstitute}">
- <xv:Label>prefSubstitute</xv:Label>
- </xv:TextField>
- <xv:TextField id="trGpList" width="150" maxLength="3" value="/PrefixesAdd:PrefixesAdd/trGpList" onChange="#{ArsPrefixesAddBean.onTrGpListChange}">
- <xv:Label>prefTrGpList</xv:Label>
- </xv:TextField>
- <xv:TextField id="userComment" width="150" maxLength="20" value="/PrefixesAdd:PrefixesAdd/userComment">
- <xv:Label>prefUserComment</xv:Label>
- </xv:TextField>
- <xv:ComboBox id="destination" width="150" value="/PrefixesAdd:PrefixesAdd/destination" listener="#{ArsPrefixesAddBean}">
- <xv:Label>prefDestination</xv:Label>
- </xv:ComboBox>
- <xv:ComboBox id="metering" width="150" value="/PrefixesAdd:PrefixesAdd/metering">
- <xv:Label>prefMetering</xv:Label>
- </xv:ComboBox>
- <xv:ComboBox id="calling" width="150" value="/PrefixesAdd:PrefixesAdd/calling">
- <xv:Label>prefCalling</xv:Label>
- </xv:ComboBox>
- <xv:ComboBox id="called" width="150" value="/PrefixesAdd:PrefixesAdd/called">
- <xv:Label>prefCalled</xv:Label>
- </xv:ComboBox>
- <xv:ComboBox id="ppCalled" width="150" value="/PrefixesAdd:PrefixesAdd/ppCalled">
- <xv:Label>prefppCalled</xv:Label>
- </xv:ComboBox>
-
- <xv:Footer>
- <xv:Button id="OkButton" action="#{ArsPrefixesAddBean.submit}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{ArsPrefixesAddBean.cancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
- </xv:Panel>
-</xv:View>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:PrefixesAddSubline="http://www.alu.com/ebg/angie/sobo/config/telephony/ars/PrefixesAddSubline"
- modelInstance="-1">
-
- <xv:Panel id="PrefixesAddForm" width="400" labelWidth="100">
- <xv:Title>
- <xv:Label>PrefixesAddSublineTitleKey</xv:Label>
- </xv:Title>
- <xv:TextField id="hiddenRowId" value="/PrefixesAddSubline:PrefixesAddSubline/hiddenRowId" readOnly="true">
- <xv:Label>prefHiddenRowId</xv:Label>
- </xv:TextField>
- <xv:TextField id="listId" maxLength="3" width="150" value="/PrefixesAddSubline:PrefixesAddSubline/listId" readOnly="true">
- <xv:Label>prefListIdKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="activation" width="150" value="/PrefixesAddSubline:PrefixesAddSubline/activation" readOnly="true">
- <xv:Label>prefActivation</xv:Label>
- </xv:TextField>
- <xv:ComboBox id="network" width="150" value="/PrefixesAddSubline:PrefixesAddSubline/network">
- <xv:Label>prefNetwork</xv:Label>
- </xv:ComboBox>
- <xv:TextField id="prefix" maxLength="16" width="150" value="/PrefixesAddSubline:PrefixesAddSubline/prefix">
- <xv:Label>prefPrefix</xv:Label>
- </xv:TextField>
- <xv:TextField id="ranges" width="150" maxLength="16" value="/PrefixesAddSubline:PrefixesAddSubline/ranges">
- <xv:Label>prefRanges</xv:Label>
- </xv:TextField>
- <xv:TextField id="substitute" width="150" maxLength="16" value="/PrefixesAddSubline:PrefixesAddSubline/substitute" onChange="#{ArsPrefixesAddSublineBean.checkIpRangesAndSubstitute}">
- <xv:Label>prefSubstitute</xv:Label>
- </xv:TextField>
- <xv:TextField id="trGpList" width="150" maxLength="3" value="/PrefixesAddSubline:PrefixesAddSubline/trGpList" onChange="#{ArsPrefixesAddSublineBean.onTrGpListChange}">
- <xv:Label>prefTrGpList</xv:Label>
- </xv:TextField>
- <xv:TextField id="userComment" width="150" maxLength="20" value="/PrefixesAddSubline:PrefixesAddSubline/userComment">
- <xv:Label>prefUserComment</xv:Label>
- </xv:TextField>
- <xv:ComboBox id="destination" width="150" value="/PrefixesAddSubline:PrefixesAddSubline/destination" onChange="#{ArsPrefixesAddSublineBean.onDestinationChange}">
- <xv:Label>prefDestination</xv:Label>
- </xv:ComboBox>
- <xv:ComboBox id="metering" width="150" value="/PrefixesAddSubline:PrefixesAddSubline/metering">
- <xv:Label>prefMetering</xv:Label>
- </xv:ComboBox>
- <xv:ComboBox id="calling" width="150" value="/PrefixesAddSubline:PrefixesAddSubline/calling">
- <xv:Label>prefCalling</xv:Label>
- </xv:ComboBox>
- <xv:ComboBox id="called" width="150" value="/PrefixesAddSubline:PrefixesAddSubline/called">
- <xv:Label>prefCalled</xv:Label>
- </xv:ComboBox>
- <xv:ComboBox id="ppCalled" width="150" value="/PrefixesAddSubline:PrefixesAddSubline/ppCalled">
- <xv:Label>prefppCalled</xv:Label>
- </xv:ComboBox>
-
- <xv:Footer>
- <xv:Button id="OkButton" action="#{ArsPrefixesAddSublineBean.submit}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{ArsPrefixesAddSublineBean.cancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
- </xv:Panel>
-</xv:View>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:PrefixesDelete="http://www.alu.com/ebg/angie/sobo/config/telephony/ars/PrefixesDelete"
- modelInstance="-1">
-
- <xv:Panel id="PrefixesDeleteForm" height="170" width="410" labelWidth="140" border="true">
- <xv:Title>
- <xv:Label>prefixesDeleteTitleKey</xv:Label>
- </xv:Title>
-
- <xv:FieldSet id="FSContainerLabelWidth" width="400" padding="10px 0 0 10px">
- <xv:Title>
- <xv:Label>ConfirmDeletionKey</xv:Label>
- </xv:Title>
- <xv:Label>ArsConfirmDeletionMessageKey</xv:Label>
- <xv:TextField id="hiddenRowId" value="/PrefixesDelete:PrefixesDelete/listOfRowsToDelete/prefixesToDelete/hiddenRowId">
- <xv:Label>hiddenRowId</xv:Label>
- </xv:TextField>
- </xv:FieldSet>
-
- <xv:Footer>
- <xv:Button id="OkButton" action="#{ArsPrefixesDeleteBean.submit}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{ArsPrefixesDeleteBean.cancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
- </xv:Panel>
-
-</xv:View>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:PrefixesModify="http://www.alu.com/ebg/angie/sobo/config/telephony/ars/PrefixesModify"
- modelInstance="-1">
-
- <xv:Panel id="PrefixesModifyForm" width="400" labelWidth="100">
- <xv:Title>
- <xv:Label>PrefixesModifyTitleKey</xv:Label>
- </xv:Title>
- <xv:TextField id="hiddenRowId" value="/PrefixesModify:PrefixesModify/hiddenRowId" readOnly="true">
- <xv:Label>prefHiddenRowId</xv:Label>
- </xv:TextField>
- <xv:TextField id="listId" maxLength="3" width="150" value="/PrefixesModify:PrefixesModify/listId" readOnly="true">
- <xv:Label>prefListIdKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="activation" width="150" value="/PrefixesModify:PrefixesModify/activation" readOnly="true">
- <xv:Label>prefActivation</xv:Label>
- </xv:TextField>
- <xv:ComboBox id="network" width="150" value="/PrefixesModify:PrefixesModify/network" onChange="#{ArsPrefixesModifyBean.onNetworkChange}">
- <xv:Label>prefNetwork</xv:Label>
- </xv:ComboBox>
- <xv:TextField id="prefix" maxLength="16" width="150" value="/PrefixesModify:PrefixesModify/prefix">
- <xv:Label>prefPrefix</xv:Label>
- </xv:TextField>
- <xv:TextField id="ranges" maxLength="16" width="150" value="/PrefixesModify:PrefixesModify/ranges" onChange="#{ArsPrefixesModifyBean.onRangesChange}">
- <xv:Label>prefRanges</xv:Label>
- </xv:TextField>
- <xv:TextField id="substitute" maxLength="16" width="150" value="/PrefixesModify:PrefixesModify/substitute" onChange="#{ArsPrefixesModifyBean.checkIpRangesAndSubstitute}">
- <xv:Label>prefSubstitute</xv:Label>
- </xv:TextField>
- <xv:TextField id="trGpList" maxLength="3" width="150" value="/PrefixesModify:PrefixesModify/trGpList" onChange="#{ArsPrefixesModifyBean.onTrGpListChange}">
- <xv:Label>prefTrGpList</xv:Label>
- </xv:TextField>
- <xv:TextField id="userComment" maxLength="20" width="150" value="/PrefixesModify:PrefixesModify/userComment">
- <xv:Label>prefUserComment</xv:Label>
- </xv:TextField>
- <xv:ComboBox id="destination" width="150" value="/PrefixesModify:PrefixesModify/destination" onChange="#{ArsPrefixesModifyBean.onDestinationChange}">
- <xv:Label>prefDestination</xv:Label>
- </xv:ComboBox>
- <xv:ComboBox id="metering" width="150" value="/PrefixesModify:PrefixesModify/metering">
- <xv:Label>prefMetering</xv:Label>
- </xv:ComboBox>
- <xv:ComboBox id="calling" width="150" value="/PrefixesModify:PrefixesModify/calling">
- <xv:Label>prefCalling</xv:Label>
- </xv:ComboBox>
- <xv:ComboBox id="called" width="150" value="/PrefixesModify:PrefixesModify/called">
- <xv:Label>prefCalled</xv:Label>
- </xv:ComboBox>
- <xv:ComboBox id="ppCalled" width="150" value="/PrefixesModify:PrefixesModify/ppCalled">
- <xv:Label>prefppCalled</xv:Label>
- </xv:ComboBox>
-
- <xv:Footer>
- <xv:Button id="OkButton" action="#{ArsPrefixesModifyBean.submit}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{ArsPrefixesModifyBean.cancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
- </xv:Panel>
-</xv:View>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:ArsSelectionList="http://www.alu.com/ebg/angie/sobo/config/telephony/ars/ArsSelectionList"
- modelInstance="-1">
-
- <xv:Panel id="ArsSelectionListGrid" height="260" width="450" border="true">
- <xv:Title>
- <xv:Label>ArsSelectionListTitleKey</xv:Label>
- </xv:Title>
-
- <xv:Panel id="GridPanel">
- <xv:Grid id="selectionListGrid" width="420" height="180"
- value="/ArsSelectionList:ArsSelectionList/ArsSelectionListGrid/ArsSelectionListLine">
- <xv:Column mapping="objc" sortable="true"><xv:Label>ArsSelectionListobjcKey</xv:Label></xv:Column>
- <xv:Column mapping="index" sortable="true"><xv:Label>ArsSelectionListIndexKey</xv:Label></xv:Column>
- <xv:Column mapping="internalNo" sortable="true"><xv:Label>ArsSelectionListInternalNoKey</xv:Label></xv:Column>
- <xv:Column mapping="type" sortable="true"><xv:Label>ArsSelectionListTypeKey</xv:Label></xv:Column>
- </xv:Grid>
- </xv:Panel>
-
- <xv:Footer>
- <xv:Button id="OkButton" action="#{ArsSelectionListBean.submit}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{ArsSelectionListBean.cancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
- </xv:Panel>
-</xv:View>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:SipPublicNumbering="http://www.alu.com/ebg/angie/sobo/config/telephony/ars/SipPublicNumbering"
- modelInstance="-1">
-
- <xv:Panel id="SipPublicNumberingGrid" height="440" labelWidth="150" border="false">
- <xv:Title>
- <xv:Label>SipTitleKey</xv:Label>
- </xv:Title>
- <xv:ToolBar id="SipPublicNumberingToolBar">
- <xv:Button id="AddButton" action="#{ArsSipPublicNumberingBean.add}">
- <xv:Label>AddKey</xv:Label>
- </xv:Button>
- <xv:Separator></xv:Separator>
- <xv:Button id="DeleteButton" action="#{ArsSipPublicNumberingBean.delete}">
- <xv:Label>DeleteKey</xv:Label>
- </xv:Button>
- <xv:Separator></xv:Separator>
- <xv:Button id="ModifyButton" action="#{ArsSipPublicNumberingBean.modify}">
- <xv:Label>ModifyKey</xv:Label>
- </xv:Button>
- </xv:ToolBar>
-
- <xv:Panel id="GridPanel">
- <xv:Grid id="SipGrid" width="700" height="200"
- value="/SipPublicNumbering:SipPublicNumbering/SipPublicNumberingGrid/SipPublicNumberingLine">
- <xv:Column mapping="index" sortable="true" hidden="true"><xv:Label>SipIndexKey</xv:Label></xv:Column>
- <xv:Column mapping="outCallingFormat" sortable="true"><xv:Label>outCallingFmtKey</xv:Label></xv:Column>
- <xv:Column mapping="outCallingPrefix" sortable="true"><xv:Label>outCallingPrefKey</xv:Label></xv:Column>
- <xv:Column mapping="outCalledFormat" sortable="true"><xv:Label>outCalledFmtKey</xv:Label></xv:Column>
- <xv:Column mapping="outCalledPrefix" sortable="true"><xv:Label>outCalledPrefKey</xv:Label></xv:Column>
- <xv:Column mapping="outCalledShortPrefix" sortable="true"><xv:Label>outCalledShortPrefKey</xv:Label></xv:Column>
- <xv:Column mapping="incCallingFormat" sortable="true"><xv:Label>inCallingFmtKey</xv:Label></xv:Column>
- <xv:Column mapping="incCallingPrefix" sortable="true"><xv:Label>inCallingPrefKey</xv:Label></xv:Column>
- <xv:Column mapping="incCalledFormat" sortable="true"><xv:Label>inCalledFmtKey</xv:Label></xv:Column>
- <xv:Column mapping="incCalledPrefix" sortable="true"><xv:Label>inCalledPrefKey</xv:Label></xv:Column>
- </xv:Grid>
- </xv:Panel>
- </xv:Panel>
-</xv:View>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:SipPublicNumberingAdd="http://www.alu.com/ebg/angie/sobo/config/telephony/ars/SipPublicNumberingAdd"
- modelInstance="-1">
-
- <xv:Panel id="SipPublicNumberingAddForm" height="420" width="400" labelWidth="150">
- <xv:Title>
- <xv:Label>SipAddTitleKey</xv:Label>
- </xv:Title>
-
-
- <xv:ComboBox id="CFO" width="150" value="/SipPublicNumberingAdd:SipPublicNumberingAdd/outCallingFormat">
- <xv:Label>outCallingFmtKey</xv:Label>
- <xv:Entry key="0">Canonical</xv:Entry>
- <xv:Entry key="1">International</xv:Entry>
- <xv:Entry key="2">National</xv:Entry>
- <xv:Entry key="3">National without intercity prefix</xv:Entry>
- <xv:Entry key="4">Regional</xv:Entry>
- </xv:ComboBox>
-
- <xv:TextField id="CPO" maxLength="10" width="150" value="/SipPublicNumberingAdd:SipPublicNumberingAdd/outCallingPrefix">
- <xv:Label>outCallingPrefKey</xv:Label>
- </xv:TextField>
-
- <xv:ComboBox id="CdFO" width="150" value="/SipPublicNumberingAdd:SipPublicNumberingAdd/outCalledFormat">
- <xv:Label>outCalledFmtKey</xv:Label>
- <xv:Entry key="0">Canonical</xv:Entry>
- <xv:Entry key="1">International</xv:Entry>
- <xv:Entry key="2">National/International</xv:Entry>
- <xv:Entry key="3">National without intercity prefix</xv:Entry>
- <xv:Entry key="4">Undefined</xv:Entry>
- </xv:ComboBox>
-
- <xv:TextField id="CdPO" maxLength="10" width="150" value="/SipPublicNumberingAdd:SipPublicNumberingAdd/outCalledPrefix">
- <xv:Label>outCalledPrefKey</xv:Label>
- </xv:TextField>
-
- <xv:TextField id="CdPSO" maxLength="10" width="150" value="/SipPublicNumberingAdd:SipPublicNumberingAdd/outCalledShortPrefix">
- <xv:Label>outCalledShortPrefKey</xv:Label>
- </xv:TextField>
-
- <xv:ComboBox id="CFI" width="150" value="/SipPublicNumberingAdd:SipPublicNumberingAdd/incCallingFormat">
- <xv:Label>inCallingFmtKey</xv:Label>
- <xv:Entry key="0">Canonical/International</xv:Entry>
- <xv:Entry key="1">National</xv:Entry>
- <xv:Entry key="2">Regional</xv:Entry>
- <xv:Entry key="3">Unknown</xv:Entry>
- </xv:ComboBox>
-
- <xv:TextField id="CPI" maxLength="20" width="150" value="/SipPublicNumberingAdd:SipPublicNumberingAdd/incCallingPrefix">
- <xv:Label>inCallingPrefKey</xv:Label>
- </xv:TextField>
-
- <xv:ComboBox id="CdFI" width="150" value="/SipPublicNumberingAdd:SipPublicNumberingAdd/incCalledFormat">
- <xv:Label>inCalledFmtKey</xv:Label>
- <xv:Entry key="0">Canonical/International</xv:Entry>
- <xv:Entry key="1">National</xv:Entry>
- <xv:Entry key="2">Regional</xv:Entry>
- <xv:Entry key="3">DDI</xv:Entry>
- </xv:ComboBox>
-
- <xv:TextField id="CdPI" maxLength="20" width="150" value="/SipPublicNumberingAdd:SipPublicNumberingAdd/incCalledPrefix">
- <xv:Label>inCalledPrefKey</xv:Label>
- </xv:TextField>
-
- <xv:Footer>
- <xv:Button id="OkButton" action="#{ArsSipPublicNumberingAddBean.submit}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{ArsSipPublicNumberingAddBean.cancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
- </xv:Panel>
-</xv:View>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:SipPublicNumberingDelete="http://www.alu.com/ebg/angie/sobo/config/telephony/ars/SipPublicNumberingDelete"
- modelInstance="-1">
-
- <xv:Panel id="SipPublicNumberingDeleteForm" height="200" width="450" labelWidth="140" border="false">
- <xv:Title>
- <xv:Label>ArsSipPublicNumberingDeleteKey</xv:Label>
- </xv:Title>
-
- <xv:FieldSet id="FSContainerLabelWidth" width="400" padding="10px 0 0 10px">
- <xv:Title>
- <xv:Label>ConfirmDeletionKey</xv:Label>
- </xv:Title>
- <xv:Label>ArsConfirmDeletionMessageKey</xv:Label>
- <xv:TextField id="hiddenIndex" readOnly="true" width="150" value="/SipPublicNumberingDelete:SipPublicNumberingDelete/listOfRowsToDelete/prefixToDelete/index">
- <xv:Label>SipIndexKey</xv:Label>
- </xv:TextField>
- </xv:FieldSet>
-
- <xv:Footer>
- <xv:Button id="OkButton" action="#{ArsSipPublicNumberingDeleteBean.submit}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{ArsSipPublicNumberingDeleteBean.cancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
- </xv:Panel>
-
-</xv:View>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:SipPublicNumberingModify="http://www.alu.com/ebg/angie/sobo/config/telephony/ars/SipPublicNumberingModify"
- modelInstance="-1">
-
- <xv:Panel id="SipPublicNumberingModifyForm" height="420" labelWidth="150" width="400">
- <xv:Title>
- <xv:Label>SipModifyTitleKey</xv:Label>
- </xv:Title>
- <xv:ComboBox id="CFO" width="150" value="/SipPublicNumberingModify:SipPublicNumberingModify/outCallingFormat">
- <xv:Label>outCallingFmtKey</xv:Label>
- <xv:Entry key="0">Canonical</xv:Entry>
- <xv:Entry key="1">International</xv:Entry>
- <xv:Entry key="2">National</xv:Entry>
- <xv:Entry key="3">National without intercity prefix</xv:Entry>
- <xv:Entry key="4">Regional</xv:Entry>
- </xv:ComboBox>
-
- <xv:TextField id="CPO" maxLength="10" width="150" value="/SipPublicNumberingModify:SipPublicNumberingModify/outCallingPrefix">
- <xv:Label>outCallingPrefKey</xv:Label>
- </xv:TextField>
-
- <xv:ComboBox id="CdFO" width="150" value="/SipPublicNumberingModify:SipPublicNumberingModify/outCalledFormat">
- <xv:Label>outCalledFmtKey</xv:Label>
- <xv:Entry key="0">Canonical</xv:Entry>
- <xv:Entry key="1">International</xv:Entry>
- <xv:Entry key="2">National/International</xv:Entry>
- <xv:Entry key="3">National without intercity prefix</xv:Entry>
- <xv:Entry key="4">Undefined</xv:Entry>
- </xv:ComboBox>
-
- <xv:TextField id="CdPO" maxLength="10" width="150" value="/SipPublicNumberingModify:SipPublicNumberingModify/outCalledPrefix">
- <xv:Label>outCalledPrefKey</xv:Label>
- </xv:TextField>
-
- <xv:TextField id="CdPSO" maxLength="10" width="150" value="/SipPublicNumberingModify:SipPublicNumberingModify/outCalledShortPrefix">
- <xv:Label>outCalledShortPrefKey</xv:Label>
- </xv:TextField>
-
- <xv:ComboBox id="CFI" width="150" value="/SipPublicNumberingModify:SipPublicNumberingModify/incCallingFormat">
- <xv:Label>inCallingFmtKey</xv:Label>
- <xv:Entry key="0">Canonical/International</xv:Entry>
- <xv:Entry key="1">National</xv:Entry>
- <xv:Entry key="2">Regional</xv:Entry>
- <xv:Entry key="3">Unknown</xv:Entry>
- </xv:ComboBox>
-
- <xv:TextField id="CPI" maxLength="20" width="150" value="/SipPublicNumberingModify:SipPublicNumberingModify/incCallingPrefix">
- <xv:Label>inCallingPrefKey</xv:Label>
- </xv:TextField>
-
- <xv:ComboBox id="CdFI" width="150" value="/SipPublicNumberingModify:SipPublicNumberingModify/incCalledFormat">
- <xv:Label>inCalledFmtKey</xv:Label>
- <xv:Entry key="0">Canonical/International</xv:Entry>
- <xv:Entry key="1">National</xv:Entry>
- <xv:Entry key="2">Regional</xv:Entry>
- <xv:Entry key="3">DDI</xv:Entry>
- </xv:ComboBox>
-
- <xv:TextField id="CdPI" maxLength="20" width="150" value="/SipPublicNumberingModify:SipPublicNumberingModify/incCalledPrefix">
- <xv:Label>inCalledPrefKey</xv:Label>
- </xv:TextField>
-
- <xv:Footer>
- <xv:Button id="OkButton" action="#{ArsSipPublicNumberingModifyBean.submit}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{ArsSipPublicNumberingModifyBean.cancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
- </xv:Panel>
-</xv:View>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:TrunkGroupsLists="http://www.alu.com/ebg/angie/sobo/config/telephony/ars/TrunkGroupsLists"
- modelInstance="-1">
-
-
- <xv:Panel id="SipPublicNumberingGrid" height="440" labelWidth="150" border="false">
- <xv:Title>
- <xv:Label>trunkTitleKey</xv:Label>
- </xv:Title>
- <xv:ToolBar id="trunkGroupsListsToolBar">
- <xv:Button id="AddButton" action="#{ArsTrunkGroupsListsBean.add}">
- <xv:Label>AddKey</xv:Label>
- </xv:Button>
- <xv:Button id="AddSublineButton" action="#{ArsTrunkGroupsListsBean.addSubline}">
- <xv:Label>AddSublineKey</xv:Label>
- </xv:Button>
- <xv:Separator></xv:Separator>
- <xv:Button id="DeleteButton" action="#{ArsTrunkGroupsListsBean.delete}">
- <xv:Label>DeleteKey</xv:Label>
- </xv:Button>
- <xv:Separator></xv:Separator>
- <xv:Button id="ModifyButton" action="#{ArsTrunkGroupsListsBean.modify}">
- <xv:Label>ModifyKey</xv:Label>
- </xv:Button>
- </xv:ToolBar>
-
- <xv:Panel id="GridPanel">
- <xv:Grid id="trunkGrid" width="700" height="200" value="/TrunkGroupsLists:TrunkGroupsLists/TrunkGroupsListsGrid/TrunkGroupsListsLine">
- <xv:Column mapping="hiddenRowId" sortable="true" hidden="true"><xv:Label>hiddenRowId</xv:Label></xv:Column>
- <xv:Column mapping="listId" sortable="true"><xv:Label>listIdKey</xv:Label></xv:Column>
- <xv:Column mapping="index" sortable="true"><xv:Label>trunkIndexKey</xv:Label></xv:Column>
- <xv:Column mapping="directoryNo" sortable="true"><xv:Label>directoryNoKey</xv:Label></xv:Column>
- <xv:Column mapping="identChar" sortable="true"><xv:Label>identCharKey</xv:Label></xv:Column>
- </xv:Grid>
- </xv:Panel>
-
-
- </xv:Panel>
-</xv:View>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:TrunkGroupsListsAdd="http://www.alu.com/ebg/angie/sobo/config/telephony/ars/TrunkGroupsListsAdd"
- modelInstance="-1">
-
- <xv:Panel id="TrunkGroupsListsAddForm" width="400" height="250" labelWidth="100">
- <xv:Title>
- <xv:Label>trunkAddTitleKey</xv:Label>
- </xv:Title>
- <xv:TextField id="hiddenRowId" value="/TrunkGroupsListsAdd:TrunkGroupsListsAdd/hiddenRowId" readOnly="true">
- <xv:Label>hiddenRowId</xv:Label>
- </xv:TextField>
- <xv:TextField id="listId" maxLength="3" width="150" value="/TrunkGroupsListsAdd:TrunkGroupsListsAdd/listId">
- <xv:Label>listIdKey</xv:Label>
- </xv:TextField>
- <xv:WrapPanel>
- <xv:TextField id="index" width="150" value="/TrunkGroupsListsAdd:TrunkGroupsListsAdd/index" readOnly="true">
- <xv:Label>trunkIndexKey</xv:Label>
- </xv:TextField>
- <xv:Button id="go" action="#{ArsTrunkGroupsListsAddBean.setBdlIndex}">
- ...
- </xv:Button>
- </xv:WrapPanel>
- <xv:TextField id="directoryNo" width="150" value="/TrunkGroupsListsAdd:TrunkGroupsListsAdd/directoryNo" readOnly="true">
- <xv:Label>directoryNoKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="char" width="150" maxLength="1" value="/TrunkGroupsListsAdd:TrunkGroupsListsAdd/identChar">
- <xv:Label>identCharKey</xv:Label>
- </xv:TextField>
-
- <xv:Footer>
- <xv:Button id="OkButton" action="#{ArsTrunkGroupsListsAddBean.submit}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{ArsTrunkGroupsListsAddBean.cancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
- </xv:Panel>
-</xv:View>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:TrunkGroupsListsAddSubline="http://www.alu.com/ebg/angie/sobo/config/telephony/ars/TrunkGroupsListsAddSubline"
- modelInstance="-1">
-
- <xv:Panel id="TrunkGroupsListsAddSublineForm" width="400" height="420" labelWidth="100">
- <xv:Title>
- <xv:Label>trunkAddSublineTitleKey</xv:Label>
- </xv:Title>
- <xv:TextField id="hiddenRowId" value="/TrunkGroupsListsAddSubline:TrunkGroupsListsAddSubline/hiddenRowId">
- <xv:Label>hiddenRowId</xv:Label>
- </xv:TextField>
- <xv:TextField id="listId" width="150" value="/TrunkGroupsListsAddSubline:TrunkGroupsListsAddSubline/listId" readOnly="true">
- <xv:Label>listIdKey</xv:Label>
- </xv:TextField>
- <xv:WrapPanel>
- <xv:TextField id="index" width="150" value="/TrunkGroupsListsAddSubline:TrunkGroupsListsAddSubline/index" readOnly="true">
- <xv:Label>trunkIndexKey</xv:Label>
- </xv:TextField>
- <xv:Button id="go" action="#{ArsTrunkGroupsListsAddSublineBean.setBdlIndex}">
- ...
- </xv:Button>
- </xv:WrapPanel>
- <xv:TextField id="directoryNo" width="150" value="/TrunkGroupsListsAddSubline:TrunkGroupsListsAddSubline/directoryNo" readOnly="true">
- <xv:Label>directoryNoKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="char" width="150" maxLength="1" value="/TrunkGroupsListsAddSubline:TrunkGroupsListsAddSubline/identChar">
- <xv:Label>identCharKey</xv:Label>
- </xv:TextField>
-
- <xv:Footer>
- <xv:Button id="OkButton" action="#{ArsTrunkGroupsListsAddSublineBean.submit}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{ArsTrunkGroupsListsAddSublineBean.cancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
- </xv:Panel>
-</xv:View>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:TrunkGroupsListsDelete="http://www.alu.com/ebg/angie/sobo/config/telephony/ars/TrunkGroupsListsDelete"
- modelInstance="-1">
-
- <xv:Panel id="TrunkGroupsListsDeleteForm" height="170" width="410" labelWidth="140" border="true">
- <xv:Title>
- <xv:Label>trunkDeleteTitleKey</xv:Label>
- </xv:Title>
-
- <xv:FieldSet id="FSContainerLabelWidth" width="400" padding="10px 0 0 10px">
- <xv:Title>
- <xv:Label>ConfirmDeletionKey</xv:Label>
- </xv:Title>
- <xv:Label>ArsConfirmDeletionMessageKey</xv:Label>
- <xv:TextField id="hiddenRowId" value="/TrunkGroupsListsDelete:TrunkGroupsListsDelete/listOfRowsToDelete/trunkListToDelete/hiddenRowId">
- <xv:Label>hiddenRowId</xv:Label>
- </xv:TextField>
- </xv:FieldSet>
-
- <xv:Footer>
- <xv:Button id="OkButton" action="#{ArsTrunkGroupsListsDeleteBean.submit}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{ArsTrunkGroupsListsDeleteBean.cancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
- </xv:Panel>
-
-</xv:View>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:TrunkGroupsListsModify="http://www.alu.com/ebg/angie/sobo/config/telephony/ars/TrunkGroupsListsModify"
- modelInstance="-1">
-
- <xv:Panel id="TrunkGroupsListsModifyForm" width="400" height="250" labelWidth="100">
- <xv:Title>
- <xv:Label>trunkModifyTitleKey</xv:Label>
- </xv:Title>
- <xv:TextField id="hiddenRowId" value="/TrunkGroupsListsModify:TrunkGroupsListsModify/hiddenRowId">
- <xv:Label>hiddenRowId</xv:Label>
- </xv:TextField>
- <xv:TextField id="listId" maxLength="3" width="150" value="/TrunkGroupsListsModify:TrunkGroupsListsModify/listId">
- <xv:Label>listIdKey</xv:Label>
- </xv:TextField>
- <xv:WrapPanel>
- <xv:TextField id="index" width="150" value="/TrunkGroupsListsModify:TrunkGroupsListsModify/index" readOnly="true">
- <xv:Label>trunkIndexKey</xv:Label>
- </xv:TextField>
- <xv:Button id="go" action="#{ArsTrunkGroupsListsModifyBean.setBdlIndex}">
- ...
- </xv:Button>
- </xv:WrapPanel>
- <xv:TextField id="directoryNo" width="150" value="/TrunkGroupsListsModify:TrunkGroupsListsModify/directoryNo" readOnly="true">
- <xv:Label>directoryNoKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="char" maxLength="1" value="/TrunkGroupsListsModify:TrunkGroupsListsModify/identChar">
- <xv:Label>identCharKey</xv:Label>
- </xv:TextField>
-
- <xv:Footer>
- <xv:Button id="OkButton" action="#{ArsTrunkGroupsListsModifyBean.submit}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{ArsTrunkGroupsListsModifyBean.cancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
- </xv:Panel>
-</xv:View>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:devicesAdd="http://www.alu.com/ebg/angie/sobo/config/telephony/devices/DevicesAdd"
- modelInstance="-1">
-
- <xv:Panel id="DevicesAddForm" height="440" labelWidth="140" border="false">
- <xv:Title>
- <xv:Label>DevicesAddTitleKey</xv:Label>
- </xv:Title>
-
- <!-- Radio Group Panel -->
- <xv:Panel id="panelRadioGroup" labelWidth="150" border="false" padding="5">
- <xv:RadioGroup id="rgAddSubscriber" orientation="vertical" value="/devicesAdd:DevicesAdd/selectedType" onChange="#{DevicesAddBean.onChangeTerminalType}">
- <xv:Radio value="IPTerminal">
- <xv:Label>DevicesAddIPTerminalKey</xv:Label>
- </xv:Radio>
- <xv:Radio value="VirtualTerminal">
- <xv:Label>DevicesAddVirtualTerminalKey</xv:Label>
- </xv:Radio>
-<!-- <xv:Radio value="SIPTerminal" -->
-<!-- <xv:Label>DevicesAddSIPTerminalKey</xv:Label -->
-<!-- </xv:Radio -->
- </xv:RadioGroup>
- </xv:Panel>
-
- <!-- Fields Panel -->
- <xv:Panel id="panelFields" labelWidth="150" border="false" padding="5">
- <!-- Number of devices -->
- <xv:Spinner id="spNbDevices" value="/devicesAdd:DevicesAdd/selectedNumberOfDevice">
- <xv:Label>DevicesAddNbDevicesKey</xv:Label>
- </xv:Spinner>
- <!-- Device Number -->
- <xv:ComboBox id="cbNoDevice">
- <xv:Label>No.</xv:Label>
- <xv:Entry key="127">127</xv:Entry>
- <xv:Entry key="128">128</xv:Entry>
- <xv:Entry key="129">129</xv:Entry>
- </xv:ComboBox>
- </xv:Panel>
-
- <!-- Bottom of tab : buttons -->
- <xv:Footer>
- <xv:Button id="buttonOKInternal" action="#{DevicesAddBean.onClickOk}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{DevicesAddBean.onClickCancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
- </xv:Panel>
-
- <!-- Invisible panel -->
- <xv:Panel id="InvisiblePanel">
- <xv:TextField id="InvisibleField1"
- value="/devicesAdd:DevicesAdd/hasSubDevice">
- </xv:TextField>
- </xv:Panel>
-</xv:View>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:devicesDelete="http://www.alu.com/ebg/angie/sobo/config/telephony/devices/DevicesDelete"
- modelInstance="-1">
-
- <xv:Panel id="DevicesDeleteForm" labelWidth="140" border="false">
- <xv:Title>
- <xv:Label>DevicesDeleteTitleKey</xv:Label>
- </xv:Title>
-
- <xv:FieldSet id="FSContainerLabelWidth" width="400" padding="10px 0 0 10px">
- <xv:Title>
- <xv:Label>ConfirmDeletionKey</xv:Label>
- </xv:Title>
- <xv:Label>DevicesConfirmDeletionMessageKey</xv:Label>
- </xv:FieldSet>
-
- <xv:Footer>
- <xv:Button id="OkButton" action="#{DevicesDeleteBean.submit}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{DevicesDeleteBean.cancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
-
- </xv:Panel>
- <xv:Panel id="InvisiblePanel">
- <xv:TextField id="InvisibleField"
- value="/devicesDelete:DevicesDelete/listOfDevicesToDelete">
- </xv:TextField>
- </xv:Panel>
-</xv:View>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:devicesDetails="http://www.alu.com/ebg/angie/sobo/config/telephony/devices/DevicesDetails"
- modelInstance="-1">
-
- <!-- <xv:Panel id="DevicesDetailsForm" labelWidth="140" border="false" width="715" height="440"> -->
- <xv:Panel id="DevicesDetailsForm" labelWidth="140" border="true" width="420" height="490">
- <xv:Title>
- <xv:Label>DevicesDetailsTitleKey</xv:Label>
- </xv:Title>
-<!-- <xv:TabPanel id="DevicesDetailsTabPanel" height="360"> -->
- <xv:TabPanel id="DevicesDetailsTabPanel" height="420" width="410">
-
-<!-- BEGIN OF MAIN PANEL -->
-
- <xv:Panel id="MainDetailsPanel">
- <xv:Title>
- <xv:Label>DevicesDetailsMainPanelKey</xv:Label>
- </xv:Title>
-
- <!-- DEVICE -->
-
- <xv:FieldSet id="DeviceFieldSet">
- <xv:Title>
- <xv:Label>DevicesDetailsDeviceFieldSetKey</xv:Label>
- </xv:Title>
- <xv:TextField id="PhysicalAddressTextField" readOnly="true" value="/devicesDetails:DevicesDetails/PhysicalAddress">
- <xv:Label>DevicesDetailsPhysicalAddressTextFieldKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="NameTextField" readOnly="true" value="/devicesDetails:DevicesDetails/Name">
- <xv:Label>DevicesDetailsNameTextFieldKey</xv:Label>
- </xv:TextField>
- <xv:WrapPanel>
- <xv:TextField id="deviceTypeTextField" readOnly="true">
- <xv:Label>DevicesDetailsOriginalTypeTextFieldKey</xv:Label>
- </xv:TextField>
- <xv:Button id="ModifyTypeButton" action="#{DevicesDetailsBean.onClickType}">
- <xv:Label>DevicesDetailsModifyTypeButtonKey</xv:Label>
- </xv:Button>
- </xv:WrapPanel>
- </xv:FieldSet>
-
-
-
- <!-- IP -->
-
- <xv:FieldSet id="IPFieldSet">
- <xv:Title>
- <xv:Label>DevicesDetailsIPFieldSetKey</xv:Label>
- </xv:Title>
- <xv:TextField id="MACAdressTextField" value="/devicesDetails:DevicesDetails/MacAddress">
- <xv:Label>DevicesDetailsMACAdressTextFieldKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="IPAddressTextField" readOnly="true" value="/devicesDetails:DevicesDetails/IPAddress">
- <xv:Label>DevicesDetailsIPAddressTextFieldKey</xv:Label>
- </xv:TextField>
-
- <!-- <xv:ComboBox id="voiceCodingComboBox" value="/devicesDetails:DevicesDetails/VoiceCodingDecoding/comboSelect" items="/devicesDetails:DevicesDetails/VoiceCodingDecoding/entryCombo"> -->
- <xv:ComboBox id="voiceCodingComboBox" value="/devicesDetails:DevicesDetails/VoiceCodingDecoding/comboSelect">
- <xv:Label>DevicesDetailsVoiceCodingComboBoxKey</xv:Label>
- </xv:ComboBox>
-
- <xv:CheckBox id="echoCancellationCheckBox" ignoreAlign="true" value="/devicesDetails:DevicesDetails/EchoCancellation">
- <xv:Label>DevicesDetailsEchoCancellationCheckBoxKey</xv:Label>
- </xv:CheckBox>
- <xv:CheckBox id="voiceActiveDetectionCheckBox" ignoreAlign="true" value="/devicesDetails:DevicesDetails/VoiceActiveDetection">
- <xv:Label>DevicesDetailsVoiceActiveDetectionCheckBoxKey</xv:Label>
- </xv:CheckBox>
- </xv:FieldSet>
-
- <!-- SIP -->
-
- <xv:FieldSet id="SIPFieldSet">
- <xv:Title>
- <xv:Label>DevicesDetailsSIPFieldSetKey</xv:Label>
- </xv:Title>
- <xv:FieldSet id="authentificateFieldSet">
- <xv:Title/>
- <xv:CheckBox id="authentificateCheckBox" ignoreAlign="true" value="/devicesDetails:DevicesDetails/IdentificateSIP">
- <xv:Label>DevicesDetailsAuthentificateSIPCheckBoxKey</xv:Label>
- <xv:Subset>
- <xv:TextField id="identityTextField">
- <xv:Label>DevicesDetailsSIPIdentityTextFieldKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="passwordTextField" password="true" value="/devicesDetails:DevicesDetails/SIPPassword">
- <xv:Label>DevicesDetailsSIPPasswordTextFieldKey</xv:Label>
- </xv:TextField>
- </xv:Subset>
- </xv:CheckBox>
- </xv:FieldSet>
- <xv:ComboBox id="deviceProfileComboBox">
- <xv:Label>DevicesDetailsProfileCheckBoxKey</xv:Label>
- <xv:Entry key="default">default</xv:Entry>
- <xv:Entry key="Profil1">Profil 1</xv:Entry>
- <xv:Entry key="Profil2">Profil 2</xv:Entry>
- </xv:ComboBox>
- </xv:FieldSet>
-
- <!--OUT OF SERVICE -->
-
- <xv:FieldSet id="outOfServiceFieldSet">
- <xv:Title/>
- <xv:Label id="physicalInServiceLabel"/>
- <xv:CheckBox id="outOfServiceCheckBox" value="/devicesDetails:DevicesDetails/OutOfService">
- Out of Service (logically)
- </xv:CheckBox>
- </xv:FieldSet>
-
- </xv:Panel>
-
-<!-- END OF MAIN PANEL -->
-
-<!-- BEGIN OF MISCELLANEOUS PANEL -->
-
- <xv:Panel id="MiscellaneousDetailsPanel">
- <xv:Title>
- <xv:Label>DevicesDetailsMiscellaneousPanelKey</xv:Label>
- </xv:Title>
-
- <!-- HOTLINE -->
-
- <xv:FieldSet id="hotlineFieldSet">
- <xv:Title>
- <xv:Label>DevicesDetailsHotlineFieldSetKey</xv:Label>
- </xv:Title>
- <xv:RadioGroup id="hotlineRadioGroup" orientation="vertical" value="None">
- <xv:Radio value="None">None</xv:Radio>
- <xv:Radio value="Immediate">Immediate</xv:Radio>
- <xv:Radio value="Delayed">Delayed</xv:Radio>
- </xv:RadioGroup>
- <xv:ComboBox id="DestinationNumberComboBox" value="/devicesDetails:DevicesDetails/DestinationNumber/comboSelect">
- <xv:Label>DevicesDetailsDestinationNumberComboBoxKey</xv:Label>
- </xv:ComboBox>
- </xv:FieldSet>
-
- <!-- CUG -->
-
- <xv:FieldSet id="CUGFieldSet">
- <xv:Title/>
- <xv:CheckBox id="outgoingAccessCheckBox">
- <xv:Label>DevicesDetailsOutgoingAccessCheckBoxKey</xv:Label>
- </xv:CheckBox>
- </xv:FieldSet>
-
- <!-- FIELDSET 3 -->
-
- <xv:FieldSet id="FieldSet3">
- <xv:Title/>
- <xv:TextField id="lockStateTextField" readOnly="true">
- <xv:Label>DevicesDetailsLockStateTextFieldKey</xv:Label>
- </xv:TextField>
- </xv:FieldSet>
-
- <!-- FIELDSET 4 -->
-
- <xv:FieldSet id="FieldSet4">
- <xv:Title/>
-
- <!-- <xv:ComboBox id="typeOfKeyboardComboBox" value="/devicesDetails:DevicesDetails/TypeOfKeyboard/comboSelect" items="/devicesDetails:DevicesDetails/TypeOfKeyboard/entryCombo">-->
- <xv:ComboBox id="typeOfKeyboardComboBox" value="/devicesDetails:DevicesDetails/TypeOfKeyboard/comboSelect">
- <xv:Label>DevicesDetailsTypeOfKeyboardComboBoxKey</xv:Label>
- </xv:ComboBox>
-
- <!-- <xv:ComboBox id="numericKeypadTypeComboBox" value="/devicesDetails:DevicesDetails/TypeOfKeypad/comboSelect" items="/devicesDetails:DevicesDetails/TypeOfKeypad/entryCombo">-->
- <xv:ComboBox id="numericKeypadTypeComboBox" value="/devicesDetails:DevicesDetails/TypeOfKeypad/comboSelect">
- <xv:Label>DevicesDetailsNumericKeypadTypeComboBoxKey</xv:Label>
- </xv:ComboBox>
-
- <xv:ComboBox id="prorityLevelComboBox" value="/devicesDetails:DevicesDetails/PriorityLevel">
- <xv:Label>Priority Level</xv:Label>
- </xv:ComboBox>
- </xv:FieldSet>
-
- </xv:Panel>
-
-<!-- END OF MISCELLANEOUS PANEL -->
-
-<!-- BEGIN OF INFORMATION PANEL -->
-
- <xv:Panel id="InformationDetailsPanel">
- <xv:Title>
- <xv:Label>DevicesDetailsInformationPanelKey</xv:Label>
- </xv:Title>
- <xv:FieldSet id="InformationDetailsFieldSet">
- <xv:Title>
- <xv:Label>DevicesDetailsInformationFieldSetKey</xv:Label>
- </xv:Title>
- <xv:TextField id="originalTypeTextField" readOnly="true">
- <xv:Label>DevicesDetailsOriginalTypeTextFieldKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="temporaryTypeTextField" readOnly="true">
- <xv:Label>DevicesDetailsTemporaryTypeTextFieldKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="modeTextField" readOnly="true">
- <xv:Label>DevicesDetailsModeTextFieldKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="softwareVersionTextField" readOnly="true" value="/devicesDetails:DevicesDetails/SoftwareVersion">
- <xv:Label>DevicesDetailsSoftwareVersionTextFieldKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="bootLoaderVersionTextField" readOnly="true" value="/devicesDetails:DevicesDetails/BootloaderVersion">
- <xv:Label>DevicesDetailsBootLoaderVersionTextFieldKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="dataVersionTextField" readOnly="true" value="/devicesDetails:DevicesDetails/DataVersion">
- <xv:Label>DevicesDetailsDataVersionTextFieldKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="hardwareNumberTextField" readOnly="true" value="/devicesDetails:DevicesDetails/HardwareNumber">
- <xv:Label>DevicesDetailsHardwareNumberTextFieldKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="serialNumberTextField" readOnly="true" value="/devicesDetails:DevicesDetails/SerialNumber">
- <xv:Label>DevicesDetailsSerialNumberTextFieldKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="localizationVersionTextField" readOnly="true" value="/devicesDetails:DevicesDetails/LocalizationNumber">
- <xv:Label>DevicesDetailsLocalizationVersionTextFieldKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="customizationVersionTextField" readOnly="true" value="/devicesDetails:DevicesDetails/CustomizationVersion">
- <xv:Label>DevicesDetailsCustomizationVersionTextFieldKey</xv:Label>
- </xv:TextField>
- </xv:FieldSet>
- </xv:Panel>
-
-<!-- END OF INFORMATION PANEL -->
-
-
- </xv:TabPanel>
-
- <xv:Footer>
- <xv:Button id="OkButton" action="#{DevicesDetailsBean.onClickOk}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{DevicesDetailsBean.onClickCancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
-
- </xv:Panel>
-</xv:View>
-
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:devicesList="http://www.alu.com/ebg/angie/sobo/config/telephony/devices/DevicesList"
- modelInstance="-1">
-
- <xv:Panel id="DevicesListForm" labelWidth="140" border="false">
- <xv:Title>
- <xv:Label>DevicesTitleKey</xv:Label>
- </xv:Title>
-
- <xv:ToolBar id="DevicesListToolBar">
- <xv:Button id="AddButton" action="#{DevicesListBean.add}">
- <xv:Label>AddKey</xv:Label>
- </xv:Button>
- <xv:Separator></xv:Separator>
- <xv:Button id="ModifyButton" action="#{DevicesListBean.modify}">
- <xv:Label>ModifyKey</xv:Label>
- </xv:Button>
- <xv:Separator></xv:Separator>
- <xv:Button id="DeleteButton" action="#{DevicesListBean.delete}">
- <xv:Label>DeleteKey</xv:Label>
- </xv:Button>
- </xv:ToolBar>
-
- <xv:Panel id="DevicesListGridPanel" border="false">
- <xv:Grid id="DevicesListGrid" width="600" height="440" value="/devicesList:DevicesList/deviceGrid/deviceLine" listener="#{DevicesListBean}">
- <xv:Column mapping="index" sortable="true" width="100" hidden="true">DevicesListIndexKey</xv:Column>
- <xv:Column mapping="physicalAddress" sortable="true" width="100">DevicesListPhysicalAddressKey</xv:Column>
- <xv:Column mapping="internalNumber" sortable="true" width="100">DevicesListInternalNumberKey</xv:Column>
- <xv:Column mapping="publicNumber" sortable="true" width="100">DevicesListPublicNumberKey</xv:Column>
- <xv:Column mapping="terminal" sortable="true" width="120">DevicesListTerminalKey</xv:Column>
- <xv:Column mapping="name" sortable="true" width="190">DevicesListNameKey</xv:Column>
- <xv:Column mapping="physicalService" sortable="true" width="30">DevicesListPhysicalServiceKey</xv:Column>
- <xv:Column mapping="logicalService" sortable="true" width="30">DevicesListLogicalServiceKey</xv:Column>
- <xv:Column mapping="accessType" sortable="true" width="30" hidden="true"></xv:Column>
- <xv:Column mapping="noDevices" sortable="true" width="30" hidden="true"></xv:Column>
- <xv:Column mapping="terminalType" sortable="true" width="30" hidden="true"></xv:Column>
- <xv:Column mapping="isHandset" sortable="true" width="30" hidden="true"></xv:Column>
- <xv:Column mapping="isSubDevice" sortable="true" width="30" hidden="true"></xv:Column>
- </xv:Grid>
- </xv:Panel>
-
- </xv:Panel>
-</xv:View>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:devicesType="http://www.alu.com/ebg/angie/sobo/config/telephony/devices/DevicesType"
- modelInstance="-1">
-
- <xv:Panel id="DevicesTypeForm" labelWidth="140" border="true" width="360" height="240">
- <xv:Title>
- <xv:Label>DevicesTypeTitleKey</xv:Label>
- </xv:Title>
-
- <xv:TextField id="PhysicalAddressTextField" readOnly="true" value="/devicesType:DevicesType/PhysicalAddress">
- <xv:Label>DevicesTypePhysicalAddressTextFieldKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="NameTextField" readOnly="true" value="/devicesType:DevicesType/Name">
- <xv:Label>DevicesTypeNameTextFieldKey</xv:Label>
- </xv:TextField>
-
- <!-- <xv:ComboBox id="TerminalTypeComboBox" value="/devicesType:DevicesType/TerminalType/comboSelect" items="devicesType:DevicesType/TerminalType/entryCombo"> -->
- <xv:ComboBox id="TerminalTypeComboBox" value="/devicesType:DevicesType/TerminalType/comboSelect">
- <xv:Label>DevicesTypeTerminalTypeComboBoxKey</xv:Label>
- </xv:ComboBox>
-
- <xv:Footer>
- <xv:Button id="OkButton" action="#{DevicesTypeBean.onClickOk}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{DevicesTypeBean.onClickCancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
- </xv:Panel>
-</xv:View>
-
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:endOfDialingAdd="http://www.alu.com/ebg/angie/sobo/config/telephony/numberingsettings/EndOfDialingAdd"
- modelInstance="-1">
-
- <xv:Panel id="endOfDialingAddPanel" labelWidth="140" border="false">
- <xv:Title>
- <xv:Label>EndofDialingAddPrefixKey</xv:Label>
- </xv:Title>
-
- <xv:Panel id="endOfDialingModifyPanel" height="240" border="false">
- <xv:TextField id="defaultCounterTextField" value="/endOfDialingAdd:EndOfDialingAdd/defaultCounter"
- width="60" readOnly="true">
- <xv:Label>DefaultCounterKey</xv:Label>
- </xv:TextField>
-
- <xv:TextField id="prefixTextField" value="/endOfDialingAdd:EndOfDialingAdd/prefix" maxLength="6" width="50" onChange="#{EndOfDialingAddBean.checkPrefixField}">
- <xv:Label>PrefixKey</xv:Label>
- </xv:TextField>
-
- <xv:TextField id="counterTextFiled" value="/endOfDialingAdd:EndOfDialingAdd/counter" maxLength="2" width="50">
- <xv:Label>CounterKey</xv:Label>
- </xv:TextField>
-
- <xv:Footer>
- <xv:Button id="OkButton" action="#{EndOfDialingAddBean.submit}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{EndOfDialingAddBean.cancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
-
- </xv:Panel>
-
- </xv:Panel>
-
-</xv:View>
+++ /dev/null
-<?xml version="1.0" encoding="WINDOWS-1252"?>
-<xv:View xmlns:xv="http://www.alu.com/umf/view" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:endOfDialingDelete="http://www.alu.com/ebg/angie/sobo/config/telephony/numberingsettings/EndOfDialingDelete" xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd" modelInstance="-1">
-
- <xv:Panel id="endOfDialingDeleteForm" labelWidth="140" border="false">
- <xv:Title>
- <xv:Label>EndofDialingDeletePrefixKey</xv:Label>
- </xv:Title>
-
- <xv:FieldSet id="FSContainerLabelWidth" width="400" padding="10px 0 0 10px">
- <xv:Title>
- <xv:Label>ConfirmDeletionKey</xv:Label>
- </xv:Title>
- <xv:Label>EndofDialingDeleteConfirmDeletionMessageKey</xv:Label>
- </xv:FieldSet>
-
- <xv:Footer>
- <xv:Button id="OkButton" action="#{EndOfDialingDeleteBean.submit}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{EndOfDialingDeleteBean.cancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
-
- </xv:Panel>
- <xv:Panel id="InvisiblePanel">
- <xv:TextField id="InvisibleField"
- value="/endOfDialingDelete:EndOfDialingDelete/listOfPrefixesToDelete">
- </xv:TextField>
- </xv:Panel>
-</xv:View>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:endOfDialingModify="http://www.alu.com/ebg/angie/sobo/config/telephony/numberingsettings/EndOfDialingModify"
- modelInstance="-1">
-
- <xv:Panel id="endOfDialingModifyForm" labelWidth="140" border="false">
-
- <xv:Title>
- <xv:Label>EndofDialingModifyPrefixKey</xv:Label>
- </xv:Title>
-
- <xv:Panel id="endOfDialingModifyPanel" height="240" border="false">
- <xv:TextField id="defaultCounterTextField" width="60" readOnly="true"
- value="/endOfDialingModify:EndOfDialingModify/defaultCounter">
- <xv:Label>DefaultCounterKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="prefixTextField" maxLength="6" value="/endOfDialingModify:EndOfDialingModify/prefix" width="50">
- <xv:Label>PrefixKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="counterTextField" maxLength="2" value="/endOfDialingModify:EndOfDialingModify/counter" width="50">
- <xv:Label>CounterKey</xv:Label>
- </xv:TextField>
- <xv:Footer>
- <xv:Button id="OkButton" action="#{EndOfDialingModifyBean.submit}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{EndOfDialingModifyBean.cancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
- </xv:Panel>
- </xv:Panel>
-</xv:View>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:endOfDialingModifyDefaultCounter="http://www.alu.com/ebg/angie/sobo/config/telephony/numberingsettings/EndOfDialingModifyDefaultCounter"
- modelInstance="-1">
-
- <xv:Panel id="MainPanel" labelWidth="180" border="false">
- <xv:Title>
- <xv:Label>ModifyDefaultCounterKey</xv:Label>
- </xv:Title>
-
- <xv:TextField id="defaultCounterTextField" maxLength="2" width="60"
- value="/endOfDialingModifyDefaultCounter:EndOfDialingModifyDefaultCounter/defaultCounter">
- <xv:Label>DefaultCounterKey</xv:Label>
- </xv:TextField>
-
- <xv:Footer>
- <xv:Button id="OkButton" action="#{EndOfDialingModifyDefaultCounterBean.submit}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{EndOfDialingModifyDefaultCounterBean.cancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
-
- </xv:Panel>
-</xv:View>
+++ /dev/null
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:listOfAccesses="http://www.alu.com/ebg/angie/sobo/config/telephony/listofaccesses/ListOfAccesses"
- modelInstance="-1">
-
- <xv:Panel id="MainPanel" height="440" labelWidth="180" border="false">
- <xv:Title>
- <xv:Label>ListOfAccessesKey</xv:Label>
- </xv:Title>
-
- <xv:ToolBar id="ListOfAccessesToolBar">
- <xv:Button id="deleteAccessLine">
- <xv:Label>deleteKey</xv:Label>
- </xv:Button>
- <xv:Separator></xv:Separator>
- <xv:Button id="detailsAccessLine">
- <xv:Label>DetailsKey</xv:Label>
- </xv:Button>
- <xv:Separator></xv:Separator>
- </xv:ToolBar>
- <xv:Panel id="GridPanel" width="550" height="150">
- <xv:Grid id="ListOfAccessesGrid" width="550" height="150"
- value="/listOfAccesses:ListOfAccesses/externalLines/AccessLine">
- <xv:Column mapping="PhysicalAddress"><xv:Label>PhysicalAddressKey</xv:Label></xv:Column>
- <xv:Column mapping="TypeName" sortable="true" width="120"><xv:Label>AccessTypeNameKey</xv:Label></xv:Column>
- <xv:Column mapping="Identifier" width="120"><xv:Label>IdentifierKey</xv:Label></xv:Column>
- <xv:Column mapping="NumberOfChannel" width="300"><xv:Label>NoOfChannelKey</xv:Label></xv:Column>
- <xv:Column mapping="Index" hidden ="true" width="300"><xv:Label>IndexKey</xv:Label></xv:Column>
- <xv:Column mapping="Type" hidden ="true" width="300">AccessTypeKey<xv:Label></xv:Label></xv:Column>
- <xv:Column mapping="Category" hidden ="true" width="300"><xv:Label>GeneralAccessTypeKey</xv:Label></xv:Column>
- </xv:Grid>
- </xv:Panel>
-
-
- </xv:Panel>
-</xv:View>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:numberingPlanAddModify="http://www.alu.com/ebg/angie/sobo/config/telephony/numberingplan/NumberingPlansAddModify"
- modelInstance="-1">
-
- <!-- Main Panel -->
- <xv:Panel id="panelNumberingPlansAddModify" width="715" height="440">
-
- <!-- Title -->
- <xv:Title>
- <xv:Label>NumberingPlansAddTitleKey</xv:Label>
- </xv:Title>
-
- <!-- Function -->
- <xv:ComboBox id="cbFunction" value="/numberingPlanAddModify:NumberingPlansAddModify/Functions/comboSelect"
- items="/numberingPlanAddModify:NumberingPlansAddModify/Functions/entryCombo"
- listener="#{NumberingPlansAddModifyBean}">
- <xv:Label>NumberingPlansAddModifyFunctionKey</xv:Label>
- </xv:ComboBox>
-
- <!-- Start -->
- <xv:TextField id="startTextField" value="/numberingPlanAddModify:NumberingPlansAddModify/Start" width="50">
- <xv:Label>NumberingPlansAddModifyStartKey</xv:Label>
- </xv:TextField>
-
- <!-- End -->
- <xv:TextField id="endTextField" value="/numberingPlanAddModify:NumberingPlansAddModify/End" width="50">
- <xv:Label>NumberingPlansAddModifyEndKey</xv:Label>
- </xv:TextField>
-
- <!-- Base -->
- <xv:TextField id="baseTextField" value="/numberingPlanAddModify:NumberingPlansAddModify/Base" width="50">
- <xv:Label>NumberingPlansAddModifyBaseKey</xv:Label>
- </xv:TextField>
-
- <!-- NMT -->
- <xv:ComboBox id="cbNmt">
- <xv:Label>NumberingPlansAddModifyNmtKey</xv:Label>
- <xv:Entry key="Drop">Drop</xv:Entry>
- <xv:Entry key="Keep">Keep</xv:Entry>
- </xv:ComboBox>
-
- <!-- Priv -->
- <xv:ComboBox id="cbPrivate">
- <xv:Label>NumberingPlansAddModifyPrivateKey</xv:Label>
- <xv:Entry key="0">No</xv:Entry>
- <xv:Entry key="1">Yes</xv:Entry>
- </xv:ComboBox>
-
- <!-- Fax -->
- <xv:TextField id="faxTextField" value="/numberingPlanAddModify:NumberingPlansAddModify/Fax" width="50">
- <xv:Label>NumberingPlansAddModifyFaxKey</xv:Label>
- </xv:TextField>
-
- <!-- Bottom of tab : buttons -->
- <xv:Footer>
- <xv:Button id="OkButton" action="#{NumberingPlansAddModifyBean.add}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{NumberingPlansAddModifyBean.cancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
- </xv:Panel>
- <xv:Panel id="InvisiblePanel">
- </xv:Panel>
-
-</xv:View>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:numberingPlanDelete="http://www.alu.com/ebg/angie/sobo/config/telephony/numberingplan/NumberingPlansDelete"
- modelInstance="-1">
-
- <!-- Main Panel -->
- <xv:Panel id="panelNumberingPlansDelete" width="715" height="440">
-
- <!-- Title -->
- <xv:Title>
- <xv:Label>NumberingPlansDeleteTitleKey</xv:Label>
- </xv:Title>
-
- <!-- Text -->
- <xv:FieldSet id="FSContainerLabelWidth" width="400" padding="10px 0 0 10px">
- <xv:Title>
- <xv:Label>ConfirmDeletionKey</xv:Label>
- </xv:Title>
- <xv:Label>NumberingPlansConfirmDeletionMessageKey</xv:Label>
- </xv:FieldSet>
-
- <!-- Bottom of tab : buttons -->
- <xv:Footer>
- <xv:Button id="OkButton" action="#{NumberingPlansDeleteBean.submit}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- <xv:Button id="CancelButton" action="#{NumberingPlansDeleteBean.cancel}">
- <xv:Label>CancelKey</xv:Label>
- </xv:Button>
- </xv:Footer>
- </xv:Panel>
- <xv:Panel id="InvisiblePanel">
- <xv:TextField id="InvisibleField"
- value="/numberingPlanDelete:NumberingPlansDelete/listOfNumberingPlansToDelete">
- </xv:TextField>
- </xv:Panel>
-
-</xv:View>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:numberingPlan="http://www.alu.com/ebg/angie/sobo/config/telephony/numberingplan/NumberingPlansMain"
- modelInstance="-1">
-
- <!-- Main Panel -->
- <xv:Panel id="panelNumberingPlans" width="715" height="440" labelWidth="150">
- <!-- Tab Component -->
- <xv:TabPanel id="tabPanelNumberingPlans" width="715" height="440">
- <!-- First Tab : Internal Numbering Plan -->
- <xv:Panel id="panelInternal">
- <xv:Title>
- <xv:Label>NumberingPlansTitleKey</xv:Label>
- </xv:Title>
-
- <!-- Toolbar -->
- <xv:ToolBar id="NumberingPlansToolBar">
- <xv:Button id="NumberingPlansAddButton" action="#{NumberingPlansBean.add}">
- <xv:Label>AddKey</xv:Label>
- </xv:Button>
- <xv:Separator></xv:Separator>
- <xv:Button id="NumberingPlansModifyButton" action="#{NumberingPlansBean.modify}">
- <xv:Label>ModifyKey</xv:Label>
- </xv:Button>
- <xv:Separator></xv:Separator>
- <xv:Button id="NumberingPlansDeleteButton" action="#{NumberingPlansBean.delete}">
- <xv:Label>DeleteKey</xv:Label>
- </xv:Button>
- </xv:ToolBar>
-
- <!-- Main Panel of tab -->
- <xv:WrapPanel>
- <!-- Grid component -->
- <xv:Panel id="panelNumberingPlansGridInternal" border="false">
- <xv:Grid id="gridNumberingPlansInternal" width="680" height="320" value="/numberingPlan:NumberingPlansMain/NumberingPlansGrid/NumberingPlansPlan" listener="#{NumberingPlansBean}">
- <xv:Column mapping="Function" width="200">
- <xv:Label>NumberingPlansFunctionKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="Start" width="80">
- <xv:Label>NumberingPlansStartKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="End" width="80">
- <xv:Label>NumberingPlansEndKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="Base" width="80">
- <xv:Label>NumberingPlansBaseKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="Nmt" width="80">
- <xv:Label>NumberingPlansNmtKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="Priv" width="80">
- <xv:Label>NumberingPlansPrivKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="Fax" width="80">
- <xv:Label>NumberingPlansFaxKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="Id" width="80" hidden="true">
- </xv:Column>
- </xv:Grid>
- </xv:Panel>
-
- </xv:WrapPanel>
- </xv:Panel>
-
- <!-- Second tab : Public Numbering Plan -->
- <xv:Panel id="panelPublic">
- <xv:Title>
- <xv:Label>NumberingPlansPublicTitleKey</xv:Label>
- </xv:Title>
-
- <!-- Toolbar -->
- <xv:ToolBar id="PublicNumberingPlansToolBar">
- <xv:Button id="PublicNumberingPlansAddButton" action="#{NumberingPlansBean.addPublic}">
- <xv:Label>AddKey</xv:Label>
- </xv:Button>
- <xv:Separator></xv:Separator>
- <xv:Button id="PublicNumberingPlansModifyButton" action="#{NumberingPlansBean.modifyPublic}">
- <xv:Label>ModifyKey</xv:Label>
- </xv:Button>
- <xv:Separator></xv:Separator>
- <xv:Button id="PublicNumberingPlansDeleteButton" action="#{NumberingPlansBean.deletePublic}">
- <xv:Label>DeleteKey</xv:Label>
- </xv:Button>
- </xv:ToolBar>
-
- <!-- Main Panel of tab -->
- <xv:WrapPanel>
- <!-- Grid component -->
- <xv:Panel id="panelPublicNumberingPlansGridInternal" border="false">
- <xv:Grid id="gridNumberingPlansPublic" width="680" height="320" value="/numberingPlan:NumberingPlansMain/NumberingPlansPublicGrid/NumberingPlansPublicPlan" listener="#{NumberingPlansBean}">
- <xv:Column mapping="Function" width="200">
- <xv:Label>NumberingPlansFunctionKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="Start" width="80">
- <xv:Label>NumberingPlansStartKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="End" width="80">
- <xv:Label>NumberingPlansEndKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="Base" width="80">
- <xv:Label>NumberingPlansBaseKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="Nmt" width="80">
- <xv:Label>NumberingPlansNmtKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="Priv" width="80">
- <xv:Label>NumberingPlansPrivKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="Fax" width="80">
- <xv:Label>NumberingPlansFaxKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="Id" width="80" hidden="true">
- </xv:Column>
- </xv:Grid>
- </xv:Panel>
-
- </xv:WrapPanel>
- </xv:Panel>
-
- <!-- Third tab : Restricted Public Numbering Plan -->
- <xv:Panel id="panelRestricted">
- <xv:Title>
- <xv:Label>NumberingPlansRestrictedTitleKey</xv:Label>
- </xv:Title>
-
- <!-- Toolbar -->
- <xv:ToolBar id="RestrictedNumberingPlansToolBar">
- <xv:Button id="RestrictedNumberingPlansAddButton" action="#{NumberingPlansBean.addRestricted}">
- <xv:Label>AddKey</xv:Label>
- </xv:Button>
- <xv:Separator></xv:Separator>
- <xv:Button id="RestrictedNumberingPlansModifyButton" action="#{NumberingPlansBean.modifyRestricted}">
- <xv:Label>ModifyKey</xv:Label>
- </xv:Button>
- <xv:Separator></xv:Separator>
- <xv:Button id="RestrictedNumberingPlansDeleteButton" action="#{NumberingPlansBean.deleteRestricted}">
- <xv:Label>DeleteKey</xv:Label>
- </xv:Button>
- </xv:ToolBar>
-
- <!-- Main Panel of tab -->
- <xv:WrapPanel>
- <!-- Grid component -->
- <xv:Panel id="panelNumberingPlansGridRestricted" border="false">
- <xv:Grid id="gridNumberingPlansRestricted" width="680" height="320" value="/numberingPlan:NumberingPlansMain/NumberingPlansRestrictedGrid/NumberingPlansRestrictedPlan" listener="#{NumberingPlansBean}">
- <xv:Column mapping="Function" width="200">
- <xv:Label>NumberingPlansFunctionKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="Start" width="80">
- <xv:Label>NumberingPlansStartKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="End" width="80">
- <xv:Label>NumberingPlansEndKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="Base" width="80">
- <xv:Label>NumberingPlansBaseKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="Nmt" width="80">
- <xv:Label>NumberingPlansNmtKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="Priv" width="80">
- <xv:Label>NumberingPlansPrivKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="Fax" width="80">
- <xv:Label>NumberingPlansFaxKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="Id" width="80" hidden="true">
- </xv:Column>
- </xv:Grid>
- </xv:Panel>
-
- </xv:WrapPanel>
- </xv:Panel>
-
- <!-- Fourth tab : Private Numbering Plan -->
- <xv:Panel id="panelPrivate">
- <xv:Title>
- <xv:Label>NumberingPlansPrivateTitleKey</xv:Label>
- </xv:Title>
-
-
- <!-- Toolbar -->
- <xv:ToolBar id="PrivateNumberingPlansToolBar">
- <xv:Button id="PrivateNumberingPlansAddButton" action="#{NumberingPlansBean.addPrivate}">
- <xv:Label>AddKey</xv:Label>
- </xv:Button>
- <xv:Separator></xv:Separator>
- <xv:Button id="PrivateNumberingPlansModifyButton" action="#{NumberingPlansBean.modifyPrivate}">
- <xv:Label>ModifyKey</xv:Label>
- </xv:Button>
- <xv:Separator></xv:Separator>
- <xv:Button id="PrivateNumberingPlansDeleteButton" action="#{NumberingPlansBean.deletePrivate}">
- <xv:Label>DeleteKey</xv:Label>
- </xv:Button>
- </xv:ToolBar>
-
- <!-- Main Panel of tab -->
- <xv:WrapPanel>
- <!-- Grid component -->
- <xv:Panel id="panelNumberingPlansGridPrivate" border="false">
- <xv:Grid id="gridNumberingPlansPrivate" width="680" height="320" value="/numberingPlan:NumberingPlansMain/NumberingPlansPrivateGrid/NumberingPlansPrivatePlan" listener="#{NumberingPlansBean}">
- <xv:Column mapping="Function" width="200">
- <xv:Label>NumberingPlansFunctionKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="Start" width="80">
- <xv:Label>NumberingPlansStartKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="End" width="80">
- <xv:Label>NumberingPlansEndKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="Base" width="80">
- <xv:Label>NumberingPlansBaseKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="Nmt" width="80">
- <xv:Label>NumberingPlansNmtKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="Priv" width="80">
- <xv:Label>NumberingPlansPrivKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="Fax" width="80">
- <xv:Label>NumberingPlansFaxKey</xv:Label>
- </xv:Column>
- <xv:Column mapping="Id" width="80" hidden="true">
- </xv:Column>
- </xv:Grid>
- </xv:Panel>
-
- </xv:WrapPanel>
- </xv:Panel>
- </xv:TabPanel>
- </xv:Panel>
-
- <xv:Panel id="InvisiblePanel">
- <xv:TextField id="InvisibleField1"
- value="/numberingPlan:NumberingPlansMain/canModifyMainList">
- </xv:TextField>
- <xv:TextField id="InvisibleField2"
- value="/numberingPlan:NumberingPlansMain/canModifyDDIList">
- </xv:TextField>
- <xv:TextField id="InvisibleField3"
- value="/numberingPlan:NumberingPlansMain/canModifyAtlList">
- </xv:TextField>
- <xv:TextField id="InvisibleField4"
- value="/numberingPlan:NumberingPlansMain/grp_dyn">
- </xv:TextField>
- <xv:TextField id="InvisibleField5"
- value="/numberingPlan:NumberingPlansMain/maxMainNp">
- </xv:TextField>
- <xv:TextField id="InvisibleField6"
- value="/numberingPlan:NumberingPlansMain/maxDdiNp">
- </xv:TextField>
- <xv:TextField id="InvisibleField7"
- value="/numberingPlan:NumberingPlansMain/maxPrivNp">
- </xv:TextField>
- <xv:TextField id="InvisibleField8"
- value="/numberingPlan:NumberingPlansMain/currentScreen">
- </xv:TextField>
- </xv:Panel>
-
-</xv:View>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:xv="http://www.alu.com/umf/view"
- xmlns:numberingSettings="http://www.alu.com/ebg/angie/sobo/config/telephony/numberingsettings/NumberingSettings"
- modelInstance="-1">
-
- <xv:Panel id="MainPanel" height="440" labelWidth="180" border="false">
- <xv:Title>
- <xv:Label>NumberingSettingsKey</xv:Label>
- </xv:Title>
-
- <xv:TabPanel id="InbrEODtabPanel" height="440" >
-
- <xv:Panel id="InstallationNumbersPanel">
- <xv:Title>
- <xv:Label>InstallationNumbersTableTitleKey</xv:Label>
- </xv:Title>
- <xv:TextField id="installationNumberTextField" maxLength="16" value="/numberingSettings:NumberingSettings/installationNumber" onChange="#{NumberingSettingsBean.checkTextFieldInstallationNumberMaxLength}">
- <xv:Label>InstallationNumberKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="internationalPrefixTextField" maxLength="9" value="/numberingSettings:NumberingSettings/internationalPrefix">
- <xv:Label>InternationalPrefixKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="internationalCodeTextField" maxLength="5" value="/numberingSettings:NumberingSettings/internationalCode" onChange="#{NumberingSettingsBean.validateInternationalCode}">
- <xv:Label>InternationalCodeKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="intercityPrefixTextField" maxLength="9" value="/numberingSettings:NumberingSettings/intercityPrefix">
- <xv:Label>IntercityPrefixKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="intercityCodeTextField" maxLength="9" value="/numberingSettings:NumberingSettings/intercityCode" onChange="#{NumberingSettingsBean.validateIntercityCode}">
- <xv:Label>IntercityCodeKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="recallPrefixTextField" maxLength="4" value="/numberingSettings:NumberingSettings/recallPrefix">
- <xv:Label>RecallPrefixKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="alternativeSystemCLIPTextField" maxLength="22" value="/numberingSettings:NumberingSettings/alternativeSystemCLIP">
- <xv:Label>AlternativeSystemCLIPKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="privateInstallationNumberTextField" maxLength="9" value="/numberingSettings:NumberingSettings/privateInstallationNumber">
- <xv:Label>PrivateInstallationNumberKey</xv:Label>
- </xv:TextField>
- <xv:TextField id="VPNEscapePrefixToRemoveTextField" maxLength="4" value="/numberingSettings:NumberingSettings/VPNEscapePrefixToRemove">
- <xv:Label>VPNEscapePrefixtoRemoveKey</xv:Label>
- </xv:TextField>
- <xv:Footer>
- <xv:Button id="OkButton" action="#{NumberingSettingsBean.submit}">
- <xv:Label>OKKey</xv:Label>
- </xv:Button>
- </xv:Footer>
- </xv:Panel>
-
- <xv:Panel id="endOfDialingPanel">
- <xv:Title>
- <xv:Label>EndOfDialingTableTitleKey</xv:Label>
- </xv:Title>
- <xv:ToolBar id="EndOfDialingToolBar">
- <xv:Button id="addEndOfDialing" action="#{NumberingSettingsBean.add}">
- <xv:Label>AddKey</xv:Label>
- </xv:Button>
- <xv:Separator></xv:Separator>
- <xv:Button id="deleteEndOfDialing" action="#{NumberingSettingsBean.delete}">
- <xv:Label>DeleteKey</xv:Label>
- </xv:Button>
- <xv:Separator></xv:Separator>
- <xv:Button id="modifyEndOfDialing" action="#{NumberingSettingsBean.modifyEndOfDialingLine}">
- <xv:Label>ModifyKey</xv:Label>
- </xv:Button>
- </xv:ToolBar>
- <xv:Panel id="GridPanel" width="550" height="150">
- <xv:Grid id="EndOfDialingGrid" width="550" height="150"
- value="/numberingSettings:NumberingSettings/endOfDialingLines/endOfDialingLine" listener="#{NumberingSettingsBean}">
- <xv:Column mapping="index" hidden="true"><xv:Label>IndexKey</xv:Label></xv:Column>
- <xv:Column mapping="prefix" sortable="true" width="120"><xv:Label>PrefixKey</xv:Label></xv:Column>
- <xv:Column mapping="counter" sortable="true" width="120"><xv:Label>CounterKey</xv:Label></xv:Column>
- <xv:Column mapping="openCloseDialing" sortable="true" width="300"><xv:Label>OpenCloseDialingKey</xv:Label></xv:Column>
- </xv:Grid>
- </xv:Panel>
- <xv:Panel id="DefaultCounterPanel" border="true" padding="10" width="550">
- <xv:WrapPanel padding="10">
- <xv:TextField id="defaultCounterTextField" width="40" readOnly="true"
- value="/numberingSettings:NumberingSettings/defaultCounter">
- <xv:Label>DefaultCounterKey</xv:Label>
- </xv:TextField>
- <xv:Button id="modifyDefaultCounter" action="#{NumberingSettingsBean.modifyDefaultCounter}">
- <xv:Label>ModifyKey</xv:Label>
- </xv:Button>
- </xv:WrapPanel>
- </xv:Panel>
- </xv:Panel>
-
- </xv:TabPanel>
-
- </xv:Panel>
-</xv:View>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:userEdit="http://www.alu.com/umf/sdk/userEdit"
- xmlns:xv="http://www.alu.com/umf/view"
- modelInstance="-1">
-
- <!-- Window for the user configuration -->
- <xv:Panel id="pnUserEdit" height="440" labelWidth="130" border="false">
- <xv:Panel id="pnActive" padding="3" labelWidth="100">
- <xv:RadioGroup id="rgActiveUser" orientation="horizontal" value="/userEdit:userConfiguration/rgActiveUser">
- <xv:Label>active</xv:Label>
- <xv:Radio value="true">yes</xv:Radio>
- <xv:Radio value="false">no</xv:Radio>
- </xv:RadioGroup>
- </xv:Panel>
-
- <xv:TabPanel id="tpUserEdit" height="370">
- <!-- Tab User Details -->
- <xv:Panel id="pnUserDetails">
- <xv:Title>detailsTab</xv:Title>
-
- <xv:WrapPanel>
- <xv:Panel id="pnRightDetailsCivility" width="370" >
- <xv:Panel id="pnRgGender" labelWidth="50">
- <xv:RadioGroup id="rgGender" orientation="horizontal"
- value="/userEdit:userConfiguration/rgGender">
- <xv:Label>gender</xv:Label>
- <xv:Radio value="mr">mr</xv:Radio>
- <xv:Radio value="ms">ms</xv:Radio>
- <xv:Radio value="mrs">mrs</xv:Radio>
- </xv:RadioGroup>
- </xv:Panel>
- <xv:TextField id="tfLatinLastName" value="/userEdit:userConfiguration/tfLatinLastName"
- width="165" listener="#{UserEditBean}">lastName</xv:TextField>
- <xv:TextField id="tfLatinFirstName" value="/userEdit:userConfiguration/tfLatinFirstName"
- width="165" listener="#{UserEditBean}">firstName</xv:TextField>
- <xv:TextField id="tfInternationalLastName"
- value="/userEdit:userConfiguration/tfInternationalLastName" width="165">intLastName</xv:TextField>
- <xv:TextField id="tfInternationalFirstName"
- value="/userEdit:userConfiguration/tfInternationalFirstName" width="165">intFirstName</xv:TextField>
- </xv:Panel>
- <xv:Panel id="pnPhoto" width="310">
- <xv:WrapPanel>
- <xv:Panel id="pnPhotoSpace" width="230" height="125"/>
- <xv:Panel id="pnPhotoViewSpace">
- <xv:Panel id="pnPhotoView" width="60" height="80" border="true">
- <xv:Image id="imPhotoPath" value="$plugImg/images.jpg"/>
- </xv:Panel>
- <xv:Button id="btChangePhoto">
- <xv:Label>change</xv:Label>
- </xv:Button>
- </xv:Panel>
- </xv:WrapPanel>
- </xv:Panel>
- </xv:WrapPanel>
- <xv:WrapPanel>
- <xv:Panel id="pnRightDetailsEnd" width="370">
- <xv:TextField id="tfTitle" value="/userEdit:userConfiguration/tfTitle" width="165">
- title</xv:TextField>
- <xv:WrapPanel>
- <xv:Panel id="pnCompany">
- <xv:TextField id="tfCompany" value="/userEdit:userConfiguration/tfCompany" readOnly="true">
- company
- </xv:TextField>
- </xv:Panel>
- <xv:Button id="btDetailsCompany" action="#{UserEditBean.companyDetails}">
- <xv:Label>details</xv:Label>
- </xv:Button>
- </xv:WrapPanel>
-
- <xv:WrapPanel>
- <xv:Panel id="pnGroup">
- <xv:TextField id="tfGroup" value="/userEdit:userConfiguration/tfGroup" width="165" readOnly="true"> <!-- value="/UserEdit:userConfiguration/tfGroup" -->
- group</xv:TextField>
- </xv:Panel>
- <xv:Button id="btAddGroup">
- <xv:Label>add</xv:Label>
- </xv:Button>
- </xv:WrapPanel>
-
- <xv:ComboBox id="cbAssistant" value="/userEdit:userConfiguration/cbAssistant/value" items="/userEdit:userConfiguration/cbAssistant/items/item">
- <xv:Label>assistant</xv:Label>
- </xv:ComboBox>
-
- <xv:Panel id="pnDownDetails">
- <xv:ComboBox id="cbLanguage" value="/userEdit:userConfiguration/cbLanguage/value" items="/userEdit:userConfiguration/cbLanguage/items/item">
- <xv:Label>language</xv:Label>
- </xv:ComboBox>
- <xv:ComboBox id="cbTimeZone" value="/userEdit:userConfiguration/cbTimeZone/value" items="/userEdit:userConfiguration/cbTimeZone/items/item">
- <xv:Label>timeZone</xv:Label>
- </xv:ComboBox>
- </xv:Panel>
-
- </xv:Panel>
- <xv:Panel id="pnLeftDetails" width="310">
- <xv:Panel id="pnLogin">
- <xv:TextField id="tfLogin" value="/userEdit:userConfiguration/tfLogin" width="165">login</xv:TextField>
- <xv:Panel id="pnResetAccountPassword" labelWidth="100">
- <xv:RadioGroup id="rgResetAccountPassword" orientation="horizontal"
- value="/userEdit:userConfiguration/boResetAccountPassword">
- <xv:Label>resetAccountPassword</xv:Label>
- <xv:Radio value="true">yes</xv:Radio>
- <xv:Radio value="false">no</xv:Radio>
- </xv:RadioGroup>
- </xv:Panel>
- <xv:TextField id="dtExpirationDate" width="165">expirationDate</xv:TextField>
- <xv:TextField id="tfDisplayName" width="165">phoneDisplayName</xv:TextField>
- <xv:Panel id="pnResetPhonePassword" labelWidth="100">
- <xv:RadioGroup id="rgResetPhonePassword" orientation="horizontal" value="/userEdit:userConfiguration/boResetPhonePassword">
- <xv:Label>resetPhonePassword</xv:Label>
- <xv:Radio value="true">yes</xv:Radio>
- <xv:Radio value="false">no</xv:Radio>
- </xv:RadioGroup>
- </xv:Panel>
- </xv:Panel>
-
- </xv:Panel>
- </xv:WrapPanel>
-
- </xv:Panel>
-
- <!-- Tab User Telephony -->
- <xv:Panel id="pnTelephony" autoScroll="true">
- <xv:Title>telephonyTab</xv:Title>
-
- </xv:Panel>
-
- <!-- Tab User Email/Instant Messaging -->
- <xv:Panel id="pnEmail">
- <xv:Title>emailTab</xv:Title>
- <xv:WrapPanel>
-
- <xv:Button id="btEmailIMConfiguration">
- <xv:Label>emailConfiguration</xv:Label>
- </xv:Button>
- </xv:WrapPanel>
-
- </xv:Panel>
-
- <!-- Tab User Applications -->
- <xv:Panel id="pnApplications">
- <xv:Title>applicationsTab</xv:Title>
- <xv:CheckBox id="chCreateWorkspace" >
- <xv:Label>createWorkspace</xv:Label>
- </xv:CheckBox>
- <xv:CheckBox id="chCreateResource" >
- <xv:Label>createResource</xv:Label>
- </xv:CheckBox>
- <xv:CheckBox id="chContact" >
- <xv:Label>contact</xv:Label>
- </xv:CheckBox>
- <xv:CheckBox id="chCalendar" >
- <xv:Label>calendar</xv:Label>
- </xv:CheckBox>
- <xv:CheckBox id="chTask" >
- <xv:Label>task</xv:Label>
- </xv:CheckBox>
- <xv:WrapPanel>
- <xv:Panel id="pnWebfile">
- <xv:CheckBox id="chWebfile" listener="#{UserEditBean}">
- <xv:Label>webfile</xv:Label>
- </xv:CheckBox>
- </xv:Panel>
- <xv:Button id="btQuotasManagement">
- <xv:Label>manageQuotas</xv:Label>
- </xv:Button>
- </xv:WrapPanel>
- </xv:Panel>
-
- <!-- Tab User Administration -->
- <xv:Panel id="pnAdministrationManagement">
- <xv:Title>administrationTab</xv:Title>
-
- <xv:WrapPanel>
- <xv:Panel id="pnRightAdministration" width="370">
- <xv:ComboBox id="cbDirectoryManagement" listener="#{UserEditBean}"
- value="/userEdit:userConfiguration/cbDirectoryManagement/value" items="/userEdit:userConfiguration/cbDirectoryManagement/items/item">
- <xv:Label>directoryManagement</xv:Label>
- </xv:ComboBox>
- <xv:Panel id="pnSpaceAdministrationDirectiry" height="10"> </xv:Panel>
- <xv:ComboBox id="cbTelephonyManagement" value="/userEdit:userConfiguration/cbTelephonyManagement/value"
- items="/userEdit:userConfiguration/cbTelephonyManagement/items/item">
- <xv:Label>telephonyManagement</xv:Label>
- </xv:ComboBox>
- <xv:ComboBox id="cbWebManagement" value="/userEdit:userConfiguration/cbWebManagement/value"
- items="/userEdit:userConfiguration/cbWebManagement/items/item">
- <xv:Label>webManagement</xv:Label>
- </xv:ComboBox>
- <xv:Panel id="pnSpaceAdministrationWeb" height="10"> </xv:Panel>
- <xv:ComboBox id="cbFleetManagement" value="/userEdit:userConfiguration/cbFleetManagement/value"
- items="/userEdit:userConfiguration/cbFleetManagement/items/item">
- <xv:Label>fleetManagement</xv:Label>
- </xv:ComboBox>
- <xv:ComboBox id="cbFailsafeManagement" value="/userEdit:userConfiguration/cbFailsafeManagement/value"
- items="/userEdit:userConfiguration/cbFailsafeManagement/items/item">
- <xv:Label>failsafeManagement</xv:Label>
- </xv:ComboBox>
- <xv:Panel id="pnSpaceAdministrationIWP" height="10"> </xv:Panel>
- <xv:ComboBox id="cbIWPManagement" value="/userEdit:userConfiguration/cbIWPManagement/value"
- items="/userEdit:userConfiguration/cbIWPManagement/items/item">
- <xv:Label>IWPManagement</xv:Label>
- </xv:ComboBox>
- </xv:Panel>
-
- <xv:Panel id="pnLeftAdministration">
- <xv:FieldSet id="fsSelectGroup">
- <xv:Title>selectGroup</xv:Title>
- <xv:WrapPanel labelWidth="1">
- <xv:TextField id="tfSelectGroup" readOnly="true"/>
- <xv:Button id="btSelectGroup">
- <xv:Label>selectGroupButton</xv:Label>
- </xv:Button>
- </xv:WrapPanel>
- </xv:FieldSet>
- </xv:Panel>
-
- </xv:WrapPanel>
- </xv:Panel>
- </xv:TabPanel>
-
- <!-- Window Button -->
- <xv:WrapPanel>
- <xv:Panel id="pnButtonSpace" width="600"/>
- <xv:Button id="btSubmitUserEdit" action="#{UserEditBean.submit}">ok</xv:Button>
- <xv:Button id="btCancelUserEdit" action="userEditToUserEdit">cancel</xv:Button>
- </xv:WrapPanel>
- </xv:Panel>
-
- <!-- Window modal for Company details -->
- <xv:Window id="wnCompanyDetails" width="400" height="400" closable="true" hidden="true" modal="true">
- <xv:Title>companyDetails</xv:Title>
- <xv:Panel id="pnCompanyDetails" padding="10 10 10 10" labelWidth="100">
- <xv:TextField id="tfCompanyName" value="/userEdit:userConfiguration/tfCompanyName" readOnly="true" width="200">
- name
- </xv:TextField>
- <xv:TextField id="tfCompanyAddress" value="/userEdit:userConfiguration/tfCompanyAddress" readOnly="true" width="200">
- address
- </xv:TextField>
- <xv:TextField id="tfCompanyCity" value="/userEdit:userConfiguration/tfCompanyCity" readOnly="true" width="200">
- city
- </xv:TextField>
- <xv:TextField id="tfCompanyZipCode" value="/userEdit:userConfiguration/tfCompanyZipCode" readOnly="true" width="200">
- zipCode
- </xv:TextField>
- <xv:TextField id="tfCompanyState" value="/userEdit:userConfiguration/tfCompanyState" readOnly="true" width="200">
- state
- </xv:TextField>
- <xv:TextField id="tfCompanyCountry" value="/userEdit:userConfiguration/tfCompanyCountry" readOnly="true" width="200">
- country
- </xv:TextField>
- <xv:TextField id="tfCompanyPhoneNumber" value="/userEdit:userConfiguration/tfCompanyPhoneNumber" readOnly="true" width="200">
- phoneNumber
- </xv:TextField>
- <xv:TextField id="tfCompanyFaxNumber" value="/userEdit:userConfiguration/tfCompanyFaxNumber" readOnly="true" width="200">
- faxNumber
- </xv:TextField>
- <xv:TextField id="tfCompanyWebPage" value="/userEdit:userConfiguration/tfCompanyWebPage" readOnly="true" width="200">
- webPage
- </xv:TextField>
- <!--
- <xv:Footer>
- <xv:Button id="btBackUserEdit" action="#{UserEditBean.back}" position="right">back</xv:Button>
- </xv:Footer>
- -->
- </xv:Panel>
- </xv:Window>
-</xv:View>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:usersAccounts="http://www.alu.com/umf/sdk/usersAccounts"
- xmlns:xv="http://www.alu.com/umf/view"
- modelInstance="-1">
- <xv:Panel id="pnUsersList" autoScroll="true" labelWidth="165">
- <xv:Grid id="grUsersList" readOnly="true" value="/usersAccounts:usersList/grUsersList/persons/person" listener="#{UsersAccountsBean}" height="410" width="715" paging="15" collapsible="true">
- <xv:ToolBar id="tbUsersList" position="left">
- <xv:Button id="btAddUser" action="userEditableView" position="left" >
- <xv:Label>add</xv:Label>
- </xv:Button>
- <xv:Button id="btModifyUser" action="#{UsersAccountsBean.modifyUser}">
- <xv:Label>modify</xv:Label>
- </xv:Button>
- <xv:Button id="btDeleteUser" action="#{UsersAccountsBean.deleteUser}">
- <xv:Label>delete</xv:Label>
- </xv:Button>
- </xv:ToolBar>
- <xv:Label>usersList</xv:Label>
- <xv:Column mapping="loId" hidden="true" localized="false"></xv:Column>
- <xv:Column mapping="stName" >name</xv:Column>
- <xv:Column mapping="stLogin" >login</xv:Column>
- <xv:Column mapping="stPhoneNumber" >phoneNumber</xv:Column>
- <xv:Column mapping="stEMailAddress" >email</xv:Column>
- <xv:Column mapping="stGroup" >group</xv:Column>
- <xv:Column mapping="chActivated/boActivated" renderer="checkbox">activated</xv:Column>
- </xv:Grid>
- </xv:Panel>
-</xv:View>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<xv:View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.alu.com/umf/view file:/D:/UMFp-workspaces/xsd/view.xsd"
- xmlns:usersDelete="http://www.alu.com/umf/sdk/usersDelete"
- xmlns:xv="http://www.alu.com/umf/view"
- modelInstance="-1">
-
- <xv:Panel id="pnDelete" width="715" height="440" labelWidth="130" border="false">
- <xv:Panel id="pnDeleteBorder" width="200" border="true" margin="10" >
- <xv:Panel id="pnDeleteBox" border="false" margin="10" padding="0px 0px 0px 5px">
- <xv:Label id="lbDeleteMessage1" >deleteMessagePart1</xv:Label>
- <xv:Panel id="pnDeleteBox2" border="false" margin="0" padding="0px 0px 0px 30px">
- <xv:Label id="lbDeleteMessage2" >deleteMessagePart2</xv:Label>
- </xv:Panel>
- <xv:Label id="lbNbUsers" value="/usersDelete:usersDelete/lbNbUsers"></xv:Label>
- <xv:WrapPanel padding="5">
- <xv:Button id="btSubmitDelete" action="#{UsersDeleteBean.submit}" margin="5px 0px 0px 35px">ok</xv:Button>
- <xv:Button id="btCancelDelete" action="usersList" margin="5px 0px 0px 0px">cancel</xv:Button>
- </xv:WrapPanel>
- </xv:Panel>
-
- </xv:Panel>
- </xv:Panel>
-</xv:View>
\ No newline at end of file
+++ /dev/null
-#include <stdio.h>
-
-#include <string>
-#include <iostream>
-#include <sstream>
-#include <fstream>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-
-#include <view.h>
-#include <p_view.h>
-
-using namespace std;
-using namespace view;
-
-class myContent : public virtual p_PANEL_skel
-{
- public:
- myContent() {std::cout<<"create myContent\n";};
- ~myContent() {};
- protected:
- // virtual void onAttramount(const std::string &v) {std::cout<<" Got ammount : "<<v<<" - "<<m_attr_amount<<std::endl;};
- //virtual void onAttrtaille(const std::string &v) {std::cout<<" Got taille : "<<v<<" - "<<m_attr_taille<<std::endl;};
- // virtual void onAttrname(const std::string &v) {std::cout<<" Got name : "<<v<<std::endl;};
- virtual void onElPanel(PANEL_skel &dede) {
- p_PANEL_skel::onElPanel(dede);
-/**
- if ( m_context.size() > 0 )
- {
- PANEL_skel *st = static_cast<PANEL_skel *>(m_context.back().m_data);
- st->Panel(v);
-
- } else {
- PANEL_skel::Panel_sptr t(new PANEL_skel::Panel_type (v));
- //m_Panel.push_back(t);
- m_PANEL.Panel(t);
- }
- */
- std::cout<<" Got Panel : "<<dede<<"\n";
- };
-};
-
-class myXMI : public virtual p_VIEW_skel
-{
- public:
- myXMI() :p_VIEW_skel() {std::cout<<"Build maint view\n";};
- virtual ~myXMI() {};
-#if 0
- virtual void postImpl()
- {
- State &s(m_context.back());
- VIEW_skel &v=*(static_cast<VIEW_skel *>(s.m_data));
- std::cout<<"postImpl to avoid removing from ... stack_size="<<m_context.size()<<"\n";
- //std::cout<<m_Panel;
- }
- virtual void preImpl()
- {
- m_context.push_back(State());
- std::cout<<"Called my preImpl stack size="<<m_context.size()<<"\n";
- State &s(m_context.back());
- s.m_data = new VIEW_skel;
-
- }
- // virtual void onElgreeting(std::string &dede) {std::cout<<" XMI Got greeting : "<<dede<<"\n";};
- virtual void onElPanel(PANEL_skel &dede) {std::cout<<" View Got Panel : "<<dede<<"\n";};
-#endif
- // virtual void onAttrversion(const std::string &v) {std::cout<<" Attribute Version works :"<<v<<"\n";};
-};
-
-
-/**
- *
- */
-int test1(const char *filename,xsd::parser::ParserBase &p)
-{
-
- std::ifstream iss1;
- iss1.open(filename,std::ifstream::in);
- xsd::parser::expat::Document doc(p,"View");
- doc.parse(iss1);
-}
-
-
-int test2(xsd::parser::ParserBase &p)
-{
- std::string test="<XMI version=\"1.0\"><name name=\"attr_nm\" amount=\"1.2\">andre</name><greeting>Marc</greeting><nbr>12</nbr></XMI>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(p,"XMI");
- doc.parse(iss1);
-}
-
-int test3(xsd::parser::ParserBase &p)
-{
- std::string test="<XMI xmlns:hm='http://www.webobject.dyndns.org/hello' version=\"1.0\"><name name=\"attr_nm\" amount=\"1.2\" hm:taille=\"5\">andre</name><greeting>Marc</greeting><hm:nbr>12</hm:nbr></XMI>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(p,"XMI");
- doc.parse(iss1);
-}
-
-
-int main(int argc,char **argv)
-{
- printf("\n\tHello world ... test 1 sizeof p_VIEW=%d\n\n",sizeof(p_VIEW_skel));
- //p_VIEW_skel pxmi;
- myXMI pxmi;
- VIEW_skel v;
-#if 1
- myContent pxmi_c;
-
- p_WINDOW_skel pwin;
- p_WRAPPANEL_skel pwpanel,pwp2,pwp3;
- p_RADIOGROUP_skel pradiog;
- p_LABEL_skel l;
- p_TITLE_skel title;
- p_RADIO_skel rd;
- p_BUTTON_skel b;
- p_TEXTFIELD_skel tf;
- myContent p1;
- p_TABPANEL_skel tabp;
-
- title.Label_parser(l);
- tabp.Panel_parser(p1);
- p1.RadioGroup_parser(pradiog); /* well add radiog to second pa*/
- p1.TextField_parser(tf);
- p1.Panel_parser(p1);
- pradiog.Label_parser(l);
- pradiog.Radio_parser(rd);
- pxmi.Panel_parser(p1); /* Panel in View*/
- pxmi.Window_parser(pwin);
- pxmi.WrapPanel_parser(pwpanel);
-
- pxmi_c.Panel_parser(p1); /* p1 is Panel in Panel from view second panel */
- pxmi_c.TabPanel_parser(tabp);
- p1.TabPanel_parser(tabp);
- p1.WrapPanel_parser(pwpanel);
- p1.Title_parser(title);
- pwin.Panel_parser(p1);
-
-#if 0
-#endif
- pwpanel.Panel_parser(p1);
-#if 0
-#endif
- pwpanel.Button_parser(b);
- test1("WbmUser/views/UserEdit.gml",pxmi);
-#endif
- pxmi.post(v);
- std::cout<<v<<"\n";
-#if 0
- printf("\n\tHello world ... test 2\n\n");
- test2(pxmi);
- pxmi.post(xmi);
- std::cout<<"Result="<<xmi<<"\n";
- printf("\n\tHello world ... test 3\n\n");
- test3(pxmi);
-
- test3(pxmi);
- pxmi.post(xmi);
-#endif
- printf("\n\tGood bye ... test 1\n\n");
-}
-
+++ /dev/null
-PROJECT(uml2)
-
-ENABLE_TESTING()
-
-FIND_LIBRARY(EXPAT_LIB expat "/usr/local/lib:/usr/lib")
-FIND_LIBRARY(CPPUNIT_LIB cppunit "/usr/local/lib:/usr/lib")
-FIND_LIBRARY(DL_LIB ltdl "/lib:/usr/local/lib:/usr/lib")
-
-INCLUDE_DIRECTORIES("${xml-t_SOURCE_DIR}/libxsd/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/include")
-INCLUDE_DIRECTORIES(".")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}")
-INCLUDE_DIRECTORIES("/usr/local/include")
-
-SET(SAXON CACHE STRING "~/Tools/saxon/saxon9.jar")
-SET(XSD2CPP "${CMAKE_CURRENT_SOURCE_DIR}/../../xsd2cpp.xsl")
-SET(XSD2DEPS "${CMAKE_CURRENT_SOURCE_DIR}/../../xsd2cpp-make-deps.xsl")
-SET(XMI "${xml-t_SOURCE_DIR}/../../data-models/xmi.xsd")
-SET(ECORE "${xml-t_SOURCE_DIR}/../../data-models/ecore.xsd")
-SET(UML2 "${xml-t_SOURCE_DIR}/../../data-models/uml2xmi.xsd")
-
-
-#ADD_CUSTOM_COMMAND(
-# SOURCE ${XMI}
-# COMMAND java
-# ARGS -jar ${SAXON} -s ${XMI} -xsl:${XSD2CPP} rootdir="./parser/"
-# target="release" incdir="/../include" srcdir="./"
-# root-element="\"XMI\""
-# OUTPUT
-# ${CMAKE_CURRENT_BINARY_DIR}/parser/p_xmi.cpp
-# ${CMAKE_CURRENT_BINARY_DIR}/parser/xmi.cpp
-# COMMENT "Transform ${XMI}"
-# )
-
-XSD2CPP(
- SOURCE ${XMI}
- OUTPUT xmi
- ROOT-ELEMENT "XMI"
- # DEPS xmi-deps.xml
- XSDDIRS "./../\;../../data-models/\;./\;/home/aeb/Devs/home/data-models/oxo_wsdl/\;../../data-models/\;./../\;"
- )
-
-ADD_CUSTOM_COMMAND(
- TARGET ${CMAKE_CURRENT_BINARY_DIR}/deps_ecore.xml
- COMMAND java -jar ${SAXON} -s ${ECORE} -xsl:${XSD2DEPS} -o deps_ecore.xml
- COMMENT "Male deps of ${ECORE} "
- )
-ADD_CUSTOM_TARGET(deps_ecore.xml
- COMMAND java -jar ${SAXON} -s ${ECORE} -xsl:${XSD2DEPS} -o ${CMAKE_CURRENT_BINARY_DIR}/deps_ecore.xml target="release" rootdir="./parser/"
- root-element="EPackage"
- COMMENT "Make deps of ${ECORE} "
- )
-
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/deps_ecore.xml
- GENERATED)
-
-#ADD_CUSTOM_COMMAND(
-# SOURCE ${ECORE}
-# COMMAND java
-# ARGS -jar ${SAXON} -s ${ECORE} -xsl:${XSD2CPP} target="release" rootdir="./parser/"
-# incdir="/../include" srcdir="./" root-element="EModel"
-# xsddir="./\;/home/aeb/Devs/home/data-models/oxo_wsdl/\;../../data-models/\;./../\;"
-# deps="${CMAKE_CURRENT_BINARY_DIR}/deps_ecore.xml"
-# OUTPUT
-# ${CMAKE_CURRENT_BINARY_DIR}/parser/p_ecore.cpp
-# ${CMAKE_CURRENT_BINARY_DIR}/parser/ecore.cpp
-# ${CMAKE_CURRENT_BINARY_DIR}/include/ecore.h
-# ${CMAKE_CURRENT_BINARY_DIR}/include/p_ecore.h
-# COMMENT "Transform ${ECORE} to cpp and header files "
-# )
-# DEPS ecore-deps.xml
-
-XSD2CPP(
- SOURCE ${ECORE}
- OUTPUT ecore
- ROOT-ELEMENT EPackage
- DEPS deps1_ecore.xml
- XSDDIRS "./../\;../../data-models/\;./\;/home/aeb/Devs/home/data-models/oxo_wsdl/\;../../data-models/\;./../\;"
- )
-#ADD_CUSTOM_COMMAND(
-# SOURCE ${UML2}
-# COMMAND java
-# ARGS -jar ${SAXON} -s ${UML2} -xsl:${XSD2CPP} target="release" rootdir="./parser/"
-# incdir="/../include" srcdir="./" root-element="Model"
-# xsddir="./\;/home/aeb/Devs/home/data-models/oxo_wsdl/\;../../data-models/\;./../\;"
-# OUTPUT
-# ${CMAKE_CURRENT_BINARY_DIR}/parser/p_UML2.cpp
-# ${CMAKE_CURRENT_BINARY_DIR}/parser/UML2.cpp
-# ${CMAKE_CURRENT_BINARY_DIR}/include/UML2.h
-# ${CMAKE_CURRENT_BINARY_DIR}/include/p_UML2.h
-# COMMENT "Transform ${UML2}"
-# )
-
-XSD2CPP(
- SOURCE ${UML2}
- OUTPUT uml2xmi
- ROOT-ELEMENT Model
- DEPS uml-deps.xml
- XSDDIRS "./\;/home/aeb/Devs/home/data-models/oxo_wsdl/\;../../data-models/\;./../\;"
- )
-#SOURCE ${xml-t_SOURCE_DIR}/../../../../data-models/xmi.xsd
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/parser/xmi.cpp
- GENERATED)
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/parser/p_xmi.cpp
- GENERATED)
-
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/parser/p_ecore.cpp
- GENERATED)
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/parser/ecore.cpp
- GENERATED)
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/parser/p_UML.cpp
- GENERATED)
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/parser/UML.cpp
- GENERATED)
-
-ADD_EXECUTABLE(uml2
- ${CMAKE_CURRENT_BINARY_DIR}/parser/UML.cpp
- main.cpp )
-IF(COMMAND cmake_policy)
- cmake_policy(SET CMP0003 NEW)
-ENDIF(COMMAND cmake_policy)
-
-#
-# Test Stuff
-#
-IF(NOT ${CPPUNIT_LIB})
- ADD_EXECUTABLE(test_xmi
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_xmi.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/xmi.cpp
- main_test.cpp
- )
- TARGET_LINK_LIBRARIES(test_xmi
- libxsd
- ${EXPAT_LIB}
- ${CPPUNIT_LIB}
- )
- ADD_EXECUTABLE(test_ecore
- ${CMAKE_CURRENT_BINARY_DIR}/parser/ecore.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_ecore.cpp
- main_test.cpp
- )
- TARGET_LINK_LIBRARIES(test_ecore
- libxsd
- ${EXPAT_LIB}
- ${CPPUNIT_LIB}
- )
- ADD_EXECUTABLE(test_uml2
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_uml2xmi.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/uml2xmi.cpp
- main_test.cpp
- )
-
- TARGET_LINK_LIBRARIES(test_uml2
- libxsd
- ${EXPAT_LIB}
- ${CPPUNIT_LIB}
- )
-
- MESSAGE("Found Library ${DL_LIB}")
- IF(NOT ${DL_LIB})
- TARGET_LINK_LIBRARIES(test_xmi ${DL_LIB})
- TARGET_LINK_LIBRARIES(test_ecore ${DL_LIB})
- TARGET_LINK_LIBRARIES(test_uml2 ${DL_LIB})
- ENDIF(NOT ${DL_LIB})
-
-
- # ADD_TEST(SimpleType tp_basic01 Hello)
- # ADD_TEST(SimpleTypeSerialize sr_basic01 Hello)
- # ADD_TEST(SimpleTypeNativeTypes sr_basic02 Hello)
- # ADD_TEST(SimpleTypeRef tparser_basic Hello)
- # ADD_TEST(SimpleTypeUnion tparser_basic Hello)
- # ADD_TEST(SimpleTypeEnumaration tparser_basic Hello)
- # ADD_TEST(SimpleTypeExtesion tparser_basic Hello)
- # ADD_TEST(SimpleTypeRestriction tparser_basic Hello)
- # ADD_TEST(ComplexType tparser_basic Hello)
- # ADD_TEST(ComplexTypeSequence tparser_basic Hello)
- # ADD_TEST(ComplexTypeChoice tparser_basic Hello)
- # ADD_TEST(ComplexTypeAll tparser_basic Hello)
- # ADD_TEST(ComplexTypeNamespace tparser_basic Hello)
- # ADD_TEST(ComplexRecursion tc_03basic Hello)
-ELSE(NOT ${CPPUNIT_LIB})
- MESSAGE("I do not have cppunit library ${CPPUNIT_LIB} ")
-ENDIF(NOT ${CPPUNIT_LIB})
-
-
-#
-# Install stuff
-#
-IF (NOT ${CPPUNIT_LIB})
-INSTALL(TARGETS test_xmi test_ecore test_uml2
- ARCHIVE
- RUNTIME DESTINATION examples/uml2
- COMPONENT Examples)
-ENDIF(NOT ${CPPUNIT_LIB})
-INSTALL(FILES
- ${XMI}
- DESTINATION examples/uml2
- COMPONENT Examples
- )
-INSTALL(FILES
- ${uml2_SOURCE_DIR}/main.cpp
- DESTINATION examples/uml2
- COMPONENT Examples
- )
-INSTALL(FILES
- ${uml2_BINARY_DIR}/parser/xmi.cpp
- ${uml2_BINARY_DIR}/parser/p_xmi.cpp
- DESTINATION examples/uml2/parser
- COMPONENT Examples
- )
-INSTALL(FILES
- ${uml2_BINARY_DIR}/include/xmi.h
- ${uml2_BINARY_DIR}/include/p_xmi.h
- DESTINATION examples/basic/include
- COMPONENT Examples
- )
+++ /dev/null
-#include <iostream>
-
-#include <cppunit/BriefTestProgressListener.h>
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/TestResult.h>
-#include <cppunit/TestResultCollector.h>
-#include <cppunit/TestRunner.h>
-
-
-
-int main(int argc,char **argv)
-{
- // Create the event manager and test controller
- CPPUNIT_NS::TestResult controller;
-
- // Add a listener that colllects test result
- CPPUNIT_NS::TestResultCollector result;
- controller.addListener( &result );
-
- // Add a listener that print dots as test run.
- CPPUNIT_NS::BriefTestProgressListener progress;
- controller.addListener( &progress );
-
- // Add the top suite to the test runner
- CPPUNIT_NS::TestRunner runner;
- runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
- runner.run( controller );
-
- // Print test in a compiler compatible format.
- CPPUNIT_NS::CompilerOutputter outputter( &result, CPPUNIT_NS::stdCOut() );
- outputter.write();
-
- return result.wasSuccessful() ? 0 : 1;
-
-}
+++ /dev/null
-PROJECT(x3d)
-
-FIND_LIBRARY(EXPAT_LIB expat "/usr/local/lib:/usr/lib")
-INCLUDE_DIRECTORIES("${xml-t_SOURCE_DIR}/libxsd/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/")
-INCLUDE_DIRECTORIES("/usr/local/include")
-
-INCLUDE(${xml-t_SOURCE_DIR}/../../rules/saxon.cmake)
-
-
-SET(X3D
- "${xml-t_SOURCE_DIR}/../../data-models/x3d-3_0.xsd")
-
-
-#
-
-XSD2CPP(
- SOURCE ${X3D}
- OUTPUT x3d-3_0
- ROOT-ELEMENT X3D
- DEPS x3d-3_0deps.xml
- XSDDIRS "./../\;../../data-models/\;"
- )
-
-#XSD2CPP_BOTH(${X3D} x3d-3_0 "" "./../\;../../data-models/\;"
-# "tests/svg/nsmap.xml")
-
-
-
-IF(COMMAND cmake_policy)
- cmake_policy(SET CMP0003 NEW)
-ENDIF(COMMAND cmake_policy)
-
-#
-#
-#
-ADD_EXECUTABLE(x3d_serialize
- main_test.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/x3d-3_0.cpp
- )
-
-TARGET_LINK_LIBRARIES(x3d_serialize libxsd ${EXPAT_LIB}
- ${CPPUNIT_LIB}
- ${DL_LIB}
- )
-
-#
-#ADD_EXECUTABLE(xpdl_parse
-# main_test.cpp
-# ${CMAKE_CURRENT_BINARY_DIR}/parser/p_xpdl_10.cpp
-#" )
-
-#ARGET_LINK_LIBRARIES(xpdl_parse libxsd ${EXPAT_LIB}
-# ${CPPUNIT_LIB}
-# ${DL_LIB}
-# )
-
-
+++ /dev/null
-#include <iostream>
-
-#include <cppunit/BriefTestProgressListener.h>
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/TestResult.h>
-#include <cppunit/TestResultCollector.h>
-#include <cppunit/TestRunner.h>
-
-
-
-int main(int argc,char **argv)
-{
- // Create the event manager and test controller
- CPPUNIT_NS::TestResult controller;
-
- // Add a listener that colllects test result
- CPPUNIT_NS::TestResultCollector result;
- controller.addListener( &result );
-
- // Add a listener that print dots as test run.
- CPPUNIT_NS::BriefTestProgressListener progress;
- controller.addListener( &progress );
-
- // Add the top suite to the test runner
- CPPUNIT_NS::TestRunner runner;
- runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
- runner.run( controller );
-
- // Print test in a compiler compatible format.
- CPPUNIT_NS::CompilerOutputter outputter( &result, CPPUNIT_NS::stdCOut() );
- outputter.write();
-
- return result.wasSuccessful() ? 0 : 1;
-
-}
+++ /dev/null
-PROJECT(xmldsig)
-
-FIND_LIBRARY(EXPAT_LIB expat "/usr/local/lib:/usr/lib")
-INCLUDE_DIRECTORIES("${xml-t_SOURCE_DIR}/libxsd/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/")
-INCLUDE_DIRECTORIES("/usr/local/include")
-
-INCLUDE(${xml-t_SOURCE_DIR}/../../rules/saxon.cmake)
-
-
-SET(XMLDSIG
- "${xml-t_SOURCE_DIR}/../../data-models/xmldsig-core-schema.xsd")
-
-
-#
-
-XSD2CPP(SOURCE ${XMLDSIG}
- OUTPUT xmldsig-core-schema
- XSDDIRS "./../\;../../data-models/\;"
- ROOT-ELEMENT Signature
-)
-
-
-
-IF(COMMAND cmake_policy)
- cmake_policy(SET CMP0003 NEW)
-ENDIF(COMMAND cmake_policy)
-
-#
-#
-#
-ADD_EXECUTABLE(xmldsig
- main_test.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/xmldsig-core-schema.cpp
- )
-
-TARGET_LINK_LIBRARIES(xmldsig libxsd ${EXPAT_LIB}
- ${CPPUNIT_LIB}
- ${DL_LIB}
- )
-
-#
-#ADD_EXECUTABLE(xpdl_parse
-# main_test.cpp
-# ${CMAKE_CURRENT_BINARY_DIR}/parser/p_xpdl_10.cpp
-#" )
-
-#ARGET_LINK_LIBRARIES(xpdl_parse libxsd ${EXPAT_LIB}
-# ${CPPUNIT_LIB}
-# ${DL_LIB}
-# )
-
-
+++ /dev/null
-#include <iostream>
-
-#include <cppunit/BriefTestProgressListener.h>
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/TestResult.h>
-#include <cppunit/TestResultCollector.h>
-#include <cppunit/TestRunner.h>
-
-
-
-int main(int argc,char **argv)
-{
- // Create the event manager and test controller
- CPPUNIT_NS::TestResult controller;
-
- // Add a listener that colllects test result
- CPPUNIT_NS::TestResultCollector result;
- controller.addListener( &result );
-
- // Add a listener that print dots as test run.
- CPPUNIT_NS::BriefTestProgressListener progress;
- controller.addListener( &progress );
-
- // Add the top suite to the test runner
- CPPUNIT_NS::TestRunner runner;
- runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
- runner.run( controller );
-
- // Print test in a compiler compatible format.
- CPPUNIT_NS::CompilerOutputter outputter( &result, CPPUNIT_NS::stdCOut() );
- outputter.write();
-
- return result.wasSuccessful() ? 0 : 1;
-
-}
+++ /dev/null
-PROJECT(xpdl)
-
-FIND_LIBRARY(EXPAT_LIB expat "/usr/local/lib:/usr/lib")
-INCLUDE_DIRECTORIES("${xml-t_SOURCE_DIR}/libxsd/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/")
-INCLUDE_DIRECTORIES("/usr/local/include")
-
-INCLUDE(${xml-t_SOURCE_DIR}/../../rules/saxon.cmake)
-
-#SET(SAXON CACHE STRING "~/Tools/saxon/saxon9.jar")
-#SET(WSDL2 "${CMAKE_CURRENT_SOURCE_DIR}/../../wsdl2.xsl")
-#SET(XSD2CPP "${CMAKE_CURRENT_SOURCE_DIR}/../../xsd2cpp.xsl")
-
-SET(XPDL
- "${xml-t_SOURCE_DIR}/../../data-models/workflow/xpdl_21.xsd")
-
-SET(XPDL_10
- "${xml-t_SOURCE_DIR}/../../data-models/workflow/xpdl_10.xsd")
-
-#
-
-XSD2CPP(
- SOURCE ${XPDL}
- OUTPUT xpdl_21
- ROOT-ELEMENT
- XSDDIRS "./../\;../../data-models/\;"
- )
-
-XSD2CPP_BOTH(${XPDL_10} xpdl_10 "" "./../\;../../data-models/\;"
- "tests/svg/nsmap.xml")
-
-
-
-IF(COMMAND cmake_policy)
- cmake_policy(SET CMP0003 NEW)
-ENDIF(COMMAND cmake_policy)
-
-#
-#
-#
-ADD_EXECUTABLE(xpdl_serialize
- main_test.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/xpdl_10.cpp
- )
-
-TARGET_LINK_LIBRARIES(xpdl_serialize libxsd ${EXPAT_LIB}
- ${CPPUNIT_LIB}
- ${DL_LIB}
- )
-
-#
-ADD_EXECUTABLE(xpdl_parse
- main_test.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_xpdl_10.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/xpdl_10.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/xpdl_21.cpp
- )
-
-TARGET_LINK_LIBRARIES(xpdl_parse libxsd ${EXPAT_LIB}
- ${CPPUNIT_LIB}
- ${DL_LIB}
- )
-
-
+++ /dev/null
-#include <iostream>
-
-#include <cppunit/BriefTestProgressListener.h>
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/TestResult.h>
-#include <cppunit/TestResultCollector.h>
-#include <cppunit/TestRunner.h>
-
-
-
-int main(int argc,char **argv)
-{
- // Create the event manager and test controller
- CPPUNIT_NS::TestResult controller;
-
- // Add a listener that colllects test result
- CPPUNIT_NS::TestResultCollector result;
- controller.addListener( &result );
-
- // Add a listener that print dots as test run.
- CPPUNIT_NS::BriefTestProgressListener progress;
- controller.addListener( &progress );
-
- // Add the top suite to the test runner
- CPPUNIT_NS::TestRunner runner;
- runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
- runner.run( controller );
-
- // Print test in a compiler compatible format.
- CPPUNIT_NS::CompilerOutputter outputter( &result, CPPUNIT_NS::stdCOut() );
- outputter.write();
-
- return result.wasSuccessful() ? 0 : 1;
-
-}
+++ /dev/null
-PROJECT(xslt)
-
-FIND_LIBRARY(EXPAT_LIB expat "/usr/local/lib:/usr/lib")
-INCLUDE_DIRECTORIES("${xml-t_SOURCE_DIR}/libxsd/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/")
-INCLUDE_DIRECTORIES("/usr/local/include")
-
-INCLUDE(${xml-t_SOURCE_DIR}/../../rules/saxon.cmake)
-
-
-SET(XSLT_SCHEMA
- "${xml-t_SOURCE_DIR}/../../data-models/xslt20.xsd")
-
-SET(XSLT_SCHEMA10
- "${xml-t_SOURCE_DIR}/../../data-models/xslt.xsd")
-
-
-#
-
-XSD2CPP(SOURCE ${XSLT_SCHEMA}
- OUTPUT xslt20
- DEPS xslt20-deps.xml
- ROOT-ELEMENT "transform"
- XSDDIRS "\;./../\;../../data-models/\;/home/aeb/Devs/home/home/data-models/\;../../data-models/oxo_wsdl/\;./../\;${xml-t_SOURCE_DIR}/../../data-models/\;"
-)
-
-XSD2CPP(SOURCE ${XSLT_SCHEMA10}
- OUTPUT xslt
- OPTS "polymorphic=\"yes\""
- XSDDIRS "\;./../\;../../data-models/\;/home/aeb/Devs/home/home/data-models/\;../../data-models/oxo_wsdl/\;./../\;${xml-t_SOURCE_DIR}/../../data-models/\;"
-)
-
-IF(COMMAND cmake_policy)
- cmake_policy(SET CMP0003 NEW)
-ENDIF(COMMAND cmake_policy)
-
-#
-#
-#
-ADD_EXECUTABLE(xsltlib20
- main_test.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/xslt20.cpp
- )
-
-TARGET_LINK_LIBRARIES(xsltlib20 libxsd ${EXPAT_LIB}
- ${CPPUNIT_LIB}
- ${DL_LIB}
- )
-
-ADD_EXECUTABLE(xsltlib
- main_test.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/xslt.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_xslt.cpp
- TestCaseParseXsl.cpp
- )
-
-TARGET_LINK_LIBRARIES(xsltlib libxsd ${EXPAT_LIB}
- ${CPPUNIT_LIB}
- ${DL_LIB}
- )
-
-ADD_EXECUTABLE(xsltlibd
- main_test.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/xslt.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/parser/p_xslt.cpp
- TestCaseParseXsl.cpp
- )
-SET_TARGET_PROPERTIES(xsltlibd
- PROPERTIES
- CLEAN_DIRECT_OUTPUT 1
- COMPILE_FLAGS "-DDEBUG -DPARSER_DEBUG=1"
- )
-TARGET_LINK_LIBRARIES(xsltlibd xsdd ${CPPUNIT_LIB}
- ${DL_LIB}
- ${EXPAT_LIB}
- )
-
-
-
+++ /dev/null
-#include <cppunit/config/SourcePrefix.h>
-#include "TestCaseParseXsl.h"
-#include <fstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestCaseParseXsl);
-
-class TestResult : public virtual Transform::stylesheet_skel
-{
- public:
- std::string &version() {return me_attr_version.m_content;};
-};
-
-void TestCaseParseXsl::setUp()
-{
- m_template.match_parser(m_match);
- m_template.param_parser(m_param);
- m_root._template_parser(m_template);
- m_xmlsourcepath= "./xmlsources/";
-}
-
-/**
- *
- */
-void TestCaseParseXsl::parse_01()
-{
- TestResult s;
- char r[128];
- signed char c=(signed char)60;
- std::string test="<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\""
- " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">"
- "<xsl:template match=\"dede\" mode=\"base\">"
- "<xsl:param name=\"test_param\"/>"
- "</xsl:template></xsl:stylesheet>";
- //"<xsl:text>COUCOU</xsl:text>"
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"stylesheet");
- std::cout<<"Start Parsing ("<<test<<")"<<std::endl;
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s.version()=="1.0");
-#if 0
- CPPUNIT_ASSERT(s.greeting()=="Marc");
- CPPUNIT_ASSERT(s.nbr()==12);
- CPPUNIT_ASSERT( ( s.name())[0]!= NULL);
- sprintf(r,"Why is name=%s\n",s.name()[0]->content().c_str());
- CPPUNIT_ASSERT_MESSAGE( r , s.name()[0]->content() == "andre");
-#endif
-}
-
-/**
- *
- */
-void TestCaseParseXsl::parse_02()
-{
- TestResult s;
- char r[128];
- signed char c=(signed char)60;
- std::string test="<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\""
- " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">"
- "<xsl:template match=\"TypeDefinition\" mode=\"base\">"
- "<xsl:param name=\"test_param\"/>"
- "</xsl:template>"
- "<xsl:template match=\"ValueDefinition\" mode=\"base\">"
- "<xsl:param name=\"t2_p1\"/>"
- "</xsl:template>"
- "</xsl:stylesheet>";
- //"<xsl:text>COUCOU</xsl:text>"
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"stylesheet");
- std::cout<<"Start Parsing ("<<test<<")"<<std::endl;
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s.version()=="1.0");
-}
-
-/**
- *
- */
-void TestCaseParseXsl::parse_03()
-{
-#if 0
- TestResult s;
- std::string test="<Simple version=\"1.0\"><name version=\"first test\" link=\"A\">andre</name><greeting>Marc</greeting><nbr>12</nbr></Simple>";
- std::istringstream iss1(test,std::istringstream::in);
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s.version()=="1.2");
-#endif
-}
-
-/**
- *
- */
-void TestCaseParseXsl::parse_file_01int()
-{
-#if 0
- basic_type::Simple_skel s;
- std::ifstream iss1;
- std::string filename = m_xmlsourcepath + "01basic_01int.xml";
- iss1.open(filename.c_str(),std::ifstream::in);
- xsd::parser::expat::Document doc(m_root,"Simple");
- doc.parse(iss1);
- m_root.post(s);
- CPPUNIT_ASSERT(s._int()==454);
-#endif
-}
+++ /dev/null
-#ifndef TESTCASE_PARSEXSL_H
-#define TESTCASE_PARSEXSL_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <xsd/xsd.h>
-#include <xsd/parser/expat/elements.h>
-#include <include/xslt.h>
-#include <include/p_xslt.h>
-
-
-using namespace Transform;
-
-class TestCaseParseXsl : public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestCaseParseXsl );
- CPPUNIT_TEST(parse_01);
- CPPUNIT_TEST(parse_02);
-/*
- CPPUNIT_TEST(parse_02);
- CPPUNIT_TEST_FAIL(parse_03);
- CPPUNIT_TEST(parse_file_01int);
-*/
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void setUp();
- protected:
- xsd::parser::SimpleElement m_nbr,m_greeting,m__int,m__double,m__string;
- p_variable_definition_skel m_param;
- p_pattern_skel m_match;
- p_named_template_skel m_template;
- p_stylesheet_skel m_root;
-
- std::string m_xmlsourcepath;
- protected:
- void parse_01();
- void parse_02();
- void parse_03();
- void parse_file_01int();
-};
-#endif
+++ /dev/null
-#include <iostream>
-
-#include <cppunit/BriefTestProgressListener.h>
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/TestResult.h>
-#include <cppunit/TestResultCollector.h>
-#include <cppunit/TestRunner.h>
-
-
-
-int main(int argc,char **argv)
-{
- // Create the event manager and test controller
- CPPUNIT_NS::TestResult controller;
-
- // Add a listener that colllects test result
- CPPUNIT_NS::TestResultCollector result;
- controller.addListener( &result );
-
- // Add a listener that print dots as test run.
- CPPUNIT_NS::BriefTestProgressListener progress;
- controller.addListener( &progress );
-
- // Add the top suite to the test runner
- CPPUNIT_NS::TestRunner runner;
- runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
- runner.run( controller );
-
- // Print test in a compiler compatible format.
- CPPUNIT_NS::CompilerOutputter outputter( &result, CPPUNIT_NS::stdCOut() );
- outputter.write();
-
- return result.wasSuccessful() ? 0 : 1;
-
-}
+++ /dev/null
-<?xml version="1.0" ?>\r
-<!DOCTYPE xslt [\r
-\r
- <!-- Formating -->\r
- <!ENTITY CR "
">\r
- <!ENTITY NL ' '>\r
- <!ENTITY TAB "	">\r
- <!ENTITY PV ";">\r
- <!ENTITY CLS_PREF "">\r
- <!ENTITY TYPE_SUFF "_skel">\r
- <!ENTITY ELEM_PREF "el_">\r
- <!ENTITY ELEM_SUFF "_skel">\r
- <!ENTITY ATTR_PREF "attr_">\r
- <!ENTITY ATTR_SUFF "_skel">\r
- <!ENTITY INDENT " ">\r
- <!ENTITY INDENT2 "&INDENT;&INDENT;">\r
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">\r
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">\r
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">\r
- <!ENTITY DM "urn:broadband-forum-org:cwmp:datamodel-1-0">\r
- <!ENTITY DMR "urn:broadband-forum-org:cwmp:datamodel-report-0-1">\r
-]>\r
-<!-- \r
- vim:ts=2:sw=2:et:encoding=utf-8 \r
-\r
- This file is responsible to generate the code for the 4 files\r
--->\r
-<xsl:stylesheet\r
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"\r
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"\r
- xmlns:dm="&DM;"\r
- xmlns:dmr="&DMR;"\r
- xmlns:saxon="http://exslt.org/common"\r
- extension-element-prefixes="saxon"\r
- version="2.0" >\r
-\r
-\r
- <!-- -->\r
- <xsl:template match="dm:document" mode='header'>\r
- <xsl:apply-templates mode='header'/>\r
- </xsl:template>\r
-\r
- <!-- -->\r
- <xsl:template match="import" mode='header'>\r
- <xsl:apply-templates mode='header'/>\r
- </xsl:template>\r
-\r
- <!-- -->\r
- <xsl:template match="model" mode='header'>\r
- <xsl:variable name='filename'>\r
- <xsl:value-of select='concat($incdir,"/",$out,".h")'/>\r
- </xsl:variable>\r
- <xsl:result-document href='{$filename}' format='text'>\r
- <xsl:value-of select='concat("#ifndef MODEL_",$out,"_H ")'/>\r
- <xsl:value-of select='concat("#define MODEL_",$out,"_H ")'/>\r
- <xsl:apply-templates select="object" mode='header'/>\r
- <xsl:value-of select='concat("#endif","")'/>\r
- </xsl:result-document>\r
- </xsl:template>\r
-\r
- <!-- -->\r
- <xsl:template match="object" mode='header'>\r
- <xsl:variable name='fields'>\r
- <xsl:apply-templates select='.' mode='dot-string-to-nodes'/>\r
- </xsl:variable>\r
- <xsl:variable name='class'>\r
- <xsl:choose>\r
- <xsl:when test='$fields/xsd:field[position() = last()]/@name="{i}"'>\r
- <xsl:value-of select='$fields/xsd:field[position() =(last()-1)]/@name'/>\r
- </xsl:when>\r
- <xsl:otherwise>\r
- <xsl:value-of select='$fields/xsd:field[position()=last()]/@name'/>\r
- </xsl:otherwise>\r
- </xsl:choose>\r
- </xsl:variable>\r
- <xsl:value-of select='concat(" // Object:",@name," ")'/>\r
- <xsl:value-of select='concat("struct ",$class," { ")'/>\r
- <xsl:apply-templates select="parameter|uniqueKey" mode='header'/>\r
- <xsl:text>};&NL;</xsl:text>\r
- </xsl:template>\r
-\r
- <!-- -->\r
- <xsl:template match="parameter" mode='header'>\r
- <xsl:variable name='type'>\r
- <xsl:apply-templates select="syntax" mode='syntax'/>\r
- </xsl:variable>\r
- <xsl:variable name='name'>\r
- <xsl:choose>\r
- <xsl:when test='@name'><xsl:value-of select='@name'/></xsl:when>\r
- <xsl:when test='@ref'><xsl:value-of select='@ref'/></xsl:when>\r
- </xsl:choose>\r
- </xsl:variable>\r
- <xsl:value-of select='concat("&INDENT;",$type," ",$name,"; ")'/>\r
- </xsl:template>\r
- \r
- <!-- -->\r
- <xsl:template match="uniqueKey" mode='header'>\r
- <!--\r
- <xsl:apply-templates select="parameter" mode='header'/>\r
- -->\r
- </xsl:template>\r
-\r
- <!-- -->\r
- <xsl:template match="description" mode='header'>\r
- </xsl:template>\r
- \r
- <!-- -->\r
- <xsl:template match="syntax" mode='header'>\r
- <xsl:apply-templates mode="syntax"/>\r
- </xsl:template>\r
-\r
-\r
-</xsl:stylesheet>\r
-\r
+++ /dev/null
-<?xml version="1.0" ?>\r
-<!DOCTYPE xslt [\r
-\r
- <!-- Formating -->\r
- <!ENTITY CR "
">\r
- <!ENTITY NL " ">\r
- <!ENTITY TAB "	">\r
- <!ENTITY PV ";">\r
- <!ENTITY CLS_PREF "">\r
- <!ENTITY TYPE_SUFF "_skel">\r
- <!ENTITY ELEM_PREF "el_">\r
- <!ENTITY ELEM_SUFF "_skel">\r
- <!ENTITY ATTR_PREF "attr_">\r
- <!ENTITY ATTR_SUFF "_skel">\r
- <!ENTITY INDENT " ">\r
- <!ENTITY INDENT2 "&INDENT;&INDENT;">\r
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">\r
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">\r
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">\r
- <!ENTITY DM "urn:broadband-forum-org:cwmp:datamodel-1-0">\r
- <!ENTITY DMR "urn:broadband-forum-org:cwmp:datamodel-report-0-1">\r
-]>\r
-<!-- \r
- vim:ts=2:sw=2:et:encoding=utf-8 \r
-\r
- This file is responsible to generate the code for the 4 files\r
--->\r
-<xsl:stylesheet\r
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"\r
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"\r
- xmlns:dm="&DM;"\r
- xmlns:dmr="&DMR;"\r
- xmlns:saxon="http://exslt.org/common"\r
- extension-element-prefixes="saxon"\r
- version="2.0" >\r
-\r
-\r
- <!-- -->\r
- <xsl:template match="dm:document" mode='source'>\r
- <xsl:apply-templates mode='source'/>\r
- </xsl:template>\r
-\r
- <!-- -->\r
- <xsl:template match="import" mode='source'>\r
- <xsl:apply-templates mode='source'/>\r
- </xsl:template>\r
-\r
- <!-- -->\r
- <xsl:template match="model" mode='source'>\r
- <xsl:variable name='filename'>\r
- <xsl:value-of select='concat($srcdir,"/",$out,".cpp")'/>\r
- </xsl:variable>\r
- <xsl:message terminate='no'>Generate :<xsl:value-of select='$filename'/></xsl:message>\r
- <xsl:result-document href='{$filename}' format='text'>\r
- <xsl:apply-templates select="object" mode='source'/>\r
- </xsl:result-document>\r
- </xsl:template>\r
-\r
- <!-- -->\r
- <xsl:template match="object" mode='source'>\r
- <xsl:text/>\r
- <xsl:value-of select='concat("//Object:",@name)'/>\r
- <xsl:text>&NL;</xsl:text>\r
- <xsl:apply-templates select="parameter|uniqueKey" mode='source'/>\r
- <xsl:text>&NL;</xsl:text>\r
- </xsl:template>\r
-\r
- <!-- -->\r
- <xsl:template match="parameter" mode='source'>\r
- <xsl:value-of select='concat("&INDENT;","//")'/>\r
- <xsl:apply-templates select="syntax" mode='syntax'/>\r
- <xsl:value-of select="concat('&INDENT;',@name,@ref)"/>\r
- <xsl:text>;&NL;</xsl:text>\r
- </xsl:template>\r
- \r
- <!-- -->\r
- <xsl:template match="uniqueKey" mode='source'>\r
- <xsl:apply-templates select="parameter" mode='source'/>\r
- </xsl:template>\r
-\r
- <!-- -->\r
- <xsl:template match="description" mode='source'>\r
- </xsl:template>\r
- \r
- <!-- -->\r
- <xsl:template match="syntax" mode='source'>\r
- <xsl:apply-templates mode="syntax"/>\r
- </xsl:template>\r
-\r
- <!-- -->\r
-\r
- <xsl:template match="*" mode="syntax">\r
- <xsl:value-of select='name(.)'/>\r
- </xsl:template>\r
- \r
- <xsl:template match="list|string|unsignedInt" mode="syntax">\r
- <xsl:value-of select='name(.)'/>\r
- </xsl:template>\r
- \r
- <xsl:template match="dataType" mode="syntax">\r
- <xsl:value-of select='concat(name(.)," ",@ref)'/>\r
- </xsl:template>\r
-\r
-</xsl:stylesheet>\r
-\r
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL " ">
- <!ENTITY TAB "	">
- <!ENTITY PV ";">
- <!ENTITY CLS_PREF "">
- <!ENTITY TYPE_SUFF "_skel">
- <!ENTITY ELEM_PREF "el_">
- <!ENTITY ELEM_SUFF "_skel">
- <!ENTITY ATTR_PREF "attr_">
- <!ENTITY ATTR_SUFF "_skel">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
- <!ENTITY DM "urn:broadband-forum-org:cwmp:datamodel-1-0">
- <!ENTITY DMR "urn:broadband-forum-org:cwmp:datamodel-report-0-1">
-]>
-<!--
- vim:ts=2:sw=2:et:encoding=utf-8
-
- This file is responsible to generate the code for the 4 files
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:dm="&DM;"
- xmlns:dmr="&DMR;"
- xmlns:saxon="http://exslt.org/common"
- extension-element-prefixes="saxon"
- version="2.0" >
-
-
- <xsl:template name='dot-string-to-nodes'>
- <xsl:param name='string'/>
- <xsl:if test="not($string='')">
- <xsl:message terminate="no">tr069-utils: space-string-list: <xsl:value-of
- select="$string"/> </xsl:message>
- <xsl:choose>
- <xsl:when test='contains($string,".")'>
- <xsl:variable name='type'
- select='substring-before($string,".")'/>
- <xsl:variable name='ns'>
- <xsl:choose>
- <xsl:when test='contains($type,":")'>
- <xsl:value-of
- select='../namespace::*[name()=substring-before($type,":")]'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of
- select='../namespace::*[name()=""]'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='local-name'>
- <xsl:choose>
- <xsl:when test="contains($type,':')"><xsl:value-of select="substring-after($type,':')"/></xsl:when>
- <xsl:otherwise><xsl:value-of select='$type'/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:message terminate='no'><xsl:value-of select='concat("type=",$type," NS=",$ns)'/></xsl:message>
- <!--TODO compute the proper namespace if contains : -->
- <xsl:element name='field' namespace='&XSD;'>
- <xsl:attribute name='type' namespace="">
- <xsl:value-of
- select='substring-before($string,".")'/>
- </xsl:attribute>
- <xsl:attribute name='name' namespace="">
- <xsl:value-of
- select='$local-name'/>
- </xsl:attribute>
- <xsl:value-of
- select='$local-name'/>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name='type'
- select='$string'/>
- <xsl:variable name='ns'>
- <xsl:choose>
- <xsl:when test='contains($type,":")'>
- <xsl:value-of
- select='../namespace::*[name()=substring-before($type,":")]'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of
- select='../namespace::*[name()=""]'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='local-name'>
- <xsl:choose>
- <xsl:when test="contains($type,':')"><xsl:value-of select="substring-after($type,':')"/></xsl:when>
- <xsl:otherwise><xsl:value-of select='$type'/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:element name='field' namespace='&XSD;'>
- <xsl:attribute name='type' namespace="">
- <xsl:value-of select='$string'/>
- </xsl:attribute>
- <xsl:attribute name='name' namespace="">
- <xsl:value-of select='$local-name'/>
- </xsl:attribute>
- <xsl:value-of select='$local-name'/>
- </xsl:element>
- <xsl:message terminate="no">tr069-utils: space-string-list: Built:<xsl:value-of
- select="concat($string,' namespace=',$ns)"/> </xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test='string-length(substring-after($string,"."))>0'>
- <xsl:call-template name='dot-string-to-nodes'>
- <xsl:with-param name='string' select='substring-after($string,".")'/>
- </xsl:call-template>
- </xsl:if>
- </xsl:if>
- </xsl:template>
- <!-- for simpleTypes in union-->
- <xsl:template match='object' mode="dot-string-to-nodes">
- <xsl:call-template name='dot-string-to-nodes'>
- <xsl:with-param name='string' select='@name'/>
- </xsl:call-template>
- </xsl:template>
-
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>\r
-<!DOCTYPE xslt [\r
-\r
- <!-- Formating -->\r
- <!ENTITY CR "
">\r
- <!ENTITY NL " ">\r
- <!ENTITY TAB "	">\r
- <!ENTITY PV ";">\r
- <!ENTITY CLS_PREF "">\r
- <!ENTITY TYPE_SUFF "_skel">\r
- <!ENTITY ELEM_PREF "el_">\r
- <!ENTITY ELEM_SUFF "_skel">\r
- <!ENTITY ATTR_PREF "attr_">\r
- <!ENTITY ATTR_SUFF "_skel">\r
- <!ENTITY INDENT " ">\r
- <!ENTITY INDENT2 "&INDENT;&INDENT;">\r
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">\r
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">\r
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">\r
- <!ENTITY DM "urn:broadband-forum-org:cwmp:datamodel-1-0">\r
- <!ENTITY DMR "urn:broadband-forum-org:cwmp:datamodel-report-0-1">\r
-]>\r
-<!-- \r
- vim:ts=2:sw=2:et:encoding=utf-8 \r
-\r
- This file is responsible to generate the code for the 4 files\r
--->\r
-<xsl:stylesheet\r
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"\r
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"\r
- xmlns:dm="&DM;"\r
- xmlns:dmr="&DMR;"\r
- xmlns:saxon="http://exslt.org/common"\r
- extension-element-prefixes="saxon"\r
- version="2.0" >\r
-\r
- <xsl:import href='tr069-utils.xsl'/>\r
- <xsl:import href='tr069-header.xsl'/>\r
- <xsl:import href='tr069-source.xsl'/>\r
-\r
- <xsl:output name='text' method='text'/>\r
- <xsl:param name='out' select='""'/>\r
- <xsl:param name='incdir' select='""'/>\r
- <xsl:param name='srcdir' select='""'/>\r
- <!-- -->\r
- <xsl:template match="/">\r
- <xsl:apply-templates mode='header'/>\r
- <xsl:apply-templates mode='source'/>\r
- </xsl:template>\r
-\r
- <!-- -->\r
- <xsl:template match="dm:document">\r
- <xsl:apply-templates />\r
- </xsl:template>\r
-\r
- <!-- -->\r
- <xsl:template match="import">\r
- <xsl:apply-templates />\r
- </xsl:template>\r
-\r
- <!-- -->\r
- <xsl:template match="model">\r
- <xsl:apply-templates select="." mode='header'/>\r
- <xsl:apply-templates select="." mode='source'/>\r
- </xsl:template>\r
-\r
- <!-- -->\r
- <xsl:template match="object">\r
- <xsl:text/>\r
- <xsl:value-of select='concat("Object:",@name)'/>\r
- <xsl:text>&NL;</xsl:text>\r
- <xsl:apply-templates select="parameter|uniqueKey"/>\r
- <xsl:text>&NL;</xsl:text>\r
- </xsl:template>\r
-\r
- <!-- -->\r
- <xsl:template match="parameter">\r
- <xsl:value-of select="concat('&INDENT;',@name,@ref)"/>\r
- <xsl:apply-templates select="syntax"/>\r
- <xsl:text>&NL;</xsl:text>\r
- </xsl:template>\r
- \r
- <!-- -->\r
- <xsl:template match="uniqueKey">\r
- <xsl:apply-templates select="parameter"/>\r
- </xsl:template>\r
-\r
- <!-- -->\r
- <xsl:template match="description">\r
- </xsl:template>\r
- \r
-\r
- <!-- -->\r
-\r
- <!-- Syntax rules -->\r
- <xsl:template match="syntax" mode="syntax">\r
- <xsl:apply-templates select='./*[1]' mode='syntax'/>\r
- </xsl:template>\r
- \r
- <!-- -->\r
- <xsl:template match="text()" mode="syntax">\r
- </xsl:template>\r
-\r
- <!-- -->\r
- <xsl:template match="boolean|dataTime|base64|hexBin" mode="syntax">\r
- <xsl:value-of select='concat(name(.),"")'/>\r
- </xsl:template>\r
- \r
- <!-- -->\r
- <xsl:template match="long|int" mode="syntax">\r
- <!--\r
- <xsl:value-of select='name(.)'/>\r
- -->\r
- <xsl:value-of select='"long"'/>\r
- </xsl:template>\r
- <!-- -->\r
- <xsl:template match="unsignedLong|unsignedInt" mode="syntax">\r
- <xsl:value-of select='"unsigned long"'/>\r
- </xsl:template>\r
- \r
- <!-- -->\r
- <xsl:template match="list" mode="syntax">\r
- <xsl:variable name='type'>\r
- <xsl:apply-templates select='./following-sibling::*[1]' mode='syntax'/>\r
- </xsl:variable>\r
- <xsl:value-of select='concat("std::",name(.),"<",$type,">")'/>\r
- </xsl:template>\r
- <!-- -->\r
- <xsl:template match="string" mode="syntax">\r
- <xsl:choose>\r
- <xsl:when test='./size/@maxLength'>\r
- <xsl:value-of select='concat("std::",name(.),"/*",./size/@maxLength,"*/")'/>\r
- </xsl:when>\r
- <xsl:otherwise>\r
- <xsl:value-of select='concat("std::",name(.))'/>\r
- </xsl:otherwise>\r
- </xsl:choose>\r
- </xsl:template>\r
- <!-- -->\r
- <xsl:template match="dataType" mode="syntax">\r
- <xsl:value-of select='concat("/*",name(.),"*/ ",@ref)'/>\r
- </xsl:template>\r
-\r
-</xsl:stylesheet>\r
-\r
+++ /dev/null
-<xsl:stylesheet version="2.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:xdt="http://www.w3.org/2005/02/xpath-datatypes"
- xmlns:UML="org.omg.xmi.namespace.UML"
- exclude-result-prefixes="xs xdt UML">
-
- <!--xsl:key name="class" match="UML:Class" use="@xmi.id" /-->
- <xsl:output method="text" media-type="text/xml" indent="yes" encoding="ISO-8859-1" />
- <xsl:variable name="from" select="0"/>
- <xsl:variable name="to" select="NON"/>
- <xsl:template match="XMI.header"/>
- <xsl:template match="XMI.content">
- <xsl:call-template name="pre-graph"/>
- <xsl:apply-templates
- select="UML:Model/UML:Namespace.ownedElement/UML:Package/UML:Namespace.ownedElement/UML:Class" />
- <xsl:apply-templates
- select="UML:Model/UML:Namespace.ownedElement/UML:Package/UML:Namespace.ownedElement/UML:Association"/>
- <xsl:call-template name="post-graph"/>
- <!--xsl:call-template name="attributes"/>
- <xsl:call-template name="functions"/-->
- </xsl:template>
-
- <xsl:template name="attributes">
- int x;
- </xsl:template>
-
- <xsl:template name="functions">
- public static void main(String[] args){
- }
- </xsl:template>
-
- <xsl:template name="pre-graph">
- digraph g {
- graph [
- rankdir = "LR"
- ];
-
- node [
- fontsize = "16"
- shape = "ellipse"
- ];
-
- edge [
- ];
- </xsl:template>
-
- <xsl:template name="post-graph">
- }
- </xsl:template>
-
- <xsl:template match="UML:Namespace.ownedElement/UML:Class">
- <!--"<xsl:value-of select="@xmi.id"/>" [
- label = "<xsl:value-of select="@name"/>"
- shape = "record"
- ];-->
- "<xsl:value-of select="@xmi.id"/>" [
- label = "<xsl:value-of select="@name"/> | <xsl:value-of select="@visibility"/> | "
- shape = "record"
- ];
-
- <!--xsl:text> </xsl:text>
- <xsl:value-of select="@visibility"/-->
- <!-- new Line character-->
- <!--xsl:text>
 </xsl:text-->
- </xsl:template>
-
- <xsl:template match="UML:Association.connection">
- <xsl:apply-templates select="UML:AssociationEnd/UML:AssociationEnd.participant/UML:Class"/>
- </xsl:template>
-
- <xsl:template match="UML:Association">
- <xsl:variable name="f"
- select="UML:Association.connection/UML:AssociationEnd/UML:AssociationEnd.participant/UML:Class/@xmi.idref"/>
- "<xsl:value-of select="$f[1]"/>" -> "<xsl:value-of select="$f[2]"/>" [
- id = <xsl:value-of select="@xmi.id"/>
- ];
- </xsl:template>
-
- <xsl:template match="UML:Attribute">
- </xsl:template>
-</xsl:stylesheet>
+++ /dev/null
-<xsl:stylesheet
- xmlns:uuid="http://www.uuid.org"
- xmlns:math = "http://exslt.org/math"
- xmlns:xs = "http://www.w3.org/2001/XMLSchema"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="2.0">
-
-
-<xsl:template match="/">
-<xsl:value-of select="
-concat('First random ID:', uuid:get-id()),
-concat('Base timestamp: ', uuid:generate-timestamp()),
-concat('Clock id: ' ,uuid:generate-clock-id()),
-concat('Network node: ' ,uuid:get-network-node()),
-concat('UUID Version: ' ,uuid:get-uuid-version()),
-concat('Generated UUID: ' ,uuid:get-uuid()),
-concat('Generated UUID: ' ,uuid:get-uuid()),
-concat('Generated UUID: ' ,uuid:get-uuid()),
-concat('Generated UUID: ' ,uuid:get-uuid())
-" separator=" " />
-</xsl:template>
-<!--
-Functions in the uuid: namespace are used to calculate a UUID
-The method used is a derived timestamp method, which is explained
-here: http://www.famkruithof.net/guid-uuid-timebased.html
-and here: http://www.ietf.org/rfc/rfc4122.txt
--->
-<!--
-Returns the UUID
--->
-<xsl:function name="uuid:get-uuid" as="xs:string*">
-<xsl:variable name="ts"
-select="uuid:ts-to-hex(uuid:generate-timestamp())" />
-<xsl:value-of separator="-" select="
-substring($ts, 8, 8),
-substring($ts, 4, 4),
-string-join((uuid:get-uuid-version(), substring($ts, 1, 3)), ''),
-uuid:generate-clock-id(),
-uuid:get-network-node()" />
-</xsl:function>
-<!--
-internal aux. fu
-with saxon, this creates a more-unique result with
-generate-id then when just using a variable containing a node
--->
-<xsl:function name="uuid:_get-node"><xsl:comment /></xsl:function>
-
-<!-- generates some kind of unique id -->
-<xsl:function name="uuid:get-id" as="xs:string">
-<xsl:sequence select="generate-id(uuid:_get-node())" />
-</xsl:function>
-<!--
-should return the next nr in sequence, but this can't be done
-in xslt. Instead, it returns a guaranteed unique number
--->
-<xsl:function name="uuid:next-nr" as="xs:integer">
-<xsl:variable name="node"><xsl:comment /></xsl:variable>
-<xsl:sequence select="
-xs:integer(replace(
-generate-id($node), '\D', ''))" />
-</xsl:function>
-<!-- internal fu for returning hex digits only -->
-<xsl:function name="uuid:_hex-only" as="xs:string">
-<xsl:param name="string" />
-<xsl:param name="count" />
-<xsl:sequence select="
-substring(replace(
-$string, '[^0-9a-fA-F]', '')
-, 1, $count)" />
-</xsl:function>
-<!-- may as well be defined as returning the same seq each time -->
-<xsl:variable name="_clock" select="uuid:get-id()" />
-<xsl:function name="uuid:generate-clock-id" as="xs:string">
-<xsl:sequence select="uuid:_hex-only($_clock, 4)" />
-</xsl:function>
-<!--
-returns the network node, this one is 'random', but must
-be the same within calls. The least-significant bit must be '1'
-when it is not a real MAC address (in this case it is set to '1')
--->
-<xsl:function name="uuid:get-network-node" as="xs:string">
-<xsl:sequence select="uuid:_hex-only('09-17-3F-13-E4-C5', 12)" />
-</xsl:function>
-<!-- returns version, for timestamp uuids, this is "1" -->
-<xsl:function name="uuid:get-uuid-version" as="xs:string">
-<xsl:sequence select="'1'" />
-</xsl:function>
-<!--
-Generates a timestamp of the amount of 100 nanosecond
-intervals from 15 October 1582, in UTC time.
--->
-<xsl:function name="uuid:generate-timestamp">
-<!--
-date calculation automatically goes
-correct when you add the timezone information, in this
-case that is UTC.
--->
-<xsl:variable name="duration-from-1582" as="xs:dayTimeDuration" >
-<xsl:sequence select="
-current-dateTime() -
-xs:dateTime('1582-10-15T00:00:00.000Z')" />
-</xsl:variable>
-<xsl:variable name="random-offset" as="xs:integer">
-<xsl:sequence select="uuid:next-nr() mod 10000"></xsl:sequence>
-</xsl:variable>
-
-<!-- do the math to get the 100 nano second intervals -->
-<xsl:sequence select="
-(days-from-duration($duration-from-1582) * 24 * 60 * 60 +
-hours-from-duration($duration-from-1582) * 60 * 60 +
-minutes-from-duration($duration-from-1582) * 60 +
-seconds-from-duration($duration-from-1582)) * 1000
-* 10000 + $random-offset" />
-</xsl:function>
-<!-- simple non-generalized function to convert from timestamp to hex -->
-<xsl:function name="uuid:ts-to-hex">
-<xsl:param name="dec-val" />
-<xsl:value-of separator="" select="
-for $i in 1 to 15
-return (0 to 9, tokenize('A B C D E F', ' '))
-[
-$dec-val idiv
-xs:integer(math:power(16, 15 - $i))
-mod 16 + 1
-]" />
-</xsl:function>
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!--
- vim:ts=2:sw=2:et:
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- version="2.0" >
-
- <xsl:import href="xsd2cpp-types.xsl"/>
- <xsl:import href="wsdl2soap-header.xsl"/>
- <xsl:import href="wsdl2soap-cpp.xsl"/>
- <xsl:output name='default.dd' method="xml"/>
- <xsl:output name='header' method="text"/>
-
- <xsl:param name='output'>def.xsd</xsl:param>
- <xsl:param name='target'>xsd</xsl:param>
- <xsl:param name='incdir'>include</xsl:param>
- <xsl:param name='srcdir'>./</xsl:param>
- <xsl:param name='types'></xsl:param>
- <xsl:param name='elem_suff'>_sptr</xsl:param>
-
- <xsl:key name='xsd_element' match="xsd:element"
- use="@name"/>
- <xsl:key name='xsd_type' match="xsd:simpleType|xsd:complexType"
- use="@name"/>
- <xsl:key name='xsd_simpleTypeByName' match="xsd:simpleType"
- use="@name"/>
- <xsl:key name='xsd_complexTypeByName' match="xsd:complexType"
- use="@name"/>
- <xsl:key name='binding' match="wsdl:binding"
- use="@name"/>
- <xsl:key name='portType' match="wsdl:portType"
- use="@name"/>
- <xsl:key name='message' match="wsdl:message"
- use="@name"/>
-
- <!-- Root entry -->
- <xsl:template match='/'>
- <xsl:variable name='fd'>
- <xsl:apply-templates mode="do-import"/>
- </xsl:variable>
- <!-- Extract the types from wsdl -->
- <xsl:choose>
- <xsl:when test='$target="soap"'>
- <xsl:apply-templates select='$fd' mode='wsdl2-header'>
- </xsl:apply-templates>
- <xsl:apply-templates select="$fd" mode='wsdl2-cpp'>
- </xsl:apply-templates>
-
- </xsl:when>
- <xsl:when test='$target="soap2file"'>
- <xsl:result-document href="dede.xml" format="default.dd">
- <xsl:apply-templates select='.' mode='do-import'>
- </xsl:apply-templates>
- </xsl:result-document>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="wsdl:definitions" mode='types2xsd'>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- ***
- *** do-import
- ***
- -->
- <xsl:template match="node()|@*" mode="do-import">
- <xsl:param name='root'>yes</xsl:param>
- <xsl:message>Import: <xsl:value-of select='concat("node=",node-name(.)," rt=",$root)'/></xsl:message>
- <xsl:choose>
- <xsl:when test="$root='yes'">
- <xsl:copy>
- <xsl:apply-templates select="node()|@*" mode="do-import">
- <xsl:with-param name='root' select="$root"/>
- </xsl:apply-templates>
- </xsl:copy>
- </xsl:when>
- <xsl:when test="($root='no') and
- string(node-name(.))!='wsdl:definitions'">
- <xsl:copy>
- <xsl:apply-templates select="node()|@*" mode="do-import">
- <xsl:with-param name='root' select="$root"/>
- </xsl:apply-templates>
- </xsl:copy>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message> No definitions</xsl:message>
- <xsl:apply-templates select="node()" mode="do-import">
- <xsl:with-param name='root' select="$root"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match="wsdl:import" mode="do-import">
- <xsl:param name='root'>yes</xsl:param>
- <xsl:variable name='schema' select="@location"/>
- <xsl:apply-templates select="document($schema)" mode="do-import">
- <xsl:with-param name='root'>no</xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:import" mode="do-import">
- <xsl:param name='root'></xsl:param>
- <xsl:variable name='schema' select="@schemaLocation"/>
- <xsl:copy-of select='.'/>
- <xsl:apply-templates select="document($schema)/xsd:schema/*" mode="do-import">
- <xsl:with-param name='root' select="$root"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- types2xsd-->
- <xsl:template match='wsdl:definitions' mode='types2xsd'>
- <xsl:message>Start Process definitions wsdl:definitions</xsl:message>
- <xsl:apply-templates select="wsdl:types" mode='types2xsd'>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match='wsdl:types' mode='types2xsd'>
- <xsl:message terminate="no">Have wsdl:types</xsl:message>
- <xsl:result-document href="{$output}" format="default.dd">
- <xsl:apply-templates mode='types2xsd'>
- </xsl:apply-templates>
- </xsl:result-document>
- </xsl:template>
-
- <xsl:template match='wsdl:ports' mode='types2xsd'>
- </xsl:template>
-
- <xsl:template match='*|text()|@*' mode='types2xsd'>
- <xsl:copy-of select='.'/>
- </xsl:template>
-
- <xsl:template match='xsd:schema' mode='types2xsd'>
- <xsl:message> Copy in xsd:schema: <xsl:value-of select="local-name(.)"/>
- </xsl:message>
- <xsl:element name='xsd:schema'>
- <xsl:for-each select="namespace::*">
- <xsl:variable name='nsp' select='name()'/>
- <!--
- -->
- <xsl:namespace name="{$nsp}"><xsl:value-of select="."/></xsl:namespace>
- <xsl:message><xsl:value-of select="concat($nsp,'-',.)"/></xsl:message>
- </xsl:for-each>
- <xsl:attribute name="targetNamespace"><xsl:value-of select="@targetNamespace"/></xsl:attribute>
- <xsl:apply-templates select="xsd:*" mode='types2xsd'>
- </xsl:apply-templates>
- <xsl:message>Next Apply </xsl:message>
- <xsl:apply-templates select="/wsdl:definitions" mode='wsdl-soap2xsd'>
- </xsl:apply-templates>
-
- </xsl:element>
- </xsl:template>
- <xsl:template match='xsd:*' mode='types2xsd'>
- <xsl:message> Copy def : <xsl:value-of select="local-name(.)"/>
- </xsl:message>
- <xsl:copy-of select='.'/>
- </xsl:template>
-
- <!-- wsdl-soap2xsd-->
- <xsl:template match='wsdl:definitions' mode='wsdl-soap2xsd'>
- <xsl:message>Now Messages Have types defes</xsl:message>
- <xsl:apply-templates select="wsdl:service" mode='wsdl-soap2xsd'>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match='wsdl:service' mode='wsdl-soap2xsd'>
- <xsl:message>Have types defes</xsl:message>
- <xsl:apply-templates select="wsdl:port" mode='wsdl-soap2xsd'>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match='wsdl:port' mode='wsdl-soap2xsd'>
- <xsl:variable name='bind' select="substring-after(@binding,':')"/>
- <xsl:apply-templates select="key('binding',$bind)" mode='wsdl-soap2xsd'>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match='wsdl:binding' mode='wsdl-soap2xsd'>
- <xsl:variable name='port' select="substring-after(@type,':')"/>
- <xsl:message>Binding <xsl:value-of select="@name"/></xsl:message>
- <xsl:choose>
- <xsl:when test="soap:binding">
- <xsl:apply-templates select="wsdl:operation" mode='wsdl-soap2xsd'>
- <xsl:with-param name='port' select="key('portType',$port)"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>Unsupported binding</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:template>
-
- <xsl:template match='wsdl:operation' mode='wsdl-soap2xsd'>
- <xsl:param name='port'/>
- <xsl:variable name="name" select='@name'/>
- <xsl:variable name='pop' select='$port/wsdl:operation[@name=$name]'/>
- <xsl:variable name='imsg' select='key("message",substring-after($pop/wsdl:input/@message,":"))'/>
-
- <xsl:message>Have operation types <xsl:value-of select="@name"/></xsl:message>
- <xsl:element name='xsd:complexType'>
- <xsl:attribute name='name'><xsl:value-of select="@name"/></xsl:attribute>
- <xsl:element name='xsd:sequence'>
- <xsl:apply-templates select="$imsg" mode='wsdl-soap2xsd'>
- <xsl:with-param name='port' select="$port"/>
- </xsl:apply-templates>
- </xsl:element>
- </xsl:element>
- </xsl:template>
-
-
- <xsl:template match='wsdl:part' mode='wsdl-soap2xsd'>
- <xsl:param name='port'/>
- <xsl:variable name='name' select='@name'/>
- <xsl:element name='xsd:element'>
- <xsl:attribute name="name"><xsl:value-of select="$name"/></xsl:attribute>
- <xsl:attribute name="type"><xsl:value-of select="@type"/></xsl:attribute>
- </xsl:element>
- </xsl:template>
-
- <!-- Util functions -->
-
- <xsl:template name='cpp_namespace'>
- <xsl:param name='type'/>
- <xsl:variable name='cp_ns'>
- <xsl:call-template name='basename'>
- <xsl:with-param name='path' select="$type"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select='translate($cp_ns,"./:-","")'/>
- </xsl:template>
-
- <xsl:template name="basename">
- <xsl:param name="path"/>
- <xsl:variable name='res' select="substring-after($path,'/')"/>
- <xsl:choose>
- <xsl:when test='contains($path,"/") and $res=""'>
- <xsl:value-of select="$path"/>
- </xsl:when>
- <xsl:when test="contains($path, '/') and $res!='' ">
- <xsl:call-template name="basename">
- <xsl:with-param name="path" select="substring-after($path, '/')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$path"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='@*' mode="namespace-uri-of-qname">
- <xsl:choose>
- <xsl:when test='substring-after(.,":")'>
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="."/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/wsdl:definitions/@targetNamespace"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template name="namespace-uri-of-qname">
- <xsl:param name="qname"/>
- <xsl:if test="contains($qname,':')">
- <xsl:value-of select="namespace-uri-from-QName(resolve-QName($qname,/wsdl:definitions/wsdl:types))"/>
- </xsl:if>
- </xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
-]>
-<!--
- :vim:ts=2:sw=2:et:
- :vim:ts=2:sw=2:et:softtabstop=2:
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- version="2.0" >
-
-
-
- <xsl:key name='binding' match='wsdl:binding' use='@name'/>
- <xsl:key name='message' match='wsdl:message' use='@name'/>
-
- <!-- wsdl2-cpp -->
- <xsl:template match='wsdl:definitions' mode='wsdl2-cpp'>
- <xsl:result-document href="{$output}.cpp" format="header">
- <xsl:apply-templates select="wsdl:service" mode='wsdl2-cpp'/>
- </xsl:result-document>
- <xsl:text> </xsl:text>
- </xsl:template>
-
- <xsl:template match='wsdl:service' mode='wsdl2-cpp'>
- <xsl:text>#include <iostream> </xsl:text>
- <xsl:text>#include "soap-encoding.h" </xsl:text>
- <xsl:text>#include "soap-envelope.h" </xsl:text>
- <xsl:text>#include "</xsl:text>
- <xsl:value-of select='concat($types,"")'/>
- <xsl:text>" </xsl:text>
- <xsl:text> using namespace envelope; </xsl:text>
- <xsl:text>//using namespace </xsl:text>
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="/wsdl:definitions/@targetNamespace"/>
- </xsl:call-template>
- <xsl:text>; </xsl:text>
- <xsl:text>#include <</xsl:text>
- <xsl:value-of select='concat(@name,".h> ")'/>
- <xsl:apply-templates select="wsdl:port" mode='wsdl2-cpp'/>
- <xsl:text>// Bindding implementation : </xsl:text>
- <xsl:value-of select='@binding'/>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select='wsdl:port'
- mode='service-operation'>
- <xsl:with-param name='service' select="@name"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match="wsdl:port" mode="wsdl2-cpp">
- <xsl:variable name='bind' select="substring-after(@binding,':')"/>
- <xsl:message>Binding: <xsl:value-of select="concat(@binding,'')"/></xsl:message>
- <xsl:apply-templates select="key('binding',$bind)" mode="wsdl2-cpp"/>
- </xsl:template>
-
- <xsl:template match='wsdl:binding' mode='wsdl2-cpp'>
- <xsl:text>/*do binding*/ </xsl:text>
- <xsl:choose>
- <xsl:when test='./soap:binding'>
- <xsl:apply-templates select='wsdl:operation'
- mode='wsdl2-cpp-soap'>
- <xsl:with-param name='style' select="@style"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>Unsupported binding for now</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- wsdl2-cpp-soap -->
- <xsl:template match='wsdl:operation' mode='wsdl2-cpp-soap'>
- <xsl:param name='style'>document</xsl:param>
- <xsl:variable name='name' select="@name"/>
- <!--
- <xsl:text> //class Op_</xsl:text>
- <xsl:value-of select="concat(@name,' { public:')"/>
- -->
- <xsl:choose>
- <xsl:when test='./soap:operation'>
- <xsl:apply-templates select='wsdl:input|wsdl:output|wsdl:fault'
- mode='wsdl2-cpp-soap-op'>
- <xsl:with-param name='operation'
- select='key("portType",substring-after(../@type,":"))/wsdl:operation[@name=$name]'/>
- <xsl:with-param name='style' select="./soap:operation/@style"/>
- <xsl:with-param name='class' select='concat("Op_",@name)'/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>Mal formed wsd </xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- <!--
- <xsl:text> }; </xsl:text>
- -->
- </xsl:template>
-
- <!-- wsdl2-cpp-soap-op -->
- <xsl:template match='wsdl:input' mode='wsdl2-cpp-soap-op'>
- <xsl:param name='operation'>document</xsl:param>
- <xsl:param name='style'>document</xsl:param>
- <xsl:param name='class'></xsl:param>
- <xsl:variable name="inp" select="$operation/wsdl:input"/>
- <xsl:variable name="msg_name">
- <xsl:choose>
- <xsl:when test='contains($operation/wsdl:input/@message,":")'>
- <xsl:value-of
- select="substring-after($operation/wsdl:input/@message,':')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$operation/wsdl:input/@message"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:message>wsdl2-cpp-soap-op <xsl:value-of select="$class"/></xsl:message>
- <xsl:text>/* * input: </xsl:text>
- <xsl:value-of select="concat($class,' ',$msg_name)"/>
- <xsl:text> */ </xsl:text>
- <xsl:text>void </xsl:text>
- <xsl:value-of select='concat($class,"::send(std::ostream &os")'/>
- <xsl:apply-templates select="$inp" mode='wsdl-header'>
- </xsl:apply-templates>
- <xsl:text>) { </xsl:text>
- <xsl:text>&INDENT;Envelope_sptr e(new Envelope_skel()); </xsl:text>
- <xsl:text>&INDENT;Body_sptr b(new Body_skel()); </xsl:text>
- <!-- implementation -->
- <xsl:apply-templates select="$operation/../../wsdl:message[@name=$msg_name]" mode='wsdl2-cpp-soap-op-serialize'>
- <xsl:with-param name='style' select='$style'/>
- </xsl:apply-templates>
- <xsl:text>&INDENT;e->Body(b); </xsl:text>
- <xsl:text>&INDENT;os<<Envelope_elem_type(e); </xsl:text>
- <xsl:text> } </xsl:text>
- </xsl:template>
- <!-- output wsdl2-cpp-soap-op -->
- <xsl:template match='wsdl:output' mode='wsdl2-cpp-soap-op'>
- <xsl:param name='operation'>document</xsl:param>
- <xsl:param name='class'></xsl:param>
- <xsl:variable name="inp" select="$operation/wsdl:output"/>
- <xsl:text> /* output: </xsl:text>
- <xsl:value-of select="concat($operation/@name,'')" />
- <xsl:text> */ void </xsl:text>
- <xsl:value-of select='concat($class,"::receive(std::istream &is")'/>
- <xsl:apply-templates select="$inp" mode='wsdl-header'>
- </xsl:apply-templates>
- <xsl:text>) { </xsl:text>
- <xsl:text> } </xsl:text>
- </xsl:template>
- <!-- fault wsdl2-cpp-soap-op -->
- <xsl:template match='wsdl:fault' mode='wsdl2-cpp-soap-op'>
- <xsl:param name='operation'>document</xsl:param>
- <xsl:param name='class'></xsl:param>
- <xsl:text>/* </xsl:text><xsl:text>*/ </xsl:text>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='wsdl:message' mode='wsdl2-cpp-soap-op-serialize'>
- <xsl:param name='operation'>document</xsl:param>
- <xsl:param name='style'>document</xsl:param>
- <xsl:text> &INDENT;/* Message </xsl:text>
- <xsl:value-of select="@name"/>
- <xsl:text>*/ </xsl:text>
- <xsl:apply-templates select="wsdl:part" mode="wsdl2-cpp-soap-op-serialize">
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='wsdl:part[@element]' mode='wsdl2-cpp-soap-op-serialize'>
- <xsl:param name='operation'>document</xsl:param>
- <xsl:param name='style'>document</xsl:param>
- <xsl:variable name="eln">
- <xsl:choose>
- <xsl:when test='contains(@element,":")'><xsl:value-of
- select="substring-after(@element,':')"/>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="@element"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>&INDENT;b->any((xmlSerializer *)</xsl:text>
- <xsl:value-of select='concat("&*",$eln,"")'/>
- <xsl:text>); </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match='wsdl:part[@type]' mode='wsdl2-cpp-soap-op-serialize'>
- <xsl:param name='operation'>document</xsl:param>
- <xsl:param name='style'>document</xsl:param>
- <xsl:text>&INDENT;//os<<"</xsl:text>
- <xsl:value-of select='concat(@name,"")'/>
- <xsl:text>"; </xsl:text>
- </xsl:template>
-
- <!--
- ***
- *** service-operation
- ***
- -->
- <xsl:template match="wsdl:port" mode='service-operation'>
- <xsl:param name='service'/>
-
- <xsl:variable name="binding">
- <xsl:choose>
- <xsl:when test='contains(@binding,":")'><xsl:value-of
- select='substring-after(@binding,":")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='@binding'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>// Bindding implementation : </xsl:text>
- <xsl:value-of select='concat(@binding," search:",$binding)'/>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select='key("binding",$binding)'
- mode='service-operation'>
- <xsl:with-param name='service' select="$service"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='wsdl:binding' mode='service-operation'>
- <xsl:param name='service'/>
- <xsl:text>//service-operation wsdl:binding </xsl:text>
- <xsl:apply-templates select='wsdl:operation' mode='service-operation'>
- <xsl:with-param name='service' select="$service"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='wsdl:operation' mode='service-operation'>
- <xsl:param name='service'/>
- <xsl:text> //service-operation wsdl:operation </xsl:text>
- <xsl:value-of select='concat("void ",$service,"::",@name)'/>
- <xsl:text>(void *s, </xsl:text>
- <xsl:for-each select='wsdl:input|wsdl:output'>
- <xsl:variable name="msg">
- <xsl:choose>
- <xsl:when test='contains(@name,":")'><xsl:value-of
- select='substring-after(@name,":")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='@name'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:apply-templates select='key("message",$msg)'
- mode='service-operation-param'>
- <xsl:with-param name='service' select="$service"/>
- </xsl:apply-templates>
- <xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
- </xsl:for-each>
- <xsl:text>) </xsl:text>
- <xsl:text>{ </xsl:text>
-
- <xsl:text>} </xsl:text>
- </xsl:template>
-
-
- <!--
- ***
- *** service-operation-param
- ***
- -->
- <xsl:template match='wsdl:message' mode='service-operation-param'>
- <xsl:param name='service'/>
- <xsl:variable name='ns'>
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="/wsdl:definitions/@targetNamespace"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="elem_ns"><xsl:apply-templates
- select="./wsdl:part/@element" mode="namespace-uri-of-qname"/></xsl:variable>
- <xsl:variable name="cpp_ns">
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="$elem_ns"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='element'>
- <xsl:choose>
- <xsl:when test='contains(./wsdl:part/@element,":")'>
- <xsl:value-of select='substring-after(./wsdl:part/@element,":")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='./wsdl:part/@element'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='./wsdl:part/@name="input"'><xsl:text>&INDENT4;const </xsl:text></xsl:when>
- <xsl:otherwise><xsl:text>&INDENT4;</xsl:text></xsl:otherwise>
- </xsl:choose>
- <xsl:value-of select='concat($cpp_ns,"::",$element,$elem_suff,"")'/>
- <xsl:text> &</xsl:text>
- <xsl:value-of select="@name"/>
- </xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
-]>
-<!--
- :vim:ts=2:sw=2:et:
- :vim:ts=2:sw=2:et:softtabstop=2:
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- version="2.0" >
-
-
- <xsl:template match='wsdl:definitions' mode='wsdl2-header'>
- <xsl:variable name='filename'>
- <xsl:apply-templates select='wsdl:service' mode="wsdl-header-filename"/>
- </xsl:variable>
- <xsl:variable name='fn' select='concat($incdir,"/",$filename,".h")'/>
- <xsl:result-document href="{$fn}" format="header">
- <xsl:text>#ifndef </xsl:text>
- <xsl:value-of select='concat($filename,"_H ")'/>
- <xsl:text>#define </xsl:text>
- <xsl:value-of select='concat($filename,"_H ")'/>
- <xsl:apply-templates select="wsdl:types" mode="wsdl-header-include"/>
- <xsl:apply-templates select="wsdl:service" mode="wsdl-header"/>
- <xsl:text> #endif </xsl:text>
- </xsl:result-document>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='wsdl:service' mode='wsdl-header-filename'>
- <xsl:value-of select="concat(@name,'')"/>
- </xsl:template>
- <!-- SERVICE definition -->
- <xsl:template match='wsdl:service' mode='wsdl-header'>
- <xsl:variable name="dede" select="./wsdl:port/@name"/>
- <xsl:apply-templates select="wsdl:port" mode="wsdl-header"/>
-
- <xsl:text>class </xsl:text>
- <xsl:value-of select="concat(@name,' { ')"/>
- <xsl:text> public: </xsl:text>
- <!-- Ok, get binding and build operations -->
- <xsl:message><xsl:value-of select="concat(@name,'- 1:',$dede,'- 2:',@type)"/></xsl:message>
- <!-- Here I am wrong, I should chack wich binding is used
- soap bindinf, ? http binding maybe something else.
- -->
- <xsl:message>Parent name is:<xsl:value-of select="concat(local-name(parent::node()),'')"/></xsl:message>
- <xsl:apply-templates select="parent::node()/wsdl:portType" mode='wsdl-header'/>
- <xsl:text>};</xsl:text>
- </xsl:template>
- <!--
- ***
- *** wsdl-header-include
- ***
- -->
- <!-- -->
- <xsl:template match='wsdl:types' mode='wsdl-header-include'>
- <xsl:text>/* wsdl-header-include </xsl:text>
- <xsl:value-of select='concat(name(.)," */ ")'/>
- <xsl:apply-templates select='xsd:schema' mode='wsdl-header-include'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:schema' mode='wsdl-header-include'>
- <xsl:text>/* wsdl-header-include </xsl:text>
- <xsl:value-of select='concat(name(.)," */ ")'/>
- <xsl:apply-templates select='xsd:import' mode='wsdl-header-include'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:import' mode='wsdl-header-include'>
- <xsl:variable name="filename">
- <xsl:value-of select='concat(substring-before(@schemaLocation,".xsd"),".h")'/>
- </xsl:variable>
- <xsl:text>/* wsdl-header-include </xsl:text>
- <xsl:value-of select='concat(name(.)," @location=",@schemaLocation," */ ")'/>
- <xsl:text>#include "</xsl:text>
- <xsl:value-of select='$filename'/><xsl:text>" </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match='wsdl:port' mode='wsdl-header-include'>
- <xsl:text>/* wsdl-header-include </xsl:text>
- <xsl:value-of select='concat(name(.)," */ ")'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='wsdl:service' mode='wsdl-header-include'>
- <xsl:text>/* wsdl-header-include </xsl:text>
- <xsl:value-of select='concat(name(.)," */ ")'/>
- </xsl:template>
- <!-- -->
- <!--
- ****
- **** wsdl-header
- ****
- -->
- <xsl:template match="wsdl:port" mode="wsdl-header">
- <xsl:variable name='bind' select="substring-after(@binding,':')"/>
- <xsl:message> <xsl:value-of select="concat(@binding,'')"/></xsl:message>
- <xsl:apply-templates select="key('binding',$bind)" mode="wsdl-header"/>
- </xsl:template>
-
- <xsl:template match='portType' mode='wsdl-header'>
- <xsl:message>Why not here !<xsl:value-of select="concat('PortType:',@name,'- 1:','- 2:')"/></xsl:message>
- <xsl:text>/* Do operations */ </xsl:text>
- <xsl:apply-templates select="wsdl:operation"
- mode="wsdl-header"/>
- </xsl:template>
- <xsl:template match='wsdl:portType' mode='wsdl-header'>
- <xsl:message>Why not here !<xsl:value-of select="concat('PortType:',@name,'- 1:','- 2:')"/></xsl:message>
- <xsl:text>/* Do operations */ </xsl:text>
- <xsl:apply-templates select="wsdl:operation"
- mode="wsdl-header"/>
- </xsl:template>
-
- <xsl:template match='wsdl:operation' mode='wsdl-header'>
- <xsl:variable name='in_msg' select='key("message",substring-after(./wsdl:input/@message,":"))'>
- </xsl:variable>
- <xsl:text> void </xsl:text>
- <xsl:value-of select="concat(@name,'(void *s')"/>
- <xsl:apply-templates select='wsdl:input' mode="wsdl-header"/>
- <xsl:apply-templates select='wsdl:output' mode="wsdl-header"/>
- <xsl:text> ); </xsl:text>
- </xsl:template>
- <xsl:template match='wsdl:input' mode='wsdl-header'>
- <!-- messages 1 or more -->
- <xsl:variable name='message'>
- <xsl:choose>
- <xsl:when test='substring-before(@message,":")=""'>
- <xsl:text></xsl:text>
- <xsl:apply-templates
- select='/wsdl:definitions/wsdl:message[@name=@message]' mode="wsdl-header"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name='msg' select="substring-after(@message,':')"/>
- <xsl:text></xsl:text>
- <xsl:apply-templates
- select='../../../wsdl:message[@name=$msg]' mode="wsdl-header"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="$message"/>
- </xsl:template>
-
- <xsl:template match='wsdl:output' mode='wsdl-header'>
- <!-- messages 1 or more -->
- <xsl:variable name='message'>
- <xsl:choose>
- <xsl:when test='substring-before(@message,":")=""'>
- <xsl:apply-templates
- select='/wsdl:definitions/wsdl:message[@name=@message]' mode="wsdl-header">
- <xsl:with-param name='dir'>out</xsl:with-param>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name='msg' select="substring-after(@message,':')"/>
- <xsl:text></xsl:text>
- <xsl:apply-templates
- select='/wsdl:definitions/wsdl:message[@name=$msg]' mode="wsdl-header">
- <xsl:with-param name='dir'>out</xsl:with-param>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="$message"/>
- </xsl:template>
-
- <xsl:template match='wsdl:message' mode='wsdl-header'>
- <xsl:param name='dir'>in</xsl:param>
- <xsl:message>Have message:<xsl:value-of select="concat($dir,' ',@name)"/></xsl:message>
- <xsl:choose>
- <xsl:when test="count(./wsdl:part)>=1">
- <xsl:apply-templates select="wsdl:part" mode="wsdl-header">
- <xsl:with-param name='dir' select="$dir"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- SOAP Document part -->
- <xsl:template match='wsdl:part[@element]' mode='wsdl-header'>
- <xsl:param name='dir'>in</xsl:param>
- <xsl:text>,</xsl:text>
- <xsl:if test='$dir="in"'><xsl:text>const </xsl:text></xsl:if>
- <xsl:variable name="elem_ns"><xsl:apply-templates
- select="@element" mode="namespace-uri-of-qname"/></xsl:variable>
- <xsl:variable name="cpp_ns">
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="$elem_ns"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="el" select="key('xsd_element',substring-after(@element,':'))"/>
- <xsl:value-of select='concat($cpp_ns,"::",$el/@name,$elem_suff," &",$el/@name)'/>
- </xsl:template>
- <!-- SOAP RPC-->
- <xsl:template match='wsdl:part[@type]' mode='wsdl-header'>
- <xsl:param name='dir'>in</xsl:param>
- <xsl:variable name="elem_ns"><xsl:apply-templates
- select="@type" mode="namespace-uri-of-qname"/></xsl:variable>
- <xsl:variable name="cpp_ns">
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="$elem_ns"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:text>,</xsl:text>
- <xsl:if test='$dir="in"'><xsl:text>const </xsl:text></xsl:if>
- <xsl:variable name="el" select="key('xsd_type',substring-after(@type,':'))">
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='local-name($el)=""'>
- <xsl:variable name="xsd_type">
- <xsl:apply-templates select="@type" mode='xsd-types-base'>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:value-of select='concat("/*yep*/",$xsd_type,"")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat($cpp_ns,"::",$el/@name,$elem_suff,"")'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:value-of select="concat(' &',@name,' ')"/>
- </xsl:template>
-
- <xsl:template match='wsdl:binding' mode='wsdl-header'>
- <xsl:variable name='portType'
- select="select=key('portType',substring-after(@type,':'))"/>
- <xsl:choose>
- <xsl:when test="./soap:binding">
- <!-- Ok, it's a soap binding, let process -->
- <xsl:apply-templates select="wsdl:operation" mode='wsdl-soap-header'>
- <xsl:with-param name='style' select='./soap:binding/@style'/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>Ok, unsuported binding</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- wsdl-soap-header -->
- <xsl:template match='wsdl:operation' mode='wsdl-soap-header'>
- <xsl:param name='style'>document</xsl:param>
- <xsl:message>Process Op <xsl:value-of
- select='concat(@name,"	 binding style:",$style," op style : ",./soap:operation/@style)'/> </xsl:message>
- <!--
- -->
- <xsl:text>class </xsl:text>
- <xsl:variable name='name' select="@name"/>
- <xsl:value-of select='concat("Op_",@name," { ")'/>
- <xsl:text>&INDENT;public: </xsl:text>
- <xsl:apply-templates select='wsdl:input|wsdl:output|wsdl:fault'
- mode='wsdl-soap-header'>
- <xsl:with-param name='operation' select='@name'/>
- <xsl:with-param name='style' select='$style'/>
- <!--<xsl:with-param name='port'
- select='key("portType",substring-after(../@type,":"))/wsdl:operation[@name=$name]'/>
- -->
- <xsl:with-param name='port'
- select="../../wsdl:portType/wsdl:operation[@name=$name]"/>
- </xsl:apply-templates>
- <xsl:text> }; </xsl:text>
- </xsl:template>
-
-
- <xsl:template match="wsdl:input" mode='wsdl-soap-header'>
- <xsl:param name='port'/>
- <xsl:param name='style'/>
- <xsl:param name='operation'/>
- <xsl:message></xsl:message>
- <xsl:text>/* Ok try to generate send method </xsl:text>
- <xsl:value-of select="$port/@name"/>
- <xsl:text>*/ void send(std::ostream &os</xsl:text>
- <xsl:apply-templates select='$port/wsdl:input' mode='wsdl-header'/>
- <xsl:text>); </xsl:text>
- </xsl:template>
- <xsl:template match="wsdl:output" mode='wsdl-soap-header'>
- <xsl:param name='port'/>
- <xsl:param name='style'/>
- <xsl:param name='operation'/>
- <xsl:message></xsl:message>
- <xsl:text>/* Ok try to generate send method </xsl:text>
- <xsl:value-of select="$port/@name"/>
- <xsl:text>*/ void receive(std::istream &is</xsl:text>
- <xsl:apply-templates select='$port/wsdl:output' mode='wsdl-header'/>
- <xsl:text>); </xsl:text>
- </xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
- xmlns:msxsl="urn:schemas-microsoft-com:xslt"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:s="http://www.w3.org/2001/XMLSchema"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
- >
- <!--
- // wsdl.xslt
- // The WSDL to JavaScript transformation.
- // Copyright by Matthias Hertel, http://www.mathertel.de
- // This work is licensed under a Creative Commons Attribution 2.0 Germany License.
- // See http://creativecommons.org/licenses/by/2.0/de/
- // - - - - -
- // 19.07.2005 optional documentation
- // 20.07.2005 more datatypes and XML Documents
- // 20.07.2005 more datatypes and XML Documents fixed
- // 03.12.2005 compatible to axis and bea WebServices. Thanks to Thomas Rudin
- // 07.03.2006 Now this xslt is independent of the alias used for the namespace of XMLSchema in the wsdl.
- // Thanks to Ant?nio Cruz for this great trick.
- // 31.03.2006 Bug on xml types fixed.
- // 19.11.2006 supporting (old) RPC encoding.
- // 26.11.2006 better serializing complex objects
- // 18.07.2007 better identifying complex objects
- // 12.10.2007 using server-relative url to avoid false scheme, host names and ports caused by firewalls.
- // 03.07.2008 targetNamespace origin changed.
- // 05.07.2008 enable external schema: using the document() function
- // 09.11.2008 fixing external schema when unrelated references are present.
- -->
- <xsl:strip-space elements="*" />
-
- <xsl:output method="text" version="4.0" />
- <xsl:param name="alias">
- <xsl:value-of select="wsdl:definitions/wsdl:service/@name" />
- </xsl:param>
-
- <xsl:template match="/">
- // javascript proxy for SOAP based web services
- // by Matthias Hertel
- /* <xsl:value-of select="wsdl:definitions/wsdl:documentation" /> */
- <xsl:for-each select="/wsdl:definitions/wsdl:service/wsdl:port[soap:address]">
- <xsl:call-template name="soapport" />
- </xsl:for-each>
- </xsl:template>
-
- <xsl:template name="soapport">
- proxies.<xsl:value-of select="$alias" /> = {
- url: "/<xsl:value-of select="substring-after(substring(soap:address/@location, 9), '/')" />",
- ns: "<xsl:value-of select="/wsdl:definitions/@targetNamespace" />"
- } // proxies.<xsl:value-of select="$alias" />
- <xsl:text>
</xsl:text>
-
- <xsl:for-each select="/wsdl:definitions/wsdl:binding[@name = substring-after(current()/@binding, ':')]">
- <xsl:call-template name="soapbinding11" />
- </xsl:for-each>
- </xsl:template>
-
- <xsl:template name="soapbinding11">
- <xsl:variable name="portTypeName" select="substring-after(current()/@type, ':')" />
- <xsl:for-each select="wsdl:operation">
- <xsl:variable name="inputMessageName" select="substring-after(/wsdl:definitions/wsdl:portType[@name = $portTypeName]/wsdl:operation[@name = current()/@name]/wsdl:input/@message, ':')" />
- <xsl:variable name="outputMessageName" select="substring-after(/wsdl:definitions/wsdl:portType[@name = $portTypeName]/wsdl:operation[@name = current()/@name]/wsdl:output/@message, ':')" />
- /* inputMessageName='<xsl:value-of select="$inputMessageName" />', outputMessageName='<xsl:value-of select="$outputMessageName" />' */
-
- <xsl:for-each select="/wsdl:definitions/wsdl:portType[@name = $portTypeName]/wsdl:operation[@name = current()/@name]/wsdl:documentation">
- /** <xsl:value-of select="." /> */
- </xsl:for-each>
- proxies.<xsl:value-of select="$alias" />.<xsl:value-of select="@name" /> = function () { return(proxies.callSoap(arguments)); }
- proxies.<xsl:value-of select="$alias" />.<xsl:value-of select="@name" />.fname = "<xsl:value-of select="@name" />";
- proxies.<xsl:value-of select="$alias" />.<xsl:value-of select="@name" />.service = proxies.<xsl:value-of select="$alias" />;
- proxies.<xsl:value-of select="$alias" />.<xsl:value-of select="@name" />.action = "\"<xsl:value-of select="soap:operation/@soapAction" />\"";
- proxies.<xsl:value-of select="$alias" />.<xsl:value-of select="@name" />.params = [<xsl:for-each select="/wsdl:definitions/wsdl:message[@name = $inputMessageName]">
- <xsl:call-template name="soapMessage" />
- </xsl:for-each>];
- proxies.<xsl:value-of select="$alias" />.<xsl:value-of select="@name" />.rtype = [<xsl:for-each select="/wsdl:definitions/wsdl:message[@name = $outputMessageName]">
- <xsl:call-template name="soapMessage" />
- </xsl:for-each>];
- </xsl:for-each>
- </xsl:template>
-
- <xsl:template name="soapElem">
- <xsl:param name="type"/>
- <xsl:param name="name"/>
- <xsl:variable name="pre" select="substring-before($type, ':')" />
- <xsl:variable name="post" select="substring-after($type, ':')" />
- <xsl:choose>
-
- <!-- simple types -->
- <xsl:when test="$post='string'">
- "<xsl:value-of select="$name" />"
- </xsl:when>
-
- <xsl:when test="$post='int' or $post='unsignedInt' or $post='short' or $post='unsignedShort'
- or $post='unsignedLong' or $post='long'">
- "<xsl:value-of select="$name" />:int"
- </xsl:when>
-
- <xsl:when test="$post='double' or $post='float'">
- "<xsl:value-of select="$name" />:float"
- </xsl:when>
- <xsl:when test="$post='dateTime'">
- "<xsl:value-of select="$name" />:date"
- </xsl:when>
-
- <xsl:when test="$post='boolean'">
- "<xsl:value-of select="$name" />:bool"
- </xsl:when>
-
- <!-- arrays !-->
- <xsl:when test="$post='ArrayOfString'">
- "<xsl:value-of select="$name" />:s[]"
- </xsl:when>
- <xsl:when test="$post='ArrayOfInt' or $post='ArrayOfUnsignedInt' or $post='ArrayOfShort' or $post='ArrayOfUnsignedShort' or $post='ArrayOfLong' or $post='ArrayOfUnsignedLong'">
- "<xsl:value-of select="$name" />:int[]"
- </xsl:when>
- <xsl:when test="$post='ArrayOfFloat'">
- "<xsl:value-of select="$name" />:float[]"
- </xsl:when>
- <xsl:when test="$post='ArrayOfBoolean'">
- "<xsl:value-of select="$name" />:bool[]"
- </xsl:when>
-
- <!-- complex structured objects -->
- <xsl:when test="//s:complexType[@name=$post] ">
- "<xsl:value-of select="$name" />:ds"
- </xsl:when>
-
- <!-- ASP.NET datasets-->
- <xsl:when test="count(./s:complexType/s:sequence/*) > 1">
- "<xsl:value-of select="$name" />:ds"
- </xsl:when>
-
- <!-- XML Documents -->
- <xsl:when test="./s:complexType/s:sequence/s:any">
- "<xsl:value-of select="$name" />:x"
- </xsl:when>
-
- <!-- complex objects -->
- <xsl:when test="substring-before($type, ':')='tns' or not($type)">
- "<xsl:value-of select="$name" />:ds"
- </xsl:when>
-
- <xsl:otherwise>
- "<xsl:value-of select="$name" />"
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="soapMessage">
- <xsl:choose>
- <xsl:when test="wsdl:part[@type]">
- <!-- SOAP RPC encoding -->
- <xsl:for-each select="wsdl:part">
- <xsl:call-template name="soapElem">
- <xsl:with-param name="name" select="@name" />
- <xsl:with-param name="type" select="@type" />
- </xsl:call-template>
- <xsl:if test="position()!=last()">,</xsl:if>
- </xsl:for-each>
- </xsl:when>
-
- <xsl:when test="/wsdl:definitions/wsdl:types/s:schema/s:import[@schemaLocation]">
- <!-- importing an external schema -->
- <xsl:variable name="inputElementName" select="substring-after(wsdl:part/@element, ':')" />
- <xsl:for-each select="/wsdl:definitions/wsdl:types/s:schema/s:import">
- <xsl:variable name="doc" select="document(@schemaLocation)"/>
- <xsl:for-each select="$doc/s:schema/s:element[@name=$inputElementName]//s:element">
- <xsl:call-template name="soapElem">
- <xsl:with-param name="name" select="@name" />
- <xsl:with-param name="type" select="@type" />
- </xsl:call-template>
- <xsl:if test="position()!=last()">,</xsl:if>
- </xsl:for-each>
- </xsl:for-each>
- </xsl:when>
-
- <xsl:otherwise>
- <!-- SOAP Document encoding -->
- <xsl:variable name="inputElementName" select="substring-after(wsdl:part/@element, ':')" />
-
- <xsl:for-each select="/wsdl:definitions/wsdl:types/s:schema/s:element[@name=$inputElementName]//s:element">
- <xsl:call-template name="soapElem">
- <xsl:with-param name="name" select="@name" />
- <xsl:with-param name="type" select="@type" />
- </xsl:call-template>
- <xsl:if test="position()!=last()">,</xsl:if>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-</xsl:stylesheet>
-
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
-]>
-<!--
- :vim:ts=2:sw=2:et:
- :vim:ts=2:sw=2:et:softtabstop=2:
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- version="2.0" >
-
-
- <xsl:template match='wsdl:definitions' mode='wsdl2-header'>
- <xsl:variable name='filename'>
- <xsl:apply-templates select='wsdl:service' mode="wsdl-header-filename"/>
- </xsl:variable>
- <xsl:variable name='fn' select='concat($incdir,"/",$filename,".h")'/>
- <xsl:result-document href="{$fn}" format="header">
- <xsl:text>#ifndef </xsl:text>
- <xsl:value-of select='concat($filename,"_H ")'/>
- <xsl:text>#define </xsl:text>
- <xsl:value-of select='concat($filename,"_H ")'/>
- <xsl:apply-templates select="wsdl:types" mode="wsdl-header-include"/>
- <xsl:apply-templates select="wsdl:service" mode="wsdl-header"/>
- <xsl:text> #endif </xsl:text>
- </xsl:result-document>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='wsdl:service' mode='wsdl-header-filename'>
- <xsl:value-of select="concat(@name,'')"/>
- </xsl:template>
- <!-- SERVICE definition -->
- <xsl:template match='wsdl:service' mode='wsdl-header'>
- <xsl:variable name="dede" select="./wsdl:port/@name"/>
- <xsl:apply-templates select="wsdl:port" mode="wsdl-header"/>
-
- <xsl:text>class </xsl:text>
- <xsl:value-of select="concat(@name,' { ')"/>
- <xsl:text> public: </xsl:text>
- <!-- Ok, get binding and build operations -->
- <xsl:message><xsl:value-of select="concat(@name,'- 1:',$dede,'- 2:',@type)"/></xsl:message>
- <!-- Here I am wrong, I should chack wich binding is used
- soap bindinf, ? http binding maybe something else.
- -->
- <xsl:message>Parent name is:<xsl:value-of select="concat(local-name(parent::node()),'')"/></xsl:message>
- <xsl:apply-templates select="parent::node()/wsdl:portType" mode='wsdl-header'/>
- <xsl:text>};</xsl:text>
- </xsl:template>
- <!--
- ***
- *** wsdl-header-include
- ***
- -->
- <!-- -->
- <xsl:template match='wsdl:types' mode='wsdl-header-include'>
- <xsl:text>/* wsdl-header-include </xsl:text>
- <xsl:value-of select='concat(name(.)," */ ")'/>
- <xsl:apply-templates select='xsd:schema' mode='wsdl-header-include'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:schema' mode='wsdl-header-include'>
- <xsl:text>/* wsdl-header-include </xsl:text>
- <xsl:value-of select='concat(name(.)," */ ")'/>
- <xsl:apply-templates select='xsd:import' mode='wsdl-header-include'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:import' mode='wsdl-header-include'>
- <xsl:variable name="filename">
- <xsl:value-of select='concat(substring-before(@schemaLocation,".xsd"),".h")'/>
- </xsl:variable>
- <xsl:text>/* wsdl-header-include </xsl:text>
- <xsl:value-of select='concat(name(.)," @location=",@schemaLocation," */ ")'/>
- <xsl:text>#include "</xsl:text>
- <xsl:value-of select='$filename'/><xsl:text>" </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match='wsdl:port' mode='wsdl-header-include'>
- <xsl:text>/* wsdl-header-include </xsl:text>
- <xsl:value-of select='concat(name(.)," */ ")'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='wsdl:service' mode='wsdl-header-include'>
- <xsl:text>/* wsdl-header-include </xsl:text>
- <xsl:value-of select='concat(name(.)," */ ")'/>
- </xsl:template>
- <!-- -->
- <!--
- ****
- **** wsdl-header
- ****
- -->
- <xsl:template match="wsdl:port" mode="wsdl-header">
- <xsl:variable name='bind' select="substring-after(@binding,':')"/>
- <xsl:message> <xsl:value-of select="concat(@binding,'')"/></xsl:message>
- <xsl:apply-templates select="key('binding',$bind)" mode="wsdl-header"/>
- </xsl:template>
-
- <xsl:template match='portType' mode='wsdl-header'>
- <xsl:message>Why not here !<xsl:value-of select="concat('PortType:',@name,'- 1:','- 2:')"/></xsl:message>
- <xsl:text>/* Do operations */ </xsl:text>
- <xsl:apply-templates select="wsdl:operation"
- mode="wsdl-header"/>
- </xsl:template>
- <xsl:template match='wsdl:portType' mode='wsdl-header'>
- <xsl:message>Why not here !<xsl:value-of select="concat('PortType:',@name,'- 1:','- 2:')"/></xsl:message>
- <xsl:text>/* Do operations */ </xsl:text>
- <xsl:apply-templates select="wsdl:operation"
- mode="wsdl-header"/>
- </xsl:template>
-
- <xsl:template match='wsdl:operation' mode='wsdl-header'>
- <xsl:variable name='in_msg' select='key("message",substring-after(./wsdl:input/@message,":"))'>
- </xsl:variable>
- <xsl:text> void </xsl:text>
- <xsl:value-of select="concat(@name,'(void *s')"/>
- <xsl:apply-templates select='wsdl:input' mode="wsdl-header"/>
- <xsl:apply-templates select='wsdl:output' mode="wsdl-header"/>
- <xsl:text> ); </xsl:text>
- </xsl:template>
- <xsl:template match='wsdl:input' mode='wsdl-header'>
- <!-- messages 1 or more -->
- <xsl:variable name='message'>
- <xsl:choose>
- <xsl:when test='substring-before(@message,":")=""'>
- <xsl:text></xsl:text>
- <xsl:apply-templates
- select='/wsdl:definitions/wsdl:message[@name=@message]' mode="wsdl-header"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name='msg' select="substring-after(@message,':')"/>
- <xsl:text></xsl:text>
- <xsl:apply-templates
- select='../../../wsdl:message[@name=$msg]' mode="wsdl-header"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="$message"/>
- </xsl:template>
-
- <xsl:template match='wsdl:output' mode='wsdl-header'>
- <!-- messages 1 or more -->
- <xsl:variable name='message'>
- <xsl:choose>
- <xsl:when test='substring-before(@message,":")=""'>
- <xsl:apply-templates
- select='/wsdl:definitions/wsdl:message[@name=@message]' mode="wsdl-header">
- <xsl:with-param name='dir'>out</xsl:with-param>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name='msg' select="substring-after(@message,':')"/>
- <xsl:text></xsl:text>
- <xsl:apply-templates
- select='/wsdl:definitions/wsdl:message[@name=$msg]' mode="wsdl-header">
- <xsl:with-param name='dir'>out</xsl:with-param>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="$message"/>
- </xsl:template>
-
- <xsl:template match='wsdl:message' mode='wsdl-header'>
- <xsl:param name='dir'>in</xsl:param>
- <xsl:message>Have message:<xsl:value-of select="concat($dir,' ',@name)"/></xsl:message>
- <xsl:choose>
- <xsl:when test="count(./wsdl:part)>=1">
- <xsl:apply-templates select="wsdl:part" mode="wsdl-header">
- <xsl:with-param name='dir' select="$dir"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- SOAP Document part -->
- <xsl:template match='wsdl:part[@element]' mode='wsdl-header'>
- <xsl:param name='dir'>in</xsl:param>
- <xsl:text>,</xsl:text>
- <xsl:if test='$dir="in"'><xsl:text>const </xsl:text></xsl:if>
- <xsl:variable name="elem_ns"><xsl:apply-templates
- select="@element" mode="namespace-uri-of-qname"/></xsl:variable>
- <xsl:variable name="cpp_ns">
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="$elem_ns"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="el" select="key('xsd_element',substring-after(@element,':'))"/>
- <xsl:value-of select='concat($cpp_ns,"::",$el/@name,$elem_suff," &",$el/@name)'/>
- </xsl:template>
- <!-- SOAP RPC-->
- <xsl:template match='wsdl:part[@type]' mode='wsdl-header'>
- <xsl:param name='dir'>in</xsl:param>
- <xsl:variable name="elem_ns"><xsl:apply-templates
- select="@type" mode="namespace-uri-of-qname"/></xsl:variable>
- <xsl:variable name="cpp_ns">
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="$elem_ns"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:text>,</xsl:text>
- <xsl:if test='$dir="in"'><xsl:text>const </xsl:text></xsl:if>
- <xsl:variable name="el" select="key('xsd_type',substring-after(@type,':'))">
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='local-name($el)=""'>
- <xsl:variable name="xsd_type">
- <xsl:apply-templates select="@type" mode='xsd-types-base'>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:value-of select='concat("/*yep*/",$xsd_type,"")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat($cpp_ns,"::",$el/@name,$elem_suff,"")'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:value-of select="concat(' &',@name,' ')"/>
- </xsl:template>
-
- <xsl:template match='wsdl:binding' mode='wsdl-header'>
- <xsl:variable name='portType'
- select="select=key('portType',substring-after(@type,':'))"/>
- <xsl:choose>
- <xsl:when test="./soap:binding">
- <!-- Ok, it's a soap binding, let process -->
- <xsl:apply-templates select="wsdl:operation" mode='wsdl-soap-header'>
- <xsl:with-param name='style' select='./soap:binding/@style'/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>Ok, unsuported binding</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- wsdl-soap-header -->
- <xsl:template match='wsdl:operation' mode='wsdl-soap-header'>
- <xsl:param name='style'>document</xsl:param>
- <xsl:message>Process Op <xsl:value-of
- select='concat(@name,"	 binding style:",$style," op style : ",./soap:operation/@style)'/> </xsl:message>
- <!--
- -->
- <xsl:text>class </xsl:text>
- <xsl:variable name='name' select="@name"/>
- <xsl:value-of select='concat("Op_",@name," { ")'/>
- <xsl:text>&INDENT;public: </xsl:text>
- <xsl:apply-templates select='wsdl:input|wsdl:output|wsdl:fault'
- mode='wsdl-soap-header'>
- <xsl:with-param name='operation' select='@name'/>
- <xsl:with-param name='style' select='$style'/>
- <!--<xsl:with-param name='port'
- select='key("portType",substring-after(../@type,":"))/wsdl:operation[@name=$name]'/>
- -->
- <xsl:with-param name='port'
- select="../../wsdl:portType/wsdl:operation[@name=$name]"/>
- </xsl:apply-templates>
- <xsl:text> }; </xsl:text>
- </xsl:template>
-
-
- <xsl:template match="wsdl:input" mode='wsdl-soap-header'>
- <xsl:param name='port'/>
- <xsl:param name='style'/>
- <xsl:param name='operation'/>
- <xsl:message></xsl:message>
- <xsl:text>/* Ok try to generate send method </xsl:text>
- <xsl:value-of select="$port/@name"/>
- <xsl:text>*/ void send(std::ostream &os</xsl:text>
- <xsl:apply-templates select='$port/wsdl:input' mode='wsdl-header'/>
- <xsl:text>); </xsl:text>
- </xsl:template>
- <xsl:template match="wsdl:output" mode='wsdl-soap-header'>
- <xsl:param name='port'/>
- <xsl:param name='style'/>
- <xsl:param name='operation'/>
- <xsl:message></xsl:message>
- <xsl:text>/* Ok try to generate send method </xsl:text>
- <xsl:value-of select="$port/@name"/>
- <xsl:text>*/ void receive(std::istream &is</xsl:text>
- <xsl:apply-templates select='$port/wsdl:output' mode='wsdl-header'/>
- <xsl:text>); </xsl:text>
- </xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
-]>
-<!--
- :vim:ts=2:sw=2:et:
- :vim:ts=2:sw=2:et:softtabstop=2:
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- version="2.0" >
-
-
-
- <xsl:key name='binding' match='wsdl:binding' use='@name'/>
- <xsl:key name='message' match='wsdl:message' use='@name'/>
-
- <!-- wsdl2-cpp -->
- <xsl:template match='wsdl:definitions' mode='wsdl2-cpp'>
- <xsl:result-document href="{$output}.cpp" format="header">
- <xsl:apply-templates select="wsdl:service" mode='wsdl2-cpp'/>
- </xsl:result-document>
- <xsl:text> </xsl:text>
- </xsl:template>
-
- <xsl:template match='wsdl:service' mode='wsdl2-cpp'>
- <xsl:text>#include <iostream> </xsl:text>
- <xsl:text>#include "soap-encoding.h" </xsl:text>
- <xsl:text>#include "soap-envelope.h" </xsl:text>
- <xsl:text>#include "</xsl:text>
- <xsl:value-of select='concat($types,"")'/>
- <xsl:text>" </xsl:text>
- <xsl:text> using namespace envelope; </xsl:text>
- <xsl:text>//using namespace </xsl:text>
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="/wsdl:definitions/@targetNamespace"/>
- </xsl:call-template>
- <xsl:text>; </xsl:text>
- <xsl:text>#include <</xsl:text>
- <xsl:value-of select='concat(@name,".h> ")'/>
- <xsl:apply-templates select="wsdl:port" mode='wsdl2-cpp'/>
- <xsl:text>// Bindding implementation : </xsl:text>
- <xsl:value-of select='@binding'/>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select='wsdl:port'
- mode='service-operation'>
- <xsl:with-param name='service' select="@name"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match="wsdl:port" mode="wsdl2-cpp">
- <xsl:variable name='bind' select="substring-after(@binding,':')"/>
- <xsl:message>Binding: <xsl:value-of select="concat(@binding,'')"/></xsl:message>
- <xsl:apply-templates select="key('binding',$bind)" mode="wsdl2-cpp"/>
- </xsl:template>
-
- <xsl:template match='wsdl:binding' mode='wsdl2-cpp'>
- <xsl:text>/*do binding*/ </xsl:text>
- <xsl:choose>
- <xsl:when test='./soap:binding'>
- <xsl:apply-templates select='wsdl:operation'
- mode='wsdl2-cpp-soap'>
- <xsl:with-param name='style' select="@style"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>Unsupported binding for now</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- wsdl2-cpp-soap -->
- <xsl:template match='wsdl:operation' mode='wsdl2-cpp-soap'>
- <xsl:param name='style'>document</xsl:param>
- <xsl:variable name='name' select="@name"/>
- <!--
- <xsl:text> //class Op_</xsl:text>
- <xsl:value-of select="concat(@name,' { public:')"/>
- -->
- <xsl:choose>
- <xsl:when test='./soap:operation'>
- <xsl:apply-templates select='wsdl:input|wsdl:output|wsdl:fault'
- mode='wsdl2-cpp-soap-op'>
- <xsl:with-param name='operation'
- select='key("portType",substring-after(../@type,":"))/wsdl:operation[@name=$name]'/>
- <xsl:with-param name='style' select="./soap:operation/@style"/>
- <xsl:with-param name='class' select='concat("Op_",@name)'/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>Mal formed wsd </xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- <!--
- <xsl:text> }; </xsl:text>
- -->
- </xsl:template>
-
- <!-- wsdl2-cpp-soap-op -->
- <xsl:template match='wsdl:input' mode='wsdl2-cpp-soap-op'>
- <xsl:param name='operation'>document</xsl:param>
- <xsl:param name='style'>document</xsl:param>
- <xsl:param name='class'></xsl:param>
- <xsl:variable name="inp" select="$operation/wsdl:input"/>
- <xsl:variable name="msg_name">
- <xsl:choose>
- <xsl:when test='contains($operation/wsdl:input/@message,":")'>
- <xsl:value-of
- select="substring-after($operation/wsdl:input/@message,':')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$operation/wsdl:input/@message"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:message>wsdl2-cpp-soap-op <xsl:value-of select="$class"/></xsl:message>
- <xsl:text>/* * input: </xsl:text>
- <xsl:value-of select="concat($class,' ',$msg_name)"/>
- <xsl:text> */ </xsl:text>
- <xsl:text>void </xsl:text>
- <xsl:value-of select='concat($class,"::send(std::ostream &os")'/>
- <xsl:apply-templates select="$inp" mode='wsdl-header'>
- </xsl:apply-templates>
- <xsl:text>) { </xsl:text>
- <xsl:text>&INDENT;Envelope_sptr e(new Envelope_skel()); </xsl:text>
- <xsl:text>&INDENT;Body_sptr b(new Body_skel()); </xsl:text>
- <!-- implementation -->
- <xsl:apply-templates select="$operation/../../wsdl:message[@name=$msg_name]" mode='wsdl2-cpp-soap-op-serialize'>
- <xsl:with-param name='style' select='$style'/>
- </xsl:apply-templates>
- <xsl:text>&INDENT;e->Body(b); </xsl:text>
- <xsl:text>&INDENT;os<<Envelope_elem_type(e); </xsl:text>
- <xsl:text> } </xsl:text>
- </xsl:template>
- <!-- output wsdl2-cpp-soap-op -->
- <xsl:template match='wsdl:output' mode='wsdl2-cpp-soap-op'>
- <xsl:param name='operation'>document</xsl:param>
- <xsl:param name='class'></xsl:param>
- <xsl:variable name="inp" select="$operation/wsdl:output"/>
- <xsl:text> /* output: </xsl:text>
- <xsl:value-of select="concat($operation/@name,'')" />
- <xsl:text> */ void </xsl:text>
- <xsl:value-of select='concat($class,"::receive(std::istream &is")'/>
- <xsl:apply-templates select="$inp" mode='wsdl-header'>
- </xsl:apply-templates>
- <xsl:text>) { </xsl:text>
- <xsl:text> } </xsl:text>
- </xsl:template>
- <!-- fault wsdl2-cpp-soap-op -->
- <xsl:template match='wsdl:fault' mode='wsdl2-cpp-soap-op'>
- <xsl:param name='operation'>document</xsl:param>
- <xsl:param name='class'></xsl:param>
- <xsl:text>/* </xsl:text><xsl:text>*/ </xsl:text>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='wsdl:message' mode='wsdl2-cpp-soap-op-serialize'>
- <xsl:param name='operation'>document</xsl:param>
- <xsl:param name='style'>document</xsl:param>
- <xsl:text> &INDENT;/* Message </xsl:text>
- <xsl:value-of select="@name"/>
- <xsl:text>*/ </xsl:text>
- <xsl:apply-templates select="wsdl:part" mode="wsdl2-cpp-soap-op-serialize">
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='wsdl:part[@element]' mode='wsdl2-cpp-soap-op-serialize'>
- <xsl:param name='operation'>document</xsl:param>
- <xsl:param name='style'>document</xsl:param>
- <xsl:variable name="eln">
- <xsl:choose>
- <xsl:when test='contains(@element,":")'><xsl:value-of
- select="substring-after(@element,':')"/>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="@element"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>&INDENT;b->any((xmlSerializer *)</xsl:text>
- <xsl:value-of select='concat("&*",$eln,"")'/>
- <xsl:text>); </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match='wsdl:part[@type]' mode='wsdl2-cpp-soap-op-serialize'>
- <xsl:param name='operation'>document</xsl:param>
- <xsl:param name='style'>document</xsl:param>
- <xsl:text>&INDENT;//os<<"</xsl:text>
- <xsl:value-of select='concat(@name,"")'/>
- <xsl:text>"; </xsl:text>
- </xsl:template>
-
- <!--
- ***
- *** service-operation
- ***
- -->
- <xsl:template match="wsdl:port" mode='service-operation'>
- <xsl:param name='service'/>
-
- <xsl:variable name="binding">
- <xsl:choose>
- <xsl:when test='contains(@binding,":")'><xsl:value-of
- select='substring-after(@binding,":")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='@binding'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>// Bindding implementation : </xsl:text>
- <xsl:value-of select='concat(@binding," search:",$binding)'/>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select='key("binding",$binding)'
- mode='service-operation'>
- <xsl:with-param name='service' select="$service"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='wsdl:binding' mode='service-operation'>
- <xsl:param name='service'/>
- <xsl:text>//service-operation wsdl:binding </xsl:text>
- <xsl:apply-templates select='wsdl:operation' mode='service-operation'>
- <xsl:with-param name='service' select="$service"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='wsdl:operation' mode='service-operation'>
- <xsl:param name='service'/>
- <xsl:text> //service-operation wsdl:operation </xsl:text>
- <xsl:value-of select='concat("void ",$service,"::",@name)'/>
- <xsl:text>(void *s, </xsl:text>
- <xsl:for-each select='wsdl:input|wsdl:output'>
- <xsl:variable name="msg">
- <xsl:choose>
- <xsl:when test='contains(@name,":")'><xsl:value-of
- select='substring-after(@name,":")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='@name'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:apply-templates select='key("message",$msg)'
- mode='service-operation-param'>
- <xsl:with-param name='service' select="$service"/>
- </xsl:apply-templates>
- <xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
- </xsl:for-each>
- <xsl:text>) </xsl:text>
- <xsl:text>{ </xsl:text>
-
- <xsl:text>} </xsl:text>
- </xsl:template>
-
-
- <!--
- ***
- *** service-operation-param
- ***
- -->
- <xsl:template match='wsdl:message' mode='service-operation-param'>
- <xsl:param name='service'/>
- <xsl:variable name='ns'>
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="/wsdl:definitions/@targetNamespace"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="elem_ns"><xsl:apply-templates
- select="./wsdl:part/@element" mode="namespace-uri-of-qname"/></xsl:variable>
- <xsl:variable name="cpp_ns">
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="$elem_ns"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='element'>
- <xsl:choose>
- <xsl:when test='contains(./wsdl:part/@element,":")'>
- <xsl:value-of select='substring-after(./wsdl:part/@element,":")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='./wsdl:part/@element'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='./wsdl:part/@name="input"'><xsl:text>&INDENT4;const </xsl:text></xsl:when>
- <xsl:otherwise><xsl:text>&INDENT4;</xsl:text></xsl:otherwise>
- </xsl:choose>
- <xsl:value-of select='concat($cpp_ns,"::",$element,$elem_suff,"")'/>
- <xsl:text> &</xsl:text>
- <xsl:value-of select="@name"/>
- </xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-
-<?xml version="1.0" ?>
-<!-- :vim:ts=2:sw=2:et: -->
-
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- version="2.0" >
-
- <xsl:variable name='cost'>
-
- </xsl:variable>
- <!-- root nodes in xsd:schema -->
- <xsl:template match="/" mode="billing">
- <xsl:variable name='nbrSimple' select="count(./xsd:simpleType)">
- </xsl:variable>
- <xsl:element name='Billing'>
- <xsl:value-of select="$nbrSimple"/>
- </xsl:element>
- </xsl:template>
- <xsl:template match="xsd:simpleType" mode="billing">
- </xsl:template>
-
- <xsl:template match="xsd:complexType" mode="billing">
- </xsl:template>
- <xsl:template match="xsd:element" mode="billing">
- </xsl:template>
- <xsl:template match="xsd:group" mode="billing">
- </xsl:template>
- <xsl:template match="xsd:attribute" mode="billing">
- </xsl:template>
- <xsl:template match="xsd:attributeGroup" mode="billing">
- </xsl:template>
-
-
-
-</xsl:stylesheet>
-
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!-- :vim:ts=2:sw=2:et: -->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- version="2.0" >
-
- <xsl:template name="namespace-uri-of-qname">
- <xsl:param name="qname"/>
- <xsl:if test="contains($qname,':')">
- <!--
- <xsl:value-of select="namespace::*[name()=substring-before($qname,':')]"/>
- -->
- <xsl:value-of select="namespace-uri-from-QName(resolve-QName($qname,/wsdl:definitions))"/>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match='@*' mode="xsd-default-value-base">
- <xsl:variable name="ns_type">
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname'><xsl:value-of select="."/></xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
-
- <xsl:when test="$ns_type='http://www.w3.org/2001/XMLSchema'">
- <xsl:apply-templates select="." mode="xsd-default-value"/>
- </xsl:when>
- <xsl:when test='../namespace::*[name()=""]="&XSD;" and
- not(contains(.,":")) '>
- <xsl:message terminate="no"/>
- <xsl:apply-templates select="." mode="xsd-default-value"/>
- </xsl:when>
- <xsl:when test='($ns_type="")' >
- <!--
- <xsl:message> <xsl:value-of select="concat('xsd2cpp-default-value xsd-default-value-base 1 @',name(.),' = ',$ns_type,' ',.)"/></xsl:message>
- -->
- <xsl:value-of select="concat(translate(.,'.','_'),'_skel()')"/>
- </xsl:when>
- <xsl:when test='($ns_type=/xsd:schema/@targetNamespace) and contains(.,":")' >
- <!--
- <xsl:message> <xsl:value-of select="concat('xsd2cpp-default-value xsd-default-value-base 2 @',name(.),' = ',$ns_type,' ',.)"/></xsl:message>
- -->
- <xsl:value-of select="concat(substring-after(translate(.,'.-','__'),':'),'_skel()')"/>
- </xsl:when>
- <xsl:when test='($ns_type=/xsd:schema/@targetNamespace) and not(contains(.,":"))' >
- <xsl:value-of select="concat(translate(.,'.-','__'),'_skel()')"/>
- </xsl:when>
- <xsl:when test='name(.)="name"'>
- <!-- Most of the time, elements do not have an ns -->
- <xsl:value-of select="concat(translate(.,'.','_'),'_skel')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="import"
- select="/xsd:schema/xsd:import[@namespace=$ns_type]/@schemaLocation">
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$import!=''">
- <xsl:variable name="et" select="document($import)">
- </xsl:variable>
- <xsl:value-of select="concat(key('elementByName',.),'')"/>
- <xsl:message terminate='no'>not good ext type -<xsl:value-of
- select='concat($ns_type,"- base=",.," loc=",$import," ")'/>
- <xsl:value-of select="substring-after(.,':')"/>
- </xsl:message>
- <xsl:value-of select='concat("","std::string ")'/>
- </xsl:when>
- <xsl:when test="$ns_type=''">
- <xsl:message> <xsl:value-of select="concat(' type: ',$ns_type,' ',.)"/></xsl:message>
- <xsl:value-of select="concat(translate(.,'.','_'),'_skel')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>not goodd -<xsl:value-of
- select='concat("tp=",$ns_type,"- base=",.," loc=",$import)'/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- Basic types -->
- <xsl:template
- match='@*[substring-after(.,":")="anySimpleType"]|@*[.="anySimpleType"]' mode="xsd-default-value">
- <xsl:text>""</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="string"]|@*[.="string"]' mode="xsd-default-value">
- <xsl:text></xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="hexBinary"]|@*[.="hexBinary"]' mode="xsd-default-value">
- <xsl:text>""</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="base64Binary"]|@*[.="base64Binary"]' mode="xsd-default-value">
- <xsl:text>""</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="boolean"]|@*[.="boolean"]' mode="xsd-default-value">
- <xsl:text>false</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="decimal"]|@*[.="decimal"]' mode="xsd-default-value">
- <xsl:text>(long int)0</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="float"]|@*[.="float"]' mode="xsd-default-value">
- <xsl:text>0.0</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="double"]|@*[.="double"]' mode="xsd-default-value">
- <xsl:text>(double)0.0</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="duration"]|@*[.="duration"]' mode="xsd-default-value">
- <xsl:text>""</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="dateTime"]|@*[.="dateTime"]' mode="xsd-default-value">
- <xsl:text>""</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="time"]|@*[.="time"]' mode="xsd-default-value">
- <xsl:text>""</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="date"]|@*[.="date"]' mode="xsd-default-value">
- <xsl:text>""</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="gYearMonth"]|@*[.="gYearMonth"]' mode="xsd-default-value">
- <xsl:text>""</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="gYear"]|@*[.="gYear"]' mode="xsd-default-value">
- <xsl:text>""</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="gMonth"]|@*[.="gMonth"]' mode="xsd-default-value">
- <xsl:text>""</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="gMonthDay"]|@*[.="gMonthDay"]' mode="xsd-default-value">
- <xsl:text>""</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="gDay"]|@*[.="gDay"]' mode="xsd-default-value">
- <xsl:text>""</xsl:text>
- </xsl:template>
-
- <!-- Derived from basic Types -->
- <xsl:template
- match='@*[substring-after(.,":")="normalizedString"]|@*[.="normalizedString"]' mode="xsd-default-value">
- <xsl:text>""</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="token"]|@*[.="token"]' mode="xsd-default-value">
- <xsl:text>""</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="language"]|@*[.="language"]' mode="xsd-default-value">
- <xsl:text>""</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="IDREFS"]|@*[.="IDREFS"]' mode="xsd-default-value">
- <xsl:text></xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="ENTITIES"]|@*[.="ENTITIES"]' mode="xsd-default-value">
- <xsl:text>""</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="NMTOKEN"]|@*[.="NMTOKEN"]' mode="xsd-default-value">
- <xsl:text></xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="NMTOKENS"]|@*[.="NMTOKENS"]' mode="xsd-default-value">
- <xsl:text></xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="Name"]|@*[.="Name"]' mode="xsd-default-value">
- <xsl:text></xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="NCName"]|@*[.="NCName"]' mode="xsd-default-value">
- <xsl:text></xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="QName"]|@*[.="QName"]' mode="xsd-default-value">
- <xsl:text></xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="anyURI"]|@*[.="anyURI"]' mode="xsd-default-value">
- <xsl:text></xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="ID"]|@*[.="ID"]' mode="xsd-default-value">
- <xsl:text></xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="IDREF"]|@*[.="IDREF"]' mode="xsd-default-value">
- <xsl:text></xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="ENTITY"]|@*[.="ENTITY"]' mode="xsd-default-value">
- <xsl:text></xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="integer"]|@*[.="integer"]' mode="xsd-default-value">
- <xsl:text>(int)0</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="nonPositiveInteger"]|@*[.="nonPositiveInteger"]' mode="xsd-default-value">
- <xsl:text>(long int)0</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="negativeInteger"]|@*[.="negativeInteger"]' mode="xsd-default-value">
- <xsl:text>0</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="long"]|@*[.="long"]' mode="xsd-default-value">
- <xsl:text>(long int)0</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="int"]|@*[.="int"]' mode="xsd-default-value">
- <xsl:text>(int)0</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="short"]|@*[.="short"]' mode="xsd-default-value">
- <xsl:text>0</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="byte"]|@*[.="byte"]' mode="xsd-default-value">
- <xsl:text>(signed char)0</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="nonNegativeInteger"]|@*[.="nonNegativeInteger"]' mode="xsd-default-value">
- <xsl:text>0</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="unsignedLong"]|@*[.="unsignedLong"]' mode="xsd-default-value">
- <xsl:text>0</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="unsignedInt"]|@*[.="unsignedInt"]' mode="xsd-default-value">
- <xsl:text>0</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="unsignedShort"]|@*[.="unsignedShort"]' mode="xsd-default-value">
- <xsl:text>0</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="unsignedByte"]|@*[.="unsignedByte"]' mode="xsd-default-value">
- <xsl:text>0</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="positiveInteger"]|@*[.="positiveInteger"]' mode="xsd-default-value">
- <xsl:text>0</xsl:text>
- </xsl:template>
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL " ">
- <!ENTITY TAB "	">
- <!ENTITY PV ";">
- <!ENTITY CLS_PREF "">
- <!ENTITY TYPE_SUFF "_skel">
- <!ENTITY ELEM_PREF "el_">
- <!ENTITY ELEM_SUFF "_skel">
- <!ENTITY ATTR_PREF "attr_">
- <!ENTITY ATTR_SUFF "_skel">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
- :vim:ts=2:sw=2:et:encoding=utf-8:
-
- This file is responsible to generate the code for the 4 files
-
- prefix gen-tree-hdr is used for the header file for serialization
- prefix gen-tree-hdr-element is used fot element and attribute struct
- definition.
- If Element has a name and a type
- struct ()(@name)() {
- "constructor"
- std:ostream operator<<(std;ostream os, struct ... &r){
- };
- @type m_content;
- };
-
- If Element has a ref :
- typedef if element is outise the namespace
-
- prefix gen-tree-hdr-type is used for type definitions
-
- class (type prefix)(@name)(type suff) : public (inherit) {
- public
- "constructors"
- "serializers"
- "Seter / Geters"
- "members"
- };
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:saxon="http://exslt.org/common"
- extension-element-prefixes="saxon"
- version="2.0" >
-
- <xsl:variable name='elem_pref'></xsl:variable>
- <xsl:variable name='elem_suff'>_elem_type</xsl:variable>
- <xsl:variable name='attr_pref'></xsl:variable>
- <xsl:variable name='attr_suff'>_attr_type</xsl:variable>
- <xsl:variable name='attr_class'>_attr_type_</xsl:variable>
- <xsl:variable name='type_pref'></xsl:variable>
- <xsl:variable name='type_suff'>_skel</xsl:variable>
- <xsl:variable name='type_sptr'>_sptr</xsl:variable>
- <xsl:variable name='sequ_pref'></xsl:variable>
- <xsl:variable name='sequ_suff'>_sequence</xsl:variable>
- <!--
- ***
- *** gen-tree-hdr-element ***
- ***
- Here, we generate the class that will serialize an element or an attribute
- What if it is an xsd type ?
- -->
- <xsl:template match='xsd:element[@name and not(@type)]' mode='gen-tree-hdr-element'>
- <xsl:param name='name'/>
- <xsl:param name='sp'/>
- <xsl:variable name='form'>
- <xsl:choose>
- <xsl:when test='@form'><xsl:value-of select="@form"/></xsl:when>
- <xsl:when test='/xsd:schema/@elementFormDefault'>
- <xsl:value-of select="/xsd:schema/@elementFormDefault"/></xsl:when>
- <xsl:otherwise>unqualified</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='qualified'>
- <xsl:choose>
- <xsl:when test='$form="qualified"'>true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='n_type'><xsl:value-of select='concat($name,"")'/></xsl:variable>
- <xsl:variable name='class' select='concat($elem_pref,$name,$elem_suff)'/>
-
- <xsl:variable name='type' select='concat("",$n_type,$type_sptr)'/>
- <xsl:variable name='elns'>
- <xsl:for-each select="namespace::*">
- <xsl:if test=".=/xsd:schema/@targetNamespace">
- <xsl:value-of select="name()"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:value-of select="$sp"/>
- <xsl:text>/** Element type without type */ </xsl:text>
- <xsl:value-of select="$sp"/>
- <xsl:text>struct </xsl:text><xsl:value-of select='concat($class," { ")'/>
- <!-- Constructors -->
- <xsl:value-of select='concat($sp,"&INDENT;",$class,"(const ",$type," &r,const bool w_ns=",$qualified,") :m_content(r) , m_wns(w_ns) {}; ")'/>
- <xsl:value-of select='concat($sp,"&INDENT;//",$class,"(",$type," r) {m_content=r;}; ")'/>
- <!-- serialization of the element ....-->
- <xsl:value-of select='concat($sp,"&INDENT;friend std::ostream &",
- "operator <<(std::ostream &os,const struct ",$class,"&r); ")'/>
- <!-- cast conversions -->
- <xsl:value-of select='concat($sp,"&INDENT;//operator ",$type," () {return m_content;}; ")'/>
- <!-- container -->
- <xsl:value-of select='concat($sp,"&INDENT;",$type," m_content; ")'/>
- <xsl:value-of select='concat($sp,"&INDENT;bool m_wns; ")'/>
- <xsl:value-of select="$sp"/>
- <xsl:text>}; </xsl:text>
- </xsl:template>
-
- <xsl:template match='xsd:element[@ref]' mode='gen-tree-hdr-element'>
- <!-- Nothing needs to be done here-->
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:element[@name and @type]' mode='gen-tree-hdr-element'>
- <xsl:param name='name'/>
- <xsl:param name='class'></xsl:param>
- <xsl:param name='sp'></xsl:param>
- <xsl:variable name='form'>
- <xsl:choose>
- <xsl:when test='@form'><xsl:value-of select="@form"/></xsl:when>
- <xsl:when test='/xsd:schema/@elementFormDefault'><xsl:value-of select="/xsd:schema/@elementFormDefault"/></xsl:when>
- <xsl:otherwise>unqualified</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='qualified'>
- <xsl:choose>
- <xsl:when test='$form="qualified"'>true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='n_type'><xsl:value-of select='translate(substring-after(@type,":"),".-","__")'/></xsl:variable>
- <xsl:variable name='my_class' select='concat($elem_pref,$name,$elem_suff)'/>
- <xsl:variable name='my_type' select='concat("",$n_type,$type_suff)'/>
- <xsl:variable name='ns'>
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@type"/></xsl:call-template>
- </xsl:variable>
- <xsl:variable name='elns'>
- <xsl:for-each select="namespace::*">
- <xsl:if test=".=/xsd:schema/@targetNamespace">
- <xsl:value-of select="name()"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:variable name='type'>
- <xsl:choose>
- <xsl:when test='$ns="&XSD;"'>
- <xsl:value-of select="concat($name,'_sptr')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name='tmp'>
- <xsl:apply-templates select='@type' mode='restriction-base'/>
- </xsl:variable>
- <xsl:value-of select='concat("","",$name,"_sptr")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="$sp"/>
- <xsl:text>/** Element type with type */ </xsl:text>
- <xsl:value-of select="$sp"/>
- <xsl:text>struct </xsl:text><xsl:value-of select='concat($my_class," { ")'/>
- <!-- constructor -->
- <xsl:value-of select='concat($sp,"&INDENT;",$my_class,"(const ",$type," &r,bool w_ns=",$qualified,") : m_wns(w_ns) {m_content=r;}; ")'/>
- <!-- serialization of the element ....-->
- <xsl:value-of select='concat($sp,"&INDENT;friend std::ostream &","operator <<(std::ostream &os,const struct ",$my_class,"&r) ; ")'/>
- <!-- Get reference .... -->
- <!--
- <xsl:value-of select='concat($sp,"&INDENT;//",$type," * operator "," "," *(void) {return m_content;}; ")'/>
- -->
- <!-- cast conversions -->
- <!--
- <xsl:value-of select='concat($sp,"&INDENT;//operator ",$type,"* () {return m_content;}; ")'/>
- -->
- <!-- container -->
- <xsl:value-of select='concat($sp,"&INDENT;",$type," m_content; ")'/>
- <xsl:value-of select='concat($sp,"&INDENT;bool m_wns; ",$sp)'/>
- <xsl:text>}; </xsl:text>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:attribute[@name]' mode='gen-tree-hdr-element'>
- <xsl:param name='name'/>
- <xsl:param name='sp'></xsl:param>
- <xsl:param name='indent'></xsl:param>
- <xsl:param name='class'></xsl:param>
- <xsl:variable name='form'>
- <xsl:choose>
- <xsl:when test='@form'><xsl:value-of select="@form"/></xsl:when>
- <xsl:when test='/xsd:schema/@attributeFormDefault'><xsl:value-of select="/xsd:schema/@attributeFormDefault"/></xsl:when>
- <xsl:otherwise>unqualified</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="wns">
- <xsl:choose>
- <xsl:when test="$form='qualified'">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@type"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='my_class' select='concat($attr_pref,$name,$attr_suff,"_")'/>
- <xsl:variable name='my_type' select='concat($attr_pref,$name,$attr_suff)'/>
- <xsl:variable name='type'>
- <xsl:choose>
- <xsl:when test='@type'><xsl:apply-templates select='@type' mode='restriction-base'/></xsl:when>
- <xsl:otherwise><xsl:value-of select="concat($name,'_skel')"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='elns'>
- <xsl:for-each select="namespace::*">
- <xsl:if test=".=/xsd:schema/@targetNamespace">
- <xsl:value-of select="name()"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:value-of select='concat("",$sp,"//gen-tree-hdr-element ",name(.)," @name=",@name," ")'/>
- <xsl:value-of select='concat($sp,"typedef ")'/>
- <xsl:value-of select='concat($type," ",$my_type,"; ")'/>
- <xsl:value-of select='concat($sp,"struct ",$my_class," { ")'/>
- <xsl:value-of select='concat($sp,"&INDENT;",$my_class,"(",") :m_wns(",$wns,") {}; ")'/>
- <xsl:value-of select='concat($sp,"&INDENT;",$my_class,"(const ",$type," &r,bool wns=",$wns,") : m_content(r),m_wns(wns) {}; ")'/>
- <xsl:value-of select='concat($sp,"&INDENT;//",$my_class,"(const char"," *r) {;}; ")'/>
- <xsl:value-of select='concat($sp,"&INDENT;",$my_class,"& operator =(",$type," &r) {m_content=r; return *this;}; ")'/>
- <!-- serialization of the element ....-->
- <xsl:choose>
- <xsl:when test='$class!=""'>
- <xsl:value-of select='concat($sp,"&INDENT;friend std::ostream &","operator <<(std::ostream &os,const ",$class,"::",$my_class," &r) { ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat($sp,"&INDENT;friend std::ostream &","operator <<(std::ostream &os,const struct ",$my_class," &r) { ")'/>
- </xsl:otherwise>
- </xsl:choose>
-
- <xsl:value-of select='concat($sp,"&INDENT2;")'/>
- <xsl:text>if( r.m_wns ) { </xsl:text>
- <xsl:value-of select='concat($sp,"&INDENT3;")'/>
- <xsl:text>os<<" </xsl:text>
- <xsl:value-of select="concat($elns,':')"/>
- <xsl:value-of select='@name'/><xsl:text>=\""</xsl:text>
- <xsl:value-of select='concat("","<<r.m_content")'/>
- <xsl:text><<"\""; </xsl:text>
- <!-- with namespace-->
- <xsl:value-of select='concat($sp,"&INDENT2;}")'/>
- <xsl:value-of select='concat(" else { ",$sp,"&INDENT3;")'/>
- <xsl:text>os<<" </xsl:text>
- <xsl:value-of select='@name'/><xsl:text>=\""</xsl:text>
- <xsl:value-of select='concat("","<<r.m_content")'/>
- <xsl:text><<"\""; </xsl:text>
-
- <xsl:value-of select='concat($sp,"&INDENT2;} ",$sp,"&INDENT2;return os; ",$sp,"&INDENT;}; ")'/>
- <!-- cast conversions -->
- <xsl:value-of select='concat($sp,"&INDENT;operator ",$type," () const {return m_content;}; ")'/>
- <!-- container -->
- <xsl:value-of select='concat($sp,"&INDENT;",$type," m_content; ")'/>
- <xsl:value-of select='concat($sp,"&INDENT;bool"," m_wns; ")'/>
- <xsl:value-of select='concat($sp,"}; ")'/>
- </xsl:template>
- <!--
- <xsl:template match='xsd:attribute[@name and not(@type)]' mode='gen-tree-hdr-element'>
- <xsl:param name='name'/>
- <xsl:param name='class'></xsl:param>
- <xsl:param name='cpp_type'></xsl:param>
- <xsl:param name='sp'></xsl:param>
-
-
- </xsl:template>
- -->
-
- <xsl:template match='xsd:attribute[@ref]' mode='gen-tree-hdr-element'>
- <xsl:message terminate='yes'/>
- </xsl:template>
-
- <xsl:template match='xsd:attributeGroup[@name]' mode='gen-tree-hdr-element'>
- <xsl:message terminate='yes'/>
- </xsl:template>
-
- <!--
- ***
- *** gen-tree-hdr-type
- ***
- Here, I should put the prototype of
- -->
- <xsl:template match='xsd:simpleType' mode='gen-tree-hdr-type'>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexType' mode='gen-tree-hdr-type'>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element' mode='gen-tree-hdr-type'>
- <xsl:param name='indent' select='""'/>
- <xsl:param name='name'/>
- <xsl:param name='type'/>
- <xsl:param name='maxOccurs'>1</xsl:param>
- <xsl:variable name='local-maxOccurs'>
- <xsl:choose>
- <xsl:when test='@maxOccurs'><xsl:value-of select="@maxOccurs"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="$maxOccurs"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='$local-maxOccurs="unbounded"'>
- <xsl:value-of select='concat($indent,"&INDENT2;",$type,"_sequence ",$cls-tree-mbr-elem-prefix,$name,"; ")'/>
- </xsl:when>
- <xsl:when test='$local-maxOccurs>1'>
- <xsl:value-of select='concat($indent,"&INDENT2;",$type,"_sequence ",$cls-tree-mbr-elem-prefix,$name,"; ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat($indent,"&INDENT2;",$type,"_sptr ",$cls-tree-mbr-elem-prefix,$name,"; ")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attribute' mode='gen-tree-hdr-type'>
- </xsl:template>
- <!--
- ***
- *** gen-tree-hdr-elem-serial
- ***
- serialize primitive types.
- -->
- <xsl:template match='xsd:element' mode='gen-tree-hdr-elem-serial'>
- <xsl:param name='ns'/> <!-- namespace of type -->
- <xsl:choose>
- <xsl:when test='$ns="&XSD;" and local-name(@type) = "bolean"'>
- <xsl:value-of select='concat("","&INDENT2;os<<")'/>
- <xsl:text>(*(r.m_content))?"true":"false"; </xsl:text>
- </xsl:when>
- <xsl:when test="not(@type) and not(./xsd:complexType|./xsd:simpleType)">
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("","&INDENT2;os<<*(r.m_content); ")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match='xsd:complexType' mode='gen-tree-hdr-elem-serial'>
- </xsl:template>
- <!--
- ***
- *** gen-tree-hdr-type-member
- ***
- Here, I should put the prototype of
- -->
- <xsl:template match='xsd:attribute[@ref and not(@name)]' mode='gen-tree-hdr-type-member'>
- <xsl:text>&INDENT2;//New way for type definitions attribute gen-tree-hdr-type-member </xsl:text>
- </xsl:template>
- <xsl:template match='xsd:attribute[@name and not(@type)]' mode='gen-tree-hdr-type-member'>
- <xsl:param name='name'/>
- <xsl:param name='cpp_type'/>
- <xsl:text>&INDENT2;//New way for type definitions attribute gen-tree-hdr-type-member </xsl:text>
- <xsl:text>&INDENT2;typedef </xsl:text><xsl:value-of select='concat($cpp_type," ",$name,"_attr_type; ")'/>
- </xsl:template>
- <xsl:template match='xsd:attribute[@name and @type]' mode='gen-tree-hdr-type-member'>
- <xsl:text>&INDENT2;//New way for type definitions attribute gen-tree-hdr-type-member </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[@name and not(@type)]' mode='gen-tree-hdr-type-member'>
- <xsl:param name='name'/>
- <xsl:param name='cpp_type'/>
- <xsl:param name='indent'>&INDENT2;</xsl:param>
- <!-- Add typedefs -->
- <xsl:value-of select='concat($indent,"")'/>
- <xsl:text>// xsd2cpp-gen New way for type definitions </xsl:text>
- <xsl:value-of select="concat('Element name=','@name')"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select='concat($indent,"typedef ")'/>
- <xsl:value-of select='concat("",$cpp_type," ",$name,"_type; ")'/>
- <xsl:value-of select='concat($indent,"typedef ")'/>
- <xsl:value-of select='concat($shared-ptr,"::shared_ptr<",$name,"_type> ",$name,"_sptr; ")'/>
- <xsl:value-of select='concat($indent,"typedef ")'/>
- <xsl:value-of select='concat("std::vector<",$name,"_sptr> ",$name,"_sequence; ")'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[@name and @type]' mode='gen-tree-hdr-type-member'>
- <xsl:param name='name'/>
- <xsl:param name='cpp_type'/>
- <xsl:param name='indent'>&INDENT2;</xsl:param>
- <!-- Add typedefs -->
- <xsl:value-of select='concat($indent,"")'/>
- <xsl:text>// xsd2cpp-gen New way for type definitions </xsl:text>
- <xsl:value-of select='concat($indent,"typedef ")'/>
- <xsl:value-of select='concat("",$cpp_type," ",$name,"_type; ")'/>
- <xsl:value-of select='concat($indent,"typedef ")'/>
- <xsl:value-of select='concat($shared-ptr,"::shared_ptr<",$name,"_type> ",$name,"_sptr; ")'/>
- <xsl:value-of select='concat($indent,"typedef ")'/>
- <xsl:value-of select='concat("std::vector<",$name,"_sptr> ",$name,"_sequence; ")'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[@ref]' mode='gen-tree-hdr-type-member'>
- <xsl:param name='name'/>
- <xsl:param name='cpp_type'/>
- <!-- Add typedefs -->
- <xsl:text>&INDENT2;// xsd2cpp-gen New way for type definitions </xsl:text>
- <xsl:value-of select='concat("name=",$name," ")'/>
- <xsl:text>&INDENT2;typedef </xsl:text>
- <xsl:value-of select='concat("",$cpp_type," ",$name,"_type; ")'/>
- <xsl:text>&INDENT2;typedef </xsl:text>
- <xsl:value-of select='concat($shared-ptr,"::shared_ptr<",$name,"_type> ",$name,"_sptr; ")'/>
- <xsl:text>&INDENT2;typedef </xsl:text>
- <xsl:value-of select='concat("std::vector<",$name,"_sptr> ",$name,"_sequence; ")'/>
- </xsl:template>
-
-
-
-
- <!--
- ***
- *** gen-tree-hdr-type-construtors
- ***
- Here, I should put the prototype of
- -->
- <xsl:template match='xsd:simpleType' mode='gen-tree-hdr-type-constructors'>
- </xsl:template>
- <xsl:template match='xsd:complexType' mode='gen-tree-hdr-type-constructors'>
- </xsl:template>
- <xsl:template match='xsd:simpleContent' mode='gen-tree-hdr-type-constructors'>
- </xsl:template>
- <xsl:template match='xsd:complexContent' mode='gen-tree-hdr-type-constructors'>
- </xsl:template>
- <xsl:template match='xsd:restriction' mode='gen-tree-hdr-type-constructors'>
- </xsl:template>
- <xsl:template match='xsd:extension' mode='gen-tree-hdr-type-constructors'>
- </xsl:template>
-
- <!--
- ***
- *** gen-tree-impl-const-params
- ***
- -->
- <xsl:template match='xsd:element[@name and @type]' mode="gen-tree-impl-const-params">
- </xsl:template>
- <xsl:template match='xsd:element[@name and not(@type)]' mode="gen-tree-impl-const-params">
- </xsl:template>
- <xsl:template match='xsd:element[@ref]' mode="gen-tree-impl-const-params">
- </xsl:template>
- <xsl:template match='xsd:attribute[@name and @type]' mode="gen-tree-impl-const-params">
- </xsl:template>
- <xsl:template match='xsd:attribute[@name and not(@type)]' mode="gen-tree-impl-const-params">
- </xsl:template>
- <xsl:template match='xsd:attribute[@ref]' mode="gen-tree-impl-const-params">
- </xsl:template>
-
- <!--
- ***
- ** gen-tree-impl-const-params-copy
- ***
- -->
- <xsl:template match='xsd:element' mode="gen-tree-impl-const-params-copy">
- <xsl:param name='class'/>
- <xsl:param name='name'/>
- <xsl:param name='cpp_type'/>
- <xsl:variable name="maxOccurs">
- <xsl:choose>
- <xsl:when test="@maxOccurs"><xsl:value-of select="@maxOccurs"/></xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>&INDENT;</xsl:text>
- <xsl:value-of select='concat("&INDENT;",$cls-tree-mbr-elem-prefix,$name,"=f.",$cls-tree-mbr-elem-prefix,$name,"; ")'/>
- </xsl:template>
- <xsl:template match='xsd:any' mode="gen-tree-impl-const-params-copy">
- </xsl:template>
- <xsl:template match='xsd:attribute[@name and @type]' mode="gen-tree-impl-const-params-copy">
- </xsl:template>
- <xsl:template match='xsd:attribute[@name and not(@type)]' mode="gen-tree-impl-const-params-copy">
- </xsl:template>
- <xsl:template match='xsd:attribute[@ref]' mode="gen-tree-impl-const-params-copy">
- </xsl:template>
-
- <!--
- ***
- ** gen-tree-impl-element
- ***
- -->
- <xsl:template match='xsd:element' mode="gen-tree-impl-element">
- <xsl:param name='name'/>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:variable name='my_class' select='concat($elem_pref,$name,$elem_suff)'/>
- <xsl:variable name='ns'>
- <xsl:choose>
- <xsl:when test="@type">
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@type"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test='not(@type) and not(./xsd:simpleType or
- ./xsd:complexType)'>
- <xsl:text>&XSD;</xsl:text>
- </xsl:when>
- <xsl:when test='not(@type) and ./xsd:simpleType'>
- <xsl:text>&XSD;</xsl:text>
- </xsl:when>
- <xsl:otherwise></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='elns'>
- <xsl:for-each select="namespace::*">
- <xsl:if test="(.=/xsd:schema/@targetNamespace) and (name(.) != '')">
- <xsl:variable name='lns' select="."/>
- <!--
- <xsl:message terminate="no"><xsl:value-of select="."/>
- <xsl:value-of select="$namespace-map/maps/map[@ns=$lns]/@name"/> nonme</xsl:message>
- -->
- <xsl:choose>
- <xsl:when test="$namespace-map/maps/map[@ns=$lns]">
- <xsl:value-of select="$namespace-map/maps/map[@ns=$lns]/@name"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="name()"/></xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:text>/*gen-tree-impl-element implementation of serialization method of element */ </xsl:text>
- <!-- serialization of the element ....-->
- <xsl:value-of select='concat("std::ostream &","operator <<(std::ostream &os,const struct ",$scope,"",$my_class,"&r) { ")'/>
- <xsl:text>&INDENT;if (r.m_wns) { </xsl:text>
- <!-- with namespaces -->
- <xsl:text>&INDENT2;os<<"<</xsl:text>
- <xsl:value-of select='concat($elns,":",@name)'/><xsl:text>"; </xsl:text>
- <!-- -->
- <xsl:if test='(local-name(..)="schema") and 0'>
- <xsl:text>&INDENT2;os<<"</xsl:text>
- <xsl:apply-templates select="namespace::*" mode="generate-tree-skell-serialize-ns"/>
- <xsl:for-each select="namespace::*">
- <xsl:variable name='ns' select='.'/>
- <xsl:if test='$ns!="http://www.w3.org/XML/1998/namespace" and $ns!="http://www.w3.org/2001/XMLSchema"'>
- <xsl:text> </xsl:text>
- <xsl:value-of select="concat('xmlns:',name(),'=')"/>
- <xsl:text>\"</xsl:text>
- <xsl:value-of select="."/>
- <xsl:text>\"</xsl:text>
- </xsl:if>
- </xsl:for-each>
- <xsl:text>"; </xsl:text>
- </xsl:if>
- <xsl:if test='$ns!="&XSD;"'>
- <xsl:text>&INDENT2;r.m_content->serialize_attributes(os); </xsl:text>
- </xsl:if>
- <xsl:text>&INDENT2;os<<">"; </xsl:text>
- <!-- -->
- <xsl:value-of select='concat("","&INDENT2;//os<<*(r.m_content); ")'/>
- <xsl:apply-templates select='.' mode='gen-tree-hdr-elem-serial'>
- <xsl:with-param name='ns' select="$ns"/>
- </xsl:apply-templates>
- <xsl:text>&INDENT2;os<<"</</xsl:text>
- <xsl:value-of select='concat($elns,":",@name)'/><xsl:text>>"; </xsl:text>
- <xsl:text>&INDENT;} else { </xsl:text>
- <!-- without namespaces -->
- <xsl:text>&INDENT2;os<<"<</xsl:text>
- <xsl:value-of select='concat("",@name)'/><xsl:text>"; </xsl:text>
- <xsl:if test='$ns!="&XSD;"'>
- <xsl:text>&INDENT2;r.m_content->serialize_attributes(os); </xsl:text>
- </xsl:if>
- <xsl:text>&INDENT2;os<<">"; </xsl:text>
- <!-- -->
- <xsl:apply-templates select='.' mode='gen-tree-hdr-elem-serial'>
- <xsl:with-param name='ns' select="$ns"/>
- </xsl:apply-templates>
- <xsl:text>&INDENT2;os<<"</</xsl:text>
- <xsl:value-of select='concat("",@name)'/><xsl:text>>"; </xsl:text>
- <xsl:text>&INDENT;} </xsl:text>
- <xsl:text>&INDENT;return os;&NL;} </xsl:text>
- </xsl:template>
- <!--
- ***
- ** gen-tree-impl-serialize
- ***
- -->
- <!-- serialize element new way. Still questions on how to make it -->
- <xsl:template match='xsd:element[@name]' mode="gen-tree-impl-serialize">
- <xsl:param name='name'/>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:variable name='form'>
- <xsl:choose>
- <xsl:when test='@form'><xsl:value-of select="@form"/></xsl:when>
- <xsl:when test='/xsd:schema/@elementFormDefault'><xsl:value-of select="/xsd:schema/@elementFormDefault"/></xsl:when>
- <xsl:otherwise>unqualified</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='minOccurs'>
- <xsl:choose>
- <xsl:when test="@minOccurs"><xsl:value-of select="@minOccurs"/></xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='maxOccurs'>
- <xsl:choose>
- <xsl:when test="@maxOccurs"><xsl:value-of select="@maxOccurs"/></xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:text>&INDENT;/* gen-tree-impl-serialize TO BE TREATED new way scope:</xsl:text>
- <xsl:value-of select="concat($scope,' cls=',$class,' ',$maxOccurs)"/><xsl:text>*/ </xsl:text>
- <xsl:choose>
- <xsl:when test='$maxOccurs="unbounded"'>
- <xsl:value-of select='concat($class,"::",$name,"_sequence::const_iterator ",$name,"_it; ")'/>
- <xsl:value-of select='concat("&INDENT;for (",$name,"_it = obj.",$cls-tree-mbr-elem-prefix,$name,".begin(); ")'/>
- <xsl:value-of select='concat("&INDENT2;",$name,"_it != obj.",$cls-tree-mbr-elem-prefix,$name,".end(); ")'/>
- <xsl:value-of select='concat("&INDENT2;",$name,"_it++) { ")'/>
- <xsl:text>&INDENT2;os<<</xsl:text>
- <xsl:value-of select="concat($class,'::',$name,'_elem_type')"/>
- <xsl:value-of select="concat('(*',$name,'_it); ')"/>
- </xsl:when>
- <xsl:when test='$maxOccurs>1'>
- <xsl:value-of select='concat("&INDENT;",$class,"::",$name,"_sequence::const_iterator ",$name,"_it; ")'/>
- <xsl:value-of select='concat("&INDENT;for (",$name,"_it = obj.",$cls-tree-mbr-elem-prefix,$name,".begin(); ")'/>
- <xsl:value-of select='concat("&INDENT2;",$name,"_it != obj.",$cls-tree-mbr-elem-prefix,$name,".end(); ")'/>
- <xsl:value-of select='concat("&INDENT2;",$name,"_it++) { ")'/>
- <xsl:text>&INDENT2;os<<</xsl:text>
- <xsl:value-of select="concat($class,'::',$name,'_elem_type')"/>
- <xsl:value-of select="concat('(*',$name,'_it); ')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>&INDENT;if (obj.</xsl:text>
- <xsl:value-of select="concat($cls-tree-mbr-elem-prefix,$name,' != NULL) { &INDENT2;')"/>
- <xsl:text>&INDENT2;</xsl:text>
- <xsl:value-of select='concat($class,"::",$name)'/><xsl:text>_sptr s(</xsl:text>
- <xsl:value-of select='concat("obj.",$cls-tree-mbr-elem-prefix,$name)'/>
- <xsl:text>); </xsl:text>
- <xsl:value-of select='concat("&INDENT2;os<<",$class,"::",$name,$elem_suff,"(s); ")'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>&INDENT;} </xsl:text>
- </xsl:template>
-
- <!-- serialize element new way. Still questions on how to make it -->
- <xsl:template match='xsd:element[@ref]' mode="gen-tree-impl-serialize">
- <xsl:param name='name'/>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='maxOccurs'>1</xsl:param>
- <xsl:variable name='form'>
- <xsl:choose>
- <xsl:when test='@form'><xsl:value-of select="@form"/></xsl:when>
- <xsl:when test='/xsd:schema/@elementFormDefault'><xsl:value-of select="/xsd:schema/@elementFormDefault"/></xsl:when>
- <xsl:otherwise>unqualified</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='minOccurs'>
- <xsl:choose>
- <xsl:when test="@minOccurs"><xsl:value-of select="@minOccurs"/></xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='local-maxOccurs'>
- <xsl:choose>
- <xsl:when test="@maxOccurs"><xsl:value-of select="@maxOccurs"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="$maxOccurs"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:text>&INDENT;/* gen-tree-impl-serialze </xsl:text>
- <xsl:value-of select='concat("@ref=",@ref," new way scope: ")'/>
- <xsl:value-of select="concat($scope,' cls=',$class,' @maxOccurs=',@maxOccurs,' $maxOccurs=',$maxOccurs)"/><xsl:text>*/ </xsl:text>
- <xsl:choose>
- <xsl:when test='$local-maxOccurs="unbounded"'>
- <!--
- <xsl:value-of select='concat("&INDENT;",$class,"::",$name,"_sequence::const_iterator ",$name,"_it; ")'/>
- -->
- <xsl:value-of select='concat("&INDENT;","",$name,"_sequence::const_iterator ",$name,"_it; ")'/>
- <xsl:value-of select='concat("&INDENT;for (",$name,"_it = obj.",$cls-tree-mbr-elem-prefix,$name,".begin(); ")'/>
- <xsl:value-of select='concat("&INDENT2;",$name,"_it != obj.",$cls-tree-mbr-elem-prefix,$name,".end(); ")'/>
- <xsl:value-of select='concat("&INDENT2;",$name,"_it++) { ")'/>
- <xsl:text>&INDENT2;os<<</xsl:text>
- <xsl:value-of select="concat('',$name,'_elem_type')"/>
- <xsl:value-of select="concat('(*',$name,'_it); ')"/>
- </xsl:when>
- <xsl:when test='string(number($local-maxOccurs))!= "NaN" and $local-maxOccurs>1'>
- <xsl:value-of select='concat("&INDENT;",$name,"_sequence::const_iterator ",$name,"_it; ")'/>
- <xsl:value-of select='concat("&INDENT;for (",$name,"_it = obj.",$cls-tree-mbr-elem-prefix,$name,".begin(); ")'/>
- <xsl:value-of select='concat("&INDENT2;",$name,"_it != obj.",$cls-tree-mbr-elem-prefix,$name,".end(); ")'/>
- <xsl:value-of select='concat("&INDENT2;",$name,"_it++) { ")'/>
- <xsl:text>&INDENT2;os<<</xsl:text>
- <xsl:value-of select="concat('',$name,'_elem_type')"/>
- <xsl:value-of select="concat('(*',$name,'_it); ')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>&INDENT;if (obj.</xsl:text>
- <xsl:value-of select="concat($cls-tree-mbr-elem-prefix,$name,' != NULL) { &INDENT2;')"/>
- <xsl:text>&INDENT2;</xsl:text>
- <xsl:value-of select='concat("",$name)'/><xsl:text>_sptr s(</xsl:text>
- <xsl:value-of select='concat("obj.",$cls-tree-mbr-elem-prefix,$name)'/>
- <xsl:text>); </xsl:text>
- <xsl:value-of select='concat("&INDENT2;os<<","",$name,$elem_suff,"(s); ")'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>&INDENT;} </xsl:text>
- </xsl:template>
-
-
- <xsl:template match='xsd:any' mode="gen-tree-impl-serialize">
- <xsl:text>/* trait any*/ </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attribute' mode="gen-tree-impl-serialize">
- <xsl:param name="name"/>
- <xsl:param name="ns"/>
- <xsl:text>&INDENT;os<<" </xsl:text>
- <xsl:value-of select="$name"/>
- <xsl:text>=\""<<me_attr_</xsl:text>
- <xsl:value-of select="concat($name,'')"/>
- <xsl:text><<"\""; </xsl:text>
- </xsl:template>
-
- <!--
- ***
- ** gen-tree-impl-setget
- ***
- -->
- <!-- element with name and type -->
- <!-- element with name and without type -->
- <xsl:template match='xsd:element[not(@ref)]' mode="gen-tree-impl-setget">
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:param name="eltype"/>
- <xsl:param name="name"/>
- <xsl:param name='baseclass'></xsl:param>
- <xsl:param name="maxOccurs">1</xsl:param>
- <xsl:variable name='form'>
- <xsl:choose>
- <xsl:when test='@form'><xsl:value-of select="@form"/></xsl:when>
- <xsl:when test='/xsd:schema/@elementFormDefault'><xsl:value-of select='/xsl:schema/@elementFormDefault'/></xsl:when>
- <xsl:otherwise>unqualified</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='el'>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'>
- <xsl:value-of select="substring-after(@ref,':')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='@ref'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='el_type' select='key("elementByName",substring-after(@ref,":"))/@type'/>
- <xsl:text>//gen-tree-impl-setget </xsl:text>
- <xsl:value-of select='concat("class=",$class," // scope=",$scope," name=",$name," @maxOccurs=",@maxOccurs," $baseclass=",$baseclass)'/>
- <xsl:text> </xsl:text>
- <xsl:choose>
- <xsl:when test='$baseclass'>
-
- <xsl:value-of select='concat("void ",$scope,$class,"::",$baseclass,"(",$name,"_sptr &v) { ") '/>
- <xsl:value-of select='concat("&INDENT;//me_",$baseclass,".push_back(","v);")'/>
- <xsl:text> } </xsl:text>
-
- <xsl:value-of select='concat("void ",$scope,$class,"::",$baseclass,"(",$name,"_type &v) { ") '/>
- <xsl:value-of select='concat("&INDENT;// me_",$baseclass,".push_back(",$class,"::",$name,"_sptr( new ",$name,"_type(v)));")'/>
- <xsl:text> } </xsl:text>
- </xsl:when>
- <xsl:when test='@maxOccurs="unbounded" or ($maxOccurs="unbounded" and not(@maxOccurs))'>
- <!-- sequence type-->
- <xsl:value-of select='concat(" void ",$scope,$class,"::",$name,"(const ",$name,"_sequence &v) { ") '/>
- <xsl:value-of select='concat("&INDENT;",$cls-tree-mbr-elem-prefix,$name," =v; } ")'/>
-
- <xsl:value-of select='concat("void ",$scope,$class,"::",$name,"(",$name,"_sptr &v) { ") '/>
- <xsl:value-of select='concat("&INDENT; ",$cls-tree-mbr-elem-prefix,$name,".push_back(","v);")'/>
- <xsl:text> } </xsl:text>
-
- <xsl:value-of select='concat("void ",$scope,$class,"::",$name,"(",$name,"_type &v) { ") '/>
- <xsl:value-of select='concat("&INDENT; ",$cls-tree-mbr-elem-prefix,$name,".push_back(",$class,"::",$name,"_sptr( new ",$name,"_type(v)));")'/>
- <xsl:text> } </xsl:text>
- </xsl:when>
- <xsl:when test='number(@maxOccurs)>1 or (number($maxOccurs) and ($maxOccurs>1))'>
- <!-- sequence type-->
- <xsl:value-of select='concat(" void ",$scope,$class,"::",$name,"(const ",$name,"_sequence &v) { ") '/>
- <xsl:value-of select='concat("&INDENT;",$cls-tree-mbr-elem-prefix,$name," =v; } ")'/>
-
- <xsl:value-of select='concat("void ",$scope,$class,"::",$name,"(",$name,"_sptr &v) { ") '/>
- <xsl:value-of select='concat("&INDENT; ",$cls-tree-mbr-elem-prefix,$name,".push_back(","v);")'/>
- <xsl:text> } </xsl:text>
-
- <xsl:value-of select='concat("void ",$scope,$class,"::",$name,"(",$name,"_type &v) { ") '/>
- <xsl:value-of select='concat("&INDENT; ",$cls-tree-mbr-elem-prefix,$name,".push_back(",$class,"::",$name,"_sptr( new ",$name,"_type(v)));")'/>
- <xsl:text> } </xsl:text>
- </xsl:when>
- <xsl:when test='number(@maxOccurs)=1 or number($maxOccurs)=1'>
- <!-- I need to add the auto_ptr function functions .... -->
- <xsl:value-of select='concat(" void ",$scope,$class,"::",$name,"(",$name,"_type &v) { ") '/>
- <!--
- <xsl:value-of select='concat("&INDENT;me_",$name," = new ",$eltype,"(v); } ")'/>
- -->
- <xsl:value-of select='concat("&INDENT;",$cls-tree-mbr-elem-prefix,$name,".reset( new ",$name,"_type(v)); } ")'/>
- <xsl:value-of select='concat(" void ",$scope,$class,"::",$name,"(",$name,"_sptr &v) { ") '/>
- <xsl:value-of select='concat("&INDENT;",$cls-tree-mbr-elem-prefix,$name," =v; } ")'/>
- <xsl:value-of select='concat(" void ",$scope,$class,"::",$name,"(",$name,"_type *v) { ") '/>
- <xsl:value-of select='concat("&INDENT;",$cls-tree-mbr-elem-prefix,$name,".reset(v); } ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'><xsl:value-of select='concat(@ref," ",$maxOccurs)'/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- element with ref -->
- <xsl:template match='xsd:element[@ref]' mode="gen-tree-impl-setget">
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:param name="eltype"/>
- <xsl:param name="name"/>
- <xsl:param name='baseclass'></xsl:param>
- <xsl:param name="maxOccurs">1</xsl:param>
- <xsl:variable name='form'>
- <xsl:choose>
- <xsl:when test='@form'><xsl:value-of select="@form"/></xsl:when>
- <xsl:when test='/xsd:schema/@elementFormDefault'><xsl:value-of select='/xsl:schema/@elementFormDefault'/></xsl:when>
- <xsl:otherwise>unqualified</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='el'>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'>
- <xsl:value-of select="substring-after(@ref,':')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='@ref'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:apply-templates select="@ref" mode='namespace-uri-of-qname'>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:variable name="cpp_ns">
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="$ns"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="ns-name">
- <xsl:choose>
- <xsl:when test='$ns="&XSD;"'></xsl:when>
- <xsl:when test='$ns!=/xsd:schema/@targetNamespace'><xsl:value-of
- select='concat($cpp_ns,"_")'/></xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='el_type' select='key("elementByName",substring-after(@ref,":"))/@type'/>
- <xsl:text>//gen-tree-impl-setget </xsl:text>
- <xsl:value-of select='concat("class=",$class," scope=",$scope," name=",$name," @maxOccurs=",@maxOccurs," $baseclass=",$baseclass)'/>
- <xsl:text> </xsl:text>
- <xsl:choose>
- <xsl:when test='$baseclass'>
-
- <xsl:value-of select='concat("void ",$scope,$class,"::",$baseclass,"(",$name,"_sptr &v) { ") '/>
- <xsl:value-of select='concat("&INDENT;//me_",$baseclass,".push_back(","v);")'/>
- <xsl:text> } </xsl:text>
-
- <xsl:value-of select='concat("void ",$scope,$class,"::",$baseclass,"(",$name,"_type &v) { ") '/>
- <xsl:value-of select='concat("&INDENT;// me_",$baseclass,".push_back(",$class,"::",$name,"_sptr( new ",$name,"_type(v)));")'/>
- <xsl:text> } </xsl:text>
- </xsl:when>
- <xsl:when test='@maxOccurs="unbounded" or ($maxOccurs="unbounded" and not(@maxOccurs))'>
- <!-- sequence type-->
- <xsl:value-of select='concat(" void ",$scope,$class,"::",$name,"(const ",$name,"_sequence &v) { ") '/>
- <xsl:value-of select='concat("&INDENT;",$cls-tree-mbr-elem-prefix,$ns-name,$name," =v; } ")'/>
-
- <xsl:value-of select='concat("void ",$scope,$class,"::",$name,"(",$name,"_sptr &v) { ") '/>
- <xsl:value-of select='concat("&INDENT; ",$cls-tree-mbr-elem-prefix,$ns-name,$name,".push_back(","v);")'/>
- <xsl:text> } </xsl:text>
-
- <xsl:value-of select='concat("void ",$scope,$class,"::",$name,"(",$name,"_type &v) { ") '/>
- <xsl:value-of select='concat("&INDENT; ",$cls-tree-mbr-elem-prefix,$ns-name,$name,".push_back(","",$name,"_sptr( new ",$name,"_type(v)));")'/>
- <xsl:text> } </xsl:text>
- <!-- Get function -->
- <xsl:value-of select='concat(" ",$name,"_sequence & ") '/>
- <xsl:value-of select='concat("",$scope,$class,"::",$name,"( void ) { ") '/>
- <xsl:value-of select='concat("&INDENT;return ",$cls-tree-mbr-elem-prefix,$ns-name,$name,"; } ")'/>
- </xsl:when>
- <xsl:when test='number(@maxOccurs)>1 or (number($maxOccurs) and ($maxOccurs>1))'>
- <!-- sequence type-->
- <xsl:value-of select='concat(" void ",$scope,$class,"::",$name,"(const ",$name,"_sequence &v) { ") '/>
- <xsl:value-of select='concat("&INDENT;",$cls-tree-mbr-elem-prefix,$name," =v; } ")'/>
-
- <xsl:value-of select='concat("void ",$scope,$class,"::",$name,"(",$name,"_sptr &v) { ") '/>
- <xsl:value-of select='concat("&INDENT; ",$cls-tree-mbr-elem-prefix,$name,".push_back(","v);")'/>
- <xsl:text> } </xsl:text>
-
- <xsl:value-of select='concat("void ",$scope,$class,"::",$name,"(",$name,"_type &v) { ") '/>
- <xsl:value-of select='concat("&INDENT; ",$cls-tree-mbr-elem-prefix,$name,".push_back(",$class,"::",$name,"_sptr( new ",$name,"_type(v)));")'/>
- <xsl:text> } </xsl:text>
- <!-- Get function -->
- <xsl:value-of select='concat(" ",$name,"_sequence & ") '/>
- <xsl:value-of select='concat("",$scope,$class,"::",$name,"( void ) { ") '/>
- <xsl:value-of select='concat("&INDENT;return ",$cls-tree-mbr-elem-prefix,$ns-name,$name,"; } ")'/>
- </xsl:when>
- <xsl:when test='number(@maxOccurs)=1 or number($maxOccurs)=1'>
- <!-- I need to add the auto_ptr function functions .... -->
- <xsl:value-of select='concat(" void ",$scope,$class,"::",$name,"(",$name,"_type &v) { ") '/>
- <!--
- <xsl:value-of select='concat("&INDENT;me_",$name," = new ",$eltype,"(v); } ")'/>
- -->
- <xsl:value-of select='concat("&INDENT;",$cls-tree-mbr-elem-prefix,$name,".reset( new ",$name,"_type(v)); } ")'/>
- <!-- set shared pointer reference -->
- <xsl:value-of select='concat(" void ",$scope,$class,"::",$name,"(",$name,"_sptr &v) { ") '/>
- <xsl:value-of select='concat("&INDENT;",$cls-tree-mbr-elem-prefix,$name," =v; } ")'/>
- <!-- set pointer -->
- <xsl:value-of select='concat(" void ",$scope,$class,"::",$name,"(",$name,"_type *v) { ") '/>
- <xsl:value-of select='concat("&INDENT;",$cls-tree-mbr-elem-prefix,$name,".reset(v); } ")'/>
- <!-- Get function -->
- <xsl:value-of select='concat(" ",$name,"_type & ") '/>
- <xsl:value-of select='concat("",$scope,$class,"::",$name,"( void ) { ") '/>
- <xsl:value-of select='concat("&INDENT;return *",$cls-tree-mbr-elem-prefix,$name,"; } ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'><xsl:value-of select='concat(@ref," ",$maxOccurs)'/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:any' mode="gen-tree-impl-setget">
- <xsl:message terminate='yes'>Any type seter and getter </xsl:message>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attributeGroup[@ref]' mode="gen-tree-impl-setget">
- <xsl:param name="class"/>
- <xsl:param name="eltype"/>
- <xsl:param name="name"/>
- <xsl:param name="maxOccurs">1</xsl:param>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* gen-tree-impl-setget </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref,"*/ ")'/>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attribute[@name and @type]' mode="gen-tree-impl-setget">
- <xsl:param name="class"/>
- <xsl:param name="eltype"/>
- <xsl:param name="name"/>
- <xsl:param name="maxOccurs">1</xsl:param>
- <xsl:variable name='form'>
- <xsl:choose>
- <xsl:when test='@form'><xsl:value-of select="@form"/></xsl:when>
- <xsl:when test='/xsd:schema/@attributeFormDefault'><xsl:value-of select='/xsl:schema/@attributeFormDefault'/></xsl:when>
- <xsl:otherwise>unqualified</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>// gen-tree-impl-set-get </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name," @type=",@type," eltype=",$eltype," ")'/>
- </xsl:if>
- <xsl:text>#if 0 </xsl:text>
- <!--
- -->
- <xsl:value-of select='concat("void ",$class,"::attr_",$name,"(",$eltype," &v) { ") '/>
- <xsl:value-of select='concat("&INDENT;me_attr_",$name," =v; } ")'/>
-
- <xsl:value-of select='concat($eltype," ",$class,"::attr_",$name,"(void) { ") '/>
- <xsl:value-of select='concat("&INDENT;return me_attr_",$name,".content(); } ")'/>
- <xsl:text>#endif </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attribute[@name and not(@type)]' mode="gen-tree-impl-setget">
- <xsl:param name="class"/>
- <xsl:param name="eltype"/>
- <xsl:param name="name"/>
- <xsl:param name="maxOccurs">1</xsl:param>
- <xsl:variable name='form'>
- <xsl:choose>
- <xsl:when test='@form'><xsl:value-of select="@form"/></xsl:when>
- <xsl:when test='/xsd:schema/@attributeFormDefault'><xsl:value-of select='/xsl:schema/@attributeFormDefault'/></xsl:when>
- <xsl:otherwise>unqualified</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>// eltype </xsl:text>
- <xsl:value-of select='concat($eltype," ")'/>
- <xsl:value-of select='concat(" void ",$class,"::attr_",$name,"(",$eltype," &v) { ") '/>
- <xsl:value-of select='concat("&INDENT;me_attr_",$name," =v; } ")'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attribute[@ref]' mode="gen-tree-impl-setget">
- <xsl:param name="class"/>
- <xsl:param name="eltype"/>
- <xsl:param name="name"/>
- <xsl:param name="maxOccurs">1</xsl:param>
- <xsl:variable name='form'>
- <xsl:choose>
- <xsl:when test='@form'><xsl:value-of select="@form"/></xsl:when>
- <xsl:when test='/xsd:schema/@attributeFormDefault'><xsl:value-of select='/xsl:schema/@attributeFormDefault'/></xsl:when>
- <xsl:otherwise>unqualified</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- I need to add the auto_ptr function functions .... -->
- <!--
- <xsl:value-of select='concat(" void ",$class,"::",$name,"(",$eltype," &v) { ") '/>
- <xsl:value-of select='concat("&INDENT;me_",$name,".reset( new ",$name,"_type(v)); } ")'/>
- -->
- <xsl:text>// gen-tree-impl-setget eltype </xsl:text>
- <xsl:value-of select='concat($eltype," ")'/>
- <xsl:value-of select='concat(" void ",$class,"::attr_",$name,"(",$eltype," &v) { ") '/>
- <xsl:value-of select='concat("&INDENT;me_attr_",$name," =v; } ")'/>
-
- <xsl:value-of select='concat(" // Getter ",$eltype," ",$class,"::attr_",$name,"() { ") '/>
- <xsl:choose>
- <xsl:when test='@use and @use="required"'>
- <xsl:value-of select='concat("&INDENT;return me_attr_",$name,"; } ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("&INDENT;return me_attr_",$name,"; } ")'/>
- <!--
- <xsl:value-of select='concat("&INDENT;return me_attr_",$name,".content(); } ")'/>
- -->
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- ***
- *** gen-parser-impl-element-end
- ***
- -->
- <xsl:template match="xsd:element" mode="gen-parser-impl-element-end">
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:param name='elname'/>
- <xsl:param name="sscope"/>
- <xsl:param name="is_empty">no</xsl:param>
-
- <xsl:variable name="sclass">
- <xsl:value-of select='substring-after($class,"p_")'/>
- </xsl:variable>
- <xsl:variable name='maxOccurs'>
- <xsl:apply-templates select="." mode="element-max-occurs"/>
- </xsl:variable>
- <xsl:variable name='form'>
- <xsl:apply-templates select="." mode="element-form"/>
- </xsl:variable>
- <xsl:variable name="ns">
- <xsl:choose>
- <xsl:when test='$form ="qualified"'>ns == "<xsl:value-of select="/xsd:schema/@targetNamespace"/>"</xsl:when>
- <xsl:otherwise>ns.empty()</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:text>&INDENT;// scope=</xsl:text><xsl:value-of select='$scope'/>
- <xsl:value-of select='concat(" sscope=",$sscope)'/>
- <xsl:text> </xsl:text>
- <xsl:text>&INDENT;if (name == "</xsl:text><xsl:value-of select='$elname'/><xsl:text>" &&</xsl:text>
- <xsl:value-of select="concat(' &INDENT2;',$ns,')')"/>
- <xsl:text> &INDENT;{ </xsl:text>
- <!-- Core code -->
- <xsl:text>&INDENT2;if ( this->m_</xsl:text>
- <xsl:value-of select='concat($elname,"_parser")'/><xsl:text>!=0) &INDENT2;{ </xsl:text>
- <!-- Parser is set call getter-->
- <xsl:text>&INDENT3;</xsl:text>
- <xsl:choose>
- <xsl:when test='@ref'>
- <xsl:value-of select='concat("",$elname,"_sptr tmp(new ")'/>
- <xsl:value-of select='concat("",$elname,"_type()); ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat($sscope,$sclass,"::",$elname,"_sptr tmp(new ")'/>
- <xsl:value-of select='concat($sscope,$sclass,"::",$elname,"_type()); ")'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test='$is_empty="no"'>
- <xsl:text>&INDENT3;this->m_</xsl:text>
- <xsl:value-of select='concat($elname,"_parser->post(*tmp); ")'/>
- </xsl:when>
- <xsl:otherwise><xsl:text>// Element is empty </xsl:text></xsl:otherwise>
- </xsl:choose>
- <!-- New way, call ster .... -->
- <xsl:text>&INDENT3;this->onEl</xsl:text><xsl:value-of select="$elname"/>
- <xsl:value-of select='concat("","(*tmp); ")'/>
- <!-- Treat stack case-->
- <xsl:text>&INDENT3;if ((m_context.size() > 0) && (m_context.back().m_data!=NULL)) </xsl:text>
- <xsl:text>&INDENT3;{ /* recursion active */ </xsl:text>
- <xsl:text>&INDENT4;</xsl:text><xsl:value-of select='concat($sscope,substring-after($class,"p_")," *st = ")'/>
- <xsl:value-of select='concat("static_cast<",$sscope,substring-after($class,"p_")," *>(s.m_data); ")'/>
- <xsl:text>&INDENT3;} else </xsl:text>
- <xsl:text>&INDENT3;{ </xsl:text>
- <xsl:text>&INDENT4; </xsl:text>
- <xsl:text>&INDENT3;} </xsl:text>
- <xsl:text>&INDENT2;} </xsl:text>
- <xsl:text>&INDENT2;return true; </xsl:text>
- <xsl:text>&INDENT;} </xsl:text>
- </xsl:template>
- <!--
- ***
- ** gen-parser-impl-event-begin
- ***
- -->
-
- <xsl:template match="xsd:element" mode="gen-parser-impl-event-begin">
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:param name="sscope"/>
- <xsl:param name="elname"/>
- <xsl:param name="type"/>
- <xsl:variable name="sclass">
- <xsl:value-of select='substring-after($class,"p_")'/>
- </xsl:variable>
- <xsl:variable name='maxOccurs'>
- <xsl:apply-templates select="." mode="element-max-occurs"/>
- </xsl:variable>
- <xsl:text>#if 1 </xsl:text>
- <xsl:text>void </xsl:text>
- <xsl:value-of select='concat($scope,$class,"::")'/>
- <xsl:text> onEl</xsl:text><xsl:value-of select="$elname"/>
- <xsl:choose>
- <xsl:when test='@ref'>
- <xsl:value-of select='concat("(",$type," &v) { ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("(",$sscope,$type," &v) { ")'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test='$generate-print="yes"'>
- <xsl:text>#ifdef DEBUG </xsl:text>
- <xsl:text>&INDENT;std::cout<<"</xsl:text>
- <xsl:value-of select='concat($sscope,$class,"::","onEl",$elname,":")'/>
- <xsl:text> "<<v<<"\n"; </xsl:text>
- <xsl:text>#endif </xsl:text>
- </xsl:if>
- <xsl:text>&INDENT;if ( (m_context.size() > 0 && m_context.back().m_data !=NULL)) &INDENT;{ </xsl:text>
- <xsl:text>&INDENT2;</xsl:text><xsl:value-of select='concat($sscope,$sclass," *st = ")'/>
- <xsl:value-of select='concat("static_cast<",$sscope,$sclass," *>(m_context.back().m_data); ")'/>
- <xsl:choose>
- <xsl:when test='$polymorphic="yes"'>
- <xsl:text>&INDENT2;//st-></xsl:text>
- <xsl:value-of select='concat($elname,"(v); ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>&INDENT2;st-></xsl:text>
- <xsl:value-of select='concat($elname,"(v); ")'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>&INDENT2; </xsl:text>
- <xsl:text>&INDENT;} else { </xsl:text>
- <xsl:text>&INDENT2;</xsl:text>
- <xsl:choose>
- <xsl:when test="number($maxOccurs) and $maxOccurs=1">
- <xsl:choose>
- <xsl:when test='@equivClass'>
- <xsl:value-of select='concat("//m_",$elname,".",substring-before($type,"_type"),"(v); ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("//m_",$elname," = v; ")'/>
- <xsl:value-of select='concat("&INDENT2;m_",substring-before($sclass,"_skel"),".",$elname,"(v); ")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test='@ref'>
- <xsl:value-of select='concat("",$elname,"_sptr t(new ","",$elname,"_type (v)); ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat($sclass,"::",$elname,"_sptr t(new ",$sclass,"::",$elname,"_type (v)); ")'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>&INDENT2;</xsl:text>
- <xsl:value-of select='concat("//m_",$elname,".push_back(t); ")'/>
- <xsl:text>&INDENT2;</xsl:text>
- <xsl:value-of select='concat("m_",substring-before($sclass,"_skel"),".",$elname,"(t); ")'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>&INDENT;} </xsl:text>
- <xsl:text>} </xsl:text>
- <xsl:text>#endif </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute" mode="gen-parser-impl-event-begin">
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:param name="elname"/>
- <xsl:param name="type"/>
- <xsl:param name="recursion">yes</xsl:param>
- <xsl:variable name="sclass">
- <xsl:value-of select='substring-after($class,"p_")'/>
- </xsl:variable>
- <xsl:variable name='tp'>
- <xsl:choose>
- <xsl:when test='@ref and not(@use)'>
- <!--
- <xsl:value-of select='concat("",$type,"_attr_type")'/>
- -->
- <xsl:value-of select='concat("",$type,"_optional")'/>
- </xsl:when>
- <xsl:when test='@ref and @use!="optional"'>
- <xsl:value-of select='concat("",$type,"_attr_type")'/>
- </xsl:when>
- <xsl:when test='@ref and @use="optional"'>
- <xsl:value-of select='concat("",$elname,"_optional")'/>
- </xsl:when>
- <xsl:when test='@use="optional"'>
- <xsl:value-of select='concat($sclass,"::",$elname,"_optional")'/>
- </xsl:when>
- <xsl:when test='@use and @use!="optional"'>
- <xsl:value-of select='concat($sclass,"::",$elname,"_attr_type")'/>
- </xsl:when>
- <xsl:otherwise>
- <!--
- <xsl:value-of select='concat($sclass,"::",$elname,"_attr_type")'/>
- -->
- <xsl:value-of select='concat($sclass,"::",$elname,"_optional")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>//gen-parser-impl-event-begin </xsl:text>
- <xsl:value-of select='concat(" elname=",$elname," type=",$type)'/>
- <xsl:text> </xsl:text>
- <xsl:text>void </xsl:text>
- <xsl:value-of select='concat($class,"::")'/>
- <xsl:text> onAttr</xsl:text><xsl:value-of select="$elname"/>
- <xsl:value-of select='concat("( ",$tp," &v) { ")'/>
- <xsl:if test='$generate-print="yes"'>
- <xsl:text>#ifdef DEBUG </xsl:text>
- <xsl:text>&INDENT;std::cout<<"</xsl:text>
- <xsl:value-of select='concat($sclass,"::onAttr",$elname,":")'/>
- <xsl:text> "<<v<<"\n"; </xsl:text>
- <xsl:text>#endif </xsl:text>
- </xsl:if>
- <xsl:if test='$recursion="yes"'>
- <xsl:text>&INDENT;if ( (m_context.size() > 0) &&(m_context.back().m_data!=NULL) ) &INDENT;{ </xsl:text>
- <xsl:text>&INDENT2;</xsl:text><xsl:value-of select='concat($sclass," *st = ")'/>
- <xsl:value-of select='concat("static_cast<",$sclass," *>(m_context.back().m_data); ")'/>
- <xsl:text>&INDENT2;st-></xsl:text>
- <xsl:value-of select='concat("attr_",$elname,"(v); ")'/>
- <xsl:text>&INDENT2; </xsl:text>
- <xsl:text>&INDENT;} else { </xsl:text>
- </xsl:if>
- <xsl:text>&INDENT2;</xsl:text>
- <xsl:value-of select='concat("m_",substring-before($sclass,"_skel"),".attr_",$elname,"(v); ")'/>
- <xsl:if test='$recursion="yes"'>
- <xsl:text>&INDENT;} </xsl:text>
- </xsl:if>
- <xsl:text>} </xsl:text>
- </xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
-:vim:ts=2:sw=2:et:bs=2:
- this is my last try to make the sort work properly.
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- version="2.0" >
-
- <xsl:import href="xsd2cpp-utils.xsl"/>
- <xsl:import href="xsd2cpp-make-deps-class.xsl"/>
-
-<xsl:template match='xsd:schema' mode='make-deps-method-3'>
-
- <xsl:for-each select='xsd:import|xsd:include'>
- <xsl:copy-of select="."/>
- </xsl:for-each>
- <!--
- <xsl:value-of select="namespace-uri-from-QName(resolve-QName($qname,/xsd:schema))"/>
- -->
- <xsl:variable name='nvisited' select="'|'"/>
- <xsl:variable name='leaf' select='/xsd:schema/*[
- (local-name(.)="element" and @type and
- not(contains($nvisited,concat("|",@name,"|")) )
- ) or
- (local-name(.)="attribute" and
- @type and
- contains(@type,":") and
- namespace-uri-from-QName(resolve-QName(@type,/xsd:schema)) = "&XSD;"
- ) or
- (local-name(.)="simpleType" and
- ( ( xsd:restriction/@base and
- contains(./xsd:restriction/@base,":") and
- namespace-uri-from-QName(resolve-QName(string(./xsd:restriction/@base),/xsd:schema)) = "&XSD;"
- )
- )
- ) or
- (local-name(.)="complexType" and
- not(contains($nvisited,concat("|",@name,"|")) ) and
- not(./*/xsd:element/@type[not(contains( concat("|",substring-after(.,":"),"|") ,$nvisited))
- or not (namespace-uri-from-QName(resolve-QName(.,/xsd:schema)) = "&XSD;")
- ] )
- )
- ]'/>
- <!--
- and not (namespace-uri-from-QName(resolve-QName(.,/xsd:schema)) = "&XSD;")
- -->
- <xsl:apply-templates select='$leaf[1]' mode='make-deps-method-3'>
- <xsl:with-param name='visited' select="'|string|'"/>
- </xsl:apply-templates>
-</xsl:template>
-<!-- -->
-<xsl:template match='xsd:element|xsd:attribute|xsd:group|xsd:attributeGroup|xsd:simpleType|xsd:complexType' mode='make-deps-method-3'>
- <xsl:param name='visited'/>
-
- <!--
- <xsl:copy-of select='./*'/>
- <xsl:copy />
- -->
- <xsl:copy-of select='.'/>
- <xsl:variable name='nvisited'>
- <xsl:choose>
- <xsl:when test='local-name(.)="element"'>
- <xsl:value-of select='concat($visited,"E",@name,"|")'/>
- </xsl:when>
- <xsl:when test='local-name(.)="complexType"'>
- <xsl:value-of select='concat($visited,"T",@name,"|")'/>
- </xsl:when>
- <xsl:when test='local-name(.)="simpleType"'>
- <xsl:value-of select='concat($visited,"T",@name,"|")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat($visited,@name,"|")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- The content of select is the most complicated -->
- <xsl:apply-templates select='../*[
- (local-name(.)="element" and
- not(contains($nvisited,concat("|E",@name,"|")) )
- and not(.//xsd:element[not(contains($nvisited,concat("|T",substring-after(@type,":"),"|")))
- and not (namespace-uri-from-QName(resolve-QName(@type,/xsd:schema)) != /xsd:schema/@targetNamespace)
- and not(
- contains($nvisited,concat("|E",substring-after(@ref,":"),"|"))
- or contains($nvisited,concat("|E",@ref,"|"))
- )
- ]
- )
- and not(.//xsd:group
- [@ref
- and not(
- contains($nvisited,concat("|",substring-after(@ref,":"),"|"))
- or contains($nvisited,concat("|",@ref,"|"))
- )
- ])
- )
- or ( local-name(.)="group" and
- not(contains($nvisited,concat("|",@name,"|")) )
- and not(.//xsd:element
- [not (contains($nvisited,concat("|T",substring-after(@type,":"),"|")))
- and not (namespace-uri-from-QName(resolve-QName(@type,/xsd:schema)) = "&XSD;")
- and not(
- contains($nvisited,concat("|E",substring-after(@ref,":"),"|"))
- or contains($nvisited,concat("|E",@ref,"|"))
- )
- ]
- )
- )
- or (local-name(.)="attribute" and
- not(contains($nvisited,concat("|T",@name,"|")) )) or
- ( (local-name(.)="complexType")
- and not(contains($nvisited,concat("|T",@name,"|")) )
- and not(.//xsd:element
- [not (contains($nvisited,concat("|T",substring-after(@type,":"),"|"))
- )
- and not (namespace-uri-from-QName(resolve-QName(@type,/xsd:schema)) = "&XSD;")
- and not (namespace-uri-from-QName(resolve-QName(@ref,/xsd:schema)) != /xsd:schema/@targetNamespace)
- and not(
- contains($nvisited,concat("|E",substring-after(@ref,":"),"|"))
- or contains($nvisited,concat("|E",@ref,"|"))
- )
- and not(substring-after(@type,":") = ancestor::xsd:complexType/@name)
- ]
- )
- and not(.//xsd:extension
- [not (contains($nvisited,concat("|T",substring-after(@base,":"),"|")))
- ]
- )
- )
- ][1]' mode='make-deps-method-3'>
- <xsl:with-param name='visited' select="concat($nvisited,'')"/>
-</xsl:apply-templates>
-<!--
- or (namespace-uri-from-QName(resolve-QName(.,/xsd:schema)) = "&XSD;")
--->
- <!--
- and not(.//xsd:extension
- [not (contains($nvisited,concat("|T",substring-after(@base,":"),"|")))
- ]
- )
-
-
-
- and not (namespace-uri-from-QName(resolve-QName(.,/xsd:schema)) = "&XSD;")
- -->
- <xsl:if test='local-name(.)="complexType"'>
- <xsl:for-each select='.//xsd:element[not(
- contains($nvisited,concat("|",substring-after(./@type,":"),"|"))
- or (namespace-uri-from-QName(resolve-QName(@type,/xsd:schema)) = "&XSD;")
- )
- ]'>
- <xsl:message terminate='no'><xsl:value-of select='concat("element name=",@name," ",@type," nvisited=",$nvisited)'/></xsl:message>
- </xsl:for-each>
- </xsl:if>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
- :vim:ts=2:sw=2:et:bs=2:
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- version="2.0" >
-
-
- <!--
- ****
- **** mode class
- ****
- -->
-
- <xsl:template match='xsl:element[@name and @type]' mode='class'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:variable name='n' select="./@name"/>
- <xsl:variable name='type'>
- <xsl:apply-templates select='@type' mode='local-name'/>
- </xsl:variable>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'>class <xsl:value-of select='concat(name(.)," @name=",@name)'/></xsl:message>
- </xsl:if>
- <xsl:comment> element name and type Visited = <xsl:value-of select='$Visited '/></xsl:comment>
- <xsl:text> &INDENT;</xsl:text>
- <xsl:element name='class'>
- <xsl:attribute name='type' select='local-name(.)'/>
- <xsl:attribute name='name' select='$n'></xsl:attribute>
- <xsl:apply-templates select="." mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,@name,"|")'/>
- </xsl:apply-templates>
- </xsl:element>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:element[@name and not(@type)]' mode='class'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'>class <xsl:value-of select='concat(name(.)," @name=",@name)'/></xsl:message>
- </xsl:if>
- <!--
- <xsl:message terminate='no'>Process element: <xsl:value-of
- select='@name'/></xsl:message>
- -->
- <xsl:comment> element <xsl:value-of select='concat(@name," no type v=",$Visited)'/></xsl:comment>
- <xsl:text> &INDENT;</xsl:text>
- <!--
- <xsl:element name='br'/>
- -->
- <xsl:element name='class'>
- <xsl:attribute name='type' select='local-name(.)'/>
- <xsl:attribute name='name' select='@name'>
- </xsl:attribute>
- <xsl:apply-templates select="xsd:simpleType|xsd:complexType"
- mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,@name,"|")'/>
- </xsl:apply-templates>
- <xsl:text> &INDENT;</xsl:text>
- <xsl:comment> apply simple(complex)Types ... <xsl:value-of select='concat("",@name)'/></xsl:comment>
- <xsl:text> &INDENT;</xsl:text>
- </xsl:element>
- <!--
- <xsl:apply-templates select="xsd:simpleType|xsd:complexType"
- mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,@name,"|")'/>
- </xsl:apply-templates>
- -->
- <xsl:variable name='on'>
- <xsl:apply-templates select="xsd:simpleType|xsd:complexType"
- mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,@name,"|")'/>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:apply-templates select='$on' mode='doon'>
- <xsl:with-param name='root' select='/xsd:schema'/>
- <xsl:with-param name='Visited' select='concat($Visited,@name,"|")'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[@ref and (position() = 1)]' mode='class'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:variable name='ref'>
- <xsl:apply-templates select='@ref' mode='local-name'/>
- </xsl:variable>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'>class <xsl:value-of select='concat(name(.)," @ref=",@ref)'/></xsl:message>
- </xsl:if>
- <xsl:comment> element <xsl:value-of select='concat(" @ref=",@ref," v=",$Visited)'/></xsl:comment>
- <xsl:text> &INDENT;</xsl:text>
- <xsl:element name='class'>
- <xsl:attribute name='type' select='local-name(.)'/>
- <xsl:attribute name='name' select='@ref'>
- </xsl:attribute>
- <xsl:attribute name='visited' select='$Visited'>
- </xsl:attribute>
- <xsl:apply-templates select='/xsd:schema/xsd:element[@name=$ref ]'
- mode='on'>
- <xsl:with-param name='Visited' select='concat("","")'/>
- </xsl:apply-templates>
- </xsl:element>
- <xsl:variable name="lv">
- <xsl:apply-templates select='.[not(contains($Visited,concat("|",@ref,"|")))
- and string-length($Visited) <256]' mode='deep'>
- <xsl:with-param name='Visited' select='$Visited'>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:apply-templates select='following-sibling::xsd:element[ position() = 1 ]'
- mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,$ref,"|",$lv)'/>
- </xsl:apply-templates>
-
- <!--
- <xsl:apply-templates select='/xsd:schema/xsd:element[@name=$ref and
- not(contains($Visited,concat("|",@name,"|")))]'
- mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- </xsl:apply-templates>
- -->
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:simpleType[not(@name)]' mode='class'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'>class <xsl:value-of select='concat(name(.)," ")'/></xsl:message>
- </xsl:if>
- <xsl:apply-templates select='xsd:restriction[not(contains($Visited,concat("|",@base,"|")))]' mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexType[not(@name)]' mode='class'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'>class <xsl:value-of select='concat(name(.)," ")'/></xsl:message>
- </xsl:if>
- <xsl:apply-templates select='xsd:simpleContent|xsd:complexContent' mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- </xsl:apply-templates>
- <xsl:apply-templates select='xsd:attribute' mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:simpleContent' mode='class'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:apply-templates select='xsd:restriction[not(contains($Visited,concat("|",@base,"|")))]' mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- </xsl:apply-templates>
- <xsl:apply-templates select='xsd:extension[not(contains($Visited,concat("|",@base,"|")))]' mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexContent' mode='class'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:choose>
- <xsl:when test='1'>
- <xsl:apply-templates select='xsd:restriction' mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- </xsl:apply-templates>
- <xsl:apply-templates select='xsd:extension' mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select='xsd:restriction[not(contains($Visited,concat("|",@base,"|")))]' mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- </xsl:apply-templates>
- <xsl:apply-templates select='xsd:extension[not(contains($Visited,concat("|",@base,"|")))]' mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:choice|xsd:sequence|xsl:all' mode='class'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'>class <xsl:value-of select='concat(name(.)," ")'/></xsl:message>
- </xsl:if>
- <xsl:for-each select='xsd:element[@ref]'>
- <xsl:variable name='lv'>
- <!-- <xsl:text>|</xsl:text>
- <xsl:for-each select='preceding-sibling::xsd:element[position()=1]'>
- <xsl:value-of select='concat(@ref,"|")'/>
- <xsl:apply-templates select='.[not(contains($Visited,concat("|",@ref,"|")))
- and string-length($Visited) <256]' mode='deep'>
- <xsl:with-param name='Visited' select='$Visited'>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:for-each>
- -->
- </xsl:variable>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'>class <xsl:value-of select='concat(./@ref," lv=",$lv)'/></xsl:message>
- </xsl:if>
- <xsl:apply-templates select='.[@ref and not(contains(concat($Visited,$lv),concat("|",@ref,"|"))
- )]' mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,$lv,"")'/>
- </xsl:apply-templates>
- <xsl:apply-templates select='.[@ref and not(contains($Visited,concat("|",substring-after(@ref,":"),"|")))]' mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,$lv,"")'/>
- </xsl:apply-templates>
- </xsl:for-each>
- <!-- groupe -->
- <xsl:apply-templates select='xsd:group[@ref and not(contains(concat($Visited,""),concat("|",@ref,"|"))
- )]' mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- </xsl:apply-templates>
- <!-- -->
- <xsl:apply-templates select='xsd:choice|xsd:sequence' mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:simpleType[@name]' mode='class'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'> <xsl:value-of select='concat("class ",name(.)," @name=",@name)'/></xsl:message>
- </xsl:if>
- <xsl:element name='class'>
- <xsl:attribute name='type' select='local-name(.)'/>
- <xsl:attribute name='name' select='@name'>
- </xsl:attribute>
- <xsl:apply-templates select="./xsd:restriction" mode="on">
- <xsl:with-param name='Visited' select='concat($Visited,@name,"|")'/>
- </xsl:apply-templates>
- </xsl:element>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexType[@name]' mode='class'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'> <xsl:value-of select='concat("class ",name(.)," @name=",@name)'/></xsl:message>
- </xsl:if>
- <xsl:element name='class'>
- <xsl:attribute name='type' select='local-name(.)'/>
- <xsl:attribute name='name' select='@name'>
- </xsl:attribute>
- <xsl:apply-templates select="."
- mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,@name,"|")'/>
- </xsl:apply-templates>
- </xsl:element>
-
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:extension|xsd:restriction' mode='class'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:variable name='base'>
- <xsl:apply-templates select='@base' mode='local-name'/>
- </xsl:variable>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'>class <xsl:value-of select='concat(name(.)," @base=",@base)'/></xsl:message>
- </xsl:if>
- <xsl:apply-templates select="xsd:sequence|xsd:choice|xsd:all"
- mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,$base,"|")'/>
- </xsl:apply-templates>
- <xsl:if test='not(contains($Visited,concat("|",$base,"|")))'>
- <xsl:apply-templates select='/xsd:schema/xsd:complexType[@name=$base]' mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,$base,"|")'/>
- </xsl:apply-templates>
- </xsl:if>
- <!--
- <xsl:if test='not(contains($Visited,concat("|",$base,"|")))'>
- <xsl:apply-templates select='/xsd:schema/xsd:complexType[@name=$base]' mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,$base,"|")'/>
- </xsl:apply-templates>
- </xsl:if>
- <xsl:apply-templates select="xsd:group[@ref and not(contains($Visited,concat('|',@ref,'|')))]"
- mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,@base,"|")'/>
- </xsl:apply-templates>
- -->
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:group[@name]' mode='class'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'>class <xsl:value-of select='concat(name(.)," ",@name," ",$Visited)'/></xsl:message>
- </xsl:if>
- <xsl:element name='class'>
- <xsl:attribute name='type' select='local-name(.)'/>
- <xsl:attribute name='name' select='@name'>
- </xsl:attribute>
- <xsl:attribute name='visited' select='$Visited'/>
- <xsl:apply-templates select="xsd:sequence|xsd:choice|xsd:all"
- mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,@name,"|")'/>
- </xsl:apply-templates>
- </xsl:element>
-
- <xsl:variable name='on'>
- <xsl:element name='ons'>
- <xsl:apply-templates select="xsd:sequence|xsd:choice|xsd:all"
- mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,@name,"|")'/>
- </xsl:apply-templates>
- </xsl:element>
- </xsl:variable>
- <xsl:apply-templates select='$on/ons/on[not(contains($Visited,concat("|",@ref,"|")))]' mode='doon'>
- <xsl:with-param name='root' select='/xsd:schema'/>
- <xsl:with-param name='Visited' select='$Visited'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:group[@ref]' mode='class'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:variable name='ref'>
- <xsl:apply-templates select='@ref' mode='local-name'/>
- </xsl:variable>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'>class <xsl:value-of select='concat(name(.)," @ref=",@ref)'/></xsl:message>
- </xsl:if>
- <xsl:if test='not(contains($Visited,concat("|",$ref,"|")))'>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'> PROCESS GROUP (<xsl:value-of select='..'/>) REF <xsl:value-of select='concat(@ref," ",$Visited)'/></xsl:message>
- </xsl:if>
- <xsl:apply-templates select='.' mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attribute[@ref]' mode='class'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'>class <xsl:value-of select='concat(name(.)," @ref=",@ref)'/></xsl:message>
- </xsl:if>
- <xsl:apply-templates select='.' mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attribute[@name and not(@type)]' mode='class'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'>class <xsl:value-of select='concat(name(.)," @name=",@name)'/></xsl:message>
- </xsl:if>
- <xsl:apply-templates select='simpleType' mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attribute[@name and @type]' mode='class'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'>class <xsl:value-of select='concat(name(.)," @name=",@name)'/></xsl:message>
- </xsl:if>
- <xsl:variable name='type'>
- <xsl:apply-templates select='@type' mode='local-name'/>
- </xsl:variable>
- <xsl:apply-templates select='/xsd:schema/xsd:simpleType[(@name=$type) and not(contains($Visited,concat("|",@name,"|")))]' mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,$type,"|")'/>
- </xsl:apply-templates>
- </xsl:template>
-
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
- :vim:ts=2:sw=2:et:bs=2:
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- version="2.0"
->
-
- <!-- -->
- <xsl:template match='xsd:element[@name and @type]' mode='deep'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:param name='root' select='""'/>
- <xsl:param name='with-sibling' select='"yes"'/>
- <xsl:variable name='type'>
- <xsl:apply-templates select='@type' mode='local-name'/>
- </xsl:variable>
- <!--
- <xsl:value-of select='concat(@name,"|")'/>
- -->
- <xsl:choose>
- <xsl:when test='$root!=""'>
- <xsl:variable name='lv'>
- <xsl:apply-templates select='$root/*[@name=$type and
- not(contains($Visited,concat("|",@name,"|")))]' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,@name,"|")'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
- </xsl:variable>
- <!-- Need your friends if not root element -->
- <xsl:value-of select='concat($lv,@name,"|")'/>
- <xsl:if test='$with-sibling="yes" and local-name(..) !="schema"'>
- <xsl:apply-templates
- select='following-sibling::*[local-name(.) = "choice"
- or (local-name(.) = "element" and ./@name and not(@type))
- or (local-name(.) = "element" and ./@name and @type
- and not(
- contains($Visited,concat("|",@type,"|"))
- or contains($Visited,concat("|",substring-after(@type,":"),"|"))
- ) )
- or (local-name(.) = "element" and ./@ref and not(
- contains($Visited,concat("|",@ref,"|"))
- or contains($Visited,concat("|",substring-after(@ref,":"),"|"))
- ) )
- or (local-name(.) = "attribute" and ./@name and @type
- and not(
- contains($Visited,concat("|",@type,"|"))
- or contains($Visited,concat("|",substring-after(@type,":"),"|"))
- ) )
- or (local-name(.) = "group" and ./@ref and not(
- contains($Visited,concat("|",@ref,"|"))
- or contains($Visited,concat("|",substring-after(@ref,":"),"|"))
- ) )
- or local-name(.)= "all"
- or local-name(.)="sequence"][1]' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,"",$lv)'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select='/xsd:schema/xsd:simpleType[@name=$type and
- not(contains($Visited,concat("|",@name,"|")))]' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,@name,"|")'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
-
- <xsl:apply-templates select='/xsd:schema/xsd:complexType[@name=$type and
- not(contains($Visited,concat("|",@name,"|")))]' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,@name,"|")'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
- <!-- Need your friends if not root element -->
- <xsl:if test='$with-sibling="yes"'>
- <xsl:apply-templates
- select='following-sibling::*[local-name(.) = "choice"
- or (local-name(.) = "element" and ./@name and
- not(contains($Visited,concat("|",./@name,"|"))) )
- or local-name(.)= "all"
- or local-name(.)="sequence"][1]' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[@name and not(@type)]' mode='deep'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:param name='root' select='""'/>
- <xsl:if test='local-name(..) ="schema"'>
- <xsl:variable name='lv'>
- <xsl:apply-templates select='xsd:simpleType|xsd:complexType' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,@name,"|")'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
- </xsl:variable>
-
- <xsl:value-of select='concat(@name,"|",$lv,"")'/>
- </xsl:if>
-
- <xsl:if test='local-name(..)!="schema"'>
- <xsl:variable name='lv'>
- <xsl:apply-templates select='xsd:simpleType|xsd:complexType' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,@name,"|")'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
- </xsl:variable>
-
- <xsl:value-of select='concat($lv,"")'/>
- <xsl:apply-templates select='following-sibling::*[
- (local-name(.)="element" and @name and @type and not(
- contains($Visited,concat("|",@type,"|"))
- or contains($Visited,concat("|",substring-after(@type,":"),"|"))
- ))
- or (local-name(.)="element" and @name and not(@type)
- )
- or (local-name(.)="element" and @ref and not(
- contains($Visited,concat("|",@ref,"|"))
- or contains($Visited,concat("|",substring-after(@ref,":"),"|"))
- ))
- or (local-name(.)="group" and @ref and not(
- contains($Visited,concat("|",@ref,"|"))
- or contains($Visited,concat("|",substring-after(@ref,":"),"|"))
- ))
- or local-name(.)="choice"
- or local-name(.)="sequence"
- or local-name(.)="attribute"
- or local-name(.)="attributeGroup"
- ][1]' mode='deep'>
- <xsl:with-param name='Visited' select='concat($lv,"|",$Visited,"|")'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[@ref]' mode='deep'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:param name='root' select='""'/>
- <xsl:param name='with-sibling' select='"yes"'/>
- <xsl:variable name='type'>
- <xsl:apply-templates select='@ref' mode='local-name'/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='$root=""'>
- <xsl:apply-templates select='/xsd:schema/xsd:element[@name=$type and
- not(contains($Visited,concat("|",@name,"|")))]' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,$type,"|")'/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name='lv'>
- <xsl:apply-templates select='$root/xsd:element[
- (@name=$type and not(@type) and not(contains($Visited,concat("|",@name,"|"))))
- or (@name=$type and @type and not(contains($Visited,concat("|",@type,"|")) or
- contains($Visited,concat("|",substring-after(@type,":"),"|") )
- ) )
- ]' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- <xsl:with-param name='root' select='$root'/>
- <xsl:with-param name='with-sibling' select='"no"'/>
- </xsl:apply-templates>
- </xsl:variable>
-
- <xsl:value-of select='concat($lv,"")'/>
- <xsl:if test='$with-sibling="yes"'>
- <xsl:apply-templates select='following-sibling::*[
- (local-name(.)="element" and @name and @type and not(
- contains($Visited,concat("|",@type,"|"))
- or contains($Visited,concat("|",substring-after(@type,":"),"|"))
- ))
- or (local-name(.)="element" and @name and not(@type))
- or (local-name(.)="element" and @ref and not(contains($Visited,concat("|",@ref,"|"))
- or contains($Visited,concat("|",substring-after(@ref,":"),"|"))
- ))
- or (local-name(.)="group" and @ref and not(
- contains($Visited,concat("|",@ref,"|"))
- or contains($Visited,concat("|",substring-after(@ref,":"),"|"))
- ))
- or local-name(.)="choice"
- or local-name(.)="sequence"
- or (local-name(.)="attribute" and @name and @type and not(
- contains($Visited,concat("|",@type,"|"))
- or contains($Visited,concat("|",substring-after(@type,":"),"|"))
- ))
- or local-name(.)="attributeGroup"
- ][1]' mode='deep'>
- <xsl:with-param name='Visited' select='concat($lv,"",$Visited,"|")'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:simpleType[@name]' mode='deep'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:param name='root' select='""'/>
- <xsl:value-of select='concat(@name,"|")'/>
- <xsl:apply-templates
- select='xsd:restriction[not(contains($Visited,concat("|",@base,"|")))]' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,@base,"|")'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexType[@name]' mode='deep'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:param name='root' select='""'/>
- <xsl:value-of select='concat(@name,"|")'/>
- <xsl:apply-templates select='*[ local-name(.) ="simpleContent"
- or local-name(.) ="complexContent"
- or local-name(.) ="choice"
- or local-name(.) ="all"
- or local-name(.) ="sequence"
- or local-name(.) ="attribute"
- or (local-name(.) ="group" and @ref and not(
- contains($Visited,concat("|",@ref,"|"))
- or contains($Visited,concat("|",substring-after(@ref,":"),"|"))
- ) )
- or (local-name(.) ="attributeGroup" and @ref and not(contains($Visited,concat("|",@ref,"|"))) )
- ][1]' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,@name,"|")'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
-
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexType[not(@name)]' mode='deep'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:param name='root' select='""'/>
- <xsl:apply-templates
- select='*[
- local-name(.)="simpleContent"
- or local-name(.)="complexContent"
- or local-name(.)="attribute"
- or local-name(.)="sequence"
- ][1]' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:simpleType[not(@name)]' mode='deep'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:param name='root' select='""'/>
- <xsl:apply-templates
- select='xsd:restriction[not(contains($Visited,concat("|",@base,"|")))]' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:simpleContent' mode='deep'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:param name='root' select='""'/>
- <xsl:apply-templates
- select='xsd:restriction' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexContent' mode='deep'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:param name='root' select='""'/>
- <xsl:apply-templates
- select='xsd:restriction|xsd:extension' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
-
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:restriction|xsd:extension' mode='deep'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:param name='root' select='""'/>
- <xsl:variable name='base'>
- <xsl:apply-templates select='@base' mode='local-name'/>
- </xsl:variable>
- <xsl:variable name='lv'>
- <xsl:if test='not(contains($Visited,concat("|",$base,"|")))'>
- <xsl:value-of select='concat($base,"|")'/>
- <xsl:apply-templates select='$root/*[@name=$base]' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,$base,"|")'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:variable>
- <xsl:value-of select='$lv'/>
- <xsl:apply-templates
- select='./*[local-name(.)="sequence"
- or local-name(.) ="all"
- or local-name(.) ="element"
- or local-name(.) ="attribute"
- or local-name(.) ="attributeGroup"
- or local-name(.)="choice"][1]' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,"$lv")'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:all' mode='deep'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:param name='root' select='""'/>
- <xsl:apply-templates
- select='*[local-name(.) = "choice"
- or (local-name(.) = "element" and ./@name and not(contains($Visited,concat("|",@name,"|"))) )
- or (local-name(.) = "element" and ./@ref and not(contains($Visited,concat("|",@ref,"|")) or
- contains($Visited,concat("|",substring-after(@ref,":"),"|"))
- ) )
- ][1]' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
-
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:sequence|xsd:choice' mode='deep'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:param name='root' select='""'/>
- <xsl:param name='with-sibling' select='"yes"'/>
- <!--
- <xsl:message terminate='no'>DEEP: (<xsl:value-of select='$Visited'/>)</xsl:message>
- -->
- <xsl:choose>
- <xsl:when test='$root!=""'>
- <xsl:variable name='lv'>
- <xsl:apply-templates
- select='*[local-name(.) = "choice"
- or (local-name(.) = "element" and ./@name and @type and not(
- contains($Visited,concat("|",@type,"|"))
- or contains($Visited,concat("|",substring-after(@type,":"),"|"))
- ) )
- or (local-name(.) = "element" and ./@name and not(@type)
- )
- or (local-name(.) = "element" and ./@ref and not(contains($Visited,concat("|",@ref,"|")) or
- contains($Visited,concat("|",substring-after(@ref,":"),"|"))
- ) )
- or (local-name(.) = "group" and ./@ref and not(contains($Visited,concat("|",@ref,"|")) or
- contains($Visited,concat("|",substring-after(@ref,":"),"|"))
- ) )
- or local-name(.)= "all"
- or local-name(.)="sequence"][1]' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- <xsl:with-param name='root' select='$root'/>
- <xsl:with-param name='with-sibling' select='$with-sibling'/>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:if test='string-length($lv)> 1'>
- <xsl:value-of select='$lv'/>
- </xsl:if>
- <!-- and your siblings need to be processed too -->
- <xsl:if test='$with-sibling="yes"'>
- <xsl:apply-templates select='following-sibling::*[
- (local-name(.)="group" and @ref and not(contains($Visited,concat("|",@ref,"|")) or
- contains($Visited,concat("|",substring-after(@ref,":"),"|"))
- ))
- or local-name(.)="sequence"
- or local-name(.)="choice"
- or (local-name(.)="element" and @name and not(@type)
- )
- or (local-name(.)="element" and @name and @type and not(
- contains($Visited,concat("|",@type,"|"))
- or contains($Visited,concat("|",substring-after(@type,":"),"|"))
- ))
- or (local-name(.) = "element" and ./@ref and not(contains($Visited,concat("|",@ref,"|")) or
- contains($Visited,concat("|",substring-after(@ref,":"),"|"))
- ) )
- or (local-name(.) = "group" and ./@ref and not(contains($Visited,concat("|",@ref,"|")) or
- contains($Visited,concat("|",substring-after(@ref,":"),"|"))
- ) )
- or local-name(.)="attribute"
- or (local-name(.)="attributeGroup" and @ref and
- not(contains($Visited,concat("|",@ref,"|"))) )
- ][1]' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,"",$lv)'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:group[@name]' mode='deep'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:param name='root' select='""'/>
- <xsl:param name='with-sibling' select='"yes"'/>
- <xsl:variable name='nl'>
- <xsl:apply-templates select='*[local-name(.)= "sequence"
- or local-name(.) = "choice"
- or local-name(.) = "all"
- ][1]' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,@name,"|")'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:value-of select='concat(@name,"|")'/>
- <xsl:if test='$nl'>
- <xsl:value-of select='concat($nl,"")'/>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:group[@ref]' mode='deep'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:param name='root' select='""'/>
- <xsl:param name='with-sibling' select='"yes"'/>
- <xsl:variable name='type'>
- <xsl:apply-templates select='@ref' mode='local-name'/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='$root!=""'>
- <xsl:variable name='lv'>
- <xsl:apply-templates select='$root/xsd:group[@name=$type]' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,$type,"|")'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:value-of select='concat($type,"|",$lv)'/>
- <xsl:if test='$with-sibling="yes"'>
- <!-- Now see your friends ... -->
- <xsl:apply-templates select='following-sibling::*[
- (local-name(.)="group" and @ref and not(
- contains($Visited,concat("|",@ref,"|"))
- or contains($Visited,concat("|",substring-after(@ref,":"),"|"))
- ))
- or local-name(.)="sequence"
- or local-name(.)="choice"
- or (local-name(.)="element" and @name)
- or (local-name(.)="element" and @ref and not(
- contains($Visited,concat("|",@ref,"|"))
- or contains($Visited,concat("|",substring-after(@ref,":"),"|"))
- ))
- or (local-name(.)="group" and @ref and not(
- contains($Visited,concat("|",@ref,"|"))
- or contains($Visited,concat("|",substring-after(@ref,":"),"|"))
- ))
- or (local-name(.)="attribute" and @name and @type and not(
- contains($Visited,concat("|",@type,"|"))
- or contains($Visited,concat("|",substring-after(@type,":"),"|"))
- ))
- or local-name(.)="attributeGroup"
- ][1]' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,$type,"|",$lv)'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attributeGroup[@name]' mode='deep'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:param name='root' select='""'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attributeGroup[@ref]' mode='deep'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:param name='root' select='""'/>
- <xsl:variable name='type'>
- <xsl:apply-templates select='@ref' mode='local-name'/>
- </xsl:variable>
- <xsl:value-of select='concat($type,"|")'/>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:attribute[@ref]' mode='deep'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:variable name='type'>
- <xsl:apply-templates select='@ref' mode='local-name'/>
- </xsl:variable>
- <xsl:value-of select='concat($type,"|")'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attribute[@name and @type]' mode='deep'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:param name='root' select='""'/>
- <xsl:param name='with-sibling' select='"yes"'/>
- <xsl:variable name='type'>
- <xsl:apply-templates select='@type' mode='local-name'/>
- </xsl:variable>
- <!--
- <xsl:value-of select='concat($type,"|")'/>
- <xsl:value-of select='concat(@name,"|")'/>
- -->
- <xsl:choose>
- <xsl:when test='$root=""'>
- <xsl:apply-templates select='/xsd:schema/xsd:simpleType[@name=$type and
- not(contains($Visited,concat("|",@name,"|")))]' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,@name,"|")'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select='$root/xsd:simpleType[@name=$type and
- not(contains($Visited,concat("|",@name,"|")))]' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
- <!-- Also his brother no ? -->
- <xsl:if test='$with-sibling="yes"'>
- <xsl:apply-templates select='following-sibling::*[
- (local-name(.)="element" and @name and @type and not(
- contains($Visited,concat("|",@type,"|"))
- or contains($Visited,concat("|",substring-after(@type,":"),"|"))
- ))
- or (local-name(.)="element" and @name and not(@type))
- or (local-name(.)="element" and @ref and not(
- contains($Visited,concat("|",@ref,"|"))
- or contains($Visited,concat("|",substring-after(@ref,":"),"|"))
- ))
- or (local-name(.)="attribute" and @name and @type and not(
- contains($Visited,concat("|",@type,"|"))
- or contains($Visited,concat("|",substring-after(@type,":"),"|"))
- ))
- or local-name(.)="sequence"
- or local-name(.)="choice"
- or (local-name(.)="group" and @ref and not(
- contains($Visited,concat("|",@ref,"|"))
- or contains($Visited,concat("|",substring-after(@ref,":"),"|"))
- ))
- ][1]' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,$type,"|")'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attribute[@name and not(@type)]' mode='deep'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:param name='root' select='""'/>
- <xsl:apply-templates select='xsd:simpleType' mode='deep'>
- <xsl:with-param name='Visited' select='concat($Visited,@name,"|")'/>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
- </xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
- :vim:ts=2:sw=2:et:bs=2:
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- version="2.0" >
-
-
- <xsl:template match='on' mode='doon'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:param name='root'/>
- <xsl:variable name='ref' select='@ref'/>
- <xsl:choose>
- <xsl:when test='@type="element"'>
- <xsl:apply-templates select='$root/xsd:element[@name=$ref and not(contains($Visited,concat("|",@name,"|")))]' mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,$ref,"|")'/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='@type="extension" or @type="restriction"'>
- <xsl:apply-templates select='$root/xsd:simpleType[@name=$ref and not(contains($Visited,concat("|",@name,"|")))]' mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,$ref,"|")'/>
- </xsl:apply-templates>
- <xsl:apply-templates select='$root/xsd:complexType[@name=$ref and not(contains($Visited,concat("|",@name,"|")))]' mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,$ref,"|")'/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='@type="simpleType"'>
- </xsl:when>
- <xsl:when test='@type="group"'>
- <xsl:apply-templates select='$root/xsd:group[@name=$ref and not(contains($Visited,concat("|",@name,"|")))]' mode='class'>
- <xsl:with-param name='Visited' select='concat($Visited,@name,$ref,"|")'/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-</xsl:stylesheet>
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
- :vim:ts=2:sw=2:et:bs=2:
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- version="2.0" >
-
- <!--
- ****
- **** mode on
- ****
- -->
- <!-- -->
- <xsl:template match='xsd:element[@ref]' mode='on'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:variable name='ns'><xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select='@ref'/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'>on <xsl:value-of select='concat(name(.)," @ref=",@ref," ",$Visited)'/></xsl:message>
- </xsl:if>
- <xsl:choose>
- <xsl:when test='$ns="&XSD;"'>
- </xsl:when>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace'>
- <xsl:element name='on'>
- <xsl:attribute name='ref'>
- <xsl:apply-templates select='@ref' mode='local-name'/>
- </xsl:attribute>
- <xsl:attribute name='type' select='local-name(.)'/>
- <xsl:value-of select="substring-after(@ref,':')"/>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>Unsuported namespace</xsl:message>
- <xsl:value-of select="$ns"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[@name and @type]' mode='on'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:variable name='ns'><xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select='@type'/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'>on <xsl:value-of select='concat(name(.)," @name=",@name)'/></xsl:message>
- </xsl:if>
- <xsl:choose>
- <xsl:when test='$ns="&XSD;"'>
- </xsl:when>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace'>
- <xsl:element name='on'>
- <xsl:attribute name='ref'>
- <xsl:apply-templates select='@type' mode='local-name'/>
- </xsl:attribute>
- <xsl:value-of select="substring-after(@type,':')"/>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>Unsuported namespace</xsl:message>
- <xsl:value-of select="$ns"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexType[not(@name)]' mode='on'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'>on <xsl:value-of select='concat(name(.)," ")'/></xsl:message>
- </xsl:if>
- <xsl:apply-templates select='xsd:simpleContent|xsd:complexContent' mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,"|")'/>
- </xsl:apply-templates>
- <xsl:apply-templates
- select='xsd:group|xsd:all|xsd:all|xsd:choice|xsd:sequence' mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,"|")'/>
- </xsl:apply-templates>
- <xsl:apply-templates
- select='xsd:attribute' mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,"|")'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:simpleContent' mode='on'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:apply-templates select='xsd:restriction[not(contains($Visited,concat("|",@base,"|")))]' mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- </xsl:apply-templates>
- <xsl:apply-templates select='xsd:extension[not(contains($Visited,concat("|",@base,"|")))]' mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexContent' mode='on'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:apply-templates select='xsd:extension[not(contains($Visited,concat("|",@base,"|")))]' mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- </xsl:apply-templates>
- <xsl:apply-templates select='xsd:restriction[not(contains($Visited,concat("|",@base,"|")))]' mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:choice|xsd:sequence|xsd:all' mode='on'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'>on <xsl:value-of select='concat(name(.)," ")'/></xsl:message>
- </xsl:if>
- <xsl:apply-templates select='xsd:element[@ref and not(contains($Visited,concat("|",@ref,"|")))]' mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- </xsl:apply-templates>
- <xsl:apply-templates select='xsd:choice|xsd:sequence' mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- </xsl:apply-templates>
- <xsl:apply-templates select='xsd:group[@ref and not(contains(@ref,concat("|",@ref,"|")))]' mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- </xsl:apply-templates>
-
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:simpleType[not(@name)]' mode='on'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'>on <xsl:value-of select='concat(name(.)," ")'/></xsl:message>
- </xsl:if>
- <xsl:apply-templates select='xsd:restriction' mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,"")'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:simpleType[@name]' mode='on'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'>on <xsl:value-of select='concat(name(.)," ")'/></xsl:message>
- </xsl:if>
- <xsl:apply-templates select='./xsd:restriction' mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,"|")'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexType[@name]' mode='on'>
- <xsl:param name='Visited' select='"|"'/>
- <!--
- <xsl:apply-templates
- select='.//xsd:element|.//xsd:restriction|.//xsd:extension|.//xsd:attribute' mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,"|")'/>
- </xsl:apply-templates>
- -->
- <xsl:apply-templates
- select='xsd:simpleContent|xsd:complexContent' mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,@name,"|")'/>
- </xsl:apply-templates>
- <xsl:apply-templates
- select='xsd:all|xsd:choice|xsd:sequence' mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,@name,"|")'/>
- </xsl:apply-templates>
- <xsl:apply-templates
- select='xsd:group[@ref and not(contains($Visited,concat("|",@ref,"|")))]' mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,@name,"|")'/>
- </xsl:apply-templates>
- <xsl:apply-templates
- select='./xsd:attribute' mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,@name,"|")'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[@name and not(@type)]' mode='on'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:apply-templates select='xsd:simpleType|xsd:complexType' mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,@name,"|")'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:restriction|xsd:extension' mode='on'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:variable name='ns'>
- <xsl:apply-templates select='@base' mode='namespace-uri-of-qname'>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'>on <xsl:value-of select='concat(name(.)," @base=",@base," ",$Visited)'/></xsl:message>
- </xsl:if>
- <xsl:choose>
- <xsl:when test='$ns="&XSD;"'>
- </xsl:when>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace'>
- <xsl:element name='on'>
- <xsl:attribute name='ref'>
- <xsl:apply-templates select='@base' mode='local-name'/>
- </xsl:attribute>
- <xsl:attribute name='type' select='local-name(.)'/>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='no'>Unsuported namespace</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select='xsd:sequence|xsd:all|xsd:choice|xsd:attribute' mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,@base,"|")'/>
- </xsl:apply-templates>
- <xsl:apply-templates select='xsd:group[@ref and not(contains($Visited,concat("|",@ref,"|")))]' mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,@base,"|")'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:group[@name]' mode='on'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'>on <xsl:value-of select='concat(name(.)," @name=",@name," ",$Visited)'/></xsl:message>
- </xsl:if>
- <xsl:variable name='ns'><xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select='@ref'/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:apply-templates select='xsd:all|xsd:choice|xsd:sequence' mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,@name,"|")'/>
- </xsl:apply-templates>
- </xsl:template>
-
-
- <!-- -->
- <xsl:template match='xsd:group[@ref]' mode='on'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:variable name='ns'><xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select='@ref'/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='name'>
- <xsl:apply-templates select='@ref' mode='local-name'/>
- </xsl:variable>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'>on <xsl:value-of select='concat(name(.)," @ref=",@ref," ",$Visited)'/></xsl:message>
- </xsl:if>
- <xsl:choose>
- <xsl:when test='$ns="&XSD;"'>
- </xsl:when>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace'>
- <xsl:element name='on'>
- <xsl:attribute name='ref'>
- <xsl:apply-templates select='@ref' mode='local-name'/>
- </xsl:attribute>
- <xsl:attribute name='type' select='local-name(.)'/>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:attribute[@name and not(@type)]' mode='on'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:apply-templates select='xsd:simpleType' mode='on'>
- <xsl:with-param name='Visited' select='concat($Visited,@name,"|")'/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:attribute[@name and @type]' mode='on'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:variable name='ns'>
- <xsl:apply-templates select='@type' mode='namespace-uri-of-qname'>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:variable name='type'>
- <xsl:apply-templates select='@type' mode='local-name'/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='$ns="&XSD;"'>
- </xsl:when>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace'>
- <xsl:element name='on'>
- <xsl:attribute name='ref'>
- <xsl:apply-templates select='@type' mode='local-name'/>
- </xsl:attribute>
- <xsl:attribute name='type' select='"simpleType"'/>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>Unsuported namespace <xsl:value-of select='concat("",$ns," ",@type)'/>
- </xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
-
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
- :vim:ts=2:sw=2:et:bs=2:
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- version="2.0" >
-
- <xsl:import href="xsd2cpp-utils.xsl"/>
- <xsl:import href="xsd2cpp-make-deps-class.xsl"/>
- <xsl:import href="xsd2cpp-make-deps-on.xsl"/>
- <xsl:import href="xsd2cpp-make-deps-3.xsl"/>
- <!--
- <xsl:import href="xsd2cpp-make-deps-doon.xsl"/>
- -->
- <xsl:import href="xsd2cpp-make-deps-deep.xsl"/>
-
- <xsl:output method='xml' version="1.0" indent='yes'/>
- <xsl:param name='root-element'>XMI</xsl:param> <!-- What is the doc root -->
- <xsl:param name='debug-comment'>no</xsl:param> <!-- What is the doc root -->
- <xsl:param name='debug-console'>yes</xsl:param> <!-- What is the doc root -->
- <xsl:key name='elementByName' match="xsd:element|xsd:simpleType|xsd:complexType" use="@name"/>
-
-
-
- <xsl:template match='/'>
- <xsl:variable name='method'>3</xsl:variable>
- <!-- before 3 is 2 -->
- <!-- last promising method is 3 -->
- <xsl:choose>
- <xsl:when test='$method=2'>
- <xsl:element name="xsd:schema" namespace="&XSD;">
- <xsl:copy-of select="/xsd:schema/@*"/>
- <xsl:copy-of select="/xsd:schema/namespace::*"/>
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='/xsd:schema'/>
- <xsl:with-param name='working-on' select='/xsd:schema/xsd:element[@name=$root-element]'/>
- </xsl:call-template>
- </xsl:element>
- </xsl:when>
- <xsl:when test='$method=3'>
- <xsl:element name="xsd:schema" namespace="&XSD;">
- <xsl:copy-of select="/xsd:schema/@*"/>
- <xsl:copy-of select="/xsd:schema/namespace::*"/>
- <xsl:apply-templates select='/' mode='make-deps-method-3'>
- <xsl:with-param name='nodes' select='/xsd:schema'/>
- </xsl:apply-templates>
- </xsl:element>
- </xsl:when>
-
- <xsl:when test='0'>
- <xsl:variable name='test'>
- <xsl:element name='depends'>
- <xsl:apply-templates />
- </xsl:element>
- </xsl:variable>
- <xsl:apply-templates select='$test' mode='depends'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name='depends'>
- <xsl:apply-templates />
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- TRY RECURSIVE WAY PROCESSING FOR DEPENDENCIES -->
- <xsl:template name='make-depends'>
- <xsl:param name='nodes'/>
- <xsl:param name='indent' select='""'/>
- <xsl:param name='working-on'/>
- <xsl:param name='visited' select='"|"'/>
- <xsl:param name='depth' select="1"/>
- <xsl:variable name='name' select='$working-on/@name'/>
- <xsl:message terminate='no'><xsl:value-of select='concat($indent,"MkDeps processing ")'/>
- <xsl:value-of select='concat(local-name($working-on),"")'/>
- <xsl:if test='$working-on/@name'><xsl:value-of select='concat(" name=",$working-on/@name)'/></xsl:if>
- <xsl:if test='$working-on/@ref'>
- <xsl:variable name='ref'>
- <xsl:apply-templates select='$working-on/@ref' mode='local-name'/>
- </xsl:variable>
- <xsl:value-of select='concat(" ref=",$working-on/@ref," visited ?=",contains($visited,concat("|",$ref,"|")))'/>
- </xsl:if>
- <xsl:if test='$working-on/@type'>
- <xsl:variable name='ref'>
- <xsl:apply-templates select='$working-on/@type' mode='local-name'/>
- </xsl:variable>
- <xsl:value-of select='concat(" type=",$working-on/@type)'/>
- <xsl:value-of select='concat(" visited ?=",contains($visited,concat("|",$ref,"|"))," visited name=",contains($visited,concat("|",$name,"|")))'/>
- </xsl:if>
- </xsl:message>
-
- <xsl:choose>
- <xsl:when test='local-name($working-on)=""'>
- <xsl:message terminate='no'><xsl:value-of select='concat($indent,"Done")'/></xsl:message>
- </xsl:when>
- <!-- Case simpleType -->
- <xsl:when test='local-name($working-on)="simpleType" and not($working-on/@name)'>
- <xsl:message terminate='no'><xsl:value-of select='concat($indent,"Done TO BE TREATED")'/></xsl:message>
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'/>
- <xsl:with-param name='visited' select='$visited'/>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- <xsl:with-param name='working-on' select='$working-on/*[
- local-name(.)="restriction"
- or local-name(.)="list"
- or local-name(.)="union"
- ]'/>
- </xsl:call-template>
- </xsl:when>
- <!-- Case list -->
- <xsl:when test='local-name($working-on)="list" and not($working-on/@name)'>
- <xsl:variable name='type'>
- <xsl:apply-templates select='$working-on/@itemType' mode='local-name'/>
- </xsl:variable>
- <xsl:message terminate='no'><xsl:value-of select='concat($indent,"Done TO BE TREATED ",$type)'/></xsl:message>
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'/>
- <xsl:with-param name='visited' select='$visited'/>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- <xsl:with-param name='working-on' select='$nodes/xsd:simpleType[@name=$type]'/>
- </xsl:call-template>
- </xsl:when>
- <!-- Case field -->
- <xsl:when test='local-name($working-on)="field" and $working-on/@name'>
- <xsl:variable name='type'>
- <xsl:apply-templates select='$working-on/@type' mode='local-name'/>
- </xsl:variable>
- <xsl:message terminate='no'><xsl:value-of select='concat($indent,"Done TO BE TREATED ",$type)'/></xsl:message>
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'/>
- <xsl:with-param name='visited' select='$visited'/>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- <xsl:with-param name='working-on' select='$nodes/xsd:simpleType[@name=$type]'/>
- </xsl:call-template>
- <!-- following sibling ... -->
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'/>
- <xsl:with-param name='visited' select='concat("|",$type,$visited)'/>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- <xsl:with-param name='working-on' select='$working-on/following-sibling::xsd:field[@type=$type and
- not(contains($visited,concat("|",@type,"|")))][1]'/>
- </xsl:call-template>
- </xsl:when>
- <!-- Case union -->
- <xsl:when test='local-name($working-on)="union" and not($working-on/@name)'>
- <xsl:variable name='types'>
- <xsl:element name='schema' namespace="&XSD;">
- <xsl:copy-of select="namespace::*"/>
- <xsl:attribute name='targetNamespace'><xsl:value-of select="/xsd:schema/@targetNamespace"/></xsl:attribute>
- <xsl:apply-templates select='$working-on' mode='space-string-list'/>
- <!-- ADD simple types
- <xsl:if test='./xsd:simpleType'>
- <xsl:apply-templates select='./xsd:simpleType' mode='space-string-list'/>
- </xsl:if>
- <xsl:if test="@memberTypes">
- <xsl:call-template
- name='space-string-list'>
- <xsl:with-param name='string' select='@memberTypes'/>
- </xsl:call-template>
- </xsl:if>
- -->
- </xsl:element>
- </xsl:variable>
- <xsl:message terminate='no'><xsl:value-of select='concat($indent,"UNION TO BE TREATED")'/></xsl:message>
-
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'/>
- <xsl:with-param name='visited' select='$visited'/>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- <xsl:with-param name='working-on' select='$types/xsd:schema/xsd:field[not(contains($visited,concat("|",@type,"|")))][1]'/>
- </xsl:call-template>
- </xsl:when>
- <!-- Case complexType -->
- <xsl:when test='local-name($working-on)="complexType" and not($working-on/@name)'>
- <xsl:message terminate='no'><xsl:value-of select='concat($indent,"Processing complexType")'/></xsl:message>
- <!--
- <xsl:comment>complexType procssing <xsl:value-of select='$visited'/></xsl:comment>
- <xsl:text> </xsl:text>
- -->
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'/>
- <xsl:with-param name='visited' select='$visited'/>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- <xsl:with-param name='working-on' select='$working-on/*[
- local-name(.) = "complexContent"
- or local-name(.) ="simpleContent"
- or local-name(.) ="sequence"
- or local-name(.) ="choice"
- or (local-name(.) ="group" and @ref and
- not(
- contains($visited,concat("|",@ref,"|"))
- or contains($visited,concat("|",substring-after(@ref,":"),"|"))
- ))
- or local-name(.) ="all"
- or (local-name(.) ="attribute" and @name and @type and not(
- contains($visited,concat("|",@type,"|"))
- or contains($visited,concat("|",substring-after(@type,":"),"|"))
- ) )
- or (local-name(.) ="attributeGroup" and @ref and
- not(
- contains($visited,concat("|",@ref,"|"))
- or contains($visited,concat("|",substring-after(@ref,":"),"|"))
- ))
- ][1]'/>
- </xsl:call-template>
-
- </xsl:when>
- <!-- Case simpleContent -->
- <xsl:when test='local-name($working-on)="simpleContent"'>
- <xsl:message terminate='no'><xsl:value-of select='concat($indent,"Processing simpleContent TO BE DONE")'/></xsl:message>
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'/>
- <xsl:with-param name='visited' select='$visited'/>
- <xsl:with-param name='working-on' select='$working-on/xsd:restriction|$working-on/xsd:extension'/>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
-
- </xsl:when>
- <!-- Case all -->
- <xsl:when test='local-name($working-on)="all"'>
- <xsl:message terminate='no'><xsl:value-of select='concat($indent,"Processing simpleContent TO BE DONE")'/></xsl:message>
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'/>
- <xsl:with-param name='visited' select='$visited'/>
- <xsl:with-param name='working-on' select='$working-on/*[local-name(.) ="element"
- ][1]'/>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
-
- </xsl:when>
- <!-- Case sequence or choice -->
- <xsl:when test='local-name($working-on)="sequence" or local-name($working-on)="choice"'>
- <xsl:message terminate='no'><xsl:value-of select='$indent'/>Processing <xsl:value-of select='concat(local-name($working-on)," ",$visited)'/> </xsl:message>
- <!--
- -->
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'/>
- <xsl:with-param name='visited' select='$visited'/>
- <xsl:with-param name='working-on' select='$working-on/*[
- local-name(.) ="choice"
- or local-name(.) ="sequence"
- or (local-name(.) ="group" and @ref and
- not(
- contains($visited,concat("|",@ref,"|")) or
- contains($visited,concat("|",substring-after(@ref,":"),"|")) )
- )
- or (local-name(.) ="element" and @name and @type and
- not(contains($visited,concat("|",@type,"|")) or
- contains($visited,concat("|",substring-after(@type,":"),"|")) )
- )
- or (local-name(.) ="element" and @name and not(@type)
- )
- or (local-name(.) ="element" and @ref
- )
- ][1]'/>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
- <!-- here I should get the list of element processed -->
- <xsl:variable name='lv'>
- <xsl:apply-templates select='$working-on/*[
- local-name(.) ="choice" or local-name(.) ="sequence"
- or (local-name(.) ="element" and @name and @type and
- not(contains($visited,concat("|",@type,"|")) or
- contains($visited,concat("|",substring-after(@type,":"),"|")) )
- )
- or (local-name(.) ="element" and @name and not(@type)
- )
- or (local-name(.)="group" and @ref and not(
- contains($visited,concat("|",@ref,"|")) or
- contains($visited,concat("|",substring-after(@ref,":"),"|"))
- ))
- or (local-name(.)="element" and @ref and not(
- contains($visited,concat("|",@ref,"|")) or
- contains($visited,concat("|",substring-after(@ref,":"),"|"))
- ))
- ][1]' mode='deep'>
- <xsl:with-param name='Visited' select='""'/>
- <xsl:with-param name='root' select='$nodes'/>
- <xsl:with-param name='with-sibling' select='"yes"'/>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:message terminate='no'><xsl:value-of select='$indent'/>Processing NEXT CHOICE/SEQ <xsl:value-of select='concat(""," lv=",$lv)'/> </xsl:message>
- <!--
- -->
- <!-- next sibling second ... -->
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'/>
- <xsl:with-param name='visited' select='concat($visited,"-CHOICE|",$lv)'/>
- <xsl:with-param name='working-on' select='$working-on/following-sibling::*[
- local-name(.)="sequence"
- or local-name(.)="choice"
- or (local-name(.)="attribute" and @name and @type and
- not(contains($visited,concat("|",@type,"|")) or
- contains($visited,concat("|",substring-after(@type,":"),"|")) )
- )
- or (local-name(.)="element" and @name and @type and
- not(contains($visited,concat("|",@type,"|")) or
- contains($visited,concat("|",substring-after(@type,":"),"|")) )
- )
- or (local-name(.)="element" and @name and not(@type)
- )
- or (local-name(.)="element" and @ref and
- not(contains($visited,concat("|",@ref,"|"))) )
- or (local-name(.)="element" and @name and not(@type)
- )
- or (local-name(.)="group" and @ref and
- not(
- contains($visited,concat("|",@ref,"|"))
- or contains($visited,concat("|",substring-after(@ref,":"),"|"))
- ) )
- or (local-name(.)="attributeGroup" and @ref and
- not(contains($visited,concat("|",@ref,"|"))) )
- ][1]'/>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
- </xsl:when>
- <!-- Case complexContent -->
- <xsl:when test='local-name($working-on)="complexContent"'>
- <!--
- <xsl:message terminate='no'><xsl:value-of select='$indent'/>complexContent procssing 2</xsl:message>
- -->
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'/>
- <xsl:with-param name='visited' select='$visited'/>
- <xsl:with-param name='working-on' select='$working-on/xsd:restriction|$working-on/xsd:extension'/>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
- </xsl:when>
- <!-- Case Restriction -->
- <xsl:when test='local-name($working-on)="restriction"'>
- <xsl:variable name='base'>
- <xsl:apply-templates select='$working-on/@base' mode='local-name'/>
- </xsl:variable>
- <xsl:variable name='ns-type'>
- <xsl:apply-templates select='$working-on/@base'
- mode='namespace-uri-of-qname'/>
- </xsl:variable>
- <xsl:message terminate='no'><xsl:value-of select="$indent"/>Processing restriction 1 <xsl:value-of select="concat('base=',$base,' ',count($nodes/xsd:complexType))"/></xsl:message>
- <xsl:if test='not(contains($visited,concat("|",$base,"|"))) and $ns-type=/xsd:schema/@targetNamespace'>
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'/>
- <xsl:with-param name='visited' select='concat($visited,"")'/>
- <xsl:with-param name='working-on' select='$nodes/xsd:complexType[@name=$base and not(contains($visited,concat("|",@name,"|")))]|
- $nodes/xsd:simpleType[@name=$base and not(contains($visited,concat("|",@name,"|")))]'/>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
- </xsl:if>
- <xsl:message terminate='no'><xsl:value-of select='$indent'/>Processing restriction 2 <xsl:value-of select="concat($working-on/@base,'')"/></xsl:message>
- <!-- second ...
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'/>
- <xsl:with-param name='visited' select='concat("|",$base,$visited)'/>
- <xsl:with-param name='working-on' select='$working-on/*[
- local-name(.)="sequence"
- or local-name(.)="group"
- or local-name(.)="attribute"
- or local-name(.) = "choice"][1]'/>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
- -->
- </xsl:when>
- <!-- Case Extension -->
- <xsl:when test='local-name($working-on)="extension"'>
- <xsl:variable name='base'>
- <xsl:apply-templates select='$working-on/@base' mode='local-name'/>
- </xsl:variable>
- <xsl:message terminate='no'><xsl:value-of select="$indent"/>Processing extension 1 <xsl:value-of select="concat('base=',$base,' ',count($nodes/xsd:complexType))"/></xsl:message>
- <xsl:if test='not(contains($visited,concat("|",$base,"|")))'>
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'/>
- <xsl:with-param name='visited' select='concat($visited,"")'/>
- <xsl:with-param name='working-on' select='$nodes/xsd:complexType[@name=$base and not(contains($visited,concat("|",@name,"|")))]'/>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
- </xsl:if>
- <xsl:message terminate='no'><xsl:value-of select='$indent'/>Processing extension 2 <xsl:value-of select="concat($working-on/@base,'')"/></xsl:message>
- <!-- second ... -->
- <xsl:variable name='lv'>
- <xsl:apply-templates
- select='$nodes/xsd:complexType[@name=$base and
- not(contains($visited,concat("|",@name,"|")))]'
- mode='deep'>
- <xsl:with-param name='Visited' select='""'/>
- <xsl:with-param name='root' select='$nodes'/>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'/>
- <xsl:with-param name='visited' select='concat("|",$base,$visited,"-EXTENSION ",$base," -|",$lv)'/>
- <xsl:with-param name='working-on' select='$working-on/*[
- local-name(.)="sequence"
- or local-name(.) = "choice"
- or (local-name(.)="group" and @ref and not(
- contains(concat($visited,$lv),concat("|",@ref,"|"))
- or contains(concat($visited,$lv),concat("|",substring-after(@ref,":"),"|"))
- ))
- or (local-name(.)="attribute" and @name and @type and not(
- contains(concat($visited,$lv),concat("|",@type,"|"))
- or contains(concat($visited,$lv),concat("|",substring-after(@type,":"),"|"))
- ))
- or (local-name(.)="attribute" and @name and not(@type) and not(
- contains(concat($visited,$lv),concat("|",@name,"|"))
- ))
- or (local-name(.)="attributeGroup" and @ref and
- not(contains($visited,concat("|",@ref,"|")))
- )
- ][1]'/>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
- </xsl:when>
- <!-- Case group reference -->
- <xsl:when test='local-name($working-on)="group" and $working-on/@ref'>
- <xsl:variable name='ref' >
- <xsl:apply-templates select='$working-on/@ref'
- mode='local-name'/>
- </xsl:variable>
- <xsl:message terminate='no'><xsl:value-of select='$indent'/>Processing group <xsl:value-of select='concat("ref=",$ref," visited ?=",contains($visited,concat("|",$ref,"|")))'/> </xsl:message>
- <xsl:if test='not(contains($visited,concat("|",$ref,"|")))'>
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'/>
- <xsl:with-param name='visited' select='concat("",$visited)'/>
- <xsl:with-param name='working-on' select='$nodes/*[@name=$ref and not(contains($visited,concat("|",@name,"|")))]'/>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
- </xsl:if>
- <!-- here I should get the list of element processed -->
- <xsl:variable name='lv'>
- <xsl:if test='not(contains($visited,concat("|",$ref,"|")))'>
- <xsl:apply-templates select='$nodes/*[@name=$ref and
- not(contains($visited,concat("|",@name,"|")))]' mode='deep'>
- <xsl:with-param name='Visited' select='""'/>
- <xsl:with-param name='root' select='$nodes'/>
- <xsl:with-param name='with-sibling' select='"no"'/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:variable>
- <!--
- <xsl:message terminate='yes'><xsl:value-of select='$indent'/>Processing group <xsl:value-of select='concat("ref=",$ref," v=",$lv)'/> </xsl:message>
- -->
- <!-- next sibling second ... -->
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'/>
- <xsl:with-param name='visited' select='concat("|",$ref,$visited,"-GROUP ",$ref," -|",$lv)'/>
- <xsl:with-param name='working-on' select='$working-on/following-sibling::*[
- local-name(.)="choice"
- or local-name(.)="sequence"
- or (local-name(.)="element" and @name and not(@type) )
- or (local-name(.)="element" and @name and @type and not(
- contains($visited,concat("|",@type,"|")) or
- contains($visited,concat("|",substring-after(@type,":"),"|"))
- ))
- or (local-name(.)="attribute" and @name and @type and not(
- contains($visited,concat("|",@type,"|")) or
- contains($visited,concat("|",substring-after(@type,":"),"|"))
- ))
- or (local-name(.)="element" and @ref and not(
- contains($visited,concat("|",@ref,"|")) or
- contains($visited,concat("|",substring-after(@ref,":"),"|"))
- ))
- or (local-name(.)="group" and @ref and not(
- contains($visited,concat("|",@ref,"|")) or
- contains($visited,concat("|",substring-after(@ref,":"),"|"))
- ))
- or (local-name(.)="attributeGroup" and @ref and not(
- contains($visited,concat("|",@ref,"|")) or
- contains($visited,concat("|",substring-after(@ref,":"),"|"))
- ))
- ][1]'/>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
- </xsl:when>
- <!-- Case attributeGroup reference -->
- <xsl:when test='local-name($working-on)="attributeGroup" and $working-on/@ref'>
- <xsl:variable name='ref' >
- <xsl:apply-templates select='$working-on/@ref' mode='local-name'/>
- </xsl:variable>
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'/>
- <xsl:with-param name='visited' select='concat("",$visited)'/>
- <xsl:with-param name='working-on' select='$nodes/*[@name=$ref and not(contains($visited,concat("|",@name,"|")))]'/>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
-
- </xsl:when>
- <!-- Case element reference -->
- <xsl:when test='local-name($working-on)="element" and $working-on/@ref'>
- <xsl:variable name='ref' >
- <xsl:apply-templates select='$working-on/@ref'
- mode='local-name'/>
- </xsl:variable>
- <!--
- <xsl:message terminate='no'><xsl:value-of select='$indent'/>Processing Element <xsl:value-of select='concat("ref=",$ref)'/> </xsl:message>
- -->
- <!-- here I should get the list of element processed
- <xsl:variable name='lpv'>
- <xsl:apply-templates
- select='$working-on/preceding-sibling::xsd:element' mode='deep'>
- <xsl:with-param name='Visited' select='$visited'/>
- <xsl:with-param name='root' select='$nodes'/>
- </xsl:apply-templates>
- </xsl:variable>
- -->
- <xsl:if test='not(contains($visited,concat("|",$ref,"|")))'>
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'/>
- <xsl:with-param name='visited' select='concat("",$visited)'/>
- <xsl:with-param name='working-on' select='$nodes/*[@name=$ref and not(contains($visited,concat("|",@name,"|")))]'/>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
- </xsl:if>
- <!-- here I should get the list of element processed -->
- <xsl:variable name='lv'>
- <xsl:if test='not(contains($visited,concat("|",$ref,"|")))'>
- <xsl:apply-templates select='$nodes/xsd:element[@name=$ref and not(contains($visited,concat("|",@name,"|")))]' mode='deep'>
- <xsl:with-param name='Visited' select='""'/>
- <xsl:with-param name='root' select='$nodes'/>
- <xsl:with-param name='with-sibling' select='"no"'/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:variable>
- <!--
- <xsl:message terminate='yes'><xsl:value-of select='$indent'/>Processing Element <xsl:value-of select='concat("ref=",$ref,$working-on/following-sibling/xsd:element[position()=1]," ",$lv' /> </xsl:message>
- -->
- <!-- next sibling second ... -->
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'/>
- <xsl:with-param name='visited' select='concat("|",$ref,$visited,"ELREF ", $ref," -|",$lv)'/>
- <xsl:with-param name='working-on' select='$working-on/following-sibling::*[
- local-name(.)="choice"
- or local-name(.)="sequence"
- or local-name(.)="all"
- or (local-name(.)= "element" and @ref and not(
- contains($visited,concat("|",@ref,"|"))
- or contains($visited,concat("|",substring-after(@ref,":"),"|"))
- ) )
- or (local-name(.)= "element" and @name and @type and not(
- contains($visited,concat("|",@type,"|"))
- or contains($visited,concat("|",substring-after(@type,":"),"|"))
- ) )
- or (local-name(.)= "element" and @name and not(@type) )
- or (local-name(.)="attribute" and @name and @type and not(
- contains($visited,concat("|",@type,"|"))
- or contains($visited,concat("|",substring-after(@type,":"),"|"))
- ))
- or (local-name(.)="group" and @ref and not(
- contains($visited,concat("|",@ref,"|"))
- or contains($visited,concat("|",substring-after(@ref,":"),"|"))
- ))
- or (local-name(.)="attributeGroup" and @ref and not(
- contains($visited,concat("|",@ref,"|"))
- or contains($visited,concat("|",substring-after(@ref,":"),"|"))
- ))
- ][1]'/>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
- </xsl:when>
- <!-- Case element simpleType or complexType with name witout type not visited -->
- <xsl:when test='$working-on/@name and not(contains($visited,concat("|",$working-on/@name,"|")))'>
- <xsl:variable name='name' select='$working-on/@name'/>
- <xsl:message terminate='no'><xsl:value-of select="$indent"/>NAMED NOT CONTAINED ELEMENT <xsl:value-of select="concat(local-name($working-on),' name=',$name,' with-type=')"/><xsl:value-of select='$working-on/@type'/></xsl:message>
- <xsl:choose>
- <xsl:when test='$working-on/@type'>
- <xsl:variable name='type'>
- <xsl:apply-templates select='$working-on/@type'
- mode='local-name'/>
- </xsl:variable>
- <xsl:message terminate='no'>OK HERE visited=<xsl:value-of
- select='$visited'/></xsl:message>
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'> </xsl:with-param>
- <xsl:with-param name='visited' select='concat("",$visited)'/>
- <xsl:with-param name='working-on'
- select='$nodes/*[
- @name=$type and (local-name(.)="simpleType" or local-name(.)="complexType") and not(contains($visited,concat("|",@name,"|")))]'>
- </xsl:with-param>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
- <!-- I need to process your friends if not under root -->
- <xsl:if test='local-name($working-on/..)!="schema" and
- ( $working-on/following-sibling::*[
- (local-name(.) ="element" )
- or local-name(.) ="sequence"
- or (local-name(.) ="group" and @ref and not(
- contains($visited,concat("|",@ref,"|"))
- or contains($visited,concat("|",substring-after(@ref,":"),"|"))
- ))
- or local-name(.) ="choice"
- or (local-name(.) ="attribute" and @name and @type and not(
- contains($visited,concat("|",@type,"|"))
- or contains($visited,concat("|",substring-after(@type,":"),"|"))
- ))
- or (local-name(.) ="attributeGroup" )
- ][1]
- )'>
- <!-- -->
- <xsl:variable name='lv'>
- <xsl:apply-templates select='$nodes/*[@name=$type]' mode='deep'>
- <xsl:with-param name='Visited' select='$visited'/>
- <xsl:with-param name='root' select='$nodes'/>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:message terminate='no'><xsl:value-of select='concat($indent,"Processing NEXT Element ",$name," @type=",$type," lv=",$lv)'/></xsl:message>
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'>
- </xsl:with-param>
- <xsl:with-param name='visited' select='concat("|",$type,$visited,"",$lv)'/>
- <xsl:with-param name='working-on'
- select='$working-on/following-sibling::*[
- (local-name(.) ="element" and @name and @type and not(
- contains(concat($visited,$lv),concat("|",@type,"|"))
- or contains(concat($visited,$lv),concat("|",substring-after(@type,":"),"|"))
- ))
- or (local-name(.) ="element" and @ref and not(
- contains(concat($visited,$lv),concat("|",@ref,"|"))
- or contains(concat($visited,$lv),concat("|",substring-after(@ref,":"),"|"))
- ))
- or (local-name(.) ="element" and not(@type)
- )
- or local-name(.) = "sequence"
- or local-name(.) ="choice"
- or (local-name(.) = "group" and @ref and
- not( contains($visited,concat("|",@ref,"|"))
- or contains($visited,concat("|",substring-after(@ref,":"),"|"))
- ))
- or (local-name(.) = "attribute" and @name and @type and not(
- contains(concat($visited,$lv),concat("|",@type,"|"))
- or contains(concat($type,"|",$visited,$lv),concat("|",substring-after(@type,":"),"|"))
- )
- )
- or (local-name(.) = "attributeGroup" and @ref and
- not(contains($visited,concat("|",@ref,"|")) or
- contains($visited,concat("|",substring-after(@ref,":"),"|"))
- ) )
- ][1]'>
- </xsl:with-param>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
-
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'> </xsl:with-param>
- <xsl:with-param name='visited' select='concat("|",$name,$visited)'/>
- <xsl:with-param name='working-on'
- select='$working-on/*[local-name(.)="simpleContent"
- or local-name(.)="simpleType" or local-name(.)="complexType"
- or local-name(.)="restriction"
- or local-name(.)="sequence" or local-name(.)="choice"
- or local-name(.)="all"
- or local-name(.)="attributeGroup"
- or (local-name(.)="attribute" and @name and @type and not(
- contains($visited,concat("|",@type,"|"))
- or contains($visited,concat("|",substring-after(@type,":"),"|"))
- ))
- or local-name(.)="list"
- or local-name(.)="union"
- or local-name(.)="complexContent"][1]'>
- </xsl:with-param>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
- <!-- DO NEXT -->
- <xsl:if test='local-name($working-on/..)!="schema" and
- $working-on/following-sibling::*[
- local-name(.) ="element"
- or local-name(.) ="sequence" or local-name(.) ="choice"
- or local-name(.) ="group"
- or local-name(.) ="attribute"
- or local-name(.) ="attributeGroup"
- ][1]'>
- <xsl:variable name='lv'>
- <xsl:apply-templates select='$working-on/*[local-name(.)="simpleContent"
- or local-name(.)="simpleType" or local-name(.)="complexType"
- or local-name(.)="sequence"
- or (local-name(.)="attribute" and @name and @type and not(
- contains($visited,concat("|",@type,"|"))
- or contains($visited,concat("|",substring-after(@type,":"),"|"))
- ))
- or local-name(.)="choice"
- or local-name(.)="group"
- ][1]' mode='deep'>
- <xsl:with-param name='Visited' select='$visited'/>
- <xsl:with-param name='root' select='$nodes'/>
- <xsl:with-param name='with-sibling' select='"no"'/>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:message terminate='no'>
- <xsl:value-of select='concat($indent,"DO NEXT of: ",local-name($working-on)," ",$working-on/@name)'/></xsl:message>
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'>
- </xsl:with-param>
- <xsl:with-param name='visited' select='concat("",$visited,"",$lv)'/>
- <xsl:with-param name='working-on' select='$working-on/following-sibling::*[
- local-name(.) = "sequence"
- or ( local-name(.) ="element" and @ref and not(
- contains($visited,concat("|",@ref,"|"))
- ))
- or ( local-name(.) ="element" and @name and not(@type
- ))
- or ( local-name(.) ="element" and @name and @type and not(
- contains($visited,concat("|",@type,"|"))
- or contains($visited,concat("|",substring-after(@type,":"),"|"))
- ))
- or (local-name(.) = "group" and @ref and
- not(
- contains($visited,concat("|",@ref,"|"))
- or contains($visited,concat("|",substring-after(@ref,":"),"|"))
- ))
- or (local-name(.) = "attribute" and @name and @type and
- not(contains($visited,concat("|",substring-after(@typen,":"),"|")))
- )
- or (local-name(.) = "attributeGroup" and @ref and
- not(contains($visited,concat("|",@ref,"|")) or
- contains($visited,concat("|",substring-after(@ref,":"),"|"))
- ) )
- or local-name(.) ="choice" ][1]'>
- </xsl:with-param>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
- </xsl:if>
-
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test='local-name($working-on/..)="schema" and not(contains($visited,concat("|",$name,"|")))'>
- <xsl:message terminate='no'><xsl:value-of select='concat("Copying: ",$name)'/></xsl:message>
- <!---
- <xsl:comment> <xsl:value-of select='concat("visited before printing=",$visited)'/></xsl:comment>
- <xsl:text> &INDENT;</xsl:text>
- -->
- <xsl:copy-of select='$working-on'/>
- </xsl:if>
- </xsl:when>
-
- <!-- Case element witout type in current -->
- <xsl:when test='not($working-on/@type) and local-name($working-on)="element" and starts-with($visited,concat("|",$working-on/@name,"|"))'>
- <xsl:variable name='name' select='$working-on/@name'/>
- <xsl:message terminate='no'><xsl:value-of select='concat($indent,"Processing Element ",$name," no Type ")'/></xsl:message>
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'/>
- <xsl:with-param name='visited' select='concat("|",$name,$visited)'/>
- <xsl:with-param name='working-on' select='$working-on/simpleType|$working-on/xsd:complexType'>
- </xsl:with-param>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
- <xsl:if test='local-name($working-on/..)!="schema"'>
- <xsl:message terminate='yes'><xsl:value-of select='concat("CONTINUE HERE ? ",$working-on/@name)'/></xsl:message>
- </xsl:if>
- </xsl:when>
- <!-- Case complexType with name-->
- <xsl:when test='local-name($working-on)="complexType" and starts-with($visited,concat("|",$working-on/@name,"|"))'>
- <xsl:variable name='name' select='$working-on/@name'/>
- <!-- -->
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'>
- </xsl:with-param>
- <xsl:with-param name='visited' select='concat("",$visited)'/>
- <xsl:with-param name='working-on' select='$working-on/*[local-name(.)="sequence"
- or local-name(.)="all"
- or local-name(.)="simpleContent"
- or local-name(.)="complexContent"
- or local-name(.)="choice"][1]'>
- </xsl:with-param>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
-
-
- </xsl:when>
- <!-- Case element with name and type -->
- <xsl:when test='$working-on/@type and local-name($working-on)="element" and starts-with($visited,concat("|",$working-on/@name,"|"))'>
- <xsl:variable name='type'>
- <xsl:apply-templates select='$working-on/@type'
- mode='local-name'/>
- </xsl:variable>
- <xsl:variable name='ns-type'>
- <xsl:apply-templates select='$working-on/@type'
- mode='namespace-uri-of-qname'/>
- </xsl:variable>
- <xsl:message terminate='no'><xsl:value-of select='concat($indent,"Processing Element ",$name," @type=",$type)'/></xsl:message>
- <xsl:if test='$ns-type=/xsd:schema/@targetNamespace'>
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'>
- </xsl:with-param>
- <xsl:with-param name='visited' select='concat("",$visited)'/>
- <xsl:with-param name='working-on'
- select='$nodes/*[@name=$type
- and (local-name(.) ="simpleType"
- or local-name(.) ="complexType" )][1]'>
- </xsl:with-param>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
- </xsl:if>
- <!-- -->
- <xsl:variable name='lv'>
- <xsl:apply-templates select='$nodes/*[@name=$type]' mode='deep'>
- <xsl:with-param name='Visited' select='$visited'/>
- <xsl:with-param name='root' select='$nodes'/>
- </xsl:apply-templates>
- </xsl:variable>
- <!--If element is not a root element, process sibling ... -->
- <xsl:if test='local-name($working-on/..)!="schema" and
- ( $working-on/following-sibling::*[
- (local-name(.) ="element" )
- or local-name(.) ="sequence"
- or local-name(.) ="group"
- or local-name(.) ="choice"
- ][1]
- )'>
- <xsl:message terminate='no'><xsl:value-of select='concat($indent,"Processing NEXT Element ",$name," @type=",$type)'/></xsl:message>
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'>
- </xsl:with-param>
- <xsl:with-param name='visited' select='concat("",$visited,$lv)'/>
- <xsl:with-param name='working-on'
- select='$working-on/following-sibling::*[ local-name(.) ="element"
- or local-name(.) = "sequence"
- or (local-name(.) = "group" and @ref and not(
- contains($visited,concat("|",@ref,"|"))
- or contains($visited,concat("|",substring-after(@ref,":"),"|"))
- ))
- or local-name(.) ="choice" ][1]'>
- </xsl:with-param>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
-
- </xsl:if>
- </xsl:when>
- <!-- Case Group with name -->
- <xsl:when test='local-name($working-on)="group" and starts-with($visited,concat("|",$working-on/@name,"|"))'>
- <xsl:message terminate='no'><xsl:value-of select='concat($indent,"Processing Group name=",$name)'/></xsl:message>
- <!-- second ... -->
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'/>
- <xsl:with-param name='visited' select='concat("|",$name,$visited)'/>
- <xsl:with-param name='working-on' select='$working-on/*[
- local-name(.)="choice"
- or local-name(.)="all"
- or local-name(.)="sequence"][1]'/>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
- </xsl:when>
- <!-- Case attributeGroup with name -->
- <xsl:when test='local-name($working-on)="attributeGroup" and starts-with($visited,concat("|",$working-on/@name,"|"))'>
- <xsl:message terminate='no'><xsl:value-of select='concat($indent,"Processing attributeGroup name=",$name)'/></xsl:message>
- </xsl:when>
- <!-- Case attribute with name and type -->
- <xsl:when test='local-name($working-on)="attribute" and $working-on/@type and starts-with($visited,concat("|",$working-on/@name,"|"))'>
- <xsl:variable name='type'>
- <xsl:apply-templates select='$working-on/@type' mode='local-name'/>
- </xsl:variable>
- <xsl:message terminate='no'><xsl:value-of select='concat($indent,"Processing attribute name=",$name," type=",$type)'/></xsl:message>
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'>
- </xsl:with-param>
- <xsl:with-param name='visited' select='concat("",$visited)'/>
- <xsl:with-param name='working-on' select='$nodes/xsd:simpleType[@name=$type
- and not(contains($visited,concat("|",@name,"|")))]'>
- </xsl:with-param>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
- <xsl:message terminate='no'><xsl:value-of select='concat($indent,"Processing IN ATTR NEXT attribute name=",$name," type=",$type)'/></xsl:message>
- <!-- next sibling -->
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'>
- </xsl:with-param>
- <xsl:with-param name='visited' select='concat("|",$type,$visited)'/>
- <xsl:with-param name='working-on' select='$working-on/following-sibling::*[
- (local-name(.)="attribute" and @ref)
- or (local-name(.)="attribute" and @name and @type and not(
- contains($visited,concat("|",@type,"|"))
- or contains($visited,concat("|",substring-after(@type,":"),"|"))
- ))
- ][1]'>
- </xsl:with-param>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
- </xsl:when>
- <!-- Case attribute without type -->
- <xsl:when test='local-name($working-on)="attribute" and not($working-on/@type) and starts-with($visited,concat("|",$working-on/@name,"|"))'>
- <xsl:variable name='type' select='$working-on/@type'/>
- <xsl:message terminate='no'><xsl:value-of select='concat($indent,"Processing attribute name=",$name," type=",$type)'/></xsl:message>
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'>
- </xsl:with-param>
- <xsl:with-param name='visited' select='concat("|",$name,$visited)'/>
- <xsl:with-param name='working-on' select='$working-on/xsd:simpleType'>
- </xsl:with-param>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
- <!-- next sibling -->
- <xsl:message terminate='yes'/>
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'>
- </xsl:with-param>
- <xsl:with-param name='visited' select='concat("|",$name,$visited)'/>
- <xsl:with-param name='working-on' select='$working-on/following-sibling::xsd:attribute[position() = 1]'>
- </xsl:with-param>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
- </xsl:when>
- <!-- Case element with type not visited -->
- <xsl:when test='local-name($working-on)="element" and $working-on/@type and not(
- contains($visited,concat("|",$working-on/@type,"|"))
- or contains($visited,concat("|",substring-after($working-on/@type,":"),"|"))
- )'>
- <xsl:variable name='type'>
- <xsl:apply-templates select='$working-on/@type' mode='local-name'/>
- </xsl:variable>
- <xsl:message terminate='no'><xsl:value-of select='$indent'/>Default ELEMENT NAME and TYPE not processed <xsl:value-of select='concat(local-name($working-on)," ",$working-on/@name)'/></xsl:message>
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'>
- </xsl:with-param>
- <xsl:with-param name='visited' select='concat("",$visited)'/>
- <xsl:with-param name='working-on' select='$nodes/*[@name=$type and (local-name(.)="simpleType" or local-name(.)="complexType")]'>
- </xsl:with-param>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
- <!-- next fried-->
- <!-- next sibling -->
- <xsl:call-template name='make-depends'>
- <xsl:with-param name='nodes' select='$nodes'>
- </xsl:with-param>
- <xsl:with-param name='visited' select='concat("|",$type,$visited)'/>
- <xsl:with-param name='working-on' select='$working-on/following-sibling::*[
- (local-name(.)="attribute" and @ref)
- or (local-name(.)="attribute" and @name and @type and not(
- contains($visited,concat("|",@type,"|"))
- or contains($visited,concat("|",substring-after(@type,":"),"|"))
- ))
- or (local-name(.)="element" and @name and @type and not(
- contains($visited,concat("|",@type,"|"))
- or contains($visited,concat("|",substring-after(@type,":"),"|"))
- ))
-
- ][1]'>
- </xsl:with-param>
- <xsl:with-param name='indent' select='concat($indent,"&INDENT;")'/>
- </xsl:call-template>
-
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='no'><xsl:value-of select='$indent'/>Default none <xsl:value-of select='concat(local-name($working-on)," ",$working-on/@name)'/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:schema'>
- <xsl:choose>
- <xsl:when test='1'>
- <!-- New way -->
- <xsl:apply-templates select='xsd:element[@name=$root-element]'
- mode='class'>
- </xsl:apply-templates>
- <xsl:apply-templates select='xsd:simpleType[@name]'
- mode='class'>
- </xsl:apply-templates>
- <xsl:apply-templates
- select='xsd:element[@name!=$root-element]|xsd:group[@name]'
- mode='class'>
- </xsl:apply-templates>
- <xsl:apply-templates select='xsd:complexType[@name]'
- mode='class'>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='0'>
- <!-- Old way -->
- <xsl:for-each select='xsd:complexType|xsd:simpleType|xsd:element[not(@type) and @name]'>
- <xsl:variable name='n' select="./@name"/>
- <xsl:element name='class'>
- <xsl:attribute name='type' select='local-name(.)'/>
- <xsl:attribute name='name' select='$n'>
- </xsl:attribute>
- <xsl:apply-templates select=".//xsd:restriction|.//xsd:element|.//xsd:extension|.//xsd:attribute|.//xsd:group"/>
- </xsl:element>
- <xsl:text> </xsl:text>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match='xsd:simpleType[@name]|xsd:complexType[@name]'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:variable name='n' select="./@name"/>
- <xsl:element name='class'>
- <xsl:attribute name='type' select='local-name(.)'/>
- <xsl:attribute name='name' select='$n'>
- </xsl:attribute>
- <xsl:apply-templates select=".//xsd:restriction|.//xsd:element|.//xsd:extension|.//xsd:attribute|.//xsd:group">
- <xsl:with-param name="Visited" select='concat($Visited,"|")'/>
- </xsl:apply-templates>
- </xsl:element>
- </xsl:template>
-
-
- <xsl:template match='xsd:restriction|xsd:extension'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:variable name='ns'>
- <xsl:apply-templates select='@base' mode='namespace-uri-of-qname'>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='$ns="&XSD;"'>
- </xsl:when>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace'>
- <xsl:element name='on'>
- <xsl:attribute name='ref'>
- <xsl:choose>
- <xsl:when test='contains(@base,":")'>
- <xsl:value-of select="substring-after(@base,':')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@base"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='no'>Unsuported namespace</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:group[@name]'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:variable name='ns'><xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select='@ref'/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:apply-templates select='.//xsd:element'/>
- </xsl:template>
-
-
- <!-- -->
- <xsl:template match='xsd:group[@ref]'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:variable name='ns'><xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select='@ref'/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='name'>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'>
- <xsl:value-of select="substring-after(@ref,':')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='@ref'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='$ns="&XSD;"'>
- </xsl:when>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace'>
- <xsl:apply-templates select='/xsd:schema/xsd:group[@name=$name]'/>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
-
- <xsl:template match='xsd:element[@ref]'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:variable name='ns'><xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select='@type'/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='$ns="&XSD;"'>
- </xsl:when>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace'>
- <xsl:if test='$debug-console="yes"'>
- <xsl:message terminate='no'> <xsl:value-of select='concat(name(.)," ",@ref," v=",$Visited)'/></xsl:message>
- </xsl:if>
- <xsl:element name='on'>
- <xsl:attribute name='ref'>
- <xsl:apply-templates select="@ref" mode='local-name'/>
- </xsl:attribute>
- <xsl:value-of select="@ref"/>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[@name and not(@type)]'>
- <xsl:param name='Visited' select='"|"'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[@name and @type]'>
- <xsl:param name='Visited' select='"|"'/>
- <xsl:variable name='ns'><xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select='@type'/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='$ns="&XSD;"'>
- </xsl:when>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace'>
- <xsl:element name='on'>
- <xsl:attribute name='ref'>
- <xsl:apply-templates select="@type" mode='local-name'/>
- </xsl:attribute>
- <xsl:value-of select="substring-after(@type,':')"/>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>Unsuported namespace</xsl:message>
- <xsl:value-of select="$ns"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match='xsd:attribute[@ref]'>
- <xsl:param name='Visited' select='"|"'/>
- </xsl:template>
- <xsl:template match='xsd:attribute[@name and not(@type)]'>
- <xsl:param name='Visited' select='"|"'/>
- </xsl:template>
- <xsl:template match='xsd:attribute[@name and @type]'>
- <xsl:param name='Visited' select='"|"'/>
- <!--
- <xsl:variable name='ns'><xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select='@type'/>
- </xsl:call-template>
- </xsl:variable>
- -->
- <xsl:variable name='ns'>
- <xsl:apply-templates select='@type' mode='namespace-uri-of-qname'>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='$ns="&XSD;"'>
- </xsl:when>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace'>
- <xsl:element name='on'>
- <xsl:attribute name='ref'>
- <xsl:choose>
- <xsl:when test='contains(@type,":")'>
- <xsl:value-of select="substring-after(@type,':')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='@type'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>Unsuported namespace <xsl:value-of select='concat("",$ns," ",@type)'/>
- </xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!--
- ****
- **** depends
- ****
- -->
-
- <xsl:key name='kClassByName' match='class' use='@name'/>
-
- <xsl:template match='/' mode='depends'>
- <xsl:element name='depends'>
- <xsl:attribute name='root'>
- <xsl:value-of select='$root-element'/>
- </xsl:attribute>
- <xsl:apply-templates select='key("kClassByName",$root-element)' mode='depends'/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match='class' mode='depends'>
- <xsl:param name='pVisited' select="'|'"/>
- <xsl:variable name='name' select='@name'/>
-
- <xsl:message terminate='no'>PROCESS class <xsl:value-of select='concat(@name," v=",$pVisited,"-"," p=",position())'/> </xsl:message>
- <xsl:copy>
- <xsl:copy-of select='@*'/>
- <!--
- <xsl:attribute name='visited' select='$pVisited'/>
- -->
- <xsl:choose>
- <xsl:when test='not(./on)'>
- <xsl:message terminate='no'> TERMINAL CASE <xsl:value-of
- select='@name'/></xsl:message>
- </xsl:when>
- <xsl:when test='1'>
- <xsl:apply-templates select='on[not(contains($pVisited,concat("|",@ref,"|")))]'
- mode='depends'>
- <xsl:with-param name='pVisited'
- select='concat($pVisited,@name,"|")'/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='0'>
- <xsl:apply-templates select='key("kClassByName",on/@ref[not(contains($pVisited,concat("|",.,"|")))])'
- mode='depends'>
- <xsl:with-param name='pVisited'
- select='concat($pVisited,@name,"|")'/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
-
- <xsl:apply-templates select='on[not(contains($pVisited,concat("|",.,"|")))]'
- mode='depends'>
- <xsl:with-param name='pVisited'
- select='concat($pVisited,@name,"|")'/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template match='on' mode='depends'>
- <xsl:param name='pVisited' select="'|'"/>
- <xsl:variable name="ref" select='@ref'/>
- <xsl:variable name="cur" select='current()'/>
- <xsl:variable name='f' select='//on[$ref=@ref ]'/>
- <xsl:variable name='nc'><xsl:number from='/' level='multiple' count='class|on' select='$cur'/></xsl:variable>
- <xsl:variable name='np'><xsl:number from='/' level='multiple' count='class|on' select='$f[1]'/></xsl:variable>
- <!--<xsl:attribute name='visited' select='$pVisited'/>
- -->
- <xsl:choose>
- <xsl:when test='$nc = $np'>
- <!--
- <xsl:if test=' ($nc = $np) and not(preceding-sibling::on[@ref=$ref])'>
- <xsl:if test=' ($f[1] = $cur) and not(preceding-sibling::on[@ref=$ref])'>
- <xsl:apply-templates select='key("kClassByName",$ref)'
- -->
- <xsl:message terminate='no'>PROCESS on <xsl:value-of select='concat(@ref," v=",$pVisited,"-",@ref," c=",count(//on[@ref=$ref])," p=",position())'/> <xsl:value-of select='concat("first=",$np," curent=",$nc)'/></xsl:message>
- <xsl:message terminate="no">START Apply template on <xsl:value-of
- select='$ref'/></xsl:message>
- <xsl:apply-templates select='key("kClassByName",$ref)[1]'
- mode='depends'>
- <xsl:with-param name='pVisited' select='concat($pVisited,"")'/>
- </xsl:apply-templates>
- <xsl:message terminate="no">END Apply template on <xsl:value-of
- select='$ref'/></xsl:message>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='no'>DONT PROCESS on <xsl:value-of select='concat(@ref," v=",$pVisited,"-",@ref," c=",count(//on[@ref=$ref])," p=",position())'/> <xsl:value-of select='concat("first=",$np," curent=",$nc)'/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
- :vim:ts=2:sw=2:et:softtabstop=2:
- -->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- version="2.0" >
-
-
- <!--
- ***
- *** parser-hdr-event
- ***
- -->
- <!-- Declaration of event functions for attributes -->
- <xsl:template match="xsd:simpleType" mode='parser-hdr-event'>
- <xsl:param name='scope'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parser-hdr-event </xsl:text>
- <xsl:value-of select='concat(name(.)," @minOccurs=",@minOccurs," @maxOccurs=",@maxOccurs)'/><xsl:text>*/ </xsl:text>
- </xsl:if>
- <!--
- <xsl:apply-templates select="xsd:restriction|xsd:union|xsd:list" mode='parser-hdr-event'/>
- -->
- <xsl:apply-templates select="xsd:restriction|xsd:union|xsd:list" mode='parser-hdr-event'/>
- </xsl:template>
-
- <xsl:template match="xsd:complexType" mode='parser-hdr-event'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parser-hdr-event </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name," @minOccurs=",@minOccurs," @maxOccurs=",@maxOccurs)'/><xsl:text>*/ </xsl:text>
- </xsl:if>
- <!--
- -->
- <xsl:apply-templates select="xsd:simpleContent|xsd:complexContent" mode='parser-hdr-event'>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="xsd:sequence|xsd:choice|xsd:all|xsd:group" mode='parser-hdr-event'>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:simpleContent" mode='parser-hdr-event'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:text> /* Integrated simple Content for event */ </xsl:text>
- <xsl:apply-templates select="xsd:restriction|xsd:extension" mode='parser-hdr-event'>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:complexContent" mode='parser-hdr-event'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:apply-templates select="xsd:restriction|xsd:extension" mode='parser-hdr-event'>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:restriction" mode='parser-hdr-event'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:choose>
- <xsl:when test='local-name(..)="complexContent"'>
- <xsl:apply-templates select="xsd:element|xsd:sequence|xsd:choice" mode='parser-hdr-event'>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="xsd:attribute|xsl:attributeGroup"
- mode='parser-hdr-event'>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='local-name(..)="simpleContent"'>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode='parser-hdr-event'>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='local-name(..)="complexType"'>
- <xsl:text>&INDENT2;/* parse-skel-event </xsl:text>
- <xsl:value-of select='concat(name(.)," @base=",@base," parent is complexType to be coded */ ")'/>
- </xsl:when>
- <xsl:when test='local-name(..)="simpleType"'>
- <xsl:text>&INDENT2;/* parse-skel-event </xsl:text>
- <xsl:value-of select='concat(name(.)," @base=",@base," parent is simpleType */ ")'/>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode='parser-hdr-event'>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'><xsl:value-of select="local-name(..)"/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:annotation" mode='parser-hdr-event'>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:extension" mode='parser-hdr-event'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:text> /* extension */ </xsl:text>
- <xsl:choose>
- <xsl:when test='local-name(..)="complexContent"'>
- <xsl:apply-templates select="xsd:element|xsd:sequence|xsd:choice"
- mode='parser-hdr-event'>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="xsd:attribute|xsl:attributeGroup" mode='parser-hdr-event'>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='local-name(..)="simpleContent"'>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode='parser-hdr-event'>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='local-name(..)="complexType"'>
- <xsl:text> /* complexType */ </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>xsd:extention <xsl:value-of select="concat(@base,' ',local-name(..))"/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:union" mode='parser-hdr-event'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parser-hdr-event </xsl:text>
- <xsl:value-of select='concat(name(.)," @minOccurs=",@minOccurs," @maxOccurs=",@maxOccurs)'/><xsl:text>*/ </xsl:text>
- </xsl:if>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:attributeGroup[@name!='']" mode='parser-hdr-event'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup|xsd:anyAttribute" mode='parser-hdr-event'>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attributeGroup[@ref!='']" mode='parser-hdr-event'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:apply-templates select="key('attrGroup',substring-after(@ref,':'))" mode='parser-hdr-event'>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:anyAttributeGroup" mode='parser-hdr-event'>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:attribute[@name and not(@type)]" mode='parser-hdr-event'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:variable name="name">
- <xsl:apply-templates select="@name" mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='sclass'>
- <xsl:value-of select='substring-after($class,$cls-parser-pref)'/>
- </xsl:variable>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='./xsd:simpleType'
- mode='attribute-internal-cpp-type'/>
- </xsl:variable>
- <xsl:variable name='type'>
- <xsl:choose>
- <xsl:when test='@use and (@use!="optional")'>
- <xsl:value-of select='concat($sclass,"::",$name,"_attr_type")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat($sclass,"::",$name,"_optional")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>&INDENT2;/*TO BE CODED </xsl:text>
- <xsl:value-of select='concat("Attribute ",@name," without type ")'/>
- <xsl:text>*/ </xsl:text>
- <xsl:text>&INDENT2;virtual void onAttr</xsl:text><xsl:value-of select='$name'/>
- <xsl:value-of select='concat("(",$type)'/>
- <xsl:text> &v); </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@name and @type]" mode='parser-hdr-event'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:variable name='sclass'>
- <xsl:value-of select='substring-after($class,$cls-parser-pref)'/>
- </xsl:variable>
- <xsl:variable name="nm">
- <xsl:apply-templates select="@name" mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:apply-templates mode='namespace-uri-of-qname'
- select="@type"/>
- </xsl:variable>
- <xsl:variable name='type'>
- <xsl:choose>
- <xsl:when test='@use and (@use!="optional")'>
- <xsl:value-of select='concat($sclass,"::",$nm,"_attr_type")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat($sclass,"::",$nm,"_optional")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;// parser-hdr-event </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name," @type=",@type," cls=",$class," sclass=",$sclass)'/>
- </xsl:if>
- <xsl:text> &INDENT2;virtual void onAttr</xsl:text><xsl:value-of select='$nm'/>
- <xsl:value-of select='concat("(",$type)'/>
- <xsl:text> &v); </xsl:text>
- </xsl:template>
-
- <!-- How to handle ref to other namespaces ?
- TODO: I will style have an issue with attributes having strange names like private
- const, class or
- -->
- <xsl:template match="xsd:attribute[@ref!='']" mode='parser-hdr-event'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:variable name='ns'><xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@ref"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='nm' ><xsl:apply-templates select='@ref' mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='lref'>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'>
- <xsl:value-of select='key("attribute",substring-after(@ref,":"))'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='key("attribute",@ref)'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='type'>
- <xsl:choose>
- <xsl:when test='@use and @use!="optional"'>
- <xsl:value-of select='concat("",$nm,"_attr_type")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("",$nm,"_optional")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace'>
- <xsl:text>&INDENT2;/* attribute with ext ref </xsl:text>
- <xsl:value-of select='concat("=",@ref," ns=",$ns," class=",$class," */ ")'/>
- <xsl:text>&INDENT2;// class=</xsl:text>
- <xsl:value-of select='concat($class," ",$class)'/>
- <xsl:text> &INDENT2;virtual void onAttr</xsl:text><xsl:value-of select='$nm'/>
- <xsl:value-of select='concat("(",$type," &v); ")'/>
- </xsl:when>
- <xsl:when test='$ns!=/xsd:schema/@targetNamespace'>
- <xsl:variable name='loc-name' select="substring-after(@ref,':')"/>
- <xsl:variable name='loc'
- select="/xsd:schema/xsd:import[@namespace=$ns]/@schemaLocation">
- </xsl:variable>
- <xsl:variable name='cpp_ns'>
- <xsl:call-template name="cpp_namespace">
- <xsl:with-param name='type' select='$ns'/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:text> &INDENT2;virtual void onAttr</xsl:text><xsl:value-of select='$nm'/>
- <xsl:choose>
- <xsl:when test='$cpp_ns != ""'>
- <xsl:value-of select='concat("(",$cpp_ns,"::",$nm,"_attr_type &v /* cpp_ns*/); ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("(","",$nm,"_attr_type &v); ")'/>
- </xsl:otherwise>
- </xsl:choose>
- <!--
- <xsl:apply-templates
- select='document($loc)/xsd:schema/xsd:attribute[@name=$loc-name]' mode='parser-hdr-event'>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- -->
- <xsl:message terminate='no'>xsd2cpp xsd:attribute Foreign namespace ref
- <xsl:value-of select='concat(@ref," - ",$loc)'/></xsl:message>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>xsd2cpp xsd:attribute Not Yet good
- <xsl:value-of select='concat(@ref," - ",$ns)'/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:all" mode='parser-hdr-event'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parser-hdr-event </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name," @minOccurs=",@minOccurs," @maxOccurs=",@maxOccurs)'/><xsl:text>*/ </xsl:text>
- </xsl:if>
- <xsl:apply-templates select="xsd:element" mode='parser-hdr-event'>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:group[@name]" mode='parser-hdr-event'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parser-hdr-event </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name," @minOccurs=",@minOccurs," @maxOccurs=",@maxOccurs)'/><xsl:text>*/ </xsl:text>
- </xsl:if>
- <xsl:apply-templates select="xsd:element|xsd:choice|xsd:sequence|xsd:group|xsd:any" mode='parser-hdr-event'>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:group[@ref]" mode='parser-hdr-event'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:variable name='local-name'>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'><xsl:value-of select='substring-after(@ref,":")'/></xsl:when>
- <xsl:otherwise><xsl:value-of select='@ref'/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parser-hdr-event </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref," @minOccurs=",@minOccurs," @maxOccurs=",@maxOccurs)'/><xsl:text>*/ </xsl:text>
- </xsl:if>
- <xsl:apply-templates select="/xsd:schema/xsd:group[@name=$local-name]" mode='parser-hdr-event'>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:choice" mode='parser-hdr-event'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parser-hdr-event </xsl:text>
- <xsl:value-of select='concat(name(.)," @minOccurs=",@minOccurs," @maxOccurs=",@maxOccurs)'/><xsl:text>*/ </xsl:text>
- </xsl:if>
- <xsl:apply-templates select="xsd:element|xsd:choice|xsd:sequence|xsd:group|xsd:any" mode='parser-hdr-event'>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:sequence" mode='parser-hdr-event'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parser-hdr-event </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref," @minOccurs=",@minOccurs," @maxOccurs=",@maxOccurs)'/><xsl:text>*/ </xsl:text>
- </xsl:if>
- <xsl:apply-templates select="xsd:element|xsd:sequence|xsd:choice|xsd:group|xsd:any" mode='parser-hdr-event'>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- parse-skel-event xsd:element -->
- <xsl:template match="xsd:element[@ref]" mode='parser-hdr-event'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parser-hdr-event </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref," @minOccurs=",@minOccurs," @maxOccurs=",@maxOccurs)'/><xsl:text>*/ </xsl:text>
- </xsl:if>
- <xsl:variable name='nname'>
- <xsl:apply-templates select="@ref" mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='el'>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'><xsl:value-of
- select='substring-after(@ref,":")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@ref"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'>
- <!-- TODO if namespace is not target namespace I shall compute the
- cpp_namespace
- -->
- <xsl:text>&INDENT2;virtual void onEl</xsl:text><xsl:value-of select='$nname'/>
- <xsl:text>(</xsl:text>
- <xsl:value-of select='concat("",$nname,"_type")'/><xsl:text> &v); </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>&INDENT2;virtual void onEl</xsl:text><xsl:value-of select='$nname'/>
- <xsl:text>(</xsl:text>
- <xsl:value-of select='concat("",$nname,"_type")'/><xsl:text> &v); /* no ns */ </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:element[@name and not(@type) and @abstract and @abstract='true']" mode='parser-hdr-event'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:param name='baseclass'></xsl:param>
- <xsl:variable name='name' select="@name"/>
- <xsl:apply-templates select='/xsd:schema/xsd:element[@equivClass=$name ]' mode='parser-hdr-event'>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='baseclass'>
- <xsl:choose>
- <xsl:when test='$baseclass=""'>
- <xsl:apply-templates select="@name" mode='normalize-name'/>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="$baseclass"/></xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[(local-name(@name)!='') and not(@type) and not(@abstract)]" mode='parser-hdr-event'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:param name='baseclass'></xsl:param>
- <xsl:variable name='nname'>
- <xsl:choose>
- <xsl:when test='$baseclass=""'>
- <xsl:apply-templates select="@name" mode='normalize-name'/>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select='$baseclass'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>&INDENT2;/* Correct: Element with no type need the scope </xsl:text>
- <xsl:value-of select='concat("Scope=",$scope," class=",$class )'/>
- <xsl:text>!!*/ </xsl:text>
- <xsl:text>&INDENT2;virtual void onEl</xsl:text><xsl:value-of select='$nname'/>
- <xsl:text>(</xsl:text>
- <xsl:value-of select='concat($scope,"::",$nname,"_type")'/><xsl:text> &v)/* {}*/; </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[(local-name(@name)!='') and @type]" mode='parser-hdr-event'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:param name='baseclass'></xsl:param>
- <xsl:variable name='cpp_type'>
- <xsl:choose>
- <xsl:when test="substring-after(@type,':')">
- <xsl:apply-templates select='@type' mode='restriction-base'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat(@type,'_skel')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='nname'>
- <xsl:choose>
- <xsl:when test='$baseclass=""'>
- <xsl:apply-templates select="@name" mode='normalize-name'/>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select='$baseclass'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:choose>
- <xsl:when test="substring-after(@type,':')">
- <xsl:call-template
- name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@type"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/xsd:schema/@targetNamespace"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='$ns="http://www.w3.org/2001/XMLSchema"'>
- <xsl:text>&INDENT2;virtual void onEl</xsl:text><xsl:value-of select='$nname'/>
- <xsl:text>(</xsl:text><xsl:value-of select='$cpp_type'/>
- <xsl:text> &v) ; </xsl:text>
- </xsl:when>
- <xsl:when test='$ns!=/xsd:schema/@targetNamespace'>
- <xsl:variable name='cpp_ns'>
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="$ns"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:text>&INDENT2;virtual void onEl</xsl:text><xsl:value-of select='$nname'/>
- <xsl:text>(</xsl:text><xsl:value-of select='concat($cpp_ns,"::",substring-after(@type,":"),"_skel")'/><xsl:text> &v) ; </xsl:text>
- </xsl:when>
- <xsl:when test='$cpp_type!=""'>
- <xsl:text>&INDENT2;virtual void onEl</xsl:text><xsl:value-of select='$nname'/>
- <xsl:text>(</xsl:text><xsl:value-of select='$cpp_type'/>
- <xsl:text> &v) ; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <!-- The type is insight !!! -->
- <xsl:variable name='tp'>
- <xsl:apply-templates select="xsd:simpleType|xsd:complexType"
- mode='parse-skel-event-type'/>
- </xsl:variable>
- <xsl:text>&INDENT2;virtual void onEl</xsl:text><xsl:value-of select='$nname'/>
- <xsl:text>(</xsl:text><xsl:value-of select='$tp'/><xsl:text> &v) ; </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- Type of elements where type is in deep parse skel event type -->
- <xsl:template match="xsd:simpleType" mode="parse-skel-event-type">
- <xsl:apply-templates select="xsd:restriction|xsd:extension" mode='parse-skel-event-type'/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:complexType" mode="parse-skel-event-type">
- <xsl:apply-templates select="xsd:restriction|xsd:extension" mode='parse-skel-event-type'/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:simpleContent|xsd:complexContent" mode="parse-skel-event-type">
- <xsl:apply-templates select="xsd:sequence|xsd:choice" mode='parse-skel-event-type'/>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:list" mode="parse-skel-event-type">
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:restriction" mode="parse-skel-event-type">
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@base' mode='restriction-base'/>
- </xsl:variable>
- <xsl:value-of select="$cpp_type"/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:extension" mode="parse-skel-event-type">
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@base' mode='restriction-base'/>
- </xsl:variable>
- <xsl:value-of select="$cpp_type"/>
- </xsl:template>
-
-
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY PV ";">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<xsl:transform
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xsd2cpp="http:/ebersold.fr/dede"
- xmlns:ex="http://regenstrief.org/org.regenstrief.saxon7."
- version="2.0" >
-<!--
- vim:ts=2:sw=2:et:
--->
-
-
-
- <!--
- ***
- *** parser-hdr-member
- ***
- -->
- <!-- -->
- <xsl:template match="xsd:annotation" mode="parser-hdr-member">
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:simpleType" mode="parser-hdr-member">
- <xsl:param name='scope'/>
- <xsl:param name='class'></xsl:param>
- <xsl:apply-templates select="xsd:restriction|xsd:extension" mode='parser-hdr-member'>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:complexType" mode="parser-hdr-member">
- <xsl:param name='scope'/>
- <xsl:param name='class'></xsl:param>
- <xsl:apply-templates select="xsd:simpleContent|xsd:complexContent|xsd:sequence|xsd:choice|xsd:all|xsd:group" mode='parser-hdr-member'>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode='parser-hdr-member'>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:simpleContent" mode="parser-hdr-member">
- <xsl:param name='scope'/>
- <xsl:param name='class'></xsl:param>
- <xsl:apply-templates select="xsd:restriction|xsd:extension" mode='parser-hdr-member'>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:complexContent" mode="parser-hdr-member">
- <xsl:param name='scope'/>
- <xsl:param name='class'></xsl:param>
- <xsl:apply-templates select="xsd:restriction|xsd:extension" mode='parser-hdr-member'>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:restriction" mode="parser-hdr-member">
- <xsl:param name='scope'/>
- <xsl:param name='class'></xsl:param>
- <xsl:choose>
- <xsl:when test='local-name(..)="complexContent"'>
- <xsl:apply-templates select="xsd:element|xsd:choice|xsd:sequence|xsd:group" mode='parser-hdr-member'>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode='parser-hdr-member'>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='local-name(..)="simpleContent"'>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode='parser-hdr-member'>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='local-name(..)="simpleType"'>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>ERROR not specification conforment</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:extension" mode="parser-hdr-member">
- <xsl:param name='scope'/>
- <xsl:param name='class'></xsl:param>
- <xsl:choose>
- <xsl:when test='local-name(..)="complexContent"'>
- <xsl:apply-templates select="xsd:element|xsd:choice|xsd:sequence|xsd:group" mode='parser-hdr-member'>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode='parser-hdr-member'>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='local-name(..)="simpleContent"'>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode='parser-hdr-member'>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>ERROR not specification conforment</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:choice|xsd:sequence" mode="parser-hdr-member">
- <xsl:param name='scope'/>
- <xsl:param name='class'></xsl:param>
- <xsl:apply-templates select="xsd:element|xsd:choice|xsd:sequence|xsd:group" mode='parser-hdr-member'>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:group[@ref]" mode="parser-hdr-member">
- <xsl:param name='scope'/>
- <xsl:param name='class'></xsl:param>
- <xsl:variable name="name">
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'><xsl:value-of select='substring-after(@ref,":")'/></xsl:when>
- <xsl:otherwise><xsl:value-of select="@ref"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:apply-templates select='@ref' mode='namespace-uri-of-qname'/>
- </xsl:variable>
- <xsl:text>&INDENT;/*parser-hdr-member xsd:group </xsl:text>
- <xsl:value-of select='concat("@ref=",@ref," $class=",$class)'/>
- <xsl:text>*/ </xsl:text>
- <xsl:choose>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace'>
- <xsl:apply-templates select="key('group',substring-after(@ref,':'))" mode='parser-hdr-member'>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>xsd-parser-header xsd:group parser-hdr-member ERROR: not yet treated</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:group[@name]" mode="parser-hdr-member">
- <xsl:param name='scope'/>
- <xsl:param name='class'></xsl:param>
- <xsl:text>&INDENT;/*parser-hdr-member xsd:group </xsl:text>
- <xsl:value-of select="@name"/>
- <xsl:text>*/ </xsl:text>
- <xsl:apply-templates select='xsd:all|xsd:choice|xsd:sequence' mode="parser-hdr-member">
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@name and @type]" mode="parser-hdr-member">
- <xsl:param name='scope'/>
- <xsl:param name='class'></xsl:param>
- <xsl:variable name='ns'>
- <xsl:apply-templates select='@type' mode='namespace-uri-of-qname'/>
- </xsl:variable>
- <xsl:variable name='name'>
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='cpp_ns'>
- <xsl:call-template name="cpp_namespace">
- <xsl:with-param name='type' select='$ns'/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='maxOccurs'>
- <xsl:choose>
- <xsl:when test="@maxOccurs and @maxOccurs='unbounded'">_sequence</xsl:when>
- <xsl:otherwise>_type</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='type'>
- <xsl:apply-templates select='@type' mode='normalize-name'/>
- </xsl:variable>
- <xsl:text>&INDENT;//parser-hdr-member element name type </xsl:text>
- <xsl:value-of select="concat($type,' scope=',$scope,' nm=',$name)"/>
- <xsl:text> </xsl:text>
- <xsl:choose>
- <xsl:when test="$ns='&XSD;'">
- <xsl:value-of select='concat("&INDENT2;","")'/>
- <xsl:choose>
- <xsl:when test='local-name(..)="schema"'><xsl:value-of select='concat("//",$name,$maxOccurs," m_",$name,"; ")'/></xsl:when>
- <xsl:otherwise><xsl:value-of select='concat("//",$scope,"::",$name,$maxOccurs," m_",$name,"; ")'/></xsl:otherwise>
- </xsl:choose>
- <xsl:text>&INDENT2;::xsd::parser::SimpleElement *m_</xsl:text>
- <xsl:value-of select='concat($name,"_parser; ")'/>
- </xsl:when>
- <xsl:when test="$ns=/xsd:schema/@targetNamespace">
- <xsl:choose>
- <xsl:when test='local-name(..)="schema"'><xsl:value-of select='concat("&INDENT2;//",$name,$maxOccurs," m_",$name,"; ")'/></xsl:when>
- <xsl:otherwise><xsl:value-of select='concat("&INDENT2;//",$scope,"::",$name,$maxOccurs," m_",$name,"; ")'/></xsl:otherwise>
- </xsl:choose>
- <xsl:value-of select='concat("&INDENT2;",$cls-parser-pref)'/>
- <xsl:value-of select='concat($type,$cls-parser-suff," *m_",$name,"_parser; ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("&INDENT2;",$cpp_ns,"::p_")'/>
- <xsl:value-of select='concat($type,"_skel *m_",$name,"_parser; ")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@name and not(@type) and @abstract]" mode="parser-hdr-member">
- <xsl:param name='scope'/>
- <xsl:param name='class'></xsl:param>
- <xsl:variable name='el' select='@name'/>
- <xsl:apply-templates select='/xsd:schema/xsd:element[@equivClass=$el]' mode='parser-hdr-member'>
- <xsl:with-param name="scope" select="$scope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@name and not(@type) and not(@abstract)]" mode="parser-hdr-member">
- <xsl:param name='scope'/>
- <xsl:param name='class'></xsl:param>
- <xsl:variable name='name'>
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='maxOccurs'>
- <xsl:choose>
- <xsl:when test="@maxOccurs and @maxOccurs='unbounded'">_sequence</xsl:when>
- <xsl:otherwise>_type</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>&INDENT;//parser-hdr-member element name </xsl:text>
- <xsl:value-of select="concat(@name,' ')"/>
- <xsl:value-of select='concat("&INDENT2;",$cls-parser-pref)'/>
- <xsl:value-of select='concat($name,$cls-parser-suff,"&TAB;*m_",$name,"_parser; ")'/>
-
- <xsl:value-of select='concat("&INDENT2;","")'/>
- <xsl:value-of select='concat($scope,"::",$name,$maxOccurs," m_",$name,"; ")'/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@ref]" mode="parser-hdr-member">
- <xsl:param name='scope'/>
- <xsl:param name='class'></xsl:param>
- <xsl:variable name='name'>
- <xsl:apply-templates select="@ref" mode="normalize-name"/>
- </xsl:variable>
- <xsl:variable name='maxOccurs'>
- <xsl:choose>
- <xsl:when test="@maxOccurs and @maxOccurs='unbounded'">_sequence</xsl:when>
- <xsl:otherwise>_type</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='el-name'>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'><xsl:value-of select='substring-after(@ref,":")'/></xsl:when>
- <xsl:otherwise><xsl:value-of select="@ref"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='element'><xsl:value-of select='/xsd:schema/xsd:element[@name=$el-name]'/></xsl:variable>
- <xsl:if test='ancestor::*[@name=$name]'>
- <xsl:message terminate='no'>WARNING RECURSION DETECTED: <xsl:value-of
- select="@ref"/></xsl:message>
- </xsl:if>
- <xsl:text>&INDENT;//parser-hdr-member element </xsl:text>
- <xsl:value-of select='concat("@ref=",@ref," $class=",$class," ")'/>
- <xsl:value-of select='concat("&INDENT2;",$cls-parser-pref)'/>
- <xsl:value-of select='concat($name,$cls-parser-suff,"&TAB;*m_",$name,"_parser; ")'/>
- <xsl:choose>
- <xsl:when test='ancestor::xsd:element[@name=$name]'>
- <xsl:value-of select='concat("&INDENT2;//Rercursion for element: @ref=",@ref," ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("&INDENT2;//","")'/>
- <xsl:value-of select='concat($scope,"::",$name,$maxOccurs," m_",$name,"; ")'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test='/xsd:schema/xsd:element[@name=$el-name and @abstract="true"]'>
- <xsl:apply-templates select='/xsd:schema/xsd:element[@equivClass=$el-name]' mode='parser-hdr-member'>
- <xsl:with-param name="scope" select="$scope"/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attributeGroup[@ref]" mode="parser-hdr-member">
- <xsl:param name='scope'/>
- <xsl:param name='class'></xsl:param>
- <xsl:variable name="local-name">
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'><xsl:value-of select='substring-after(@ref,":")'/></xsl:when>
- <xsl:otherwise><xsl:value-of select="@ref"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>&INDENT2;/* parse-hdr-member xsd:attributeGroup </xsl:text><xsl:value-of select='concat("@ref=",@ref)'/><xsl:text>*/ </xsl:text>
- <!--
- <xsl:apply-templates mode="parse-hdr-member" select="key('attrGroup',substring-after(@ref,':'))">
- -->
- <xsl:apply-templates mode="parser-hdr-member" select="/xsd:schema/xsd:attributeGroup[@name=$local-name]">
- <xsl:with-param name='scope' select='$scope'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attributeGroup[@name]" mode="parser-hdr-member">
- <xsl:param name='scope'/>
- <xsl:param name='class'></xsl:param>
- <xsl:text>&INDENT2;/* parse-skel xsd:attributeGroup </xsl:text><xsl:value-of select='concat("@name=",@name)'/><xsl:text>*/ </xsl:text>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup|xsd:anyAttribute" mode="parser-hdr-member">
- <xsl:with-param name='scope' select='$scope'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@ref]" mode="parser-hdr-member">
- <xsl:param name='scope'/>
- <xsl:param name='class'></xsl:param>
- <xsl:variable name='ns'>
- <xsl:apply-templates select='@ref' mode='namespace-uri-of-qname'/>
- </xsl:variable>
- <xsl:variable name='cpp_ns'>
- <xsl:call-template name="cpp_namespace">
- <xsl:with-param name='type' select='$ns'/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='name'>
- <xsl:apply-templates select="@ref" mode="normalize-name"/>
- </xsl:variable>
- <xsl:variable name='local-name'>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'><xsl:value-of select='substring-after(@ref,":")'/></xsl:when>
- <xsl:otherwise><xsl:value-of select='@ref'/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;//parser-hdr-member </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref)'/>
- <xsl:text> </xsl:text>
- </xsl:if>
- <xsl:choose>
- <xsl:when test='@use="optional"'>
- <xsl:value-of select='concat("&INDENT2;","//")'/>
- <xsl:value-of select='concat($cpp_ns,"::",$name,"_optional m_attr_",$name,"; ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("&INDENT2;","//")'/>
- <xsl:value-of select='concat($cpp_ns,"::",$name,"_attr_type m_attr_",$name,"; ")'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace and
- /xsd:schema/xsd:attribute[$local-name=@name]/@type'>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select="/xsd:schema/xsd:attribute[@name=$local-name]/@type" mode='restriction-base'/>
- </xsl:variable>
- <xsl:variable name='type_ns'>
- <xsl:apply-templates select='/xsd:schema/xsd:attribute[@name=$local-name]/@type' mode='namespace-uri-of-qname'/>
- </xsl:variable>
- <xsl:if test='$type_ns!="&XSD;"'>
- <xsl:value-of select="concat('&INDENT2;',$cls-parser-pref,$cpp_type,' *m_',$name,'_parser; ')"/>
- </xsl:if>
- </xsl:when>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace'>
- <xsl:value-of select="concat('&INDENT2;',$cls-parser-pref,$name,$cls-parser-suff,' *m_',$name,'_parser; ')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name='cpp_ns'>
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select='$ns'/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select='concat("&INDENT;typedef ",$cpp_ns,"::",$name,"_attr_type ",$name,"_attr_type;")'/><xsl:text> </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@name and not(@type)]" mode="parser-hdr-member">
- <xsl:param name='scope'/>
- <xsl:param name='class'></xsl:param>
- <xsl:text>&INDENT2;//parser-hdr-member attribute name no type </xsl:text>
- <xsl:value-of select='@name'/>
- <xsl:text> </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@name and @type]" mode="parser-hdr-member">
- <xsl:param name='scope'/>
- <xsl:param name='class'></xsl:param>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;//parser-hdr-member attribute @name=</xsl:text>
- <xsl:value-of select='concat(@name," @type=",@type)'/>
- <xsl:text> </xsl:text>
- </xsl:if>
- <xsl:variable name="name">
- <xsl:apply-templates select="@name" mode="normalize-name"/>
- </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:apply-templates select="@type" mode='namespace-uri-of-qname'>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:variable name="type"><xsl:value-of select="concat('xsd::',substring-after(@type,':'))"/></xsl:variable>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select="@type" mode='restriction-base'/>
- </xsl:variable>
- <xsl:text>&INDENT2;/* parse-hdr-member xsd:attribute </xsl:text>
- <xsl:value-of select='concat("@name=",@name)'/><xsl:text>*/ </xsl:text>
- <xsl:choose>
- <xsl:when
- test='$ns="http://www.w3.org/2001/XMLSchema"'>
- <!-- Ok, we are in a basic type ... -->
- <xsl:choose>
- <xsl:when test='@use="optional"'>
- <xsl:value-of select='concat("&INDENT;typedef ",$scope,"::",$name,"_optional ",$name,"_optional;")'/><xsl:text> </xsl:text>
- <xsl:value-of select='concat("&INDENT;typedef ",$scope,"::",$name,"_attr_type ",$name,"_type;")'/><xsl:text> </xsl:text>
- <xsl:value-of select='concat("&INDENT;typedef ",$scope,"::",$name,"_attr_type ",$name,"_attr_type;")'/><xsl:text> </xsl:text>
- <xsl:value-of select='concat("&INDENT;typedef ",$scope,"::",$name,"_attr_type_ ",$name,"_type_;")'/><xsl:text> </xsl:text>
- <xsl:value-of select='concat("&INDENT;",$scope,"::",$name,"_optional m_attr_",$name)'/><xsl:text>; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("&INDENT;typedef ",$scope,"::",$name,"_optional ",$name,"_optional;")'/><xsl:text> </xsl:text>
- <xsl:value-of select='concat("&INDENT;typedef ",$scope,"::",$name,"_attr_type ",$name,"_attr_type;")'/><xsl:text> </xsl:text>
- <xsl:value-of select='concat("&INDENT2;",$cpp_type," m_attr_",$name)'/><xsl:text>; </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when
- test='($ns=/xsd:schema/@targetNamespace) or (not(namespace::*[name()=""]) and not(contains(@type,":")))' >
- <xsl:variable name='parser' select='concat($cls-parser-pref,$cpp_type)'></xsl:variable>
- <xsl:value-of select='concat("&INDENT;typedef ",$scope,"::",$name,"_optional ",$name,"_optional;")'/><xsl:text> </xsl:text>
- <xsl:value-of select='concat("&INDENT2;",$cpp_type," m_attr_",$name)'/><xsl:text>; </xsl:text>
- <xsl:value-of select='concat("&INDENT;typedef ",$scope,"::",$name,"_attr_type ",$name,"_attr_type;")'/><xsl:text> </xsl:text>
- <xsl:value-of select="concat('&INDENT2;',$parser,' *m_',$name,'_parser; ')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>Unmanaged Attribute <xsl:value-of
- select='@name'/> type <xsl:value-of select="concat(@type,' ns=',$ns)"/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
-
-</xsl:transform>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
- :vim:ts=2:sw=2:et:softtabstop=2:
- -->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- version="2.0" >
-
- <!-- Main entry point to generate header files for parser -->
- <xsl:template name='generateParseSkel_header-one'>
- <xsl:param name='dir'/>
- <xsl:variable name='filename-org'>
- <xsl:call-template name='basename'>
- <xsl:with-param name='path' select="document-uri(/)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:call-template name='basename'>
- <xsl:with-param name='path' select="/xsd:schema/@targetNamespace"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name='filename'
- select='concat($dir,"/p_",substring-before($filename-org,".xsd"),".h")'/>
- <xsl:message>Create <xsl:value-of select="concat('dir=',$dir,' f-org=',$filename-org,' filemane=',$filename)"/> - </xsl:message>
-
- <xsl:result-document href="{$filename}" format="text">
- <xsl:text>#ifndef </xsl:text><xsl:value-of select="concat(translate($ns,'/.-:','__'),'_PH ')"/>
- <xsl:text> </xsl:text>
- <xsl:text>#define </xsl:text><xsl:value-of select="concat(translate($ns,'/.-:','__'),'_PH')"/>
- <xsl:text> #include <string> </xsl:text>
- <xsl:text> #include <iostream> </xsl:text>
- <xsl:text> #include <xsd/xsd.h> </xsl:text>
- <xsl:text>/* Include imports */ </xsl:text>
- <!-- Include imports -->
- <xsl:apply-templates select='/xsd:schema/xsd:import' mode='include'/>
- <xsl:text> namespace </xsl:text>
- <!--
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="/xsd:schema/@targetNamespace"/>
- </xsl:call-template>
- -->
- <xsl:value-of select="$namespace"/>
- <xsl:text> { </xsl:text>
- <!-- Forward class declarations -->
- <xsl:apply-templates select="/xsd:schema" mode="parse-forward"/>
- <xsl:choose>
- <xsl:when test='$deps!=""'>
- <xsl:call-template name='generate-parser-through-deps'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="/xsd:schema" mode="parse-hdr-root">
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- <!-- We add a factory class in parser to allow the creation
- of other inheritant types. For instance The Checksum
- will implement a graphical node for a tree view.
- -->
- <xsl:if test='$generate-factory="yes-"'>
- <xsl:text>class Factory { </xsl:text>
- <xsl:text>public: </xsl:text>
- <xsl:text>&INDENT; </xsl:text>
- <xsl:text>&INDENT;Factory(); </xsl:text>
- <xsl:text>&INDENT;~Factory(); </xsl:text>
- <xsl:text>&INDENT;void *create(std::string &tp); </xsl:text>
- <xsl:text>&INDENT;void register_(std::string &tp); </xsl:text>
- <xsl:text>protected: </xsl:text>
-
- <xsl:text> }; </xsl:text>
- </xsl:if>
-
- <xsl:text> } </xsl:text>
- <xsl:text>#endif </xsl:text>
- </xsl:result-document>
- </xsl:template>
-
- <!-- -->
- <xsl:template name='generate-parser-through-deps'>
- <xsl:variable name='root' select="/xsd:schema"/>
- <xsl:variable name='new' select="document($deps)/xsd:schema"/>
- <!--
- -->
- <xsl:if test='(count($root/xsd:element[@name]) != count($new/xsd:element[@name]) )
- or (count($root/xsd:complexType[@name]) != count($new/xsd:complexType[@name]) )
- or (count($root/xsd:simpleType[@name]) != count($new/xsd:simpleType[@name]) )
- or (count($root/xsd:group[@name]) != count($new/xsd:group[@name]) )
- or (count($root/xsd:attributeGroup[@name]) != count($new/xsd:attributeGroup[@name]) )
- '>
- <xsl:message terminate='no'>
- <xsl:value-of select='concat("Old Elements:",count($root/xsd:element[@name]))'/>
- <xsl:value-of select='concat(" CplxType:",count($root/xsd:complexType[@name]))'/>
- <xsl:value-of select='concat(" SmplType:",count($root/xsd:simpleType[@name]))'/>
- <xsl:value-of select='concat(" group:",count($root/xsd:group[@name]))'/>
- <xsl:value-of select='concat(" attrGrp:",count($root/xsd:attributeGroup[@name]))'/>
- </xsl:message>
- <xsl:message terminate='no'>
- <xsl:value-of select='concat("New Elements:",count($new/xsd:element[@name]))'/>
- <xsl:value-of select='concat(" CplxType:",count($new/xsd:complexType[@name]))'/>
- <xsl:value-of select='concat(" SmplType:",count($new/xsd:simpleType[@name]))'/>
- <xsl:value-of select='concat(" group:",count($new/xsd:group[@name]))'/>
- <xsl:value-of select='concat(" attrGrp:",count($new/xsd:attributeGroup[@name]))'/>
- </xsl:message>
- <xsl:for-each select='$root/*[@name]'>
- <xsl:variable name='el' select='.'/>
- <xsl:variable name='name' select='./@name'/>
- <xsl:if test='local-name(.) = "element" and not($new/xsd:element[@name=$name])'>
- <xsl:message terminate='no'>Missing :<xsl:value-of
- select='concat(name($el)," ",$el/@name)'/>
- </xsl:message>
- </xsl:if>
- <xsl:if test='local-name(.) = "complexType" and not($new/xsd:complexType[@name=$name])'>
- <xsl:message terminate='no'>Missing :<xsl:value-of
- select='concat(name($el)," ",$el/@name)'/>
- </xsl:message>
- </xsl:if>
- <xsl:if test='count($new/*[@name=$name]) > 1'>
- <xsl:message terminate='no'>Double :<xsl:value-of
- select='concat(name($el)," ",$el/@name,"
- ",count($new/*[@name=$name]))'/>
- </xsl:message>
- </xsl:if>
- </xsl:for-each>
- <xsl:message terminate='yes'/>
- </xsl:if>
- <xsl:apply-templates select='document($deps)' mode='parse-hdr-root'>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
-
- </xsl:template>
- <!--
- ***
- *** parse-forward
- ***
- -->
- <xsl:template match="xsd:schema" mode="parse-forward">
- <xsl:apply-templates select="xsd:simpleType|xsd:complexType" mode="parse-forward"/>
- <xsl:apply-templates select="xsd:element|xsd:attribute|xsd:attributeGroup" mode="parse-forward"/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:annotation" mode="parse-forward">
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:import" mode="parse-forward">
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:include" mode="parse-forward">
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:simpleType|xsd:complexType" mode="parse-forward">
- <xsl:param name="name"/>
- <xsl:text>class </xsl:text><xsl:value-of
- select="concat('p_',$name,'_skel;')"/><xsl:text> </xsl:text>
- <xsl:text>class </xsl:text><xsl:value-of
- select="concat('',$name,'_skel;')"/><xsl:text> </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:simpleType[@name]|xsd:complexType[@name]" mode="parse-forward">
- <xsl:variable name='name' ><xsl:apply-templates select='@name'
- mode='normalize-name'/>
- </xsl:variable>
- <xsl:text>class </xsl:text><xsl:value-of
- select="concat('p_',$name,'_skel;')"/><xsl:text> </xsl:text>
- <xsl:text>class </xsl:text><xsl:value-of
- select="concat('',$name,'_skel;')"/><xsl:text> </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@name and @type]" mode="parse-forward">
- <xsl:variable name='ns'>
- <xsl:apply-templates select="@type" mode="namespace-uri-of-qname"/>
- </xsl:variable>
- <xsl:variable name='name' ><xsl:apply-templates select='@name'
- mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='nt' ><xsl:apply-templates select='@type'
- mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='l'>
- <xsl:choose>
- <xsl:when test="substring-after(@type,':')">
- <xsl:value-of select="concat('p_',$nt,'_skel')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('p_',@type,'_skel')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>typedef </xsl:text>
- <xsl:choose>
- <xsl:when test='$ns="&XSD;"'>
- <xsl:value-of select="concat('::xsd::parser::SimpleElement ',' p_',$name,'_skel ','; ')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($l,' p_',$name,'_skel ','; ')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@name and not(@type)]" mode="parse-forward">
- <xsl:variable name='name' ><xsl:apply-templates select='@name'
- mode='normalize-name'/>
- </xsl:variable>
- <xsl:text>class </xsl:text><xsl:value-of
- select="concat('p_',$name,'_skel;')"/><xsl:text> </xsl:text>
- <xsl:text>class </xsl:text><xsl:value-of
- select="concat('',$name,'_skel;')"/><xsl:text> </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@ref]" mode="parse-forward">
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@name and not(@type)]" mode="parse-forward">
- <xsl:variable name='name' ><xsl:apply-templates select='@name'
- mode='normalize-name'/>
- </xsl:variable>
- <xsl:apply-templates select="xsd:simpleType" mode="parse-forward">
- <xsl:with-param name='name' select='$name'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@name and @type]" mode="parse-forward">
- <xsl:variable name='name' ><xsl:apply-templates select='@name'
- mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@type"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='$ns="&XSD;"'>
- <xsl:text>typedef </xsl:text>
- <xsl:value-of select='concat("xsd::parser::SimpleElement p_",$name,"_skel","; ")'/>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@ref]" mode="parse-forward">
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attributeGroup" mode="parse-forward">
- <xsl:apply-templates select="xsd:attribute|xsd:anyAttribute" mode="parse-forward"/>
- </xsl:template>
-
- <!--
- ***
- *** parse-hdr-root
- ***
- -->
- <!-- -->
- <xsl:template match="xsd:annotation" mode="parse-hdr-root">
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:schema" mode="parse-hdr-root">
- <xsl:variable name="scope">
- <xsl:value-of select="$namespace"/>
- </xsl:variable>
- <xsl:apply-templates select="xsd:element|xsd:simpleType|xsd:complexType|xsd:attribute|xsd:group|xsd:attributeGroup" mode="parse-hdr-root">
- <xsl:with-param name="scope" select="$scope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:simpleType[@name]" mode="parse-hdr-root">
- <xsl:param name="scope"/>
- <xsl:variable name='name' >
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
- <xsl:call-template name='class-parser-skel'>
- <xsl:with-param name='name' select="$name"/>
- <xsl:with-param name='class' select="concat('p_',$name,'_skel')"/>
- <xsl:with-param name='scope' select="concat($scope,'')"/>
- </xsl:call-template>
- <xsl:text> </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:complexType[@name]" mode="parse-hdr-root">
- <xsl:param name="scope"/>
- <xsl:variable name='name' >
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
- <xsl:call-template name='class-parser-skel'>
- <xsl:with-param name='name' select="$name"/>
- <xsl:with-param name='class' select="concat('p_',$name,'_skel')"/>
- <xsl:with-param name='scope' select="concat($scope,'')"/>
- </xsl:call-template>
- <xsl:text> </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:complexType[not(@name)]|xsd:simpleType[not(@name)]" mode="parse-hdr-root">
- <xsl:param name="name"/>
- <xsl:param name="scope"/>
- <xsl:call-template name='class-parser-skel'>
- <xsl:with-param name='class' select="concat('p_',$name,'_skel')"/>
- <xsl:with-param name='scope' select="concat($scope,'')"/>
- <xsl:with-param name='name' select="$name"/>
- </xsl:call-template>
- <xsl:text> </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@name and @type and @abstract and (@abstract='true')]" mode="parse-hdr-root">
- <xsl:text>//parse-hdr-root </xsl:text><xsl:value-of select="concat(@name,' ')"/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@name and not(@type) and @abstract and (@abstract='true')]" mode="parse-hdr-root">
- <xsl:text>//parse-hdr-root </xsl:text><xsl:value-of select="concat(@name,' ')"/>
- <xsl:variable name='name' >
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='class' select='concat($cls-parser-pref,$name,$cls-parser-suff)'/>
- <xsl:variable name='sclass' select='concat($name,$cls-parser-suff)'/>
- <xsl:text>class </xsl:text><xsl:value-of select='concat($class,": public virtual xsd::parser::ComplexElement ")'/>
- <xsl:text>{ &INDENT;public: </xsl:text>
- <xsl:value-of select='concat("&INDENT;",$class,"() {}; ")'/>
- <xsl:value-of select='concat("&INDENT;~",$class,"() {}; ")'/>
- <xsl:value-of select='concat("&INDENT;void ","post(",$sclass," &v) {}; ")'/>
- <xsl:text>}; </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@name and @type and not(@abstract)]" mode="parse-hdr-root">
- <xsl:text>//parse-hdr-root </xsl:text><xsl:value-of select="concat(@name,' ')"/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@name and not(@type) and not(@abstract)]" mode="parse-hdr-root">
- <xsl:param name="scope"/>
- <xsl:variable name='name' >
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
- <xsl:apply-templates select="xsd:simpleType|xsd:complexType" mode="parse-hdr-root">
- <xsl:with-param name='name' select="$name"/>
- <xsl:with-param name='scope' select="concat($scope,'')"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@ref]" mode="parse-hdr-root">
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attributeGroup[@name]" mode="parse-hdr-root">
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* parse-hdr-root </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name,"*/ ")'/>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@name and @type]" mode="parse-hdr-root">
- <xsl:param name="scope"/>
- <xsl:variable name='name' >
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* parse-hdr-root </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name," ",$name,"*/ ")'/>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@name and not(@type)]" mode="parse-hdr-root">
- <xsl:param name="scope"/>
- <xsl:variable name='name' >
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
- <xsl:apply-templates select="xsd:simpleType" mode="parse-hdr-root">
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name='name' select="$name"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- The class in header generation -->
- <xsl:template name='class-parser-skel'>
- <xsl:param name='class'/>
- <xsl:param name='name'/>
- <xsl:param name='scope'></xsl:param>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name'
- mode='normalize-name'/></xsl:variable>
- <xsl:variable name='sclass'>
- <xsl:value-of select='substring-after($class,$cls-parser-pref)'/>
- </xsl:variable>
- <xsl:variable name="mixed">
- <xsl:choose>
- <xsl:when test="@mixed"><xsl:value-of select="@mixed"/></xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!--TODO
- Well, the class can have complex content ... in
- that case, we use inheritance
- -->
- <xsl:text>/** </xsl:text>
- <xsl:value-of select='concat(" * class : ",$class," ")'/>
- <xsl:value-of select='concat(" * scope : ",$scope," ")'/>
- <xsl:value-of select='concat(" * type : ",name(.)," ")'/>
- <xsl:value-of select='concat(" * name : ",$name," ")'/>
- <xsl:text> */ class </xsl:text>
- <xsl:value-of select="$class"/>
- <xsl:text> : public /*</xsl:text>
- <xsl:value-of select='concat(" ",name(.)," */")'/>
- <xsl:choose>
- <xsl:when test='local-name(.)="element"'>
- <xsl:message terminate="yes">No ELement here</xsl:message>
- </xsl:when>
- <xsl:when test='local-name(.)="simpleType"'>
- <xsl:apply-templates select="xsd:restriction|xsd:list|xsd:union" mode="class-parser-skel-inherit"/>
- </xsl:when>
- <xsl:when test='local-name(.)="complexType"'>
- <xsl:variable name="ltp">
- <xsl:apply-templates select="xsd:simpleContent|xsd:complexContent" mode="class-parser-skel-inherit"/>
- <xsl:apply-templates select="xsd:choice|xsd:sequence|xsd:group|xsd:all" mode="class-parser-skel-inherit"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$ltp=''">
- <xsl:text>xsd::parser::ComplexElement</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$ltp"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>bad inheritance</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text> { &INDENT;public: </xsl:text>
- <!-- pre function -->
- <xsl:text>&INDENT2;// virtual pre() function, to be emplemented &INDENT2;// </xsl:text>
- <xsl:text>&INDENT2;void pre(); </xsl:text>
- <xsl:choose>
- <xsl:when test='local-name(.)="complexType" and
- not(./xsd:simpleContent or ./xsd:complexContent or ./xsd:choice or
- ./xsd:sequence or ./xsd:all or ./xsd:group)'>
- <xsl:text>&INDENT2;virtual void preInternal() {}; </xsl:text>
- <xsl:text>&INDENT2;virtual void postInternal() {}; </xsl:text>
- </xsl:when>
- <xsl:when test='((local-name(.)="complexType") and (local-name(./xsd:simpleContent) != "simpleContent")) or
- ( (local-name(.)="element") and (local-name(./xsd:complexType)="complexType"))'>
- <xsl:text>&INDENT2;// virtual preInternal() function, to be emplemented &INDENT2;// </xsl:text>
- <xsl:text>&INDENT2;void preInternal() ; </xsl:text>
- <xsl:text>&INDENT2;// virtual postInternal() function, to be emplemented &INDENT2;// </xsl:text>
- <xsl:text>&INDENT2;void postInternal() ; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- <!-- Default constructor ... -->
- <xsl:value-of select='concat("&INDENT2;",$class)'/><xsl:text>( /*parser factory*/); </xsl:text>
- <xsl:text>&INDENT2;~</xsl:text><xsl:value-of select="$class"/><xsl:text>(); </xsl:text>
- <!-- We also need the start and stopElement functions -->
- <xsl:if test='local-name(.)="complexType"'>
- <xsl:text>&INDENT2;bool startElementImpl(const std::string &ns,const std::string &name,const std::string &attributes); </xsl:text>
- <xsl:text>&INDENT2;bool endElementImpl(const std::string &ns,const std::string &name); </xsl:text>
- </xsl:if>
- <xsl:text>&INDENT2;// Attribute processing &INDENT2;// </xsl:text>
- <xsl:if test='local-name(.)="complexType"'>
- <xsl:text>&INDENT2;bool AttributeImpl(const std::string &ns,const std::string &name,const std::string &val); </xsl:text>
- </xsl:if>
- <xsl:if test='$mixed="true"'>
- <xsl:text>&INDENT2;virtual bool _CharacterImpl(const std::string &c) {m_str+=c;return true;}; </xsl:text>
- </xsl:if>
- <!-- We add a post method for simple type and complex type -->
- <xsl:text>&INDENT2;virtual void post(</xsl:text>
- <xsl:choose>
- <xsl:when test='1'>
- <xsl:text></xsl:text><xsl:value-of select='concat($scope,"::",substring-after($class,$cls-parser-pref),"")'/><xsl:text> &v) ; </xsl:text>
- </xsl:when>
- <xsl:when test='$scope!="-"'>
- <xsl:text></xsl:text><xsl:value-of select='concat($scope,"")'/><xsl:text> &v) ; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text></xsl:text><xsl:value-of select='concat($name,"_skel")'/><xsl:text> &v) ; </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text> public: </xsl:text>
- <!-- Event function declarations -->
- <xsl:text>&INDENT2;// parser-hdr-event processing </xsl:text>
- <xsl:apply-templates
- select="xsd:simpleContent|xsd:complexContent|xsd:all|xsd:group|xsd:choice|xsd:sequence|xsd:attribute|xsd:attributeGroup"
- mode='parser-hdr-event'>
- <xsl:with-param name='scope' select="concat($name,'_skel')"/>
- <xsl:with-param name='class' select='concat($class,"")'/>
- </xsl:apply-templates>
- <!-- For simple type, an element can contain a list, an union or a
- restriction !!!
- -->
- <xsl:apply-templates select="xsd:restriction|xsd:list|xsd:union" mode='parser-hdr-event'>
- <xsl:with-param name='scope' select="concat($name,'_skel')"/>
- </xsl:apply-templates>
-
- <xsl:text>&INDENT2;// parse-skel processing </xsl:text>
- <!-- Here, I need to place the variables -->
- <xsl:apply-templates select="xsd:simpleContent|xsd:complexContent" mode="parse-skel">
- <xsl:with-param name='scope' select="concat($scope,'::',substring-after($class,'p_'))"/>
- </xsl:apply-templates>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="xsd:restriction" mode="parse-skel">
- <xsl:with-param name='scope' select="concat($scope,'::',substring-after($class,'p_'))"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="xsd:group|xsd:choice|xsd:sequence|xsd:attribute|xsd:all|xsd:attributeGroup" mode="parse-skel">
- <xsl:with-param name='scope' select="concat($scope,'::',substring-after($class,'p_'))"/>
- </xsl:apply-templates>
- <!-- Access methods and class attributes -->
- <xsl:text>&INDENT;protected: </xsl:text>
- <xsl:text>&INDENT2;//parser-hdr-member </xsl:text>
- <xsl:value-of select='concat("class=",$sclass,"::",$sclass," m_",$name,"; ")'/>
- <xsl:text>&INDENT2;</xsl:text>
- <xsl:value-of select='concat($scope,"::",$sclass," m_",$name,"; ")'/>
- <xsl:apply-templates select="." mode="parser-hdr-member">
- <!--
- <xsl:with-param name='scope' select="concat($scope,'')"/>
- -->
- <xsl:with-param name='scope' select="concat($scope,'::',substring-after($class,'p_'))"/>
- <xsl:with-param name='class' select="concat($class,'')"/>
- </xsl:apply-templates>
- <xsl:text>}; </xsl:text>
- </xsl:template>
-
- <!--
- ***
- *** class-parse-skel-inherit
- ***
- Compute inherit class -->
- <xsl:template match="xsd:annotation" mode="class-parser-skel-inherit">
- </xsl:template>
- <xsl:template match="xsd:simpleType" mode="class-parser-skel-inherit">
- <xsl:apply-templates select='xsd:restriction|xsd:extension'
- mode='class-parser-skel-inherit'>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="xsd:complexType" mode="class-parser-skel-inherit">
- <xsl:variable name='subel'>
- <xsl:apply-templates select='xsd:simpleContent|xsd:complexContent'
- mode='class-parser-skel-inherit'>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='$subel!=""'>
- <xsl:value-of select="$subel"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>xsd::parser::ComplexElement</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="xsd:simpleContent" mode="class-parser-skel-inherit">
- <xsl:apply-templates select='xsd:restriction|xsd:extension'
- mode='class-parser-skel-inherit'>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="xsd:complexContent" mode="class-parser-skel-inherit">
- <xsl:apply-templates select='xsd:restriction|xsd:extension'
- mode='class-parser-skel-inherit'>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="xsd:union|xsd:list" mode="class-parser-skel-inherit">
- <xsl:text>xsd::parser::SimpleElement</xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:restriction" mode="class-parser-skel-inherit">
- <xsl:variable name='ns'>
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@base"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='local-name(..)="simpleContent"'>
- <xsl:text>xsd::parser::SimpleElement</xsl:text>
- </xsl:when>
- <xsl:when test='local-name(..)="simpleType"'>
- <xsl:choose>
- <xsl:when
- test='$ns="&XSD;"'>
- <xsl:text>xsd::parser::SimpleElement</xsl:text>
- </xsl:when>
- <xsl:when
- test='not(contains(@base,":")) and namespace::*[name()=""]="&XSD;"'>
- <xsl:text>xsd::parser::SimpleElement</xsl:text>
- </xsl:when>
- <xsl:when
- test='not(contains(@base,":")) and not(namespace::*[name()=""])'>
- <!-- No targetnamespace try this-->
- <xsl:message terminate="no">TRY: </xsl:message>
- <xsl:value-of select="@base"/><xsl:text>_skel</xsl:text>
- </xsl:when>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace'>
- <xsl:text></xsl:text><xsl:value-of select="concat(substring-after(@base,':'),'_skel')"/>
- </xsl:when>
-
- <xsl:otherwise>
- <xsl:message terminate='yes'>Failed <xsl:value-of
- select="concat('ns=',$ns,' base=',@base,' Default ns=',namespace::*[name()=''])"/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test='local-name(..)="complexContent"'>
- <xsl:variable name='cpp_ns'>
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select='$ns'/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select="@base" mode='normalize-name'/>
- </xsl:variable>
- <!-- This is correct:-->
- <xsl:value-of select='concat($cpp_ns,"::p_",$cpp_type,"_skel")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>Unsuported restriction</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:extension" mode="class-parser-skel-inherit">
- <xsl:variable name='ns'>
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@base"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='cpp_ns'>
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select='$ns'/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='local-name(..)="simpleContent"'>
- <xsl:choose>
- <xsl:when test='$ns="http://www.w3.org/2001/XMLSchema"'>
- <xsl:text>xsd::parser::SimpleElement</xsl:text>
- </xsl:when>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace'>
- <xsl:text></xsl:text><xsl:value-of select="substring-after(@base,':')"/>
- </xsl:when>
- <xsl:when
- test='not(contains(@base,":")) and namespace::*[name()=""]="http://www.w3.org/2001/XMLSchema"'>
- <xsl:text>xsd::parser::SimpleElement</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>Not yet implemented csd:extension with other ns <xsl:value-of
- select="concat('ns=',$ns,' TargetNS=',/xsd:schema/@targetNamespace)"/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test='local-name(..)="complexContent"'>
- <xsl:variable name='ns_prefix' select="substring-before(@base,':')"></xsl:variable>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select="@base" mode='normalize-name'/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$ns=/xsd:schema/@targetNamespace">
- <!-- corrected on 2011/06/14 -->
- <xsl:value-of select="concat($cpp_ns,'::',$cls-parser-pref,$cpp_type,$cls-parser-suff)"/>
- </xsl:when>
- <xsl:when test='$ns="&XSD;"'>
- <xsl:text>xsd::parser::SimpleElement</xsl:text>
- </xsl:when>
- <xsl:when test='not(contains(@base,":")) and not(namespace::*[name()=""])'>
- <xsl:value-of select="@base"/><xsl:text>_skel</xsl:text>
- </xsl:when>
- <xsl:when test='contains(@base,":") and namespace::*[name()=$ns_prefix]'>
- <xsl:value-of select="concat($cpp_ns,'::',$cls-parser-pref,substring-after(@base,':'),$cls-parser-suff)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>
- <xsl:text>Not yet implemented csd:extension with other </xsl:text>
- <xsl:value-of select='concat("@base=",@base," namespace=",$ns," --", namespace::*[name()="ecore"] )'/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>Not yet implemented</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:value-of select="concat(' /* ext-base ',@base,'*/')"/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:choice|xsd:sequence|xsd:group|xsd:all" mode="class-parser-skel-inherit">
- <!-- Ok, no simple content or complex content, choose depending on Type -->
- <xsl:choose>
- <xsl:when test="local-name(..)='complexType'">
- <xsl:text>xsd::parser::ComplexElement</xsl:text>
- </xsl:when>
- <xsl:when test="local-name(..)='simpleType'">
- <xsl:text>xsd::parser::SimpleElement</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>Untreated case : <xsl:value-of
- select='concat(local-name()," - ",@name," - ",local-name(..))'/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- ****
- **** mode parse-skel
- ****
- -->
- <!-- Declaration of attributes -->
- <xsl:template match="xsd:restriction" mode="parse-skel">
- <xsl:param name='scope'/>
- <xsl:choose>
- <xsl:when test='local-name(..)="simpleContent"'>
- <xsl:message terminate='yes'>Should not call attribute and attributeGroup here</xsl:message>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode="parse-skel">
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='local-name(..)="complexContent"'>
- <xsl:apply-templates select="xsd:sequence|xsd:choice" mode="parse-skel">
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode="parse-skel">
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='local-name(..)="simpleType"'>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <!-- -->
- <xsl:template match="xsd:simpleType" mode="parse-skel">
- <xsl:param name='scope'/>
- <xsl:text>// - </xsl:text>
- <xsl:value-of select="concat(../@name,' ')"/>
- <xsl:apply-templates select="xsd:restriction|xsd:extension" mode='parse-skel-simpleType'>
- <xsl:with-param name='scope' select='$scope'/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:complexType" mode="parse-skel">
- <xsl:param name='scope'/>
- <xsl:message terminate='no'>xsd2cpp-parser xsd:complexType ....</xsl:message>
- <xsl:apply-templates select="xsd:simpleContent|xsd:complextContent" mode="parse-skel">
- <xsl:with-param name='scope' select='$scope'/>
- </xsl:apply-templates>
- <xsl:apply-templates select="xsd:choice|xsd:sequence|xsd:group|xsd:all" mode="parse-skel">
- <xsl:with-param name='scope' select='$scope'/>
- </xsl:apply-templates>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode="parse-skel">
- <xsl:with-param name='scope' select='$scope'/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:simpleContent" mode="parse-skel">
- <xsl:param name='scope'/>
- <xsl:apply-templates select="xsd:restriction|xsd:extension" mode='parse-skel-simpleContent'>
- <xsl:with-param name='scope' select='$scope'/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:complexContent" mode="parse-skel">
- <xsl:param name='scope'/>
- <xsl:apply-templates select="xsd:restriction|xsd:extension" mode="parse-skel">
- <xsl:with-param name='scope' select='$scope'/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:simpleContent' mode='parse-skel-complexType'>
- <xsl:message terminate='yes'>MUST BE CODED</xsl:message>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexContent' mode='parse-skel-complexType'>
- <xsl:message terminate='yes'>MUST BE CODED</xsl:message>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:restriction' mode='parse-skel-complexType'>
- <xsl:message terminate='yes'></xsl:message>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:restriction' mode='parse-skel-simpleType'>
- <xsl:param name='scope'/>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select="@base" mode='restriction-base'/>
- </xsl:variable>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name'
- mode='normalize-name'/></xsl:variable>
-
- <xsl:variable name='parser'>xsd::parser::SimpleElement</xsl:variable>
- <xsl:message>Warning: simpleType restriction <xsl:value-of select="@base"/></xsl:message>
- <xsl:text> //Warning: Not yet impl simpleType restriction </xsl:text>
- <xsl:value-of select="concat(@base,' ')"/>
- <xsl:value-of select="concat(' ',$cpp_type,' m_',../../@name,'; ')"/>
- <xsl:value-of select="concat(' ',$parser,' *m_',../../@name,'_parser; public: ')"/>
- <xsl:value-of select="concat(' void ',../../@name,'_parser(',$parser,' &p) ')"/>
- <xsl:value-of select="concat(' { m_',../../@name,'_parser= &p;}; protected: ')"/>
- </xsl:template>
-
- <!--
- **
- ** parentathese for parse-skel-simpleContent
- **
- -->
- <xsl:template match='xsd:restriction' mode='parse-skel-simpleContent'>
- <xsl:param name='scope'/>
- <xsl:apply-templates select="xsd:enumeration|xsd:attribute" mode="parse-skel"/>
- </xsl:template>
-
- <xsl:template match='xsd:extension' mode='parse-skel-simpleContent'>
- <xsl:param name='scope'/>
- <xsl:message>Warning: Not yet implemented simpleContent extension <xsl:value-of select="@base"/></xsl:message>
- <xsl:text>&INDENT2;//parse-skel-simpleContent </xsl:text>
- <xsl:value-of select='concat(name(.)," @base=",@base," do not follow for attributes ")'/>
- <xsl:apply-templates select="xsd:attributeGroup|xsd:attribute" mode="parse-skel"/>
- <!--
- -->
- </xsl:template>
-
-
- <xsl:template match='xsd:restriction' mode='parse-skel-complexContent'>
- <xsl:param name='scope'/>
- <xsl:message terminate='no'>Warning: Not yet implemented complexContent restriction <xsl:value-of select="@base"/></xsl:message>
- <xsl:apply-templates select="xsd:sequence|xsd:choice|xsd:element" mode="parse-skel"/>
- <xsl:apply-templates select="xsd:attributeGroup|xsd:attribute" mode="parse-skel"/>
- </xsl:template>
- <xsl:template match='xsd:extension' mode='parse-skel-complexContent'>
- <xsl:param name='scope'/>
- <xsl:message>Warning: Not yet implemented complexContent extension <xsl:value-of select="@base"/></xsl:message>
- <xsl:apply-templates select="xsd:attributeGroup|xsd:attribute" mode="parse-skel"/>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:attribute[@ref!='']" mode="parse-skel">
- <xsl:param name='scope'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parse-skel xsd:attribute </xsl:text>
- <xsl:value-of select='concat(name(.),"@ref=",@ref," ")'/><xsl:text>*/ </xsl:text>
- </xsl:if>
- <xsl:apply-templates select='key("attribute",substring-after(@ref,":"))' mode="parse-skel">
- <xsl:with-param name='scope' select='$scope'></xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match="xsd:attribute[(@name!='') and not(@type)]" mode="parse-skel">
- <xsl:variable name='cpp_type'>
- <xsl:choose>
- <xsl:when test="./xsd:simpleType">
- <xsl:apply-templates select='/xsd:simpleType'
- mode='attribute-internal-cpp-type'/>
- </xsl:when>
- <xsl:otherwise><xsl:text>std::string</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parse-skel </xsl:text>
- <xsl:value-of select='concat(name(.),"@name=",@name," NO TYPE")'/><xsl:text>*/ </xsl:text>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[(@name!='') and @type]" mode="parse-skel">
- <xsl:param name='scope'></xsl:param>
- <xsl:variable name="name">
- <xsl:apply-templates select="@name" mode="normalize-name"/>
- </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:apply-templates select="@type" mode='namespace-uri-of-qname'>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:variable name="type"><xsl:value-of select="concat('xsd::',substring-after(@type,':'))"/></xsl:variable>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select="@type" mode='restriction-base'/>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parse-skel xsd:attribute </xsl:text>
- <xsl:value-of select='concat(name(.),"@name=",@name," @type=",@type)'/><xsl:text>*/ </xsl:text>
- </xsl:if>
- <xsl:choose>
- <xsl:when
- test='$ns="http://www.w3.org/2001/XMLSchema"'>
- <!-- Ok, we are in a basic type ... -->
- <xsl:choose>
- <xsl:when test='@use="optional"'>
- <xsl:value-of select='concat("&INDENT2;//typedef ",$scope,"::",$name,"_optional ",$name,"_optional;")'/><xsl:text> </xsl:text>
- <xsl:value-of select='concat("&INDENT2;//typedef ",$scope,"::",$name,"_attr_type ",$name,"_type;")'/><xsl:text> </xsl:text>
- <xsl:value-of select='concat("&INDENT2;//",$scope,"::",$name,"_optional m_attr_",$name)'/><xsl:text>; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when
- test='($ns=/xsd:schema/@targetNamespace) or (not(namespace::*[name()=""]) and not(contains(@type,":")))' >
- <xsl:variable name='parser' select='concat($cls-parser-pref,$cpp_type)'></xsl:variable>
- <xsl:choose>
- <xsl:when test='@use="optional"'>
- <xsl:value-of select='concat("&INDENT2;//typedef ",$scope,"::",$name,"_optional ",$name,"_optional;")'/><xsl:text> </xsl:text>
- <xsl:value-of select='concat("&INDENT2;//typedef ",$scope,"::",$name,"_attr_type ",$name,"_type;")'/><xsl:text> </xsl:text>
- <xsl:value-of select='concat("&INDENT2;//",$scope,"::",$name,"_optional m_attr_",$name)'/><xsl:text>; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
-
- <xsl:value-of select="concat(' void ',$name,'_parser(',$parser,' &p) ')"/>
- <xsl:value-of select="concat(' { m_',$name,'_parser= &p;}; ')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>Unmanaged Attribute <xsl:value-of
- select='@name'/> type <xsl:value-of select="concat(@type,' ns=',$ns)"/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:attributeGroup" mode="parse-skel">
- <xsl:param name='scope'/>
- <xsl:text>&INDENT2;/* parse-skel xsd:attributeGroup </xsl:text><xsl:value-of select='@ref'/><xsl:text>*/ </xsl:text>
- <xsl:choose>
- <xsl:when test='@ref'>
- <xsl:apply-templates mode="parse-skel" select="key('attrGroup',substring-after(@ref,':'))">
- <xsl:with-param name='scope' select='$scope'/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup|xsd:anyAttribute" mode="parse-skel">
- <xsl:with-param name='scope' select='$scope'/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:anyAttribute" mode="parse-skel">
- <xsl:message terminate="no">NO YET CODED anyAttribute</xsl:message>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:choice" mode="parse-skel">
- <xsl:param name='scope'/>
- <xsl:text>&INDENT2;/* parse-skel xsd:choice */ </xsl:text>
- <xsl:text>&INDENT2;bool choice_</xsl:text>
- <xsl:value-of select='count(ancestor::xsd:choice)'/>
- <xsl:text>(unsigned long &state,unsigned long &count,</xsl:text>
- <xsl:text>std::string &ns,std::string &name,bool start=true); </xsl:text>
- <xsl:apply-templates
- select='xsd:element|xsd:group|xsd:sequence|xsd:choice|xsd:any' mode="parse-skel">
- <xsl:with-param name='scope' select='$scope'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:group[@name]" mode="parse-skel">
- <xsl:param name='scope'/>
- <xsl:text>&INDENT2;/* parse-skel </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name," scope=",$scope)'/>
- <xsl:text> */ </xsl:text>
- <xsl:apply-templates
- select='xsd:element|xsd:group|xsd:sequence|xsd:choice|xsd:any' mode="parse-skel">
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:group[@ref]" mode="parse-skel">
- <xsl:param name='scope'/>
- <xsl:variable name='local-name'>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'><xsl:value-of select='substring-after(@ref,":")'/></xsl:when>
- <xsl:otherwise><xsl:value-of select='@ref'/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>&INDENT2;/* parse-skel </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref," scope=",$scope)'/>
- <xsl:text> */ </xsl:text>
- <xsl:apply-templates
- select='/xsd:schema/xsd:group[@name=$local-name]' mode="parse-skel">
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:sequence" mode="parse-skel">
- <xsl:param name='scope'/>
- <xsl:text>&INDENT2;/* parse-skel </xsl:text>
- <xsl:value-of select='concat(name(.)," @maxOccurs=",@maxOccurs," scope=",$scope)'/>
- <xsl:text> */ </xsl:text>
- <xsl:text>&INDENT2;//bool sequence_0(unsigned long &state,unsigned long &count,</xsl:text>
- <xsl:text>std::string &ns,std::string &name,bool start=true); </xsl:text>
- <xsl:apply-templates
- select='xsd:element|xsd:group|xsd:sequence|xsd:choice|xsd:any' mode="parse-skel">
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:any" mode="parse-skel">
- <xsl:param name='scope'/>
- <xsl:value-of select='concat(@type," ",@name)'/>
- <xsl:text>/* xsd::any m_any; */ </xsl:text>
- </xsl:template>
- <!--
- There is still a lot to do here, What if type is not given ?
- how to process simpleContent and complexContent here ?
- how to process namespaces in
- -->
- <xsl:template match="xsd:element[@ref]" mode="parse-skel">
- <xsl:param name='scope'/>
- <xsl:variable name='el' select='substring-after(@ref,":")'/>
- <xsl:variable name='nname'><xsl:apply-templates select="@ref" mode="normalize-name"/>
- </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:apply-templates select='@ref' mode='namespace-uri-of-qname'/>
- </xsl:variable>
- <xsl:message>xsd-parser-header parse-skel <xsl:value-of select="@ref"/></xsl:message>
- <!--
- <xsl:apply-templates
- select="/xsd:schema/xsd:element[@name=$el]"
- mode="parse-skel">
- <xsl:with-param name='maxOccurs' select="@maxOccurs"/>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- <xsl:text>&INDENT;public: </xsl:text>
- -->
- <xsl:text>&INDENT2;// parse-skel What I am suposed to do @ref=</xsl:text>
- <xsl:value-of select='concat(@ref," ")'/>
- <xsl:value-of select='concat("&INDENT2;void ",$nname,"_parser(",$cls-parser-pref,$nname,$cls-parser-suff," &p)")'/>
- <xsl:text>{</xsl:text><xsl:value-of select='concat("m_",$nname,"_parser = &p")'/><xsl:text>;}; </xsl:text>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:element[@name and not(@type)]" mode="parse-skel">
- <xsl:param name='scope'/>
- <xsl:variable name='nname'>
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
- <!--
- <xsl:text>#if 0 </xsl:text>
- <xsl:call-template name='class-parser-skel'>
- <xsl:with-param name='class' select="concat('p_',$nname,'_skel')"/>
- <xsl:with-param name='scope' select="concat($scope,'::',$nname,'_skel')"/>
- </xsl:call-template>
- <xsl:text>#endif </xsl:text>
- -->
- <xsl:text>// Element no type </xsl:text>
- <xsl:value-of select='concat(@name," ")'/>
- <xsl:choose>
- <xsl:when test="./xsd:simpleType|xsd:complexType">
- <xsl:apply-templates select="xsd:simpleType|xsd:complexType"
- mode="parse-hdr-root">
- <xsl:with-param name='name' select="$nname"/>
- <xsl:with-param name='class' select="concat('p_',$nname,'_skel')"/>
- <xsl:with-param name='scope' select="concat($scope,'')"/>
- <!--
- <xsl:with-param name='scope' select="concat($scope,'::',$nname,'_skel')"/>
- -->
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>&INDENT2;typedef ::xsd::parser::SimpleElement </xsl:text>
- <xsl:value-of select='concat($cls-parser-pref,$nname,$cls-parser-suff,"; ")'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text> </xsl:text>
- <xsl:value-of select='concat("&INDENT2;void ",$nname,"_parser(",$cls-parser-pref,$nname,$cls-parser-suff," &p)")'/>
- <xsl:text>{</xsl:text><xsl:value-of select='concat("m_",$nname,"_parser = &p")'/><xsl:text>;}; </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@name and @type]" mode="parse-skel">
- <xsl:param name='scope'/>
- <xsl:param name='maxOccurs'>1</xsl:param>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name'
- mode='normalize-name'/></xsl:variable>
- <xsl:variable name="btype">
- <xsl:choose>
- <xsl:when test="substring-after(@type,':')">
- <xsl:value-of select="substring-after(@type,':')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@type"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="ns_type" select="substring-before(@type,':')"/>
- <xsl:variable name='ns'>
- <xsl:choose>
- <xsl:when test="substring-after(@type,':')">
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select='@type'/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/xsd:schema/@targetNamespace"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='cpp_type'>
- <xsl:choose>
- <xsl:when test="substring-after(@type,':')">
- <xsl:apply-templates select='@type' mode='restriction-base'/>
- </xsl:when>
- <xsl:when test='not(@type)'></xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat(@type,'_skel')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$cpp_type=''">
- <xsl:message terminate="yes">MUST NEVER OCCUR <xsl:value-of select='@name'/></xsl:message>
- <xsl:text> // cpp_type=null </xsl:text><xsl:value-of select="concat(@name,' ')"/>
- <!-- Ok, now start the definition of the class -->
- <xsl:call-template name='class-parser-skel'>
- <xsl:with-param name='class' select="concat('p_',$nname,'_skel')"/>
- <xsl:with-param name='scope' select="concat($scope,'::',$nname,'_skel')"/>
- </xsl:call-template>
- <xsl:text> </xsl:text>
- <xsl:text>&INDENT2;//typedef </xsl:text><xsl:value-of select='concat($cls-parser-pref,$scope,"::",$cls-parser-pref,$nname,$cls-parser-suff," ",$cls-parser-pref,$nname,$cls-parser-suff,"; ")'/>
- <xsl:value-of select='concat("&INDENT2;",$cls-parser-pref,$nname,$cls-parser-suff," *m_",$nname,"_parser")'/><xsl:text>; </xsl:text>
- <!--TODO take into account the maxOccurs and optionnal field is required to have the proper type -->
- <xsl:choose>
- <xsl:when test='(@maxOccurs="unbounded") or ($maxOccurs="unbounded")'>
- <xsl:value-of select='concat("&INDENT2;",$scope,"::",$nname,"_sequence m_",$nname)'/><xsl:text>; public: </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("&INDENT2;",$scope,"::",$nname,"_skel m_",$nname)'/><xsl:text>; public: </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:value-of select='concat("&INDENT2;void ",$nname,"_parser(p_",$scope,"::p_",$nname,"_skel &p)")'/>
- <xsl:text>{</xsl:text><xsl:value-of select='concat("m_",$nname,"_parser = &p")'/><xsl:text>;}; </xsl:text>
- </xsl:when>
- <xsl:when
- test='namespace::*[name()=$ns_type]="http://www.w3.org/2001/XMLSchema"'>
- <!-- Store the value .... -->
- <xsl:text> </xsl:text>
- <xsl:value-of select='concat("&INDENT2;void ",$nname,"_parser(::xsd::parser::SimpleElement &p)")'/>
- <xsl:text> {</xsl:text><xsl:value-of select='concat("m_",$nname,"_parser = &p")'/><xsl:text>;}; </xsl:text>
-
- </xsl:when>
- <xsl:when
- test='$ns=/xsd:schema/@targetNamespace'>
- <!-- Store the value ....
- <xsl:message terminate="no">xsd-parser:Element <xsl:value-of
- select="concat(@type,' - ',$btype)"/> lake other ns space </xsl:message>
- -->
- <!-- What will be the type ? -->
- <xsl:text>; </xsl:text>
- <xsl:value-of select='concat("&INDENT2;void ",$nname,"_parser(p_",$cpp_type," &p)")'/>
- <xsl:text>{</xsl:text><xsl:value-of select='concat("m_",$nname,"_parser = &p")'/><xsl:text>;}; </xsl:text>
- </xsl:when>
- <xsl:when test='$ns'>
- <xsl:variable name="cp_ns">
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="$ns"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:text> /* Foreign namespace </xsl:text><xsl:value-of select="$ns"/><xsl:text>*/ </xsl:text>
- <xsl:value-of select='concat(" //",$cp_ns,"::p_",$btype,"_skel *m_",@name,"_parser")'/><xsl:text>; </xsl:text>
- <!-- What will be the type ? -->
- <xsl:choose>
- <xsl:when test='(@maxOccurs="unbounded") or ($maxOccurs="unbounded")'>
- <xsl:value-of select='concat($scope,"::",$nname,"_sequence m_",$nname)'/><xsl:text>; public: </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat($scope,"::",$nname,"_type m_",@name)'/><xsl:text>; public: </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:value-of select='concat(" void ",@name,"_parser(",$cp_ns,"::p_",$btype,"_skel &p)")'/>
- <xsl:text>{</xsl:text><xsl:value-of select='concat("m_",@name,"_parser = &p")'/><xsl:text>;}; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">Warning: Need to be checked xsd-parser:Element <xsl:value-of
- select="concat(@name,' - ',@type,' - ',$btype)"/> lake other ns space </xsl:message>
- <xsl:value-of select='concat(" p_",$btype,"_skel *m_",@name,"_parser")'/><xsl:text>; </xsl:text>
- <!-- What will be the type ? -->
- <xsl:value-of select='concat($btype,"_skel m_",@name)'/><xsl:text>; public: </xsl:text>
- <xsl:value-of select='concat(" void ",@name,"_parser(p_",$btype,"_skel &p)")'/>
- <xsl:text>{</xsl:text><xsl:value-of select='concat("m_",@name,"_parser = &p")'/><xsl:text>;}; protected: </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:complexType' mode='parse-skel-element-type'>
- <xsl:apply-templates select="xsd:simpleContent|xsd:complexContent" mode='parse-skel-element-type'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:simpleContent' mode='parse-skel-element-type'>
- <xsl:apply-templates mode='parse-skel-element-type'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:restriction' mode='parse-skel-element-type'>
- <xsl:variable name='btype' select='substring-after(@base,":")'/>
- <xsl:variable name='schem' select='substring-before(@base,":")'/>
- <xsl:text> std::</xsl:text><xsl:value-of select="$btype"/>
- </xsl:template>
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-
-<!--
- :vim:ts=2:sw=2:et:
--->
-
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- version="2.0" >
-
-
- <!--
- ***
- *** parser-src-attribute
- *** implement attribute parsing ...
- -->
- <xsl:template name="parser-src-attribute">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='sscope'></xsl:param>
- <xsl:variable name='ln' select='local-name(.)'/>
- <xsl:message terminate='no'>xsd2cpp-parser Process Attr parsing <xsl:value-of select="@name"/></xsl:message>
- <xsl:text>bool </xsl:text>
- <xsl:value-of select='concat($scope,$class)'/><xsl:text>::</xsl:text>
- <xsl:text>AttributeImpl(const std::string &ns,const std::string &
- name,const std::string &val) { </xsl:text>
-<!--
--->
- <xsl:call-template name='debug'>
- <xsl:with-param name='mode' />
- <xsl:with-param name='indent' select='concat("&INDENT;","")'/>
- <xsl:with-param name='string'>
- <xsl:text>std::cout<<"</xsl:text>
- <xsl:value-of select='concat($class,"AttributeImpl size=")'/>
- <xsl:choose>
- <xsl:when test='$ln="complexType" and not(./xsd:simpleContent)'>
- <xsl:text>"<<m_context.size()<<std::endl;</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>"<<"No stack"<<std::endl;</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- <xsl:text>//std::cout<<"Attribute impl </xsl:text><xsl:value-of select="$class"/><xsl:text>\n"; </xsl:text>
- <xsl:call-template name='class-parser-skel-source-need-state'/>
- <xsl:apply-templates select="xsd:simpleContent|xsd:restriction|xsd:extension|xsd:complexContent|xsd:attribute|xsd:attributeGroup" mode="parser-src-attribute">
- </xsl:apply-templates>
- <xsl:text> return false; </xsl:text>
- <xsl:text>} </xsl:text>
- </xsl:template>
-
- <xsl:template match="xsd:annotation" mode="parser-src-attribute">
- </xsl:template>
- <xsl:template match="xsd:simpleContent" mode="parser-src-attribute">
- <xsl:apply-templates select="xsd:restriction|xsd:extension" mode='parser-src-attribute-simpleContent'/>
- </xsl:template>
- <xsl:template match="xsd:complexContent" mode="parser-src-attribute">
- <xsl:text>/* xsd:complexContent */ </xsl:text>
- <xsl:apply-templates select="xsd:restriction|xsd:extension" mode='parser-src-attribute-complexContent'/>
- </xsl:template>
- <xsl:template match="xsd:restriction" mode="parser-src-attribute-simpleContent">
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode="parser-src-attribute"/>
- </xsl:template>
- <xsl:template match="xsd:restriction" mode="parser-src-attribute-complexContent">
- <xsl:apply-templates select="xsd:sequence|xsd:choice|xsd:group|xsd:attribute|xsd:attributeGroup" mode="parser-src-attribute"/>
- </xsl:template>
- <xsl:template match="xsd:extension" mode="parser-src-attribute-simpleContent">
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode="parser-src-attribute"/>
- </xsl:template>
- <xsl:template match="xsd:extension" mode="parser-src-attribute-complexContent">
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode="parser-src-attribute"/>
- </xsl:template>
- <xsl:template match="xsd:attributeGroup[@ref!='']" mode="parser-src-attribute">
- <xsl:apply-templates select='key("attrGroup",substring-after(@ref,":"))' mode="parser-src-attribute"/>
- </xsl:template>
- <xsl:template match="xsd:attributeGroup[@name!='']" mode="parser-src-attribute">
- <xsl:apply-templates mode="parser-src-attribute"/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@name!='' and not(@type)]" mode="parser-src-attribute">
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT;/* parser-src-attribute </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name," no type */ ")'/>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@name and @type]" mode="parser-src-attribute">
- <xsl:variable name="nname"><xsl:apply-templates select="@name" mode='normalize-name'/></xsl:variable>
- <xsl:variable name='ns'>
- <xsl:choose>
- <xsl:when test='@form'>
- <xsl:apply-templates select="@form" mode='qualified-namespace'>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>ns.empty()</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='ns_'>
- <xsl:apply-templates select="@type" mode="namespace-uri-of-qname">
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:value-of select='concat("&INDENT;// Espace de nommage : ",$ns," ")'/>
- <xsl:text>&INDENT;if (name == "</xsl:text><xsl:value-of select="@name"/>
- <xsl:text>" &&</xsl:text>
- <xsl:value-of select="concat(' &INDENT2;',$ns)"/>
- <xsl:text>) { </xsl:text>
- <xsl:choose>
- <xsl:when test="$ns_='http://www.w3.org/2001/XMLSchema'">
- <xsl:text> xsd::parser::SimpleElement s; </xsl:text>
- </xsl:when>
- <xsl:when test="$ns_=/xsd:schema/@targetNamespace or
- (not(namespace::*[name()='']) and not(contains(@type,':')))">
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@type' mode='restriction-base'/>
- </xsl:variable>
- <xsl:value-of select='concat("&INDENT2;if (this->m_",$nname,"_parser==NULL) return false; ")'/>
- <xsl:value-of select='concat("&INDENT2;p_",$cpp_type," &s=")'/>
- <xsl:value-of select='concat("*this->m_",$nname,"_parser;"," ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>Don't know <xsl:value-of select="concat(@name,' ns=',$ns_)"/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>&INDENT2;s.preImpl(); </xsl:text>
- <xsl:text>&INDENT2;s._Characters(val); </xsl:text>
- <xsl:value-of select='concat("&INDENT2;",$nname,"_attr_type tmp; ")'/>
- <xsl:choose>
- <xsl:when test='@use and @use="prohibited"'>
- <!-- Should raise an error. Parameter is prohibited but present ! -->
- <xsl:value-of select='concat("&INDENT2;s.post(tmp); ","")'/>
- </xsl:when>
- <xsl:when test='@use and @use="required"'>
- <xsl:value-of select='concat("&INDENT2;s.post(tmp); ","")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("&INDENT2;s.post(","tmp","); ")'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test='@use and @use!="optional"'>
- <xsl:value-of select='concat("&INDENT2;",$nname,"_attr_type tmp_; tmp_=tmp; ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("&INDENT2;",$nname,"_optional tmp_; tmp_=tmp; ")'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>&INDENT2;this->onAttr</xsl:text><xsl:value-of select="$nname"/>
- <xsl:text>(tmp_); </xsl:text><!-- Ok, save the value of the attribute -->
- <xsl:text>&INDENT2;//std::cout<<"Process attribute </xsl:text><xsl:value-of select="@name"/>
- <xsl:text> val="<<val<<std::endl; return true; } </xsl:text>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:attribute[@ref]" mode="parser-src-attribute">
- <xsl:variable name="nname"><xsl:apply-templates select="@ref" mode='normalize-name'/></xsl:variable>
- <xsl:variable name='lref'>
- <xsl:apply-templates select='key("attribute",@ref)' mode='parse-skel'/>
- </xsl:variable>
- <xsl:variable name='name'>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'><xsl:value-of select='substring-after(@ref,":")'/></xsl:when>
- <xsl:otherwise><xsl:value-of select='@ref'/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='form'>
- <xsl:choose>
- <xsl:when test='@form'>
- <xsl:apply-templates select="@form" mode='qualified-namespace'></xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise><xsl:text>ns.empty()</xsl:text> </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:call-template name="namespace-uri-of-qname">
- <xsl:with-param name='qname' select="@ref"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text> &INDENT;/* parser-src-attribute </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref",@ref," */ ")'/>
- </xsl:if>
- <xsl:text>&INDENT;if (name == "</xsl:text><xsl:value-of select="$nname"/>
- <xsl:text>" &&</xsl:text>
- <xsl:value-of select="concat(' &INDENT2;',$form)"/>
- <xsl:text>) &INDENT;{ </xsl:text>
- <xsl:choose>
- <xsl:when test="$ns='http://www.w3.org/2001/XMLSchema'">
- <xsl:text> xsd::parser::SimpleElement s; </xsl:text>
- </xsl:when>
- <xsl:when test="$ns=/xsd:schema/@targetNamespace or
- (not(namespace::*[name()='']) and not(contains(@ref,':')))">
- <xsl:variable name='cpp_type'>
- <xsl:choose>
- <xsl:when test='/xsd:schema/xsd:attribute[@name=$name]/@type'>
- <xsl:variable name='typens'>
- <xsl:call-template name="namespace-uri-of-qname">
- <xsl:with-param name='qname' select="/xsd:schema/xsd:attribute[@name=$name]/@type"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='$typens="&XSD;"'>
- <xsl:text> xsd::parser::SimpleElement s; </xsl:text>
- </xsl:when>
- <xsl:otherwise><xsl:text>p_</xsl:text>
- <xsl:apply-templates select='/xsd:schema/xsd:attribute[@name=$name]/@type'
- mode='restriction-base'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise><xsl:text>p_</xsl:text>
- <xsl:apply-templates select='@ref' mode='restriction-base'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select='concat("&INDENT2;//if (this->m_",$nname,"_parser==NULL) return false; ")'/>
- <xsl:value-of select='concat("&INDENT2;",$cpp_type," s;//&s=")'/>
- <xsl:value-of select='concat("*this->m_",$nname,"_parser;"," ")'/>
- <!--
- <xsl:text> xsd::parser::SimpleElement s; </xsl:text>
- -->
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='no'>Don't know <xsl:value-of select="concat(@ref,' ns=',$ns)"/></xsl:message>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@ref' mode='restriction-base'/>
- </xsl:variable>
- <xsl:variable name='cpp_ns'>
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select='$ns'/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select='concat("&INDENT2;//if (this->m_",$nname,"_parser==NULL) return false; ")'/>
- <xsl:value-of select='concat("&INDENT2;",$cpp_ns,"::p_",$nname,"_skel s;//&s=")'/>
- <xsl:value-of select='concat("*this->m_",$nname,"_parser;"," ")'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>&INDENT2;s.preImpl(); </xsl:text>
- <xsl:text>&INDENT2;s._Characters(val); </xsl:text>
- <xsl:value-of select='concat("&INDENT2;",$nname,"_attr_type tmp; ")'/>
- <xsl:choose>
- <xsl:when test='@use and @use="prohibited"'>
- <!-- Should raise an error. Parameter is prohibited but present ! -->
- <xsl:value-of select='concat("&INDENT2;//s.post(tmp); ","")'/>
- </xsl:when>
- <xsl:when test='@use and @use="required"'>
- <xsl:value-of select='concat("&INDENT2;s.post(tmp); ","")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("&INDENT2;s.post(","tmp","); ")'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test='@use and @use!="optional"'>
- <xsl:value-of select='concat("&INDENT2;",$nname,"_attr_type tmp_; tmp_=tmp; ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("&INDENT2;",$nname,"_optional tmp_; tmp_=tmp; ")'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>&INDENT2;this->onAttr</xsl:text><xsl:value-of select="$nname"/>
- <xsl:text>(tmp_); </xsl:text><!-- Ok, save the value of the attribute -->
- <xsl:text>&INDENT;} </xsl:text>
- <xsl:text>#if 0 </xsl:text>
- <xsl:choose>
- <xsl:when test='$lref'>
- <!-- Ok, Local types are easy-->
- <xsl:message terminate='no'>Error to be coded lref <xsl:value-of select="@ref"/></xsl:message>
- <xsl:apply-templates select='key("attribute",substring-after(@ref,":"))' mode="parser-src-attribute"/>
- </xsl:when>
- <xsl:when test='$ns="/xsd:schema/@targetNamespace"'>
- <xsl:message terminate='yes'>Error to be coded <xsl:value-of select="@ref"/></xsl:message>
- <xsl:apply-templates select='key("attribute",substring-after(@ref,":"))' mode="parser-src-attribute"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>I don't know how to treat this case</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>#endif </xsl:text>
- </xsl:template>
-
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<xsl:transform
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xsd2cpp="http:/ebersold.fr/dede"
- xmlns:ex="http://regenstrief.org/org.regenstrief.saxon7."
- version="2.0" >
-<!--
- vim:ts=2:sw=2:et:
--->
-
-
- <!--
- End function content
-
- -->
- <!-- -->
- <xsl:template match='xsd:simpleContent' mode="parser-src-end">
- <xsl:text>&INDENT;// simpleContent TO Be coded </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexContent' mode="parser-src-end">
- <xsl:text>&INDENT;// complexContent TO Be coded </xsl:text>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:group[@ref]' mode="parser-src-end">
- <xsl:param name='class'></xsl:param>
- <xsl:param name='scope'></xsl:param>
- <xsl:param name='sscope'></xsl:param>
- <xsl:variable name='local-name'>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'><xsl:value-of select='substring-after(@ref,":")'/></xsl:when>
- <xsl:otherwise><xsl:value-of select='@ref'/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>&INDENT;// parser-src-end </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref," ")'/>
- <xsl:apply-templates select="/xsd:schema/xsd:group[@name=$local-name]" mode="parser-src-end">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='sscope' select="$sscope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:group[@name]' mode="parser-src-end">
- <xsl:param name='class'></xsl:param>
- <xsl:param name='scope'></xsl:param>
- <xsl:param name='sscope'></xsl:param>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT;/* parser-src-end </xsl:text>
- <xsl:value-of select='concat(name(.),"@name=",@name,"*/ ")'/>
- </xsl:if>
- <xsl:apply-templates select="xsd:sequence|xsd:choice|xsd:all" mode="parser-src-end">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='sscope' select="$sscope"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:all' mode="parser-src-end">
- <xsl:param name='class'></xsl:param>
- <xsl:param name='scope'></xsl:param>
- <xsl:param name='sscope'></xsl:param>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT;/* parser-src-end </xsl:text>
- <xsl:value-of select='concat(name(.),"*/ ")'/>
- </xsl:if>
- <xsl:apply-templates select="xsd:element" mode="parser-src-end">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='sscope' select="$sscope"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:choice|xsd:sequence' mode="parser-src-end">
- <xsl:param name='class'></xsl:param>
- <xsl:param name='scope'></xsl:param>
- <xsl:param name='sscope'></xsl:param>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT;/* parser-src-end </xsl:text>
- <xsl:value-of select='concat(name(.),"*/ ")'/>
- </xsl:if>
- <xsl:apply-templates select="xsd:sequence|xsd:choice|xsd:element" mode="parser-src-end">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='sscope' select="$sscope"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- Why should it be the same ? -->
- <xsl:template match='xsd:element[@ref!=""]' mode="parser-src-end">
- <xsl:param name='class'></xsl:param>
- <xsl:param name='scope'></xsl:param>
- <xsl:param name='sscope'></xsl:param>
- <xsl:variable name="sclass">
- <xsl:value-of select='substring-after($class,"p_")'/>
- </xsl:variable>
- <xsl:variable name='nname' ><xsl:apply-templates select='@ref' mode='normalize-name'/></xsl:variable>
- <xsl:variable name='form'>
- <xsl:apply-templates select="." mode="element-form"/>
- </xsl:variable>
- <xsl:variable name='maxOccurs'>
- <xsl:apply-templates select="." mode="element-max-occurs"/>
- </xsl:variable>
- <xsl:variable name="ns">
- <xsl:choose>
- <xsl:when test='$form ="qualified"'>ns == "<xsl:value-of select="/xsd:schema/@targetNamespace"/>"</xsl:when>
- <xsl:otherwise>ns.empty()</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='local-name'>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'><xsl:value-of select='substring-after(@ref,":")'/></xsl:when>
- <xsl:otherwise><xsl:value-of select="@ref"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- referenced elements could be treated differently if we refer to an
- -->
- <xsl:text>&INDENT;/* parser-src-end </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref," */ ")'/>
- <xsl:choose>
- <xsl:when test='/xsd:schema/xsd:element[@name=$local-name]/@abstract'>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select='.' mode='gen-parser-impl-element-end'>
- <xsl:with-param name='elname' select='$nname'></xsl:with-param>
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='sscope' select="$sscope"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:element[@name and not(@type)]' mode="parser-src-end">
- <xsl:param name='class'></xsl:param>
- <xsl:param name='scope'></xsl:param>
- <xsl:param name='maxOccurs'>1</xsl:param>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name' mode='normalize-name'/></xsl:variable>
- <xsl:variable name='cpp_type'>
- <xsl:value-of select='concat($scope,substring-after($class,"p_"),"::",$nname,"_type")'/>
- </xsl:variable>
- <xsl:variable name='sclass' select="substring-after($class,'p_')"/>
- <xsl:variable name='ns'>
- <xsl:choose>
- <xsl:when test='@form'>
- <xsl:apply-templates select="@form" mode='qualified-namespace'> </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='/xsd:schema/@elementFormDefault="qualified"'>
- <xsl:apply-templates select="/xsd:schema/@targetNamespace" mode='qualified-namespace'> </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='/xsd:schema/@elementFormDefault="unqualified"'>
- <xsl:text>ns.empty()</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>ns.empty()</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:apply-templates select='.'
- mode='gen-parser-impl-element-end'>
- <xsl:with-param name='elname' select='$nname'></xsl:with-param>
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='is_empty'>
- <xsl:choose>
- <xsl:when test='not(./xsd:simpleType) and
- not(./xsd:complexType)'>yes</xsl:when>
- <xsl:otherwise>no</xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
-
- </xsl:template>
-
- <!-- Generate test with element having a name. (be carefull, type can be anonymous -->
- <xsl:template match='xsd:element[@name and @type]' mode="parser-src-end">
- <xsl:param name='class'></xsl:param>
- <xsl:param name='scope'></xsl:param>
- <xsl:param name='sscope'></xsl:param>
- <xsl:param name='maxOccurs'>1</xsl:param>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name'
- mode='normalize-name'/></xsl:variable>
-
- <xsl:variable name='sclass' select="substring-after($class,'p_')"/>
- <xsl:variable name='ns'>
- <xsl:choose>
- <xsl:when test='@form'>
- <xsl:apply-templates select="@form" mode='qualified-namespace'> </xsl:apply-templates>
- </xsl:when>
- <xsl:when
- test='/xsd:schema/@elementFormDefault="qualified"'>
- <xsl:apply-templates select="/xsd:schema/@targetNamespace" mode='qualified-namespace'> </xsl:apply-templates>
- </xsl:when>
- <xsl:when
- test='/xsd:schema/@elementFormDefault="unqualified"'>
- <xsl:text>ns.empty()</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>ns.empty()</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='ns_oftype'>
- <xsl:apply-templates select="@type" mode='namespace-uri-of-qname'>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:variable name='cpp_ns'>
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select='$ns_oftype'/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='cpp_type'>
- <xsl:variable name='tmp'><xsl:apply-templates select='@type' mode='restriction-base'/></xsl:variable>
- <xsl:choose>
- <xsl:when test='$ns_oftype="&XSD;"'>
- <xsl:value-of select='concat("",$tmp)'/>
- </xsl:when>
- <xsl:when test='$ns_oftype=/xsd:schema/@targetNamespace'>
- <xsl:value-of select='concat("",$tmp)'/>
- </xsl:when>
- <xsl:when test='$ns_oftype!="" and $ns_oftype!="&XSD;" and $ns_oftype!=/xsd:schema/@targetNamespace'>
- <xsl:value-of select='concat("",$tmp)'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>STOP <xsl:value-of select="concat($tmp,' type=',@type,' - name=',@name)"/></xsl:message>
- <xsl:value-of select='concat("",$tmp)'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>#if 0 </xsl:text>
- <xsl:text>&INDENT;if (name == "</xsl:text><xsl:value-of select='@name'/><xsl:text>" &&</xsl:text>
- <xsl:value-of select="concat(' ',$ns,')')"/>
- <xsl:text>{ </xsl:text>
- <xsl:text> //std::cout<<"Yes end element </xsl:text>
- <xsl:value-of
- select="@name"/><xsl:text>"<<std::endl; </xsl:text>
- <xsl:text>&INDENT;if ( this->m_</xsl:text>
- <xsl:value-of select='concat($nname,"_parser")'/><xsl:text>!=0) { </xsl:text>
- <!-- New way, will use data from stack .... -->
- <xsl:value-of select='concat("&INDENT2;if (s.m_data) ","")'/>
- <xsl:text>&INDENT3;this->m_</xsl:text>
- <xsl:value-of select='concat($nname,"_parser->post(*(static_cast<")'/>
- <xsl:value-of select='concat($cpp_type," *>","(s.m_data))); ")'/>
- <!-- New way, will use data from stack .... -->
- <xsl:text>&INDENT2;this->onEl</xsl:text><xsl:value-of select="$nname"/>
- <xsl:value-of select='concat("(*(static_cast<",$cpp_type," *>(s.m_data))); ")'/>
- <xsl:text>&INDENT2;if (s.m_parser) </xsl:text>
- <xsl:text>&INDENT2;{ </xsl:text>
- <xsl:text>&INDENT3;s.m_parser->post(); </xsl:text>
- <!-- Release data or affect -->
- <xsl:text>&INDENT3;if (s.m_data) { </xsl:text>
- <!-- -->
- <xsl:choose>
- <xsl:when test='(@maxOccurs="unbounded") or ($maxOccurs="unbounded")'>
- <!--
- <xsl:value-of select='concat("&INDENT4;this->m_",$nname,".push_back(","",$sclass,"::",$nname,"_sptr(new ",$elem_pref,$nname,$elem_suff,"((static_cast<",$cpp_type," *>(s.m_data))))); ")'/>
- -->
- <xsl:value-of select='concat("&INDENT4;this->m_",$nname,".push_back(","",$sclass,"::",$nname,"_sptr((static_cast<",$cpp_type," *>(s.m_data)))); ")'/>
- <xsl:value-of select='concat("","&INDENT3;s.m_data=0; ")'/>
- </xsl:when>
- <xsl:otherwise>
-
- <xsl:value-of select='concat("&INDENT3;this->m_",$nname,"=*(static_cast<",$cpp_type," *>(s.m_data)); ")'/>
- <xsl:value-of select='concat("&INDENT3;delete (static_cast<",$cpp_type," *>(s.m_data));s.m_data=0; ")'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>&INDENT2;} </xsl:text>
- <xsl:text>&INDENT;} </xsl:text>
-
- <xsl:text>&INDENT2;//std::cout<<" read </xsl:text>
- <xsl:value-of select="@name"/><xsl:text> : "<<</xsl:text>
- <xsl:value-of select='concat("m_",@name)'/>
- <xsl:text><<std::endl; </xsl:text>
- <xsl:text>&INDENT2;} </xsl:text>
- <xsl:text>&INDENT2;return true; </xsl:text>
- <xsl:text>&INDENT;} </xsl:text>
- <xsl:text>#endif </xsl:text>
-
- <xsl:apply-templates select='.'
- mode='gen-parser-impl-element-end'>
- <xsl:with-param name='elname' select='$nname'></xsl:with-param>
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='sscope' select="$sscope"/>
- </xsl:apply-templates>
- </xsl:template>
-
-
-
-</xsl:transform>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<xsl:transform
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xsd2cpp="http:/ebersold.fr/dede"
- xmlns:ex="http://regenstrief.org/org.regenstrief.saxon7."
- version="2.0" >
-<!--
- vim:ts=2:sw=2:et:
--->
-
-
- <!--
- ***
- *** parser-src-event
- ***
- -->
- <xsl:template match="xsd:annotation" mode='parser-src-event'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:text>// parser-src-event </xsl:text><xsl:value-of select='name(.)'/>
- <xsl:text> </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:simpleType" mode='parser-src-event'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='sscope'/>
- <xsl:text>// parser-src-event </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name)'/>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="xsd:restriction|xsd:list|xsd:union" mode="parser-src-event">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="sscope" select="$sscope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:complexType" mode='parser-src-event'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='sscope'/>
- <xsl:text>// parser-src-event </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name)'/>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="xsd:simpleContent|xsd:complexContent|xsd:sequence|xsd:choice|xsd:group|xsd:all|xsd:attribute|xsd:attributeGroup" mode="parser-src-event">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="sscope" select="$sscope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:simpleContent" mode='parser-src-event'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='sscope'/>
- <xsl:text>// parser-src-event </xsl:text><xsl:value-of select='name(.)'/>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="xsd:restriction|xsd:extension" mode="parser-src-event">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="sscope" select="$sscope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:complexContent" mode='parser-src-event'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='sscope'/>
- <xsl:text>// parser-src-event </xsl:text><xsl:value-of select='name(.)'/>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="xsd:restriction|xsd:extension" mode="parser-src-event">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="sscope" select="$sscope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:extension" mode='parser-src-event'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='sscope'/>
- <xsl:text>// parser-src-event </xsl:text><xsl:value-of select='name(.)'/>
- <xsl:text> </xsl:text>
- <xsl:choose>
- <xsl:when test='local-name(..) ="complexContent"'>
- <xsl:apply-templates select="xsd:element|xsd:attribute" mode="parser-src-event">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="sscope" select="$sscope"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='local-name(..)="simpleContent"'>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup|xsd:anyAttribute" mode="parser-src-event">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="sscope" select="$sscope"/>
- <xsl:with-param name="recursion">no</xsl:with-param>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:restriction" mode='parser-src-event'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='sscope'/>
- <xsl:text>// parser-src-event </xsl:text><xsl:value-of select='name(.)'/>
- <xsl:text> </xsl:text>
- <xsl:choose>
- <xsl:when test='local-name(..)="complexContent"'>
- <xsl:apply-templates select="xsd:group|xsd:all|xsd:choice|xsd:sequence|xsd:attribute"
- mode="parser-src-event">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="sscope" select="$sscope"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='local-name(..) = "simpleContent"'>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup"
- mode="parser-src-event">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="sscope" select="$sscope"/>
- <xsl:with-param name="recursion">no</xsl:with-param>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>// Bad parent </xsl:text><xsl:value-of select='name(.)'/>
- <xsl:text> </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:list" mode='parser-src-event'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:text>// parser-src-event </xsl:text><xsl:value-of select='name(.)'/>
- <xsl:text> </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:union" mode='parser-src-event'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:text>// parser-src-event </xsl:text><xsl:value-of select='name(.)'/>
- <xsl:text> </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:sequence" mode='parser-src-event'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='sscope'/>
- <xsl:text>// parser-src-event </xsl:text><xsl:value-of select='concat(name(.)," @maxOccurs=",@maxOccurs)'/>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="xsd:choice|xsd:sequence|xsd:element|xsd:any|xsd:group" mode="parser-src-event">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="sscope" select="$sscope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:choice" mode='parser-src-event'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='sscope'/>
- <xsl:text>// parser-src-event </xsl:text><xsl:value-of select='name(.)'/>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="xsd:choice|xsd:sequence|xsd:any|xsd:element|xsd:group" mode="parser-src-event">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="sscope" select="$sscope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:all" mode='parser-src-event'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='sscope'/>
- <xsl:text>// parser-src-event </xsl:text><xsl:value-of select='name(.)'/>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="xsd:element" mode="parser-src-event">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="sscope" select="$sscope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:group[@ref]" mode='parser-src-event'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='sscope'/>
- <xsl:variable name='local-name'>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'><xsl:value-of select='substring-after(@ref,":")'/></xsl:when>
- <xsl:otherwise><xsl:value-of select='@ref'/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>// parser-src-event </xsl:text><xsl:value-of select='concat(name(.)," @ref=",@ref)'/>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="/xsd:schema/xsd:group[@name=$local-name]" mode="parser-src-event">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="sscope" select="$sscope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:group[@name]" mode='parser-src-event'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='sscope'/>
- <xsl:text>// parser-src-event </xsl:text><xsl:value-of select='concat(name(.),"@name=",@name)'/>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="xsd:all|xsd:choice|xsd:sequence" mode="parser-src-event">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="sscope" select="$sscope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:any" mode='parser-src-event'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='sscope'/>
- <xsl:text>// parser-src-event </xsl:text><xsl:value-of select='name(.)'/>
- <xsl:text> </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@ref]" mode='parser-src-event'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='sscope'/>
- <xsl:variable name='sclass' select='substring-after($class,"p_")'/>
- <xsl:variable name="nname">
- <xsl:apply-templates select="@ref" mode="normalize-name"/>
- </xsl:variable>
- <xsl:variable name='el-name'>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'><xsl:value-of select='substring-after(@ref,":")'/></xsl:when>
- <xsl:otherwise> <xsl:value-of select="@ref"/> </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>/** parser-src-event </xsl:text>
- <xsl:value-of select='concat(" ",name(.))'/>
- <xsl:value-of select='concat(" * @ref =",@ref," * @maxOccurs=",@maxOccurs)'/>
- <xsl:value-of select='concat(" * @abstract=",@abstract," @equiv=",@equiClass)'/>
- <xsl:value-of select='concat(" * ref abstr=",/xsd:schema/xsd:element[@name=$el-name]/@abstract)'/>
- <xsl:text> */ </xsl:text>
- <xsl:choose>
- <xsl:when test="/xsd:schema/xsd:element[@name=$el-name and @abstract='true']">
- <xsl:apply-templates select="/xsd:schema/xsd:element[@name=$el-name]" mode="parser-src-event">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="sscope" select="$sscope"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="." mode="gen-parser-impl-event-begin">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="sscope" select="$sscope"/>
- <xsl:with-param name="elname" select="$nname"/>
- <xsl:with-param name="type">
- <!--
- <xsl:value-of select='concat($sclass,"::",$nname,"_type")'/>
- -->
- <xsl:value-of select='concat("",$nname,"_type")'/>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- <!--
- -->
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@name and not(@type) and @abstract]" mode='parser-src-event'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='sscope'/>
- <xsl:param name='baseclass'></xsl:param>
- <xsl:variable name='name' select="@name"/>
- <xsl:text>/** parser-src-event </xsl:text>
- <xsl:value-of select='concat(" ",name(.))'/>
- <xsl:value-of select='concat(" * @name = ",@name)'/>
- <xsl:value-of select='concat(" @abstract = ",@abstract)'/>
- <xsl:text> */ </xsl:text>
- <xsl:apply-templates select='/xsd:schema/xsd:element[@equivClass=$name ]' mode='parser-src-event'>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='sscope' select="$sscope"/>
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='baseclass'>
- <xsl:choose>
- <xsl:when test='$baseclass=""'>
- <xsl:apply-templates select="@name" mode='normalize-name'/>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="$baseclass"/></xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
-
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@name and not(@type) and not(@abstract)]" mode='parser-src-event'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='sscope'/>
- <xsl:param name='baseclass'></xsl:param>
- <xsl:variable name='sclass' select='substring-after($class,"p_")'/>
- <xsl:variable name="nname">
- <xsl:apply-templates select="@name" mode="normalize-name"/>
- </xsl:variable>
- <xsl:text>// parser-src-event </xsl:text><xsl:value-of select='name(.)'/>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="." mode="gen-parser-impl-event-begin">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="sscope" select="$sscope"/>
- <xsl:with-param name="elname" select="$nname"/>
- <xsl:with-param name="type" select='concat($sclass,"::",$nname,"_type")'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@name and @type and not(@abstract)]" mode='parser-src-event'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='sscope'/>
- <xsl:param name='baseclass'></xsl:param>
- <xsl:variable name='sclass' select='substring-after($class,"p_")'/>
- <xsl:variable name="nname">
- <xsl:apply-templates select="@name" mode="normalize-name"/>
- </xsl:variable>
- <xsl:variable name='elname'>
- <xsl:choose>
- <xsl:when test='$baseclass=""'>
- <xsl:apply-templates select="@name" mode='normalize-name'/>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select='$baseclass'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>/** parser-src-event </xsl:text>
- <xsl:value-of select='concat(name(.)," @name = ",@name," not abstract")'/>
- <xsl:value-of select='concat(" * $class = ",$class," $baseclass = ",$baseclass)'/>
- <xsl:value-of select='concat(" * @type = ",@type," * @maxOccurs =",@maxOccurs)'/>
- <xsl:value-of select='concat(" * @equivClass = ",@equivClass," ")'/>
- <xsl:text> */ </xsl:text>
- <xsl:apply-templates select="." mode="gen-parser-impl-event-begin">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="sscope" select="$sscope"/>
- <xsl:with-param name="elname" select="$elname"/>
- <xsl:with-param name="type">
- <xsl:choose>
- <xsl:when test='local-name(..)="schema"'><xsl:value-of select='concat("",$nname,"_type")'/></xsl:when>
- <xsl:otherwise><xsl:value-of select='concat($sclass,"::",$nname,"_type")'/></xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attributeGroup[@ref]" mode='parser-src-event'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:param name='recursion'>yes</xsl:param>
- <xsl:text>// parser-src-event </xsl:text><xsl:value-of select='name(.)'/>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="key('attrGroup',substring-after(@ref,':'))" mode="parser-src-event">
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name="recursion" select="$recursion"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attributeGroup[not(@ref)]" mode='parser-src-event'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:param name='recursion'>yes</xsl:param>
- <xsl:apply-templates select="xsd:attribute" mode="parser-src-event">
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name="recursion" select="$recursion"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@ref]" mode='parser-src-event'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='recursion'>yes</xsl:param>
- <xsl:variable name='ns'><xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@ref"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="nname">
- <xsl:apply-templates select="@ref" mode="normalize-name"/>
- </xsl:variable>
- <xsl:text>// parser-src-event </xsl:text><xsl:value-of select='name(.)'/>
- <xsl:text> </xsl:text>
- <xsl:choose>
- <xsl:when test='not(contains(@ref,":"))'>
- <xsl:message terminate='no'>xsd-parser WARNING attribute without
- <xsl:value-of select="@ref"/>
- namespace</xsl:message>
- <xsl:text>// Warning attribute without namespace. </xsl:text>
- <xsl:value-of select='@ref'/>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="." mode="gen-parser-impl-event-begin">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="elname" select="$nname"/>
- <xsl:with-param name="type" select="$nname"></xsl:with-param>
- <xsl:with-param name="recursion" select="$recursion"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="$ns=/xsd:schema/@targetNamespace">
- <xsl:apply-templates select="." mode="gen-parser-impl-event-begin">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="elname" select="$nname"/>
- <xsl:with-param name="type" select="$nname"></xsl:with-param>
- <xsl:with-param name="recursion" select="$recursion"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="$ns!=/xsd:schema/@targetNamespace">
- <xsl:variable name='loc-name' select="substring-after(@ref,':')"/>
- <xsl:variable name='loc'
- select="/xsd:schema/xsd:import[@namespace=$ns]/@schemaLocation">
- </xsl:variable>
- <xsl:variable name='cpp_ns'>
- <xsl:call-template name="cpp_namespace">
- <xsl:with-param name='type' select='$ns'/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:apply-templates select="." mode="gen-parser-impl-event-begin">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="elname" select="$nname"/>
- <xsl:with-param name="type" select="concat($cpp_ns,'::',$nname)"></xsl:with-param>
- <xsl:with-param name="recursion" select="$recursion"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>// Foreign namespace attributes. </xsl:text>
- <xsl:value-of select='@ref'/>
- <xsl:text> </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@name and not(@type)]" mode='parser-src-event'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='recursion'>yes</xsl:param>
- <xsl:variable name="nname">
- <xsl:apply-templates select="@name" mode="normalize-name"/>
- </xsl:variable>
- <xsl:text>// parser-src-event </xsl:text><xsl:value-of select='name(.)'/>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="." mode="gen-parser-impl-event-begin">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="elname" select="$nname"/>
- <xsl:with-param name="recursion" select="$recursion"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@name and @type]" mode='parser-src-event'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='recursion'>yes</xsl:param>
- <xsl:variable name="nname">
- <xsl:apply-templates select="@name" mode="normalize-name"/>
- </xsl:variable>
- <xsl:text>// parser-src-event </xsl:text><xsl:value-of select='name(.)'/>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="." mode="gen-parser-impl-event-begin">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="elname" select="$nname"/>
- <xsl:with-param name="recursion" select="$recursion"/>
- </xsl:apply-templates>
- </xsl:template>
-
-
-</xsl:transform>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
- vim:ts=2:sw=2:et:bs=2:
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- version="2.0" >
-
-
- <!--
- ***
- *** parser-src-post
- ***
- implement post function if complex type parsing ...
- -->
- <xsl:template name="parser-src-post">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='name'/>
- <xsl:param name='sscope'/>
- <xsl:variable name='sclass' select='substring-after($class,"p_")'/>
- <xsl:variable name='cpp_type'>
- <xsl:choose>
- <xsl:when test='@name'><xsl:apply-templates select='@name' mode='normalize-name'/>_skel</xsl:when>
- <xsl:otherwise><xsl:value-of select='concat($name,"_skel")'/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test='@name="Envelope-"'>
- <xsl:message terminate="yes"/>
- </xsl:if>
- <xsl:if test="not(@name)">
- <xsl:message terminate="no"><xsl:value-of select='concat("name=",$name," @name=",@name," class=",$class," scope=",$scope)'/></xsl:message>
- </xsl:if>
- <xsl:variable name='fcpp_type'>
- <xsl:if test='$scope!=""'>
- <xsl:value-of select='substring-after($scope,"p_")'/>
- </xsl:if><xsl:value-of select="$cpp_type"/>
- </xsl:variable>
- <xsl:text>// mode parser-src-post with name : </xsl:text>
- <xsl:value-of select='concat($name," @name=",@name," @type=",@type," cpp_type=",$cpp_type," scope=",$scope)'/>
- <xsl:text> void </xsl:text>
- <xsl:value-of select='concat($scope,$class)'/><xsl:text>::</xsl:text>
- <xsl:text>post(</xsl:text>
- <xsl:if test='$scope!=""'>
- <xsl:value-of select='substring-after($scope,"p_")'/>
- </xsl:if><xsl:value-of select="$cpp_type"/><xsl:text> &val) { </xsl:text>
- <xsl:variable name="state"><xsl:call-template name='class-parser-skel-source-need-state'/>
- </xsl:variable>
- <xsl:value-of select="$state"/>
- <!-- debug trace -->
- <xsl:call-template name='debug'>
- <xsl:with-param name='mode' />
- <xsl:with-param name='indent' select='concat("&INDENT;","")'/>
- <xsl:with-param name='string'>
- <xsl:text>std::cout<<"</xsl:text>
- <xsl:value-of select='concat($class,"::post - ",local-name(.))'/>
- <xsl:text>"<<"\n";</xsl:text>
- </xsl:with-param>
- </xsl:call-template>
- <xsl:if test='1=1'>
- <xsl:value-of select='concat("&INDENT;val = m_",$name,"; ")'/>
- </xsl:if>
- <xsl:apply-templates
- select="xsd:simpleContent|xsd:complexContent"
- mode="parser-src-post">
- </xsl:apply-templates>
- <xsl:apply-templates
- select="xsd:restriction|xsd:extension"
- mode="parser-src-post">
- </xsl:apply-templates>
- <xsl:if test='local-name(.)="simpleType"'>
- <xsl:apply-templates
- select="xsd:union|xsd:list"
- mode="parser-src-post">
- </xsl:apply-templates>
- </xsl:if>
- <xsl:if test='1=1'>
- <xsl:value-of select='concat("&INDENT;m_",$name,"= ",$sscope,$sclass,"(); ")'/>
- </xsl:if>
- <!--
- <xsl:if test='local-name(.)="complexType" and not(./xsd:choice) and not(./xsd:sequence) and not(./xsd:complexContent)'>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode="parser-src-post"/>
- </xsl:if>
- -->
- <xsl:text>} </xsl:text>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:simpleContent' mode="parser-src-post">
- <xsl:text>&INDENT;/* parser-src-post </xsl:text>
- <xsl:value-of select='concat(name(),"*/ ")'/>
- <xsl:apply-templates
- select="xsd:restriction|xsd:extension" mode="parser-src-post"/>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:complexContent' mode="parser-src-post">
- <xsl:apply-templates
- select="xsd:restriction|xsd:extension" mode="parser-src-post"/>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:choice' mode="parser-src-post">
- <xsl:apply-templates
- select="xsd:element|xsd:group|xsd:choice|xsd:any|xsd:sequence" mode="parser-src-post"/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:sequence' mode="parser-src-post">
- <xsl:apply-templates select="xsd:element|xsd:sequence|xsd:choice|xsd:any" mode="parser-src-post"/>
- </xsl:template>
- <!--
- <xsl:template match='xsd:extension' mode="parser-src-post">
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode="parser-src-post"/>
- </xsl:template>
- -->
- <xsl:template match='xsd:attributeGroup[@name!=""]' mode="parser-src-post">
- <xsl:apply-templates select="xsd:attribute" mode="parser-src-post"/>
- </xsl:template>
- <xsl:template match='xsd:attributeGroup[@ref!=""]' mode="parser-src-post">
- <xsl:apply-templates select="key('attrGroup',substring-after(@ref,':'))" mode="parser-src-post"/>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:restriction|xsd:extension' mode="parser-src-post">
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select="./@*" mode="restriction-base"/>
- </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:apply-templates select="@base" mode="namespace-uri-of-qname"/>
- </xsl:variable>
- <xsl:text>&INDENT;/* parser-src-post </xsl:text><xsl:value-of select='concat(name(..)," @base=",@base," $ns=",$ns," */ ")'/>
- <xsl:choose>
- <xsl:when test='local-name(..)="simpleContent"'>
- <xsl:choose>
- <xsl:when test='$ns="&XSD;"'>
- <xsl:value-of select='concat("&INDENT;",$cpp_type," v; ")'/>
- <xsl:text>&INDENT;this->::xsd::parser::SimpleElement::post(v); </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("&INDENT;",$cpp_type," v = m_str; ")'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:value-of select="concat(' val= v;','')"/><xsl:text> </xsl:text>
- </xsl:when>
- <xsl:when test='local-name(..)="complexContent"'>
- <xsl:text>/*ERROR not yet treated */ </xsl:text>
- </xsl:when>
- <xsl:when test='local-name(..)="simpleType" and local-name(.)!="extension"'>
- <xsl:text> </xsl:text>
- <xsl:value-of select='concat(" ",$cpp_type," v; ")'/>
- <xsl:text>&INDENT;this->::xsd::parser::SimpleElement::post(v); </xsl:text>
- <xsl:value-of
- select="concat(' val= v;','')"/><xsl:text> </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>xsd2cpp-parser ERROR restriction or extension not allowed her <xsl:value-of select="local-name(.)"/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- <!--
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode="parser-src-post"/>
- -->
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:list' mode="parser-src-post">
- <xsl:text>&INDENT;val=m_str; // from xsd:list </xsl:text>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:union' mode="parser-src-post">
- <xsl:variable name='types'>
- <xsl:element name='schema' namespace="&XSD;">
- <xsl:copy-of select="namespace::*"/>
- <xsl:attribute name='targetNamespace'><xsl:value-of select="/xsd:schema/@targetNamespace"/></xsl:attribute>
- <xsl:if test="@memberTypes">
- <xsl:call-template
- name='space-string-list'>
- <xsl:with-param name='string' select='@memberTypes'/>
- </xsl:call-template>
- </xsl:if>
- <!-- ADD simple types -->
- <xsl:if test='./xsd:simpleType'><xsl:apply-templates select='./xsd:simpleType' mode='space-string-list'/></xsl:if>
- </xsl:element>
- </xsl:variable>
- <xsl:text>/* parser-src-post MUST TREAT UNION for </xsl:text><xsl:value-of select='concat(name(..),"*/ ")'/>
- <xsl:apply-templates select='$types' mode='parser-src-post-union'/>
- </xsl:template>
-
- <!-- union-attributes -->
- <xsl:template match='xsd:schema' mode='parser-src-post-union'>
- <xsl:apply-templates mode='parser-src-post-union'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:field' mode='parser-src-post-union'>
- <xsl:message terminate='no'>xsd2xpp-tree-header xsd:field with union-attributes @type=<xsl:value-of select="@type"/></xsl:message>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@type' mode='restriction-base'/>
- </xsl:variable>
- <xsl:variable name='ns'><xsl:apply-templates select='@type'
- mode='namespace-uri-of-qname'/>
- </xsl:variable>
- <xsl:if test='$ns="&XSD;" and not(@type = preceding-sibling::xsd:field/@type)'>
- <xsl:text>&INDENT;if ( 1 ) { </xsl:text>
- <xsl:value-of select='concat("&INDENT2;",$cpp_type," v; ")'/>
- <xsl:text>&INDENT2;this->::xsd::parser::SimpleElement::post(v); </xsl:text>
- <xsl:text>&INDENT2;val = v; </xsl:text>
- <xsl:text>&INDENT;} </xsl:text>
- </xsl:if>
- </xsl:template>
- <!-- union-enum-attributes -->
-
-
- <!-- -->
- <xsl:template match='xsd:element[@ref!=""]' mode="parser-src-post">
-
- <xsl:variable name="el" select='key("element",substring-after(@ref,":"))'/>
- <xsl:text>/*Process ref: </xsl:text>
- <xsl:value-of select='concat($el[0]," - ",@ref," nm=",substring-after(@ref,":"))'/>
- <xsl:text> */ </xsl:text>
- <xsl:if test='$el'>
- <xsl:apply-templates select="$el" mode="parser-src-post">
- <xsl:with-param name='maxOccurs' select="@maxOccurs"/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:element[@name!=""]' mode="parser-src-post">
- <xsl:param name='maxOccurs'>1</xsl:param>
- <xsl:param name='class'></xsl:param>
- <xsl:variable name='nname'>
- <xsl:apply-templates select="@name" mode='normalize-name'/>
- </xsl:variable>
- <xsl:value-of select='concat("&INDENT;//if(m_",@name,") ")'/>
- <xsl:text>&INDENT;val.</xsl:text><xsl:value-of
- select='concat($nname,"(m_",$nname,"); ")'/>
- <xsl:choose>
- <xsl:when test='(@maxOccurs="unbounded") or ($maxOccurs="unbounded")'>
- <xsl:value-of select='concat("&INDENT;m_",@name,".erase(")'/>
- <xsl:value-of select='concat("m_",@name,".begin(),")'/>
- <xsl:value-of select='concat("m_",@name,".end()); ")'/>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attribute[@name!=""]' mode="parser-src-post">
- <xsl:variable name='nname'>
- <xsl:apply-templates select="@name" mode='normalize-name'/>
- </xsl:variable>
- <xsl:text>&INDENT;val.</xsl:text>attr_<xsl:value-of
- select='concat($nname,"(m_attr_",$nname,"); ")'/>
- <xsl:if test='@use="optional"'>
- <xsl:value-of select='concat("&INDENT;m_attr_",$nname," = ",$nname,"_optional(); " )'/>
- </xsl:if>
- </xsl:template>
- <xsl:template match='xsd:attribute[@ref!=""]' mode="parser-src-post">
- <xsl:apply-templates select="key('attribute',substring-after(@ref,':'))" mode="parser-src-post"/>
- </xsl:template>
-
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
- vim:ts=2:sw=2:et:
--->
-
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- version="2.0" >
-
- <!--
- This file will contain the necessary stuff
- to create the parser objects.
- Parser works all
- complexType,simpleType, extension, sequence,choice
-
- -->
-
- <xsl:template name='generateParseSkel'>
- <xsl:param name='dir'>./test</xsl:param>
- <xsl:message>generateParseSkel: dir=<xsl:value-of select="concat($dir,' incdir=',$incdir)"/></xsl:message>
- <xsl:choose>
- <xsl:when test='$target="debug"'>
- <xsl:call-template name='generateParseSkel_header'>
- <xsl:with-param name='dir' select="concat($dir,$incdir)"/>
- </xsl:call-template>
- <xsl:call-template name='generateParseSkel_source'>
- <xsl:with-param name='dir' select="concat($dir,$srcdir)"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name='generateParseSkel_header-one'>
- <xsl:with-param name='dir' select="concat($dir,$incdir)"/>
- </xsl:call-template>
- <xsl:call-template name='generateParseSkel_source-one'>
- <xsl:with-param name='dir' select="concat($dir,$srcdir)"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- Main entry point to generate header files for parser -->
-
- <xsl:template match='xsd:import' mode='include'>
- <xsl:variable name='fn' select="substring-before(@schemaLocation,':')">
- </xsl:variable>
- <xsl:variable name='filename-org'>
- <xsl:call-template name='basename'>
- <xsl:with-param name='path' select="substring-after(@schemaLocation,':')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='filename'
- select='concat("p_",substring-before($filename-org,".xsd"),".h")'/>
- <xsl:text>/*found*/ </xsl:text>
- <xsl:choose>
- <xsl:when test='$fn="file"'>
- <xsl:text>#include <</xsl:text>
- <xsl:value-of select='concat(substring-before($filename-org,".xsd"),".h")'/>
- <xsl:text>> </xsl:text>
- <xsl:text>#include <</xsl:text>
- <xsl:value-of select='$filename'/>
- <xsl:text>> </xsl:text>
- </xsl:when>
- <xsl:when test='$fn="http"'>
- <xsl:message terminate="yes">Not yet supported <xsl:value-of select="@schemaLocation"/></xsl:message>
- </xsl:when>
- <xsl:when test='not(@schemaLocation)'>
- <xsl:message terminate="no">WARNING no schema location <xsl:value-of select="@schemaLocation"/> <xsl:value-of select="$fn"/></xsl:message>
- </xsl:when>
- <xsl:when test="document(@schemaLocation)">
- <xsl:text>/* Document exists*/ </xsl:text>
- <xsl:text>#include <</xsl:text>
- <xsl:value-of
- select="concat('',substring-before(@schemaLocation,'.xsd'),'.h')"/>
- <xsl:text>> </xsl:text>
- <xsl:text>#include <</xsl:text>
- <xsl:value-of
- select="concat('p_',substring-before(@schemaLocation,'.xsd'),'.h')"/>
- <xsl:text>> </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="no">Document does not Exists :<xsl:value-of select="@schemaLocation"/> <xsl:value-of select="$fn"/></xsl:message>
- <xsl:text>/* Document does not exists exists*/ </xsl:text>
- <xsl:text>#include <</xsl:text>
- <xsl:value-of
- select="concat('',substring-before(@schemaLocation,'.xsd'),'.h')"/>
- <xsl:text>> </xsl:text>
- <xsl:text>#include <</xsl:text>
- <xsl:value-of
- select="concat('p_',substring-before(@schemaLocation,'.xsd'),'.h')"/>
- <xsl:text>> </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match='xsd:import[substring-before(@schemaLocation,":")="file"]' mode='include-'>
- <xsl:variable name="bn">
- <xsl:call-template name='basename'>
- <xsl:with-param name='path' select="@schemaLocation"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:text>#include <</xsl:text>
- <xsl:value-of select='$bn'/>
- <xsl:text>> </xsl:text>
- </xsl:template>
-
-
- <xsl:template name='generateParseSkel_header'>
- <xsl:param name='dir'/>
- <!-- We need to create a file per complex type
- -->
- <xsl:for-each select='/xsd:schema/xsd:complexType |
- /xsd:schema/xsd:element[local-name(@type)=""]|
- /xsd:schema/xsd:simpleType'>
- <!--
- /xsd:schema/xsd:simpleType|/xsd:schema/xsd:element[@name!=$root-element]'>
- -->
- <!-- What if element only has ref ? -->
- <xsl:variable name='filename' select="concat($dir,'/p_',@name,'.h')"/>
- <xsl:message> Generate Header file <xsl:value-of
- select="concat($filename,' from node :',name(.))"/> </xsl:message>
- <xsl:variable name='cname' ><xsl:apply-templates select='@name'
- mode='normalize-name'/></xsl:variable>
- <xsl:result-document href="{$filename}" format="text">
- <xsl:text>#ifndef </xsl:text><xsl:value-of select="concat($cname,'_PH')"/>
- <xsl:text> </xsl:text>
- <xsl:text>#define </xsl:text><xsl:value-of select="concat($cname,'_PH')"/>
- <xsl:text> #include <string> </xsl:text>
- <xsl:text> #include <iostream> </xsl:text>
- <xsl:text> #include <xsd/xsd.h> </xsl:text>
- <!-- Forward class declarations -->
- <xsl:for-each select="/xsd:schema/xsd:complexType | /xsd:schema/xsd:simpleType">
- <xsl:variable name='name' ><xsl:apply-templates select='@name'
- mode='normalize-name'/></xsl:variable>
- <xsl:text>class </xsl:text><xsl:value-of
- select="concat('p_',$name,'_skel;')"/><xsl:text> </xsl:text>
- <xsl:text>class </xsl:text><xsl:value-of
- select="concat('',$name,'_skel;')"/><xsl:text> </xsl:text>
- </xsl:for-each>
- <!-- I should include elements in complexType -->
- <xsl:text>/*TODO: Add missing includes for generateParseSkel </xsl:text>
- <xsl:value-of select="$cname"/><xsl:text>*/ </xsl:text>
- <xsl:for-each select="/xsd:schema/xsd:complexType | /xsd:schema/xsd:simpleType">
- <xsl:variable name='nname' ><xsl:apply-templates select='@name'
- mode='normalize-name'/></xsl:variable>
-
- <xsl:if test="$cname!=$nname">
- <xsl:text>#include <</xsl:text><xsl:value-of select="concat('p_',@name,'.h')"/><xsl:text>> </xsl:text>
- </xsl:if>
- <xsl:if test="$cname!=$nname">
- <xsl:text>#include <</xsl:text><xsl:value-of
- select="concat('',@name,'_tskel.h')"/><xsl:text>> </xsl:text>
- </xsl:if>
- </xsl:for-each>
- <!-- Ok, now start the definition of the class -->
- <xsl:call-template name='class-parser-skel'>
- <xsl:with-param name='class' select="concat('p_',$cname,'_skel')"/>
- </xsl:call-template>
- <xsl:text>#endif</xsl:text>
- <xsl:text> </xsl:text>
- </xsl:result-document>
- </xsl:for-each>
-
- <!-- We should also create then implementation of the skell -->
-
- </xsl:template>
-
-
- <!-- Main Entry Point Start to code also the implementation of all this stuff -->
- <xsl:template name='generateParseSkel_source-one'>
- <xsl:param name='dir'/>
- <xsl:variable name='filename-org'>
- <xsl:call-template name='basename'>
- <xsl:with-param name='path' select="document-uri(/)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:call-template name='basename'>
- <xsl:with-param name='path' select="/xsd:schema/@targetNamespace"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name='filename'
- select='concat($dir,"/",substring-before(concat("p_",$filename-org),".xsd"),".cpp")'/>
- <xsl:variable name='hf'
- select='concat("",substring-before(concat("",$filename-org),".xsd"),".h")'/>
- <xsl:variable name='pf'
- select='concat("",substring-before(concat("p_",$filename-org),".xsd"),".h")'/>
-
- <xsl:result-document href="{$filename}" format="text">
- <xsl:text> #include <iostream> </xsl:text>
- <xsl:text>#include <xmlSerialize.h> </xsl:text>
- <xsl:text>/* Include imports */ </xsl:text>
- <!-- Include imports -->
- <xsl:apply-templates select='/xsd:schema/xsd:import' mode='include'/>
- <xsl:text>#include <</xsl:text>
- <xsl:value-of select="$hf"/><xsl:text>> </xsl:text>
- <xsl:text>#include <</xsl:text>
- <xsl:value-of select="$pf"/><xsl:text>> </xsl:text>
- <xsl:text>namespace </xsl:text>
- <xsl:value-of select="$namespace"/>
- <xsl:text> { </xsl:text>
- <xsl:apply-templates select="/xsd:schema" mode='class-parser-root'/>
-
- <!-- We add a factory class in parser to allow the creation
- of other inheritant types. For instance The Checksum
- will implement a graphical node for a tree view.
- -->
- <xsl:if test='$generate-factory="yes"'>
-
- </xsl:if>
- <xsl:text> } </xsl:text>
- </xsl:result-document>
- </xsl:template>
-
- <!-- What are complex types made of ?? -->
-
- <!-- Main Entry Point Start to code also the implementation of all this stuff -->
- <xsl:template name='generateParseSkel_source'>
- <xsl:param name='dir'/>
- <xsl:for-each select='xsd:schema/xsd:complexType |
- xsd:schema/xsd:element[local-name(@type)=""]|
- xsd:schema/xsd:simpleType'>
- <xsl:message terminate='no'>xsd2cpp Generate Source parsing <xsl:value-of select="@name"/></xsl:message>
- <xsl:variable name='filename' select="concat($dir,'/p_',@name,'.cpp')"/>
- <xsl:result-document href="{$filename}" format="text">
- <xsl:variable name='name' ><xsl:apply-templates select='@name'
- mode='normalize-name'/></xsl:variable>
- <xsl:text> #include <iostream> </xsl:text>
- <xsl:text>#include <xmlSerialize.h> </xsl:text>
- <xsl:text>#include <</xsl:text>
- <xsl:value-of select="@name"/><xsl:text>_tskel.h> </xsl:text>
- <xsl:text> #include <p_</xsl:text>
- <xsl:value-of select="@name"/><xsl:text>.h> </xsl:text>
- <!-- I should include elements in complexType -->
- <xsl:text>/*TODO: Add missing includes */ </xsl:text>
- <!-- Ok, now start the definition of the class -->
- <xsl:call-template name='class-parser-skel-source'>
- <xsl:with-param name='class' select="concat('p_',$name,'_skel')"/>
- </xsl:call-template>
- <xsl:text> </xsl:text>
- </xsl:result-document>
- </xsl:for-each>
-
- <!-- We should also create then implementation of the skell -->
-
- </xsl:template>
-
- <!-- What are complex types made of ?? -->
-
-
- <!--
- ***
- *** class-parser-root
- ***
- -->
- <!-- -->
- <xsl:template match="xsd:schema" mode="class-parser-root">
- <xsl:apply-templates select="xsd:simpleType|xsd:complexType|xsd:element|xsd:attribute" mode="class-parser-root"/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:annotation" mode="class-parser-root">
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:complexType[@name]|xsd:simpleType[@name]" mode="class-parser-root">
- <xsl:param name='scope'/>
- <xsl:param name='sscope'/>
- <xsl:variable name='name' >
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
- <!-- I should include elements in complexType -->
- <xsl:text> /* GENERATE CODE for element </xsl:text><xsl:value-of select='concat(name(.)," ",@name," */ ")'/>
- <!-- Ok, now start the definition of the class -->
- <xsl:call-template name='class-parser-skel-source'>
- <xsl:with-param name='class' select="concat('p_',$name,'_skel')"/>
- <xsl:with-param name='name' select="$name"/>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='sscope' select="$sscope"/>
- </xsl:call-template>
- <xsl:text> </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:simpleType[not(@name)]|xsd:complexType[not(@name)]" mode="class-parser-root">
- <xsl:param name='name'/>
- <xsl:param name='scope'/>
- <xsl:param name='sscope'/>
- <!-- I should include elements in complexType -->
- <xsl:text> /* GENERATE CODE for element </xsl:text><xsl:value-of select='concat(name(.)," ",@name," */ ")'/>
- <!-- Ok, now start the definition of the class -->
- <xsl:call-template name='class-parser-skel-source'>
- <xsl:with-param name='class' select="concat('p_',$name,'_skel')"/>
- <xsl:with-param name='name' select="concat($name,'')"/>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='sscope' select="$sscope"/>
- </xsl:call-template>
- <xsl:text> </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@name and @type]" mode="class-parser-root">
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* class-parser-root </xsl:text>
- <xsl:value-of select='concat(name(.)," */")'/>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@name and not(@type)]" mode="class-parser-root">
- <xsl:param name='scope'/>
- <xsl:variable name='name' >
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='./xsd:simpleType|./xsd:complexType'>
- <xsl:apply-templates select="xsd:simpleType|xsd:complexType" mode="class-parser-root">
- <xsl:with-param name='name' select="$name"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@ref]" mode="class-parser-root">
- <xsl:param name='scope'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* class-parser-root </xsl:text>
- <xsl:value-of select='concat(name(.)," */")'/>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:group" mode="class-parser-root">
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* class-parser-root </xsl:text>
- <xsl:value-of select='concat(name(.)," */")'/>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:all" mode="class-parser-root">
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* class-parser-root </xsl:text>
- <xsl:value-of select='concat(name(.)," */")'/>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@name and @type]" mode="class-parser-root">
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* class-parser-root </xsl:text>
- <xsl:value-of select='concat(name(.)," */")'/>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@name and not(@type)]" mode="class-parser-root">
- <xsl:variable name='name' >
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* class-parser-root </xsl:text>
- <xsl:value-of select='concat(name(.)," */")'/>
- </xsl:if>
- <xsl:apply-templates select="xsd:simpleType|xsd:complexType" mode="class-parser-root">
- <xsl:with-param name='name' select="$name"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attributeGroup" mode="class-parser-root">
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* class-parser-root </xsl:text>
- <xsl:value-of select='concat(name(.)," */")'/>
- </xsl:if>
- </xsl:template>
-
- <!--
-
- Source Generation of the skeleton
-
- -->
- <xsl:template name='class-parser-skel-source'>
- <xsl:param name='class'/>
- <xsl:param name='name'/>
- <xsl:param name='scope'></xsl:param>
- <xsl:param name='sscope'></xsl:param>
- <xsl:call-template name='class-parser-skel-source-constructors'>
- <xsl:with-param name='class'><xsl:value-of select='$class'/></xsl:with-param>
- <xsl:with-param name='scope'><xsl:value-of select='$scope'/></xsl:with-param>
- <xsl:with-param name='sscope'><xsl:value-of select='$sscope'/></xsl:with-param>
- </xsl:call-template>
- <xsl:call-template name='class-parser-skel-source-destructors'>
- <xsl:with-param name='class'><xsl:value-of select='$class'/></xsl:with-param>
- <xsl:with-param name='scope'><xsl:value-of select='$scope'/></xsl:with-param>
- </xsl:call-template>
- <!--
- -->
- <xsl:if test='local-name(.)="complexType"'>
- <xsl:call-template name='class-parser-skel-source-start'>
- <xsl:with-param name='class'><xsl:value-of select='$class'/></xsl:with-param>
- <xsl:with-param name='scope'><xsl:value-of select='$scope'/></xsl:with-param>
- <xsl:with-param name='sscope'><xsl:value-of select='$sscope'/></xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test='local-name(.)="complexType"'>
- <xsl:call-template name="parser-src-attribute">
- <xsl:with-param name='class'><xsl:value-of select='$class'/></xsl:with-param>
- <xsl:with-param name='scope'><xsl:value-of select='$scope'/></xsl:with-param>
- <xsl:with-param name='sscope'><xsl:value-of select='$sscope'/></xsl:with-param>
- </xsl:call-template>
- </xsl:if>
-
- <xsl:call-template name='class-parser-skel-source-pre'>
- <xsl:with-param name='class'><xsl:value-of select='$class'/></xsl:with-param>
- <xsl:with-param name='scope'><xsl:value-of select='$scope'/></xsl:with-param>
- <xsl:with-param name='sscope'><xsl:value-of select='$sscope'/></xsl:with-param>
- </xsl:call-template>
-
- <xsl:call-template name='class-parser-skel-source-pre-internal'>
- <xsl:with-param name='class'><xsl:value-of select='$class'/></xsl:with-param>
- <xsl:with-param name='scope'><xsl:value-of select='$scope'/></xsl:with-param>
- <xsl:with-param name='sscope'><xsl:value-of select='$sscope'/></xsl:with-param>
- </xsl:call-template>
-
- <xsl:call-template name='class-parser-skel-source-post-internal'>
- <xsl:with-param name='class'><xsl:value-of select='$class'/></xsl:with-param>
- <xsl:with-param name='scope'><xsl:value-of select='$scope'/></xsl:with-param>
- <xsl:with-param name='name'><xsl:value-of select='$name'/></xsl:with-param>
- <xsl:with-param name='sscope'><xsl:value-of select='$sscope'/></xsl:with-param>
- </xsl:call-template>
-
- <xsl:call-template name="parser-src-post">
- <xsl:with-param name='class'><xsl:value-of select='$class'/></xsl:with-param>
- <xsl:with-param name='scope'><xsl:value-of select='$scope'/></xsl:with-param>
- <xsl:with-param name='name'><xsl:value-of select='$name'/></xsl:with-param>
- <xsl:with-param name='sscope'><xsl:value-of select='$sscope'/></xsl:with-param>
- </xsl:call-template>
-
-
- <xsl:apply-templates select="." mode='class-parser-skel-source'>
- <xsl:with-param name='class'><xsl:value-of select='$class'/></xsl:with-param>
- <xsl:with-param name='scope'><xsl:value-of select='$scope'/></xsl:with-param>
- <xsl:with-param name='sscope'><xsl:value-of select='$sscope'/></xsl:with-param>
- </xsl:apply-templates>
- <!-- Generate code for elements without type () -->
- <xsl:apply-templates select="." mode='class-parser-skel-source-empty-element'>
- <xsl:with-param name='class'><xsl:value-of select='$class'/></xsl:with-param>
- <xsl:with-param name='sscope'><xsl:value-of select='$sscope'/></xsl:with-param>
- </xsl:apply-templates>
- <!-- Generate event functions -->
- <xsl:apply-templates select="." mode='parser-src-event'>
- <xsl:with-param name='class'><xsl:value-of select='$class'/></xsl:with-param>
- <xsl:with-param name='scope'><xsl:value-of select='$scope'/></xsl:with-param>
- <xsl:with-param name='sscope'><xsl:value-of select='$sscope'/></xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
-
- <!--
- Constructors
- -->
- <xsl:template name='class-parser-skel-source-constructors'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='sscope'></xsl:param>
- <xsl:value-of select='concat($scope,$class)'/><xsl:text>::</xsl:text>
- <xsl:value-of select='$class'/>
- <xsl:text>() { </xsl:text>
- <xsl:call-template name='debug'>
- <xsl:with-param name='mode' />
- <xsl:with-param name='indent' select='concat("&INDENT;","")'/>
- <xsl:with-param name='string'>
- <xsl:text>std::cout<<"</xsl:text>
- <xsl:value-of select='concat($class,"")'/>
- <xsl:text>\n";</xsl:text>
- </xsl:with-param>
- </xsl:call-template>
- <xsl:apply-templates select="xsd:simpleContent|xsd:complexContent" mode="class-parser-skel-source-constructors">
- </xsl:apply-templates>
- <xsl:apply-templates select="xsd:choice|xsd:element|xsd:sequence|xsd:all" mode="class-parser-skel-source-constructors">
- </xsl:apply-templates>
- <!-- If the element is ComplexType then we can have attributes -->
- <xsl:apply-templates select="xsd:attribute" mode="class-parser-skel-source-constructors">
- </xsl:apply-templates>
- <xsl:text>} </xsl:text>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:annotation' mode='class-parser-skel-source-constructors'>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:simpleContent' mode='class-parser-skel-source-constructors'>
- <xsl:apply-templates select="xsd:list|xsd:restriction|xsd:union" mode="class-parser-skel-source-constructors">
- </xsl:apply-templates>
- <xsl:if test='local-name(..) != "complexType"'>
- <xsl:message terminate="yes">Error simpleContent only has complexType as parent</xsl:message>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexContent' mode='class-parser-skel-source-constructors'>
- <xsl:apply-templates select="xsd:choice|xsd:element|xsd:sequence|xsd:all" mode="class-parser-skel-source-constructors">
- </xsl:apply-templates>
- <xsl:apply-templates select="xsd:attribute" mode="class-parser-skel-source-constructors">
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:choice|xsd:all|xsd:sequence' mode='class-parser-skel-source-constructors'>
- <xsl:apply-templates select="xsd:choice|xsd:element|xsd:sequence|xsd:all" mode="class-parser-skel-source-constructors">
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:element[@ref!=""]' mode='class-parser-skel-source-constructors'>
- <xsl:variable name='el' select="substring-after(@ref,':')"/>
- <xsl:text>/*xsd:element[@ref] ... parse-tree */ </xsl:text>
- <xsl:apply-templates select='/xsd:schema/xsd:element[@name=$el]' mode='class-parser-skel-source-constructors'/>
-
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:element' mode='class-parser-skel-source-constructors'>
- <xsl:variable name='nname'>
- <xsl:apply-templates select="@name" mode='normalize-name'/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='@name!=""'>
- <xsl:value-of select='concat("m_",$nname)'/><xsl:text>_parser = 0; </xsl:text>
- </xsl:when>
- <xsl:when test='@ref!=""'>
- <xsl:apply-templates
- select="/xsd:schema/xsd:element[@name=substring-after(@ref,':')]"/>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:attribute[@ref]' mode='class-parser-skel-source-constructors'>
- <xsl:param name='scope'/>
- <xsl:param name='sscope'/>
- <xsl:variable name='nname'>
- <xsl:apply-templates select="@ref" mode='normalize-name'/>
- </xsl:variable>
- <xsl:apply-templates
- select="/xsd:schema/xsd:element[@name=substring-after(@ref,':')]"/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attribute[@name and not(@type)]' mode='class-parser-skel-source-constructors'>
- <xsl:param name='scope'/>
- <xsl:param name='sscope'/>
- <xsl:variable name='nname'>
- <xsl:apply-templates select="@name" mode='normalize-name'/>
- </xsl:variable>
- <xsl:value-of select='concat("&INDENT;//m_",$nname)'/><xsl:text>_parser = 0; </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attribute[@name and @type]' mode='class-parser-skel-source-constructors'>
- <xsl:param name='scope'/>
- <xsl:param name='sscope'/>
- <xsl:variable name='nname'>
- <xsl:apply-templates select="@name" mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='ns_'>
- <xsl:call-template name="namespace-uri-of-qname">
- <xsl:with-param name='qname' select="@type"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='@name!="" and $ns_=/xsd:schema/@targetNamespace'>
- <xsl:value-of select='concat("m_",$nname)'/><xsl:text>_parser = 0; </xsl:text>
- </xsl:when>
- <xsl:when test='@ref!=""'>
- <xsl:apply-templates
- select="/xsd:schema/xsd:element[@name=substring-after(@ref,':')]"/>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <!--
- Destructors
- -->
- <xsl:template name='class-parser-skel-source-destructors'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:value-of select='concat($scope,$class)'/><xsl:text>::~</xsl:text>
- <xsl:value-of select='$class'/>
- <xsl:text>() { } </xsl:text>
- </xsl:template>
-
- <xsl:template name='class-parser-skel-source-need-state'>
- <xsl:choose>
- <xsl:when test="local-name(.)='element' and local-name(@type)=''">
- <xsl:apply-templates select="xsd:simpleType|xsd:complexType" mode="need-state"/>
- </xsl:when>
- <xsl:when test="local-name(.)='element' and local-name(@type)!=''">
- <xsl:text>/* Passed by here to be computed */ </xsl:text>
- <xsl:message terminate='yes'></xsl:message>
- <xsl:apply-templates select="xsd:simpleType|xsd:complexType" mode="need-state"/>
- </xsl:when>
- <xsl:when test="local-name(.)='complexType' and local-name(./xsd:complexContent) ='complexContent'">
- <xsl:text>&INDENT;State &s(m_context.back()); </xsl:text>
- </xsl:when>
- <xsl:when test="local-name(.)='complexType' and (./xsd:sequence or ./xsd:choice or ./xsd:group)">
- <xsl:text>&INDENT;State &s(m_context.back()); </xsl:text>
- </xsl:when>
- <xsl:when test="local-name(.)='complexType' and local-name(./xsd:simpleContent) ='simpleContent'">
- </xsl:when>
- <xsl:when test="local-name(.)='complexType' and
- (not(./xsl:simpleContent) and not(./xsd:complexContent) and
- not(./xsd:sequence) and not(./xsd:choice) and not (./xsd:all))">
- </xsl:when>
- <xsl:when test="local-name(.)='simpleType'">
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test='$verbose="yes"'>
- <xsl:message terminate="yes">To be finalized <xsl:value-of select='concat(local-name(.)," name=",@name)'/></xsl:message>
- <xsl:message terminate="no">To be finalized </xsl:message>
- </xsl:if>
- <xsl:text>&INDENT;State &s(m_context.back()); </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match='xsd:element' mode="need-state">
- <xsl:apply-templates select="xsd:simpleType|xsd:complexType" mode="need-state"/>
- </xsl:template>
- <xsl:template match='xsd:simpleType' mode="need-state"></xsl:template>
- <xsl:template match='xsd:complexType' mode="need-state">
- <xsl:apply-templates select="xsd:simpleContent|xsd:complexContent" mode="need-state"/>
- <xsl:apply-templates select="xsd:sequence|xsd:choice" mode="need-state"/>
- </xsl:template>
- <xsl:template match='xsd:simpleContent' mode="need-state"></xsl:template>
- <xsl:template match='xsd:complextContent|xsd:sequence|xsd:choice' mode="need-state">
- <xsl:text>&INDENT;State &s(m_context.back()); </xsl:text>
- </xsl:template>
- <!--
- Heu need also to implements start / stop virtual functions ....
- Who is our father , element, complexType, simpleType
- who are our sons .
- -->
- <xsl:template name='class-parser-skel-source-start'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='sscope'/>
-
- <xsl:text>/** </xsl:text>
- <xsl:text>*/ </xsl:text>
- <xsl:text>bool </xsl:text><xsl:value-of select='concat($scope,$class)'/><xsl:text>::</xsl:text>
- <xsl:text>startElementImpl(const std::string &ns,const std::string &name,</xsl:text>
- <xsl:text>const std::string &tp) { </xsl:text>
- <xsl:call-template name='class-parser-skel-source-need-state'/>
- <xsl:call-template name='debug'>
- <xsl:with-param name='mode' />
- <xsl:with-param name='indent' select='concat("&INDENT;","")'/>
- <xsl:with-param name='string'>
- <xsl:text>std::cout<<"</xsl:text>
- <xsl:value-of select='concat($class,"::startElementImpl ")'/>
- <xsl:text>"<<name<<"\n";</xsl:text>
- </xsl:with-param>
- </xsl:call-template>
- <!-- process elements with no type -->
- <xsl:if test='local-name(.)="element" and local-name(./@ype)=""'>
- <xsl:apply-templates select="xsd:simpleType|xsd:complexType" mode="class-parser-skel-source-start">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='sscope' select='$sscope'/>
- </xsl:apply-templates>
- </xsl:if>
- <xsl:text>&INDENT;/* class-parser-skel-source-start Before choice and sequence </xsl:text>
- <xsl:value-of select="concat(local-name(.),' ',$class,' */ ')"/>
- <xsl:apply-templates select="xsd:all|xsd:sequence|xsd:choice|xsd:element|xsd:simpleContent|xsd:complexContent|xsd:group" mode="class-parser-skel-source-start">
- <xsl:with-param name='class' select='$class'/>
- <xsl:with-param name='scope' select='$scope'/>
- <xsl:with-param name='sscope' select='$sscope'/>
- </xsl:apply-templates>
- <xsl:text> return false; </xsl:text><xsl:text>} </xsl:text>
-
- <xsl:text>bool </xsl:text>
- <xsl:value-of select='concat($scope,$class)'/><xsl:text>::</xsl:text>
- <xsl:text>endElementImpl(const std::string &ns,const std::string &name) { </xsl:text>
- <xsl:call-template name='debug'>
- <xsl:with-param name='mode' />
- <xsl:with-param name='indent' select='concat("&INDENT;","")'/>
- <xsl:with-param name='string'>
- <xsl:text>std::cout<<"</xsl:text>
- <xsl:value-of select='concat($class,"::end ElementImpl")'/>
- <xsl:text>"<<name<<"\n";</xsl:text>
- </xsl:with-param>
- </xsl:call-template>
- <xsl:call-template name='class-parser-skel-source-need-state'/>
- <xsl:apply-templates select="xsd:all|xsd:sequence|xsd:choice|xsd:element|xsd:simpleContent|xsd:complexContent|xsd:group" mode="parser-src-end">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='sscope' select="$sscope"/>
- </xsl:apply-templates>
- <xsl:text> return false; </xsl:text>
- <xsl:text>} </xsl:text>
-
-
- </xsl:template>
-
-
- <!--
- *
- * class-parser-skel-source-start
- *
- -->
- <!-- -->
- <xsl:template match='xsd:simpleType' mode="class-parser-skel-source-start">
- <xsl:param name='class'></xsl:param>
- <xsl:param name='scope'></xsl:param>
- <xsl:message terminate='no'>xsd2cpp-parser: xsd:simpleType not yet coded</xsl:message>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexType' mode="class-parser-skel-source-start">
- <xsl:param name='class'></xsl:param>
- <xsl:param name='scope'></xsl:param>
- <xsl:message terminate='no'>xsd2cpp-parser: xsd:complexType not yet coded</xsl:message>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:simpleContent' mode="class-parser-skel-source-start">
- <xsl:param name='class'></xsl:param>
- <xsl:param name='scope'></xsl:param>
- <xsl:message terminate='no'>xsd2cpp-parser: xsd:simpleContent not yet coded</xsl:message>
- <xsl:apply-templates select="xsd:restriction|xsd:extension" mode="class-parser-skel-source-start-simpleContent">
- <xsl:with-param name='class' select='$class'/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match='xsd:complexContent' mode="class-parser-skel-source-start">
- <xsl:param name='class'></xsl:param>
- <xsl:param name='scope'></xsl:param>
- <xsl:apply-templates select="xsd:restriction|xsd:extension" mode="class-parser-skel-source-start-complexContent">
- <xsl:with-param name='class' select='$class'/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match='xsd:restriction' mode="class-parser-skel-source-start-simpleContent">
- <xsl:variable name='ns'>
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@base"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='$ns="http://www.w3.org/2001/XMLSchema"'>
- <xsl:text>&INDENT;if (this->::xsd::parser::SimpleElement::startElementImpl(ns,name,tp))</xsl:text>
- <xsl:text> &INDENT2;return true; </xsl:text>
- </xsl:when>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace'>
- <xsl:text>&INDENT;/* </xsl:text><xsl:value-of select="substring-after(@base,':')"/>
- <xsl:text>*/ </xsl:text>
- <xsl:text>&INDENT;std::cout<<"class-parser-skel-source-start-simpleConent NOT YET CODED </xsl:text>
- <xsl:value-of select='concat(name(.)," @base=",@base)'/>
- <xsl:text>"<<std::endl; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>xsd:restriction <xsl:value-of
- select="@base"/> not yet coded for <xsl:value-of
- select="../../@name"/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match='xsd:extension' mode="class-parser-skel-source-start-simpleContent">
- <xsl:param name='class'></xsl:param>
- <xsl:param name='scope'></xsl:param>
- <xsl:variable name='ns'>
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@base"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:message terminate='no'>xsd-parser xsd:extension <xsl:value-of
- select="@base"/> not yet completely coded for <xsl:value-of
- select="../../@name"/></xsl:message>
- <xsl:choose>
- <xsl:when test='$ns="http://www.w3.org/2001/XMLSchema"'>
- <xsl:text>&INDENT;if (this->::xsd::parser::SimpleElement::startElementImpl(ns,name,tp))</xsl:text>
- <xsl:text>&INDENT2;return true; </xsl:text>
- </xsl:when>
- <xsl:when
- test='not(contains(@base,":")) and namespace::*[name()=""]="http://www.w3.org/2001/XMLSchema"'>
- <xsl:text>&INDENT;if (this->::xsd::parser::SimpleElement::startElementImpl(ns,name,tp))</xsl:text>
- <xsl:text>&INDENT2;return true; </xsl:text>
- </xsl:when>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace'>
- <xsl:text>&INDENT;/* </xsl:text><xsl:value-of select="substring-after(@base,':')"/>
- <xsl:text>*/ </xsl:text>
- <xsl:text>std::cout<<"NOT YET CODED xsd:extension start
- element"<<std::endl; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>xsd:restriction <xsl:value-of
- select="@base"/> not yet coded for <xsl:value-of
- select="../../@name"/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match='xsd:restriction' mode="class-parser-skel-source-start-complexContent">
- <xsl:param name='class'></xsl:param>
- <xsl:param name='scope'></xsl:param>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select="@base" mode='restriction-base'/>
- </xsl:variable>
- <xsl:message terminate='no'>xsd:restriction <xsl:value-of
- select="@base"/> not yet completelly coded for <xsl:value-of
- select="concat(../../@name,'-',$cpp_type)"/></xsl:message>
- <xsl:text>&INDENT;/* &INDENT;if (this->::</xsl:text>
- <xsl:value-of select="concat('p_',$cpp_type)"/>
- <xsl:text>::startElementImpl(ns,name,tp)) </xsl:text>
- <xsl:text> return true; </xsl:text>
- <xsl:text> */ </xsl:text>
- <xsl:apply-templates select='xsd:sequence|xsd:choice|xsd:all|xsd:group'
- mode='class-parser-skel-source-start'>
- <xsl:with-param name='class' select='$class'/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match='xsd:extension' mode="class-parser-skel-source-start-complexContent">
- <xsl:param name='class'></xsl:param>
- <xsl:param name='scope'></xsl:param>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select="@base" mode='normalize-name'/><xsl:value-of select="$cls-parser-suff"/>
- </xsl:variable>
- <xsl:message terminate='no'>xsd:restriction <xsl:value-of
- select="@base"/> not yet completelly coded for <xsl:value-of
- select="concat(../../@name,'-',$cpp_type)"/></xsl:message>
- <xsl:text>
- if (this-></xsl:text>
- <xsl:value-of select='concat("p_",$cpp_type)'/><xsl:text>::startElementImpl(ns,name,tp))
- return true;
- </xsl:text>
- <xsl:apply-templates select='xsd:sequence|xsd:choice|xsd:all|xsd:group'
- mode='class-parser-skel-source-start'>
- <xsl:with-param name='class' select='$class'/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match='xsd:restriction' mode="class-parser-skel-source-start">
- <xsl:param name='class'></xsl:param>
- <xsl:param name='scope'></xsl:param>
- <xsl:variable name='ns'>
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@base"/>
- </xsl:call-template>
- </xsl:variable>
- <!-- The parent is either simpleContent complexContent -->
- <xsl:choose>
- <xsl:when test='local-name(..)="simpleType"'>
- <xsl:message terminate='no'>xsd:restriction <xsl:value-of
- select="@base"/> not yet coded for <xsl:value-of
- select="../../@name"/></xsl:message>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>xsd:restriction <xsl:value-of
- select="@base"/> not yet coded for <xsl:value-of
- select="../../@name"/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match='xsd:extension' mode="class-parser-skel-source-start">
- <xsl:param name='class'></xsl:param>
- <xsl:param name='scope'></xsl:param>
- <xsl:variable name='ns'>
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@base"/>
- </xsl:call-template>
- </xsl:variable>
- <!-- The parent is either simpleContent complexContent -->
- <xsl:choose>
- <xsl:when test='local-name(..)="simpleContent"'>
- <xsl:text> /* Start to handle Extension ... */ </xsl:text>
- <xsl:text> if (this->::xsd::parser::SimpleElement::startElementImpl(ns,name,tp)) </xsl:text>
- <xsl:text> return true; </xsl:text>
- <xsl:message terminate='no'>xsd:extension ontent not yet coded
- <xsl:value-of select="@base"/></xsl:message>
- </xsl:when>
- <xsl:when test='local-name(..)="complexConcent"'>
- <xsl:message terminate='yes'>xsd:extension ontent not yet coded
- <xsl:value-of select="@base"/></xsl:message>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>xsd:extension ontent not yet coded
- <xsl:value-of select="@base"/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match='xsd:sequence' mode="class-parser-skel-source-start">
- <xsl:param name='class'></xsl:param>
- <xsl:param name='scope'></xsl:param>
- <xsl:text>&INDENT;/* class-parser-skel-source-start </xsl:text>
- <xsl:value-of select='concat(name(.)," Sequence @maxOccurs=",@maxOccurs," */ ")'/>
- <xsl:apply-templates select="xsd:element|xsd:group|xsd:choice|xsd:sequence|xsd:any" mode="class-parser-skel-source-start">
- <xsl:with-param name='class' select='$class'/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match='xsd:choice' mode="class-parser-skel-source-start">
- <xsl:param name='class'></xsl:param>
- <xsl:param name='scope'></xsl:param>
- <xsl:text>&INDENT;/* class-parser-skel-source-start </xsl:text>
- <xsl:value-of select='concat(name(.)," @maxOccurs=",@maxOccurs," */ ")'/>
- <xsl:apply-templates select="xsd:sequence|xsd:choice|xsd:element" mode="class-parser-skel-source-start">
- <xsl:with-param name='class' select='$class'/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match='xsd:group[@ref!=""]' mode="class-parser-skel-source-start">
- <xsl:param name='class'></xsl:param>
- <xsl:param name='scope'></xsl:param>
- <xsl:variable name='el' select='substring-after(@ref,":")'/>
- <xsl:text>&INDENT;/* Groupe ref */ </xsl:text>
- <xsl:apply-templates select='/xsd:schema/xsd:group[@name=$el]'
- mode='class-parser-skel-source-start'>
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='maxOccurs' select="@maxOccurs"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match='xsd:group[@name!=""]' mode="class-parser-skel-source-start">
- <xsl:param name='class'></xsl:param>
- <xsl:param name='scope'></xsl:param>
- <xsl:apply-templates select="xsd:sequence|xsd:choice|xsd:all" mode="class-parser-skel-source-start">
- <xsl:with-param name='class' select='$class'/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match='xsd:any' mode="class-parser-skel-source-start">
- <xsl:param name='class'></xsl:param>
- <xsl:param name='scope'></xsl:param>
- <xsl:text>/* Any Element To be coded*/ </xsl:text>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:element[@ref!=""]' mode="class-parser-skel-source-start">
- <xsl:param name='class'></xsl:param>
- <xsl:param name='scope'></xsl:param>
- <xsl:variable name='nname' ><xsl:apply-templates select='@ref' mode='normalize-name'/></xsl:variable>
- <xsl:variable name='form'>
- <xsl:apply-templates select="." mode="element-form"/>
- </xsl:variable>
- <xsl:variable name='maxOccurs'>
- <xsl:apply-templates select="." mode="element-max-occurs"/>
- </xsl:variable>
- <xsl:variable name='el' select='substring-after(@ref,":")'/>
- <xsl:text>&INDENT;/* xsd2cpp-parser class-parser-skel-source -start element ref </xsl:text><xsl:value-of select="@ref"/><xsl:text> */ </xsl:text>
- <!-- Well, for start there is not difference -->
- <xsl:apply-templates select='/xsd:schema/xsd:element[@name=$el]'
- mode='class-parser-skel-source-start'>
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='maxOccurs' select="@maxOccurs"/>
- </xsl:apply-templates>
-
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:element[@name and not(@type) and @abstract and @abstract="true"]' mode="class-parser-skel-source-start">
- <xsl:param name='class'></xsl:param>
- <xsl:param name='scope'></xsl:param>
- <xsl:variable name='el' select='@name'/>
- <xsl:apply-templates select='/xsd:schema/xsd:element[@equivClass=$el]'
- mode='class-parser-skel-source-start'>
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='maxOccurs' select="@maxOccurs"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:element[@name and not(@type) and not(@abstract)]' mode="class-parser-skel-source-start">
- <xsl:param name='class'></xsl:param>
- <xsl:param name='scope'></xsl:param>
- <xsl:param name='maxOccurs'>1</xsl:param>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name' mode='normalize-name'/></xsl:variable>
- <xsl:variable name='ns'>
- <xsl:choose>
- <xsl:when test='@form'>
- <xsl:apply-templates select="@form" mode='qualified-namespace'> </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='/xsd:schema/@elementFormDefault="qualified"'>
- <xsl:apply-templates select="/xsd:schema/@targetNamespace" mode='qualified-namespace'> </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='/xsd:schema/@elementFormDefault="unqualified"'>
- <xsl:text>ns.empty()</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>ns.empty()</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='cpp_type'>
- <xsl:value-of select='concat(substring-after($class,"p_"),"::",$nname,"_type")'/>
- </xsl:variable>
- <xsl:message terminate='no'>xsd2cpp-parser Process EL parsing <xsl:value-of select="concat(@name,' ',$ns)"/></xsl:message>
- <xsl:value-of select='concat("&INDENT;// Espace de nommage: ",$ns," - ",$cpp_type," cls=",$class," ")'/>
- <xsl:text>&INDENT;if (name == "</xsl:text><xsl:value-of select="@name"/><xsl:text>" && </xsl:text>
- <xsl:value-of select="concat(' &INDENT;',$ns)"/>
- <xsl:text>) &INDENT;{ </xsl:text>
- <xsl:text>&INDENT2;s.m_parser = this->m_</xsl:text><xsl:value-of select="concat($nname,'_parser; ')"/>
- <xsl:text>&INDENT2;if (s.m_parser != 0) { </xsl:text>
- <xsl:text>&INDENT3;s.m_parser->pre(); </xsl:text>
- <xsl:text>&INDENT2;} else { </xsl:text>
- <xsl:text>&INDENT3;std::cout<<"Warning no parser </xsl:text>
- <xsl:value-of select='concat($class," for el",@name)'/>
- <xsl:text>"<<std::endl; </xsl:text>
- <xsl:text>&INDENT2;} </xsl:text>
- <xsl:text>&INDENT2;//std::cout<<"Yes found element </xsl:text>
- <xsl:value-of select="@name"/>
- <xsl:text>"<<std::endl; </xsl:text>
- <xsl:text>&INDENT2;return true; </xsl:text>
- <xsl:text>&INDENT;} </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[@name!="" and @type]' mode="class-parser-skel-source-start">
- <xsl:param name='class'></xsl:param>
- <xsl:param name='scope'></xsl:param>
- <xsl:param name='maxOccurs'>1</xsl:param>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name'
- mode='normalize-name'/></xsl:variable>
-
- <xsl:choose>
- <xsl:when test='@name!=""'>
- <xsl:variable name='ns'>
- <xsl:choose>
- <xsl:when test='@form'>
- <xsl:apply-templates select="@form" mode='qualified-namespace'> </xsl:apply-templates>
- </xsl:when>
- <xsl:when
- test='/xsd:schema/@elementFormDefault="qualified"'>
- <xsl:apply-templates select="/xsd:schema/@targetNamespace" mode='qualified-namespace'> </xsl:apply-templates>
- </xsl:when>
- <xsl:when
- test='/xsd:schema/@elementFormDefault="unqualified"'>
- <xsl:text>ns.empty()</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>ns.empty()</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='cpp_type'>
- <xsl:choose>
- <xsl:when test='@type'>
- <xsl:apply-templates select='@type' mode='restriction-base'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat(substring-after($class,"p_"),"::",$nname,"_skel")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='ns_oftype'>
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@type"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='cpp_ns'>
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select='$ns_oftype'/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:message terminate='no'>xsd2cpp-parser Process EL parsing <xsl:value-of select="concat(@name,' ',$ns)"/></xsl:message>
- <xsl:value-of select='concat(" // Espace de nommage: ",$ns," - ",@type," ICI ")'/>
- <xsl:text>&INDENT;if (name == "</xsl:text><xsl:value-of select="@name"/><xsl:text>" && </xsl:text>
- <xsl:value-of select="concat(' ',$ns)"/>
- <xsl:text>) &INDENT;{ </xsl:text>
- <xsl:text> s.m_parser = this->m_</xsl:text><xsl:value-of select="concat($nname,'_parser; ')"/>
- <xsl:text>&INDENT2;if (s.m_parser != 0) { </xsl:text>
- <xsl:text>&INDENT3;s.m_parser->pre(); </xsl:text>
- <xsl:text>&INDENT2;} else { </xsl:text>
- <xsl:text>&INDENT3;std::cout<<"Warning no parser </xsl:text>
- <xsl:value-of select='concat($class," for el",@name)'/>
- <xsl:text>"<<std::endl; </xsl:text>
- <xsl:text>&INDENT2;} </xsl:text>
- <xsl:text>&INDENT2;//std::cout<<"Yes found element </xsl:text>
- <xsl:value-of select="@name"/>
- <xsl:text>"<<std::endl; </xsl:text>
- <xsl:text>&INDENT2;return true; </xsl:text>
- <xsl:text>&INDENT;} </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>/* Miss stated .... */ </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- implement post function if complex type parsing ...
- -->
- <xsl:template name='class-parser-skel-source-pre-internal'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='sscope'></xsl:param>
- <xsl:variable name='need-state'>
- <xsl:call-template name='class-parser-skel-source-need-state'/>
- </xsl:variable>
- <xsl:if test='$need-state!=""'>
- <xsl:text> void </xsl:text>
- <xsl:value-of select='concat($scope,$class,"::preInternal() { ")'/>
- <xsl:value-of select='concat($need-state," ")'/>
- <xsl:call-template name='debug'>
- <xsl:with-param name='mode' />
- <xsl:with-param name='indent' select='concat("&INDENT;","")'/>
- <xsl:with-param name='string'>
- <xsl:text>std::cout<<"</xsl:text>
- <xsl:value-of select='concat($class,"::preInternal context size=")'/>
- <xsl:text>"<<m_context.size()<<std::endl;</xsl:text>
- </xsl:with-param>
- </xsl:call-template>
- <xsl:choose>
- <xsl:when test='$with-factory="yes"'>
- <xsl:variable name="sname" select='substring-after($class,"p_")'/>
- <xsl:text>&INDENT;m_context.back().m_data= Factory::create( </xsl:text>
- <xsl:value-of select='concat(substring-after($scope,"p_"),$sname,"::",$sname,"_type); ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>&INDENT;m_context.back().m_data= new </xsl:text>
- <xsl:value-of select='concat(substring-after($scope,"p_"),substring-after($class,"p_"),"(); ")'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text> } </xsl:text>
- </xsl:if>
-
- </xsl:template>
-
- <!--
- implement post function if complex type parsing ...
- -->
- <xsl:template name='class-parser-skel-source-pre'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='sscope'/>
- <xsl:variable name='need-state'>
- <xsl:call-template name='class-parser-skel-source-need-state'/>
- </xsl:variable>
- <xsl:text> void </xsl:text>
- <xsl:value-of select='concat($scope,$class,"::pre() { ")'/>
- <xsl:if test='$need-state!=""'>
- <xsl:value-of select='concat($need-state," ")'/>
- <xsl:call-template name='debug'>
- <xsl:with-param name='mode' />
- <xsl:with-param name='indent' select='concat("&INDENT;","")'/>
- <xsl:with-param name='string'>
- <xsl:text>std::cout<<"</xsl:text>
- <xsl:value-of select='concat($class,"::pre context size=")'/>
- <xsl:text>"<<m_context.size()<<std::endl;</xsl:text>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- <xsl:text>&INDENT;m_str ="";</xsl:text>
- <xsl:text> } </xsl:text>
-
- </xsl:template>
-
-
- <!--
- implement post function if complex type parsing ...
- -->
- <xsl:template name='class-parser-skel-source-post-internal'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='name'/>
- <xsl:param name='sscope'/>
- <xsl:variable name='need-state'>
- <xsl:call-template name='class-parser-skel-source-need-state'/>
- </xsl:variable>
- <xsl:variable name='sclass' select='substring-after($class,"p_")'></xsl:variable>
- <xsl:if test='$need-state!=""'>
- <xsl:text> void </xsl:text>
- <xsl:value-of select='concat($scope,$class,"::postInternal() { ")'/>
- <xsl:value-of select='concat($need-state," ")'/>
- <xsl:call-template name='debug'>
- <xsl:with-param name='mode' />
- <xsl:with-param name='indent' select='concat("&INDENT;","")'/>
- <xsl:with-param name='string'>
- <xsl:text>std::cout<<"</xsl:text>
- <xsl:value-of select='concat($class,"::postInternal context size=")'/>
- <xsl:text>"<<m_context.size()<<std::endl;</xsl:text>
- </xsl:with-param>
- </xsl:call-template>
- <xsl:text>&INDENT;if ((m_context.size()>0) && (s.m_data != NULL)) &INDENT;{ </xsl:text>
- <xsl:text>&INDENT2;</xsl:text>
- <!--
- <xsl:value-of select='concat($sclass,"::",substring-before($sclass,"_skel"),"_sptr v(")'/>
- <xsl:value-of select='concat("static_cast<",$sclass,"*>(s.m_data))","; ")'/>
- -->
- <xsl:value-of select='concat($sscope,$sclass," *v=")'/>
- <xsl:value-of select='concat("static_cast<",$sscope,$sclass,"*>(s.m_data)","; ")'/>
- <xsl:text>&INDENT2;if ((m_context.size()>1)) &INDENT2;{ </xsl:text>
- <xsl:text>&INDENT3;</xsl:text>
- <xsl:value-of select='concat($sscope,$sclass," *s=")'/>
- <xsl:value-of select='concat("static_cast<",$sscope,$sclass,"*>(m_context[m_context.size()-2].m_data)","; ")'/>
- <xsl:text>&INDENT3;std::cout<<"RECURSION:</xsl:text>
- <xsl:value-of select='concat($sclass," size=")'/>
- <xsl:text>&INDENT3;"<<m_context.size()<<std::endl; </xsl:text>
- <xsl:value-of select='concat("&INDENT3;m_",$name,"=*v; ")'/>
- <xsl:text>&INDENT2;} &INDENT2;else &INDENT2;{ </xsl:text>
- <xsl:value-of select='concat("&INDENT3;m_",$name,"=*v; ")'/>
- <xsl:text>&INDENT2;} </xsl:text>
- <xsl:text>&INDENT2;delete v; </xsl:text>
- <xsl:text>&INDENT2;s.m_data = NULL; </xsl:text>
- <xsl:text>&INDENT;} </xsl:text>
- <xsl:text> } </xsl:text>
- </xsl:if>
-
- </xsl:template>
-
-
- <!--
- ***
- ** class-parser-skel-source
- **
- Implement the choice function
- -->
- <xsl:template match='xsd:choice' mode='class-parser-skel-source'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:text> bool </xsl:text>
- <xsl:value-of select="concat($scope,$class)"/>
- <xsl:text>::choice_0(unsigned long &state,unsigned long
- &count,std::string &ns,std::string &name,bool start) { </xsl:text>
- <xsl:text>switch(state) { </xsl:text>
- <xsl:apply-templates
- select="xsd:element|xsd:group|xsd:choice|xsd:sequence|xsd:any" mode='choice-source'>
- <xsl:with-param name='class'><xsl:value-of select='$class'/></xsl:with-param>
- </xsl:apply-templates>
- <xsl:text>}/*end switch */</xsl:text>
- <xsl:text>} </xsl:text>
-
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:annotation' mode="class-parser-skel-source">
- <xsl:param name='class'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:simpleType' mode="class-parser-skel-source">
- <xsl:param name='class'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexType' mode="class-parser-skel-source">
- <xsl:param name='class'/>
- <xsl:apply-templates
- select="xsd:complexContent|xsd:group|xsd:all|xsd:choice|xsd:sequence"
- mode='class-parser-skel-source'>
- <xsl:with-param name="class" select='$class'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexContent' mode="class-parser-skel-source">
- <xsl:param name='class'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:simpleContent' mode="class-parser-skel-source">
- <xsl:param name='class'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:restriction' mode="class-parser-skel-source">
- <xsl:param name='class'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:sequence' mode="class-parser-skel-source">
- <xsl:param name='class'/>
- <xsl:text> /* produce a sequence validation function */ </xsl:text>
-
- <xsl:text> #if 0 </xsl:text><xsl:value-of select="$class"/>
- <xsl:text>::sequence_0(unsigned long &state,unsigned long
- &count , std::string &ns,std::string & n,bool start=true) {
- switch (state) {
-
- }
- } #endif </xsl:text>
-
- </xsl:template>
-
- <!--
- ***
- ***
- ***
- -->
- <xsl:template match='xsd:element|xsd:any' mode='sequence-soure'>
- <xsl:text>case </xsl:text><xsl:value-of select='position()'/>
- <xsl:text>: break; </xsl:text>
- </xsl:template>
-
- <!--
- ***
- ***
- ***
- -->
- <xsl:template match='xsd:element|xsd:any' mode='choice-source'>
- <xsl:choose>
- <xsl:when test="local-name()='element'">
- <xsl:text> case </xsl:text><xsl:value-of
- select="position()-1"/><xsl:text>UL: </xsl:text>
- <xsl:text> if (name == "</xsl:text><xsl:value-of select='@name'/>
- <xsl:text>") { return 0; } break; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>/* TODO */</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match='xsd:sequence' mode='choice-source'>
- <xsl:text>/*xsd2cpp-parser choice-source xsd:sequence */</xsl:text>
- </xsl:template>
-
- <!--
- ***
- *** class-parse-skel-source-empty-element
- *** -->
- <xsl:template match="xsd:annotation" mode='class-parser-skel-source-empty-element'>
- <xsl:param name='class'/>
- </xsl:template>
- <xsl:template match="xsd:complexType" mode='class-parser-skel-source-empty-element'>
- <xsl:param name='class'/>
- <xsl:apply-templates select="xsd:all|xsd:sequence|xsd:choice|xsd:group"
- mode='class-parser-skel-source-empty-element'>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="xsd:complexContent"
- mode='class-parser-skel-source-empty-element'>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="xsd:simpleType" mode='class-parser-skel-source-empty-element'>
- <xsl:param name='class'/>
- <xsl:apply-templates select="xsd:restriction"
- mode='class-parser-skel-source-empty-element'>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="xsd:restriction" mode='class-parser-skel-source-empty-element'>
- <xsl:param name='class'/>
- </xsl:template>
- <xsl:template match="xsd:simpleContent" mode='class-parser-skel-source-empty-element'>
- <xsl:param name='class'/>
- <xsl:if test='$verbose="yes"'>
- <xsl:message terminate='no'>MUST GENERATE SUBCLASS 1: <xsl:value-of select="concat($class,'::',../@name)"/></xsl:message>
- </xsl:if>
- </xsl:template>
- <xsl:template match="xsd:complexContent" mode='class-parser-skel-source-empty-element'>
- <xsl:param name='class'/>
- <xsl:apply-templates select="xsd:all|xsd:sequence|xsd:choice|xsd:group"
- mode='class-parser-skel-source-empty-element'>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:sequence|xsd:all|xsd:choice|xsd:group" mode='class-parser-skel-source-empty-element'>
- <xsl:param name='class'/>
- <xsl:if test='$verbose="yes"'>
- <xsl:message terminate='no'>MUST GENERATE SUBCLASS: <xsl:value-of select="concat($class,'::',../@name)"/></xsl:message>
- </xsl:if>
- <xsl:apply-templates select="xsd:element"
- mode='class-parser-skel-source-empty-element'>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:element[@ref!='']" mode='class-parser-skel-source-empty-element'>
- <xsl:param name='class'/>
- <xsl:if test='$verbose="yes"'>
- <xsl:message terminate='no'>MUST GENERATE SUBCLASS 3: <xsl:value-of select="@name"/></xsl:message>
- </xsl:if>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:element[@name and not(@type)]" mode='class-parser-skel-source-empty-element'>
- <xsl:param name='class'/>
- <xsl:choose>
- <xsl:when test="@type">
- </xsl:when>
- <xsl:when test="./xsd:simpleType or ./xsd:complexType">
- <xsl:text>/* here 1.1*/ </xsl:text>
- <!--
- <xsl:call-template name='class-parser-skel-source' >
- <xsl:with-param name='class' select="concat('p_',@name,'_skel')"/>
- <xsl:with-param name='scope' select="concat($class,'::')"/>
- </xsl:call-template>
- -->
- <xsl:apply-templates select='./xsd:simpleType|./xsd:complexType' mode='class-parser-root' >
- <xsl:with-param name='name' select="concat('',@name,'')"/>
- <xsl:with-param name='class' select="concat('p_',@name,'_skel')"/>
- <xsl:with-param name='scope' select="concat($class,'::')"/>
- <xsl:with-param name='sscope' select="concat(substring($class,3),'::')"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='no'>MUST GENERATE SUBCLASS 5: <xsl:value-of select="@name"/></xsl:message>
- <xsl:text>/* here 1*/ </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@name and @type]" mode='class-parser-skel-source-empty-element'>
- <xsl:param name='class'/>
- <xsl:text>/* here 2*/ </xsl:text>
- <xsl:message terminate='no'>MUST GENERATE SUBCLASS 6: <xsl:value-of select="@name"/></xsl:message>
- </xsl:template>
-
-</xsl:stylesheet>
-
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY PV ";">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
- vim:ts=2:sw=2:et:encoding=utf-8
- xmlns:saxon="http://icl.com"
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:saxon="http://exslt.org/common"
- extension-element-prefixes="saxon"
- version="2.0" >
-<!--
-***
-*** %MODE%
-***
--->
-<xsl:template match='xsd:schema' mode='%MODE%'>
-</xsl:template>
-<!-- -->
-<xsl:template match='xsd:redifine' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
-</xsl:template>
-
-<!-- -->
-<xsl:template match='xsd:import' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
-</xsl:template>
-
-<!-- -->
-<xsl:template match='xsd:include' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
-</xsl:template>
-
-<!--
-**
-** %MODE%-do-include xsd:include!
-**
--->
-<xsl:template match='node()|@*' mode='%MODE%-do-include'>
- <xsl:param name='root'>yes</xsl:param>
- <xsl:choose>
- <xsl:when test='$root="yes"'>
- <xsl:copy>
- <xsl:apply-templates select="node()|@*" mode="%MODE%-do-include">
- <xsl:with-param name='root' select="$root"/>
- </xsl:apply-templates>
- </xsl:copy>
- </xsl:when>
- <xsl:when test='$root="no"'>
- <xsl:copy>
- <xsl:apply-templates select="node()|@*" mode="%MODE%-do-include">
- <xsl:with-param name='root' select="$root"/>
- </xsl:apply-templates>
- </xsl:copy>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>%MODE%-do-include should not enter here</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- -->
-<xsl:template match='xsd:include' mode='%MODE%-do-include'>
- <xsl:param name='root'>yes</xsl:param>
- <xsl:variable name='schema' select="@schemaLocation"/>
- <xsl:apply-templates select="document($schema)" mode="%MODE%-do-include">
- <xsl:with-param name='root'>no</xsl:with-param>
- </xsl:apply-templates>
-
-</xsl:template>
-<!-- -->
-<xsl:template match='xsd:schema' mode='%MODE%-do-include'>
- <xsl:param name='root'>yes</xsl:param>
- <xsl:apply-templates select="node()|@*" mode="%MODE%-do-include">
- <xsl:with-param name='root' select="$root"/>
- </xsl:apply-templates>
-</xsl:template>
-
-
-<!-- %MODE% xsd:simpleType -->
-<!-- -->
-<xsl:template match='xsd:simpleType[not(@name)]' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:param name='name'/>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
- <xsl:apply-templates select='xsd:restriction|xsd:list|xsd:union'
- mode='%MODE%'>
- <xsl:with-param name='scope' select='$scope'></xsl:with-param>
- <xsl:with-param name='class' select='$class'></xsl:with-param>
- </xsl:apply-templates>
-</xsl:template>
-<!-- -->
-<xsl:template match='xsd:simpleType[@name]' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:param name='name'/>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
- <xsl:apply-templates select='xsd:restriction|xsd:list|xsd:union'
- mode='%MODE%'>
- <xsl:with-param name='scope' select='$scope'></xsl:with-param>
- <xsl:with-param name='class' select='$class'></xsl:with-param>
- </xsl:apply-templates>
-</xsl:template>
-
-<!-- %MODE% xsd:complexType -->
-<!-- -->
-<xsl:template match='xsd:complexType' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:param name='name'/>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
- <xsl:apply-templates select='xsd:simpleContent|xsd:complexContent|xsd:group|xsd:all|xsd:choice|xsd:sequence'
- mode='%MODE%'>
- <xsl:with-param name='scope' select='$scope'></xsl:with-param>
- <xsl:with-param name='class' select='$class'></xsl:with-param>
- </xsl:apply-templates>
-</xsl:template>
-<!-- -->
-<xsl:template match='xsd:complexType' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:param name='name'/>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
- <xsl:apply-templates select='xsd:simpleContent|xsd:complexContent|xsd:group|xsd:all|xsd:choice|xsd:sequence'
- mode='%MODE%'>
- <xsl:with-param name='scope' select='$scope'></xsl:with-param>
- <xsl:with-param name='class' select='$class'></xsl:with-param>
- </xsl:apply-templates>
-</xsl:template>
-
-<!-- %MODE% xsd:group -->
-<!-- -->
-<xsl:template match='xsd:group[@name]' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
- <xsl:variable name='minOccurs'>
- <xsl:if test='not(@minOccurs)'>1</xsl:if>
- <xsl:if test='@minOccurs'><xsl:value-of select="@minOccurs"></xsl:if>
- </xsl:variable>
- <xsl:variable name='maxOccurs'>
- <xsl:if test='not(@maxOccurs)'>1</xsl:if>
- <xsl:if test='@maxOccurs'><xsl:value-of select="@maxOccurs"></xsl:if>
- </xsl:variable>
- <xsl:apply-templates select='xsd:all|xsd:choice|xsd:sequence'
- mode='%MODE%'>
- <xsl:with-param name='scope' select='$scope'></xsl:with-param>
- <xsl:with-param name='class' select='$class'></xsl:with-param>
- </xsl:apply-templates>
-</xsl:template>
-<!-- -->
-<xsl:template match='xsd:group[@ref]' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
- <xsl:apply-templates select='xsd:all|xsd:choice|xsd:sequence'
- mode='%MODE%'>
- <xsl:with-param name='scope' select='$scope'></xsl:with-param>
- <xsl:with-param name='class' select='$class'></xsl:with-param>
- </xsl:apply-templates>
-</xsl:template>
-<!-- %MODE% xsd:element -->
-<!-- -->
-<xsl:template match='xsd:element[@name and @type]' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
-</xsl:template>
-<!-- -->
-<xsl:template match='xsd:element[@name and not(@type)]' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
-</xsl:template>
-<!-- -->
-<xsl:template match='xsd:element[@ref]' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
-</xsl:template>
-<!-- %MODE% xsd:attributeGroup -->
-<!-- -->
-<xsl:template match='xsd:atributeGroup' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
-</xsl:template>
-<!-- %MODE% xsd:attribute -->
-<!-- -->
-<xsl:template match='xsd:attribute[@name and @type]' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
-</xsl:template>
-<!-- -->
-<xsl:template match='xsd:attribute[@name and not(@type)]' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
-</xsl:template>
-<!-- -->
-<xsl:template match='xsd:attribute[@ref]' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
-</xsl:template>
-
-<!-- *************** END OF ROOT PART ************************-->
-
-
-<!--
-**
-** Sons of complexType
-**
--->
-<!-- -->
-<xsl:template match='xsd:simpleContent' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
- <xsl:apply-templates select='xsd:restriction|xsd:extension'
- mode='%MODE%'>
- <xsl:with-param name='scope' select='$scope'></xsl:with-param>
- <xsl:with-param name='class' select='$class'></xsl:with-param>
- </xsl:apply-templates>
-</xsl:template>
-<!-- -->
-<xsl:template match='xsd:complexContent' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
- <xsl:apply-templates select='xsd:restriction|xsd:extension'
- mode='%MODE%'>
- <xsl:with-param name='scope' select='$scope'></xsl:with-param>
- <xsl:with-param name='class' select='$class'></xsl:with-param>
- </xsl:apply-templates>
-</xsl:template>
-<!-- -->
-<xsl:template match='xsd:all' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:variable name='minOccurs'>
- <xsl:if test='not(@minOccurs)'>1</xsl:if>
- <xsl:if test='@minOccurs'><xsl:value-of select="@minOccurs"></xsl:if>
- </xsl:variable>
- <xsl:variable name='maxOccurs'>
- <xsl:if test='not(@maxOccurs)'>1</xsl:if>
- <xsl:if test='@maxOccurs'><xsl:value-of select="@maxOccurs"></xsl:if>
- </xsl:variable>
- <xsl:if test='@maxOccurs and @maxOccurs>1'><xsl:message terminate="yes"></xsl:if>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
-</xsl:template>
-<!-- -->
-<xsl:template match='xsd:choice' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:variable name='minOccurs'>
- <xsl:if test='not(@minOccurs)'>1</xsl:if>
- <xsl:if test='@minOccurs'><xsl:value-of select="@minOccurs"></xsl:if>
- </xsl:variable>
- <xsl:variable name='maxOccurs'>
- <xsl:if test='not(@maxOccurs)'>1</xsl:if>
- <xsl:if test='@maxOccurs'><xsl:value-of select="@maxOccurs"></xsl:if>
- </xsl:variable>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
- <xsl:apply-templates select='xsd:choice|xsd:element|xsd:groupe|xsd:sequence|xsd:any'
- mode='%MODE%'>
- <xsl:with-param name='scope' select='$scope'></xsl:with-param>
- <xsl:with-param name='class' select='$class'></xsl:with-param>
- </xsl:apply-templates>
-</xsl:template>
-<!-- -->
-<xsl:template match='xsd:sequence' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:variable name='minOccurs'>
- <xsl:if test='not(@minOccurs)'>1</xsl:if>
- <xsl:if test='@minOccurs'><xsl:value-of select="@minOccurs"></xsl:if>
- </xsl:variable>
- <xsl:variable name='maxOccurs'>
- <xsl:if test='not(@maxOccurs)'>1</xsl:if>
- <xsl:if test='@maxOccurs'><xsl:value-of select="@maxOccurs"></xsl:if>
- </xsl:variable>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
- <xsl:apply-templates select='xsd:choice|xsd:element|xsd:groupe|xsd:sequence|xsd:any'
- mode='%MODE%'>
- <xsl:with-param name='scope' select='$scope'></xsl:with-param>
- <xsl:with-param name='class' select='$class'></xsl:with-param>
- </xsl:apply-templates>
-</xsl:template>
-<!--
-**
-** Sons of simpleType
-**
--->
-
-<!-- -->
-<xsl:template match='xsd:list' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
-</xsl:template>
-<!-- -->
-<xsl:template match='xsd:union' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
-</xsl:template>
-
-<!--
-**
-** RESTRICTION / EXTENSION
-**
--->
-
-<!-- -->
-<xsl:template match='xsd:restriction' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
- <xsl:choose>
- <xsl:when test='local-name(..)="simpleType" or local-name(..)= "simpleContent"'>
- <xsl:apply-templates select='xsd:simpleType|xsd:enumaration|xsd:pattern|xsd:length|xsd:minLength|xsd:maxLength'
- mode='%MODE%'>
- <xsl:with-param name='scope' select='$scope'></xsl:with-param>
- <xsl:with-param name='class' select='$class'></xsl:with-param>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='local-name(..)="complexContent"'>
- <xsl:apply-templates select='xsd:group|xsd:all|xsd:choice|xsd:sequence|xsd:attribute|xsd:attributeGroup|xsd:anyAttribute'
- mode='%MODE%'>
- <xsl:with-param name='scope' select='$scope'></xsl:with-param>
- <xsl:with-param name='class' select='$class'></xsl:with-param>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>%MODE% xsd:restriction <xsl:value-of select='@base'/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- -->
-<xsl:template match='xsd:extension' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
- <xsl:choose>
- <xsl:when test='local-name(..)="simpleContent"'>
- <xsl:apply-templates select='xsd:attribute|xsd:attributeGroup|xsd:anyAttribute'
- mode='%MODE%'>
- <xsl:with-param name='scope' select='$scope'></xsl:with-param>
- <xsl:with-param name='class' select='$class'></xsl:with-param>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='local-name(..)="complexContent"'>
- <xsl:apply-templates select='xsd:group|xsd:all|xsd:choice|xsd:sequence|xsd:attribute|xsd:attributeGroup|xsd:anyAttribute'
- mode='%MODE%'>
- <xsl:with-param name='scope' select='$scope'></xsl:with-param>
- <xsl:with-param name='class' select='$class'></xsl:with-param>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>%MODE% xsd:extension <xsl:value-of select='@base'/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!--
-**
-** RESTRICTION / EXTENSION END
-**
--->
-<!-- -->
-<xsl:template match='xsd:any' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
-</xsl:template>
-<!-- -->
-<xsl:template match='xsd:anyAttribute' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:if when test='$debug-console="yes"'><xsl:message terminate="no">%MODE% <xsl:value-of select='name(.)'/></xsl:message></xsl:if>
-</xsl:template>
-
-<!-- -->
-<!--
-<xsl:template match='xsd:' mode='%MODE%'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
-</xsl:template>
--->
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY PV ";">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
- :vim:ts=2:sw=2:et:encoding=utf-8
- xmlns:saxon="http://icl.com"
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:saxon="http://exslt.org/common"
- extension-element-prefixes="saxon"
- version="2.0" >
-
-
- <!-- -->
- <xsl:template match="xsd:complexType" mode="tree-hdr-choice-union">
- <xsl:param name='sp'><xsl:text>&INDENT;</xsl:text></xsl:param>
- <xsl:apply-templates select='xsd:choice' mode='tree-hdr-choice-union'>
- <xsl:with-param name='sp' select='concat($sp,"&INDENT;")'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:choice" mode="tree-hdr-choice-union">
- <xsl:param name='sp' select='"&INDENT;"' />
- <xsl:variable name='sibling'>
- <xsl:choose>
- <xsl:when test='preceding-sibling::*'>
- <xsl:value-of select='count(preceding-sibling::*[node()!= current()])'/>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select='concat($sp,"&INDENT;struct _choice",$sibling," { ")'/>
- <xsl:apply-templates
- select='xsd:choice|xsd:sequence|xsd:group|xsd:element|xsd:any' mode='tree-hdr-choice-union'>
- <xsl:with-param name='sp' select='concat($sp,"&INDENT;&INDENT;")'/>
- </xsl:apply-templates>
- <xsl:value-of select='concat($sp,"&INDENT;}; ")'/>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:group[@name]" mode="tree-hdr-choice-union">
- <xsl:param name='sp'>&INDENT;</xsl:param>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:group[@ref]" mode="tree-hdr-choice-union">
- <xsl:param name='sp' select='"&INDENT;"'/>
- <xsl:variable name='nname' >
- <xsl:apply-templates select='@ref' mode='normalize-name'/>
- </xsl:variable>
- <xsl:value-of select='concat($sp,$nname,$group-suff," m_",$nname,"; // group=",@ref," ")'/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:sequence" mode="tree-hdr-choice-union">
- <xsl:param name='sp'>&INDENT;</xsl:param>
- <xsl:value-of select='concat($sp,"struct ",local-name(.))'/>
- <xsl:if test='preceding-sibling::xsd:sequence'>
- <xsl:value-of select='count(preceding-sibling::xsd:sequence)'/>
- </xsl:if>
- <xsl:text> { </xsl:text>
- <xsl:apply-templates
- select='xsd:choice|xsd:sequence|xsd:group|xsd:element|xsd:any' mode='tree-hdr-choice-union'>
- <xsl:with-param name='sp' select='concat($sp,"&INDENT;")'/>
- </xsl:apply-templates>
- <xsl:value-of select='concat($sp,"} m_",local-name(.),"")'/>
- <xsl:if test='preceding-sibling::xsd:sequence'>
- <xsl:value-of select='count(preceding-sibling::xsd:sequence)'/>
- </xsl:if>
- <xsl:value-of select='concat("","; ")'/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@ref]" mode="tree-hdr-choice-union">
- <xsl:param name='sp'>&INDENT;</xsl:param>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@name and not(@type)]" mode="tree-hdr-choice-union">
- <xsl:param name='sp'>&INDENT;</xsl:param>
- <xsl:variable name='nname' >
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
- <xsl:value-of select='concat($sp,"//",$nname,"_sptr m_",$nname,"; // type=",@type," ")'/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@name and @type]" mode="tree-hdr-choice-union">
- <xsl:param name='sp'>&INDENT;</xsl:param>
- <xsl:variable name='nname' >
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name="type"><xsl:apply-templates select='@type' mode='local-name'/></xsl:variable>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@type' mode='restriction-base'/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="./ancestor::xsd:complexType[@name=$type]">
- <xsl:value-of select='concat($sp,$type,"_sptr m_",$nname,"; // local type=",@type," ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat($sp,$cpp_type," m_",$nname,"; // type=",@type," ",$type," ")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:any" mode="tree-hdr-choice-union">
- <xsl:param name='sp'>&INDENT;</xsl:param>
- </xsl:template>
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY PV ";">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
- :vim:ts=2:sw=2:et:encoding=utf-8
- xmlns:saxon="http://icl.com"
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:saxon="http://exslt.org/common"
- extension-element-prefixes="saxon"
- version="2.0" >
-
-
- <!--
- ***
- *** tree-hdr-inherit
- ***
- -->
- <!-- tree-hdr-inherit Inheritent choice -->
- <xsl:template match="xsd:annotation" mode="tree-hdr-inherit">
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:simpleType" mode="tree-hdr-inherit">
- <xsl:text> xmlSerializer</xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:complexType" mode="tree-hdr-inherit">
- <xsl:choose>
- <xsl:when test='./xsd:simpleContent|./xsd:complexContent'>
- <xsl:apply-templates select="xsd:simpleContent|xsd:complexContent" mode="tree-hdr-inherit"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text> xmlSerializer</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:simpleContent" mode="tree-hdr-inherit">
- <xsl:apply-templates select='xsd:restriction|xsd:extension' mode="tree-hdr-inherit"/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:complexContent" mode="tree-hdr-inherit">
- <xsl:choose>
- <xsl:when test='./xsd:restriction or ./xsd:extension'>
- <xsl:apply-templates select="xsd:restriction|xsd:extension" mode="tree-hdr-inherit"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text> xmlSerializer</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:restriction|xsd:extension" mode="tree-hdr-inherit">
- <xsl:variable name="base_name">
- <xsl:apply-templates select='@base' mode='restriction-base'/>
- </xsl:variable>
- <xsl:variable name="ns">
- <xsl:choose>
- <xsl:when test="substring-after(@base,':')">
- <xsl:call-template name="namespace-uri-of-qname">
- <xsl:with-param name='qname' select="@base"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/xsd:schema/@targetNamespace"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='vns'>
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="$ns"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:message terminate='no'>xsd2cpp-tree: xsd:restriction inherit</xsl:message>
-
- <xsl:choose>
- <xsl:when test='$ns="&XSD;"'><xsl:text>xmlSerializer</xsl:text></xsl:when>
- <xsl:when test='local-name(..) = "complexContent"'>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name'
- mode='normalize-name'/></xsl:variable>
- <xsl:variable name="cpp_type">
- <xsl:apply-templates select='@base' mode='restriction-base'/>
- </xsl:variable>
- <xsl:value-of select='$cpp_type'/>
- </xsl:when>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace'><xsl:text>xmlSerializer</xsl:text></xsl:when>
- <xsl:when test='not(contains(@base,":")) and not(namespace::*[name()=""])'>
- <xsl:value-of select='concat("",$base_name)'/></xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($vns,'::',substring-after(@base,':'),'_skel')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:sequence|xsd:choice|xsd:all|xsd:group" mode="tree-hdr-inherit">
- <xsl:value-of select="concat('','xmlSerialize')"/>
- </xsl:template>
-
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY PV ";">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
- vim:ts=2:sw=2:et:encoding=utf-8
- xmlns:saxon="http://icl.com"
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:saxon="http://exslt.org/common"
- extension-element-prefixes="saxon"
- version="2.0" >
-
- <xsl:template match='xsd:annotation' mode="tree-hdr-mbr-attr">
- </xsl:template>
- <xsl:template match='xsd:simpleType' mode="tree-hdr-mbr-attr">
- </xsl:template>
- <xsl:template match='xsd:complexType' mode="tree-hdr-mbr-attr">
- <xsl:apply-templates select='xsd:simpleContent|xsd:complexContent' mode="tree-hdr-mbr-attr">
- <xsl:with-param name='maxOccurs' select='@maxOccurs'/>
- </xsl:apply-templates>
- <xsl:apply-templates select='xsd:attribute|xsd:attributeGroup' mode="tree-hdr-mbr-attr">
- <xsl:with-param name='maxOccurs' select='@maxOccurs'/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match='xsd:simpleContent' mode="tree-hdr-mbr-attr">
- <xsl:apply-templates select='xsd:restriction|xsd:extension' mode="tree-hdr-mbr-attr">
- <xsl:with-param name='maxOccurs' select='@maxOccurs'/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match='xsd:complexContent' mode="tree-hdr-mbr-attr">
- <xsl:apply-templates select='xsd:restriction|xsd:extension' mode="tree-hdr-mbr-attr">
- <xsl:with-param name='maxOccurs' select='@maxOccurs'/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match='xsd:restriction' mode="tree-hdr-mbr-attr">
- <!--
- <xsl:variable name="cpp_type">
- <xsl:apply-templates select='@base' mode='restriction-base'/>
- </xsl:variable>
- -->
- <xsl:apply-templates select='xsd:attribute|xsd:attributeGroup' mode="tree-hdr-mbr-attr">
- <xsl:with-param name='maxOccurs' select='@maxOccurs'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:extension' mode="tree-hdr-mbr-attr">
- <xsl:apply-templates select='xsd:attribute|xsd:attributeGroup' mode="tree-hdr-mbr-attr">
- <xsl:with-param name='maxOccurs' select='@maxOccurs'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:sequence' mode="tree-hdr-mbr-attr">
- <xsl:apply-templates select='xsd:any' mode="tree-hdr-mbr-attr">
- <xsl:with-param name='maxOccurs' select='@maxOccurs'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:choice' mode="tree-hdr-mbr-attr">
- <xsl:apply-templates select='xsd:any' mode="tree-hdr-mbr-attr">
- <xsl:with-param name='maxOccurs' select='@maxOccurs'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[@ref!=""]' mode="tree-hdr-mbr-attr">
- <xsl:message terminate="yes"/>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:element[@name!=""]' mode="tree-hdr-mbr-attr">
- <xsl:message terminate="yes"/>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:attribute[@name and @type]' mode="tree-hdr-mbr-attr">
- <xsl:variable name='ns'>
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@ref"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='name'>
- <xsl:apply-templates select="@name" mode='normalize-name'/>
- </xsl:variable>
- <xsl:text>&INDENT2;/* tree-hdr-mbr-attr </xsl:text><xsl:value-of select='concat(" name =",@name," type=",@type)'/><xsl:text> */ </xsl:text>
- <xsl:choose>
- <xsl:when test='@use and @use!="optional"'>
- <xsl:value-of select='concat("&INDENT2;",$name,"_attr_type_ me_attr_",$name,"; ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("&INDENT2;",$name,"_optional me_attr_",$name,"; ")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:attribute[@name and not(@type)]' mode="tree-hdr-mbr-attr">
- <xsl:variable name='name'>
- <xsl:apply-templates select="@name" mode='normalize-name'/>
- </xsl:variable>
- <xsl:text>&INDENT2;/* tree-hdr-mbr-attr </xsl:text>
- <xsl:value-of select='concat(name(.)," @name =",@name," no type")'/><xsl:text>*/ </xsl:text>
- <xsl:choose>
- <xsl:when test='@use and @use="prohibited"'>
- <xsl:value-of select='concat("&INDENT2;",$name,"_optional me_attr_",$name,"; ")'/>
- </xsl:when>
- <xsl:when test='@use and @use="required"'>
- <xsl:value-of select='concat("&INDENT2;",$name,"_optional me_attr_",$name,"; ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("&INDENT2;",$name,"_optional me_attr_",$name,"; ")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attribute[@ref]' mode="tree-hdr-mbr-attr">
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* tree-hdr-mbr-attr </xsl:text>
- <xsl:value-of select='concat(name(.)," ref =",@ref)'/><xsl:text>*/ </xsl:text>
- </xsl:if>
- <xsl:variable name='name'>
- <xsl:choose>
- <xsl:when test='substring-after(@ref,":")'><xsl:value-of select='substring-after(@ref,":")'/></xsl:when>
- <xsl:otherwise><xsl:value-of select="@ref"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='lref' select='key("attribute",substring-after(@ref,":"))'/>
- <xsl:variable name='ns'>
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@ref"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='substring-before(@ref,":")=""'>
- <xsl:message terminate='no'>WARNING Attribute reference without namespace <xsl:value-of select="@ref"/></xsl:message>
- <xsl:variable name='lref' select='key("attribute",@ref)'/>
- <xsl:apply-templates select='$lref' mode="tree-hdr-mbr-attr"/>
- </xsl:when>
- <xsl:when test='($ns=/xsd:schema/@targetNamespace) and $lref'>
- <xsl:apply-templates select='$lref' mode="tree-hdr-mbr-attr"/>
- </xsl:when>
- <!--
- <xsl:when test='$lref'>
- <xsl:apply-templates select='$lref' mode="tree-hdr-mbr-attr"/>
- </xsl:when>
- -->
- <xsl:when test='$ns="&XSD;"'>
- <!-- xsd basic schema... -->
- <xsl:message terminate='yes'>WARNING Attribute reference without namespace</xsl:message>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name='cpp_ns'>
- <xsl:call-template name="cpp_namespace">
- <xsl:with-param name='type' select='$ns'/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='loc-name' select="substring-after(@ref,':')"/>
- <xsl:text>&INDENT2;</xsl:text>
- <xsl:value-of select="concat($cpp_ns,'::',$name,'_attr_type_ ')"/>
- <xsl:value-of select='concat("me_attr_",$name,"; ")'/>
- <xsl:text></xsl:text>
- <xsl:message terminate='no'>ERROR attribute type <xsl:value-of select="$loc-name"/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test='@type'>
- <xsl:message terminate='yes'>xsd:attribute <xsl:value-of select='@ref'/> type not allowed</xsl:message>
- </xsl:when>
- <xsl:when test='@form'>
- <xsl:message terminate='yes'>xsd:attribute <xsl:value-of select='@ref'/> form not allowed</xsl:message>
- </xsl:when>
- <xsl:when test='./xsd:simpleType'>
- <xsl:message terminate='yes'>xsd:attribute <xsl:value-of select='@ref'/>simpleType not allowed</xsl:message>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attributeGroup[@name!=""]' mode="tree-hdr-mbr-attr">
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* tree-hdr-mbr-attr </xsl:text><xsl:value-of select='concat(name(.)," @name =",@name,"")'/><xsl:text>*/ </xsl:text>
- </xsl:if>
- <xsl:apply-templates mode="tree-hdr-mbr-attr"
- select="xsd:attribute|xsd:attributeGroup"/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attributeGroup[@ref!=""]' mode="tree-hdr-mbr-attr">
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* tree-hdr-mbr-attr </xsl:text>
- <xsl:value-of select='concat(name(.)," ref=",@ref," ")'/><xsl:text>*/ </xsl:text>
- </xsl:if>
- <xsl:variable name='ns'>
- <xsl:apply-templates select='@ref' mode='namespace-uri-of-qname'/>
- </xsl:variable>
- <xsl:variable name='cpp_ns'>
- <xsl:call-template name="cpp_namespace">
- <xsl:with-param name='type' select='$ns'/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='name'>
- <xsl:apply-templates select="@ref" mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='local-name'>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'><xsl:value-of select='substring-after(@ref,":")'/></xsl:when>
- <xsl:otherwise><xsl:value-of select='@ref'/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text></xsl:text>
- <xsl:apply-templates mode="tree-hdr-mbr-attr"
- select="/xsd:schema/xsd:attributeGroup[@name=$local-name]"/>
- <xsl:text></xsl:text>
- <xsl:text>&INDENT2;</xsl:text>
- <xsl:choose>
- <xsl:when test='$ns="&XSD;"'>
- <xsl:value-of select='concat($name,$attribute-group-suff," ",$attribute-group-member-prefix,$name,"; ")'/>
- </xsl:when>
- <xsl:when test='$ns!=/xsd:schema/@targetNamespace'>
- <xsl:value-of select='concat($cpp_ns,"::",$name,$attribute-group-suff," ",$attribute-group-member-prefix,$name,"; ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat($name,$attribute-group-suff," ",$attribute-group-member-prefix,$name,"; ")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY PV ";">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
- vim:ts=2:sw=2:et:encoding=utf-8
- xmlns:saxon="http://icl.com"
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:saxon="http://exslt.org/common"
- extension-element-prefixes="saxon"
- version="2.0" >
-
-<!--
- ***
- *** parse-tree-member-element
- ***
- -->
- <xsl:template match='xsd:annotation' mode="parse-tree-member-element">
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:simpleType' mode="parse-tree-member-element">
- <xsl:param name='indent' select='""'/>
- <xsl:if test='$debug-comment="yes"'>
- </xsl:if>
- <xsl:apply-templates select='xsd:restriction|xsd:list|xsd:union' mode="parse-tree-member-element">
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexType' mode="parse-tree-member-element">
- <xsl:param name='indent' select='""'/>
- <xsl:if test='$debug-comment="yes"'>
- </xsl:if>
- <xsl:apply-templates select='xsd:simpleContent|xsd:complexContent' mode="parse-tree-member-element">
- </xsl:apply-templates>
- <xsl:apply-templates select='xsd:choice|xsd:sequence|xsd:group|xsd:all' mode="parse-tree-member-element">
- </xsl:apply-templates>
- <xsl:if test='./xsd:element'>
- <xsl:message terminate='yes'>ERROR: Should not be here <xsl:value-of select="@name"/></xsl:message>
- </xsl:if>
- <!-- we are not interested in attributes -->
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:simpleContent' mode="parse-tree-member-element">
- <xsl:param name='indent' select='""'/>
- <xsl:if test='$debug-comment="yes"'>
- </xsl:if>
- <xsl:apply-templates select='xsd:extension|xsd:restriction' mode="parse-tree-member-element">
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexContent' mode="parse-tree-member-element">
- <xsl:param name='indent' select='""'/>
- <xsl:if test='$debug-comment="yes"'>
- </xsl:if>
- <xsl:apply-templates select='xsd:extension|xsd:restriction' mode="parse-tree-member-element">
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:restriction' mode="parse-tree-member-element">
- <xsl:param name='indent' select='""'/>
- <xsl:choose>
- <xsl:when test='local-name(..) = "complexContent"'>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@base' mode='restriction-base'/>
- </xsl:variable>
- <xsl:apply-templates select='xsd:choice|xsd:sequence|xsd:group|xsd:all' mode="parse-tree-member-element">
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='(local-name(..) = "simpleContent") or(local-name(..) = "simpleType")'>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@base' mode='restriction-base'/>
- </xsl:variable>
- <xsl:value-of select="concat('&INDENT2;',$cpp_type)"/><xsl:text> m_content; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>ERROR: in schema</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:extension' mode="parse-tree-member-element">
- <xsl:param name='indent' select='""'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parse-tree-member-element </xsl:text>
- <xsl:value-of select='concat(name(.),"*/ ")'/>
- </xsl:if>
- <xsl:choose>
- <xsl:when test='local-name(..) = "complexContent"'>
- <xsl:apply-templates select='xsd:choice|xsd:sequence|xsd:group|xsd:all' mode="parse-tree-member-element">
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='local-name(..) = "simpleContent"'>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@base' mode='restriction-base'/>
- </xsl:variable>
- <xsl:value-of select="concat('&INDENT2;',$cpp_type)"/><xsl:text> m_content; </xsl:text>
- </xsl:when>
- <xsl:when test='local-name(..) = "simpleType"'>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@base' mode='restriction-base'/>
- </xsl:variable>
- <xsl:value-of select="concat('&INDENT2;',$cpp_type)"/><xsl:text> m_content; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:sequence|xsd:choice' mode="parse-tree-member-element">
- <xsl:param name='indent' select='""'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parse-tree-member-element </xsl:text>
- <xsl:value-of select='concat(name(.)," @maxOccurs=",@maxOccurs)'/>
- <xsl:text>*/ </xsl:text>
- </xsl:if>
- <xsl:apply-templates select='xsd:element|xsd:group|xsd:choice|xsd:sequence|xsd:any' mode="parse-tree-member-element">
- <xsl:with-param name='maxOccurs'>
- <xsl:choose>
- <xsl:when test="@maxOccurs"><xsl:value-of select="@maxOccurs"/></xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:group[@ref]' mode="parse-tree-member-element">
- <xsl:param name='indent' select='""'/>
- <xsl:variable name='nname' ><xsl:apply-templates select='@ref'
- mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name="name">
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'><xsl:value-of select='substring-after(@ref,":")'/></xsl:when>
- <xsl:otherwise><xsl:value-of select="@ref"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:apply-templates select='@ref' mode='namespace-uri-of-qname'/>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parse-tree-member-element </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref)'/>
- <xsl:text>*/ </xsl:text>
- </xsl:if>
- <xsl:choose>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace'>
- <xsl:value-of select='concat("&INDENT2;",$nname,"_elemg_type ",$cls-tree-mbr-elem-prefix,$nname,"; ")'/>
- <xsl:apply-templates select="key('group',substring-after(@ref,':'))" mode='parse-tree-member-element'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>ERROR: not yet treated</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:group[@name]' mode="parse-tree-member-element">
- <xsl:param name='indent' select='""'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parse-tree-member-element </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name)'/>
- <xsl:text>*/ </xsl:text>
- </xsl:if>
- <xsl:apply-templates select='xsd:all|xsd:choice|xsd:sequence' mode="parse-tree-member-element">
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:union' mode="parse-tree-member-element">
- <xsl:param name='indent' select='""'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parse-tree-member-element </xsl:text>
- <xsl:value-of select='concat(name(.),"*/ ")'/>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="@memberTypes">
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@memberTypes' mode='restriction-base'/>
- </xsl:variable>
- <xsl:text>&INDENT2;/* xsd2cpp-tree-hdr-mbr-elemen parse-tree-member-element xsd:union not in a good way*/ </xsl:text>
- <xsl:text>&INDENT2;struct _u m_content; </xsl:text>
- </xsl:when>
- <xsl:when test='./xsd:simpleType'>
- <xsl:text>&INDENT2;struct _u m_content; </xsl:text>
- <!--<xsl:apply-templates select="xsd:simpleType[position()=1]" mode='parse-tree-member-element'/>
- -->
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>ERROR: list without type. </xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- LIST -->
- <xsl:template match='xsd:list[not(@itemType)]' mode="parse-tree-member-element">
- <xsl:param name='indent' select='""'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parse-tree-member-element </xsl:text>
- <xsl:value-of select='concat(name(.),"*/ ")'/>
- </xsl:if>
- <xsl:choose>
- <xsl:when test='./xsd:simpleType'>
- <xsl:text>&INDENT2;std::string m_content; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>ERROR: list without type. </xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <xsl:template match='xsd:list[@itemType]' mode="parse-tree-member-element">
- <xsl:param name='indent' select='""'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parse-tree-member-element </xsl:text>
- <xsl:value-of select='concat(name(.),"*/ ")'/>
- </xsl:if>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@itemType' mode='restriction-base'/>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parse-tree-member-element </xsl:text>
- <xsl:value-of select='concat(name(.)," @itemType=",@itemType," $cpp_type=",$cpp_type,"*/ ")'/>
- </xsl:if>
- <xsl:value-of select='concat("&INDENT2;",$cpp_type," m_content; ")'/>
- <xsl:value-of select='concat("&INDENT2;std::vector<",$cpp_type,"> m_tokens; ")'/>
- </xsl:template>
-
-
- <!-- -->
- <xsl:template match='xsd:any' mode="parse-tree-member-element">
- <xsl:param name='indent' select='""'/>
- <xsl:text>&INDENT2;/*parse-tree-member-element xsd:any TO BE CODED*/ </xsl:text>
- </xsl:template>
- <!-- This is the most important part that must be moved to gen-->
- <xsl:template match='xsd:element[@name]' mode="parse-tree-member-element">
- <xsl:param name='indent' select='""'/>
- <xsl:param name='maxOccurs'>1</xsl:param>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name'
- mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='local-maxOccurs'>
- <xsl:choose>
- <xsl:when test="@maxOccurs"><xsl:value-of select="@maxOccurs"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="$maxOccurs"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parse-tree-member-element </xsl:text>
- <xsl:value-of select='concat(name(.)," name=",@name," $maxOccurs=",$maxOccurs,"*/ ")'/>
- </xsl:if>
- <xsl:choose>
- <xsl:when test='$local-maxOccurs="unbounded"'>
- <xsl:value-of select='concat("&INDENT2;",$nname,"_sequence ",$cls-tree-mbr-elem-prefix,$nname,"; ")'/>
- </xsl:when>
- <xsl:when test='$local-maxOccurs>1'>
- <xsl:value-of select='concat("&INDENT2;",$nname,"_sequence ",$cls-tree-mbr-elem-prefix,$nname,"; ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("&INDENT2;",$nname,"_sptr ",$cls-tree-mbr-elem-prefix,$nname,"; ")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[@ref]' mode="parse-tree-member-element">
- <xsl:param name='indent' select='""'/>
- <xsl:param name='maxOccurs'>1</xsl:param>
- <xsl:variable name='ns'>
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@ref"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='nname'>
- <xsl:apply-templates select="@ref" mode="normalize-name"/>
- </xsl:variable>
- <xsl:value-of select='concat($indent,"&INDENT2;/* parse-tree-member-element ")' />
- <xsl:value-of select='concat($nname," ",name(.)," @ref=",@ref,"*/ ")'/>
- <xsl:choose>
- <xsl:when test='$ns="&XSD;"'>
- </xsl:when>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace'>
- <xsl:apply-templates select='.' mode="gen-tree-hdr-type">
- <!--<xsl:with-param name='name' select="substring-after(@ref,':')"/>
- <xsl:with-param name='type' select="substring-after(@ref,':')"/>
- -->
- <xsl:with-param name='indent' select="$indent"/>
- <xsl:with-param name='name' select="$nname"/>
- <xsl:with-param name='type' select="$nname"/>
- <xsl:with-param name='maxOccurs' select="$maxOccurs"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='$ns=""'>
- <xsl:text>/*No namespace assume local */ </xsl:text>
- <xsl:apply-templates select='.' mode="gen-tree-hdr-type">
- <xsl:with-param name='name' select="$nname"/>
- <xsl:with-param name='type' select="$nname"/>
- <xsl:with-param name='maxOccurs' select="$maxOccurs"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name='loc'
- select="/xsd:schema/xsd:import[@namespace=$ns]/@schemaLocation">
- </xsl:variable>
- <xsl:variable name='doc'>
- <xsl:call-template name='import-document'>
- <xsl:with-param name='location' select='string($loc)'/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='cpp_ns'>
- <xsl:call-template name="cpp_namespace">
- <xsl:with-param name='type' select='$ns'/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:apply-templates select='.' mode="gen-tree-hdr-type">
- <!--<xsl:with-param name='name' select="substring-after(@ref,':')"/>
- <xsl:with-param name='type' select="substring-after(@ref,':')"/>
- -->
- <xsl:with-param name='indent' select="$indent"/>
- <xsl:with-param name='name' select="concat($cpp_ns,'_',$nname)"/>
- <xsl:with-param name='type' select="concat($cpp_ns,'::',$nname)"/>
- <xsl:with-param name='maxOccurs' select="$maxOccurs"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY PV ";">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
- vim:ts=2:sw=2:et:encoding=utf-8
- xmlns:saxon="http://icl.com"
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:saxon="http://exslt.org/common"
- extension-element-prefixes="saxon"
- version="2.0" >
-
-
-
- <!--
- ***
- *** tree-hdr-root
- ***
- in order to handle all element (type, attr,
- group, element, simpletype,complexType) -->
- <xsl:template match='xsd:schema' mode='tree-hdr-root'>
- <xsl:param name='indent' select='""'/>
- <xsl:apply-templates mode='tree-hdr-root'>
- <xsl:with-param name='indent' select='$indent'/>
- </xsl:apply-templates>
- <!--
- <xsl:apply-templates select="xsd:simpleType|xsd:complexType" mode='tree-hdr-root'/>
- <xsl:apply-templates select="xsd:attributeGroup" mode='tree-hdr-root'/>
- <xsl:apply-templates select="xsd:attribute" mode='tree-hdr-root'/>
- <xsl:apply-templates select="xsd:group" mode='tree-hdr-root'/>
- <xsl:apply-templates select="xsd:element" mode='tree-hdr-root'/>
- -->
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:annotation' mode='tree-hdr-root'>
- <xsl:param name='indent' select='"&INDENT;"'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:include' mode='tree-hdr-root'>
- <xsl:param name='indent' select='"&INDENT;"'/>
- <xsl:message terminate='no'>NOT CODED <xsl:value-of select='name(.)'/></xsl:message>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:import' mode='tree-hdr-root'>
- <xsl:param name='indent' select='"&INDENT;"'/>
- <xsl:message terminate='no'>NOT CODED <xsl:value-of select='name(.)'/></xsl:message>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:redefine' mode='tree-hdr-root'>
- <xsl:param name='indent' select='"&INDENT;"'/>
- <xsl:message terminate='yes'>NOT CODED <xsl:value-of select='name(.)'/></xsl:message>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:choice' mode='tree-hdr-root'>
- <xsl:param name='indent' select='"&INDENT;"'/>
- <xsl:message terminate='no'>xsd2cpp-tree-hdr-root tree-hdr-root choice NOT CODED <xsl:value-of select='name(.)'/></xsl:message>
- <xsl:value-of select='concat($indent,"/* xsd2cpp-tree-root ")'/>
- <xsl:value-of select='concat(name(.)," ",count(ancestor::*[local-name(.)="choice"]),"*/ ")'/>
- <xsl:if test='count(./ancestor::xsd:choice) > 0'>
- <xsl:value-of select='concat($indent,"struct choice_",count(ancestor::xsd:choice),"{ ")'/>
- </xsl:if>
- <xsl:apply-templates select="xsd:element" mode='parse-tree-member-element'>
- <xsl:with-param name='indent' select="concat($indent,'')"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="xsd:group|xsd:sequence|xsd:choice" mode='tree-hdr-root'>
- <xsl:with-param name='indent' select="concat($indent,'&INDENT;')"/>
- </xsl:apply-templates>
- <xsl:if test='count(./ancestor::xsd:choice) > 0'>
- <xsl:value-of select='concat($indent,"} m_choice","; ")'/>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:all' mode='tree-hdr-root'>
- <xsl:param name='indent' select='"&INDENT;"'/>
- <xsl:message terminate='no'>NOT CODED <xsl:value-of select='name(.)'/></xsl:message>
- <xsl:text>&INDENT2;/* xsd2cpp-tree-root </xsl:text>
- <xsl:value-of select='concat(name(.),"*/ ")'/>
- <xsl:apply-templates select="xsd:element" mode='parse-tree-member-element'>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:sequence' mode='tree-hdr-root'>
- <xsl:param name='indent' select='"&INDENT;"'/>
- <xsl:message terminate='no'>NOT CODED <xsl:value-of select='name(.)'/></xsl:message>
- <xsl:value-of select='concat($indent,"/* xsd2cpp-tree-root ")'/>
- <xsl:value-of select='concat(name(.),"*/ ")'/>
- <!-- TODO How to process elements without type ?-->
- <xsl:apply-templates select="xsd:element[(@name and @type) or @ref]" mode='parse-tree-member-element'>
- </xsl:apply-templates>
- <xsl:apply-templates select="xsd:group|xsd:sequence|xsd:choice" mode='tree-hdr-root'>
- <xsl:with-param name='indent' select="concat($indent,'&INDENT;')"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- Process elements -->
- <xsl:template match='xsd:element[@ref]' mode='tree-hdr-root'>
- <xsl:param name='indent' select='"&INDENT;"'/>
- <xsl:variable name='ns'>
- <xsl:call-template name="namespace-uri-of-qname">
- <xsl:with-param name='qname' select="@base"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:message terminate='yes'>NOT CODED <xsl:value-of select='name(.)'/></xsl:message>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[not(@type) and @name and @abstract and (@abstract="true")]' mode='tree-hdr-root'>
- <xsl:param name='indent' select='"&INDENT;"'/>
- <xsl:variable name='name' ><xsl:value-of select='@name'/></xsl:variable>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name' mode='normalize-name'/></xsl:variable>
- <!-- Ok, now start the definition of the class -->
- <xsl:text> /* tree-hdr-root </xsl:text>
- <xsl:value-of select='concat(" * Type :",name(.)," ")'/>
- <xsl:value-of select='concat(" * Name :",$nname," ")'/>
- <xsl:value-of select='concat(" * Abstract :",@abstract," ")'/>
- <xsl:text> */ </xsl:text>
- <xsl:text>class </xsl:text><xsl:value-of select="concat($nname,'_skel { &INDENT;public: ')"/>
- <xsl:value-of select='concat("&INDENT;",$nname,"_skel() {}; ")'/>
- <xsl:value-of select="concat('&INDENT;~',$nname,'_skel() {}; ')"/>
- <xsl:text>&INDENT;/* xsd2cpp-tree-hdr-root seter and geter */ </xsl:text>
- <!--
- <xsl:apply-templates select='/xsd:schema/xsd:element[@equivClass=$name]' mode='tree-hdr-setget'>
- </xsl:apply-templates>
- -->
- <xsl:text>&INDENT;protected: </xsl:text>
- <!--
- <xsl:apply-templates select='/xsd:schema/xsd:element[@equivClass=$name]' mode='parse-tree-member-element'>
- </xsl:apply-templates>
- -->
- <xsl:text>};</xsl:text>
- <!-- Add typedefs -->
- <xsl:apply-templates select='.' mode='gen-tree-hdr-type-member'>
- <xsl:with-param name='name' select="$nname"/>
- <xsl:with-param name='cpp_type'>
- <xsl:value-of select="concat($nname,'_skel')"/>
- </xsl:with-param>
- </xsl:apply-templates>
- <!-- Declare element structure for serialization purpose -->
- <xsl:apply-templates select='.' mode='gen-tree-hdr-element'>
- <xsl:with-param name='name' select='$nname'/>
- <xsl:with-param name='sp'><xsl:text>&INDENT2;</xsl:text></xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:element[not(@type) and @name and not(@abstract)]' mode='tree-hdr-root'>
- <xsl:param name='indent' select='"&INDENT;"'/>
- <xsl:param name='sp'/>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name' mode='normalize-name'/></xsl:variable>
- <!-- Ok, now start the definition of the class -->
- <xsl:text> /* tree-hdr-root </xsl:text>
- <xsl:value-of select='concat(" * Type :",name(.)," ")'/>
- <xsl:value-of select='concat(" * Name :",$nname," ")'/>
- <xsl:text> */ </xsl:text>
- <!-- Declare the anonymous class -->
- <xsl:apply-templates select='xsd:simpleType|xsd:complexType' mode='tree-hdr-root'>
- <xsl:with-param name='name' select="$nname"/>
- <xsl:with-param name='sp' select="$sp"/>
- </xsl:apply-templates>
- <!-- Add typedefs -->
- <xsl:if test='$sp!=""'>
- <xsl:apply-templates select='.' mode='gen-tree-hdr-type-member'>
- <xsl:with-param name='name' select="$nname"/>
- <xsl:with-param name='indent' select='$sp'></xsl:with-param>
- <xsl:with-param name='cpp_type'>
- <xsl:choose>
- <xsl:when test="not(./xsd:simpleType|./xsd:complexType)">
- <xsl:text>std::string</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($nname,'_skel')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:if>
- <!-- Declare element structure for serialization purpose -->
- <xsl:apply-templates select='.' mode='gen-tree-hdr-element'>
- <xsl:with-param name='name' select='$nname'/>
- <xsl:with-param name='sp' select='$sp'></xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[@name and @type]' mode='tree-hdr-root'>
- <xsl:param name='indent' select='"&INDENT;"'/>
- <xsl:param name='sp'></xsl:param>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name' mode='normalize-name'/> </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:call-template name="namespace-uri-of-qname">
- <xsl:with-param name='qname' select="@type"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select='$sp'/>
- <xsl:text>//xsd2cpp-tree-hdr-root tree-hdr-root element </xsl:text><xsl:value-of select='concat(@name," ",@type," ")'/>
- <xsl:choose>
- <xsl:when test='$ns="&XSD;"'>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@type' mode='restriction-base'/>
- </xsl:variable>
- <xsl:value-of select='concat($sp,"typedef ")'/>
- <xsl:value-of
- select='concat($cpp_type," el_",$nname,$elem_suff,"; ")'/>
- <xsl:value-of select='concat($sp,"typedef ")'/>
- <xsl:value-of
- select='concat($shared-ptr,"::shared_ptr<",$cpp_type,"> ",$nname,"_sptr; ")'/>
- </xsl:when>
- <xsl:when
- test='not(contains(@type,":")) and namespace::*[name()=""]="&XSD;"'>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@type' mode='restriction-base'/>
- </xsl:variable>
- <xsl:value-of select='concat($sp,"typedef ")'/>
- <xsl:value-of
- select='concat($cpp_type," el_",$nname,$elem_suff,"; ")'/>
- </xsl:when>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace'>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@type' mode='restriction-base'/>
- </xsl:variable>
- <xsl:value-of select='concat($sp,"typedef ")'/>
- <xsl:value-of
- select='concat($shared-ptr,"::shared_ptr<",$cpp_type,"> ",$nname,"_sptr; ")'/>
- <xsl:value-of select='concat($sp,"typedef ")'/>
- <xsl:value-of
- select='concat("std::vector<",$nname,"_sptr> ",$nname,"_sequence; ")'/>
- <!--
- <xsl:apply-templates select='.' mode='gen-tree-hdr-element'>
- <xsl:with-param name='name' select='$nname'/>
- </xsl:apply-templates>
- -->
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>NOT CODED <xsl:value-of select='concat("elem name= ",@name," ns=",$ns," type=",@type)'/> </xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- <!-- Declare element structure for serialization purpose -->
- <xsl:apply-templates select='.' mode='gen-tree-hdr-element'>
- <xsl:with-param name='name' select='$nname'/>
- <xsl:with-param name='sp' select="''"></xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- attributes -->
- <xsl:template match='xsd:attribute[@ref]' mode='tree-hdr-root'>
- <xsl:param name='indent' select='"&INDENT;"'/>
- <xsl:variable name='ns'>
- <xsl:call-template name="namespace-uri-of-qname">
- <xsl:with-param name='qname' select="@base"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* tree-hdr-root </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref," internal type */ ")'/>
- </xsl:if>
- <xsl:if test='../xsd:schema'>
- <xsl:message terminate='yes'>Attribute with ref should not happen here <xsl:value-of select='concat(name(.)," ",@name)'/></xsl:message>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match='xsd:attribute[@name and @type]' mode='tree-hdr-root'>
- <xsl:param name='indent' select='"&INDENT;"'/>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name' mode='normalize-name'/> </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:apply-templates select="@type" mode="namespace-uri-of-qname">
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@type' mode='restriction-base'/>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* tree-hdr-root </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name," @type=",@type," */ ")'/>
- </xsl:if>
- <xsl:choose>
- <xsl:when test='$ns="&XSD;"'>
- <xsl:apply-templates select='.' mode='gen-tree-hdr-element'>
- <xsl:with-param name='name' select='$nname'/>
- <xsl:with-param name='sp' select="'&INDENT;'"></xsl:with-param>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace'>
- <xsl:variable name='class' select='concat("attr_",$nname,"_type")'/>
- <xsl:apply-templates select='.' mode='gen-tree-hdr-element'>
- <xsl:with-param name='sp' select="'&INDENT;'"></xsl:with-param>
- <xsl:with-param name='name' select='$nname'/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>NOT CODED <xsl:value-of select='concat(name(.)," ",@name)'/> name and type</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:call-template name='member-optional'>
- <xsl:with-param name='type' select='concat($nname,"_attr_type_")'/>
- </xsl:call-template>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attribute[@name and not(@type)]' mode='tree-hdr-root'>
- <xsl:param name='indent' select='"&INDENT;"'/>
- <xsl:variable name='nname' >
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='./xsd:simpleType'
- mode='attribute-internal-cpp-type'/>
- </xsl:variable>
-
- <!-- Add typedefs -->
- <!--
- <xsl:apply-templates select='.' mode='gen-tree-hdr-type-member'>
- <xsl:with-param name='name' select="$nname"/>
- <xsl:with-param name='cpp_type' select="$cpp_type"> </xsl:with-param>
- </xsl:apply-templates>
- -->
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* tree-hdr-root </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name," internal type */ ")'/>
- </xsl:if>
- <!-- Ok, now start the definition of the class I think this is OK -->
- <xsl:apply-templates select="xsd:simpleType" mode='tree-hdr-root'>
- <xsl:with-param name='name' select="concat($nname,'')"/>
- </xsl:apply-templates>
- <!-- Generate the attr_type_ structure -->
- <xsl:apply-templates select='.' mode='gen-tree-hdr-element'>
- <xsl:with-param name='name' select='$nname'/>
- <xsl:with-param name='sp' select="''"></xsl:with-param>
- </xsl:apply-templates>
- <xsl:call-template name='member-optional'>
- <xsl:with-param name='type' select='concat($nname,"_attr_type_")'/>
- </xsl:call-template>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attributeGroup[@name]' mode='tree-hdr-root'>
- <xsl:param name='indent' select='"&INDENT;"'/>
- <xsl:variable name='name' >
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
- <!--
- <xsl:apply-templates select="xsd:attribute" mode="tree-hdr-root"/>
- -->
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text> /* tree-hdr-root </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name,"*/ ")'/>
- </xsl:if>
- <xsl:text>struct </xsl:text>
- <xsl:value-of select='concat($name,"_attrg_type { ")'/>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode='tree-hdr-root'>
- </xsl:apply-templates>
- <xsl:apply-templates select="xsd:attribute" mode='tree-hdr-mbr-attr'>
- </xsl:apply-templates>
- <xsl:text>}; </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attributeGroup[@ref]' mode='tree-hdr-root'>
- <xsl:param name='indent' select='"&INDENT;"'/>
- <xsl:variable name='name'>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'><xsl:value-of select='substring-after(@ref,":")'/></xsl:when>
- <xsl:otherwise><xsl:value-of select="@ref"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='nname' >
- <xsl:apply-templates select='@ref' mode='normalize-name'/>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT;/* tree-hdr-root </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref," should not be here */ ")'/>
- </xsl:if>
- <xsl:message terminate='no'>SHOULD NOT HAPPEN<xsl:value-of select='concat(name(.)," @ref=",@ref)'/></xsl:message>
- <xsl:text>&INDENT;/* TO BE DONE attributeGroup </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref," name=",$name,"*/ ")'/>
- <xsl:value-of select='concat("&INDENT;",$nname,$attribute-group-suff," ",$cls-tree-mbr-attr-grp-prefix,$nname,"; ")'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:group[@name]' mode='tree-hdr-root'>
- <xsl:param name='indent' select='"&INDENT;"'/>
- <xsl:variable name='name' >
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* tree-hdr-root </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name,"*/ ")'/>
- </xsl:if>
- <xsl:message terminate='no'>xsd2cpp-tree-header-root NOT CODED <xsl:value-of select='concat(name(.)," name=",@name)'/></xsl:message>
- <xsl:text> struct </xsl:text>
- <xsl:value-of select='concat($name,"_elemg_type { ")'/>
- <xsl:apply-templates select="xsd:all|xsd:choice|xsd:sequence" mode='tree-hdr-root'>
- <xsl:with-param name='indent' select="concat($indent,'&INDENT;')"/>
- </xsl:apply-templates>
- <xsl:text>}; </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:group[@ref]' mode='tree-hdr-root'>
- <xsl:param name='indent' select='"&INDENT;"'/>
- <xsl:variable name='name' >
- <xsl:apply-templates select='@ref' mode='normalize-name'/>
- </xsl:variable>
- <xsl:message terminate='no'>NOT CODED <xsl:value-of select='name(.)'/></xsl:message>
- <xsl:value-of select='concat($indent,$name,"_elemg_type m_",$name,"; ")'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:simpleType[@name]' mode='tree-hdr-root'>
- <xsl:variable name='nname' >
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
-
- <!-- Ok, now start the definition of the class -->
- <xsl:call-template name='class-tree-skel'>
- <xsl:with-param name='class' select="concat($nname,'_skel')"/>
- </xsl:call-template>
- </xsl:template>
- <!-- complex Type under root element -->
- <xsl:template match='xsd:complexType[not(@name)]|xsd:simpleType[not(@name)]' mode='tree-hdr-root'>
- <xsl:param name='indent' select='"&INDENT;"'/>
- <xsl:param name="name"/>
- <!-- Ok, now start the definition of the class -->
- <xsl:call-template name='class-tree-skel'>
- <xsl:with-param name='class' select="concat($name,'_skel')"/>
- </xsl:call-template>
- </xsl:template>
- <!-- complex Type under root schema -->
- <xsl:template match='xsd:complexType[@name]' mode='tree-hdr-root'>
- <xsl:param name='indent' select='"&INDENT;"'/>
- <xsl:variable name='nname' >
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
- <!-- Ok, now start the definition of the class -->
- <xsl:call-template name='class-tree-skel'>
- <xsl:with-param name='class' select="concat($nname,'_skel')"/>
- </xsl:call-template>
- </xsl:template>
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY PV ";">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
- ]>
-
-
-<!--
- vim:ts=2:sw=2:et:encoding=utf-8
- xmlns:saxon="http://icl.com"
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:saxon="http://exslt.org/common"
- extension-element-prefixes="saxon"
- version="2.0" >
-
-
-
- <!--
- ***
- *** tree-hdr-setget
- ***
- -->
- <xsl:template match='xsd:annotation' mode="tree-hdr-setget">
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:simpleType' mode="tree-hdr-setget">
- <xsl:param name='class'></xsl:param>
- <xsl:text>&INDENT2;/* tree-hdr-setget </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name," $class=",$class,"*/ ")'/>
- <xsl:choose>
- <xsl:when test='local-name(..)="schema"'>
- <xsl:apply-templates select="xsd:union|xsd:list|xsd:restriction"
- mode="tree-hdr-setget">
- <xsl:with-param name='class' select='$class'/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='local-name(..)="union"'>
- <xsl:message terminate='no'> tree-hdr-set <xsl:value-of select='concat(name(.)," parent not supported")'/></xsl:message>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="xsd:union|xsd:list|xsd:restriction"
- mode="tree-hdr-setget">
- <xsl:with-param name='class' select='$class'/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexType' mode="tree-hdr-setget">
- <xsl:param name='class'></xsl:param>
- <xsl:text>&INDENT2;/* tree-hdr-setget </xsl:text>
- <xsl:value-of select='concat(name(.),"*/ ")'/>
- <xsl:apply-templates select="xsd:simpleContent|xsd:complexContent"
- mode="tree-hdr-setget">
- <xsl:with-param name='class' select='$class'/>
- </xsl:apply-templates>
- <!-- Sequence choice, group and any do not have attributes -->
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup"
- mode="tree-hdr-setget">
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:simpleContent' mode="tree-hdr-setget">
- <xsl:param name='class'></xsl:param>
- <xsl:text>&INDENT2;/* tree-hdr-setget </xsl:text>
- <xsl:value-of select='concat(name(.),"*/ ")'/>
- <xsl:if test="local-name(..)='complexType'">
- <xsl:apply-templates select="xsd:restriction|xsd:extension"
- mode="tree-hdr-setget">
- <xsl:with-param name='class' select='$class'/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexContent' mode="tree-hdr-setget">
- <xsl:text>&INDENT2;/* tree-hdr-setget </xsl:text>
- <xsl:value-of select='concat(name(.),"*/ ")'/>
- <!--
- <xsl:apply-templates select="xsd:restriction|xsd:extension"
- mode="tree-hdr-setget">
- </xsl:apply-templates>
- -->
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:restriction' mode="tree-hdr-setget">
- <xsl:param name='class'></xsl:param>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@base' mode='restriction-base'/>
- </xsl:variable>
- <!-- sequence ,choice,group and any do not have attributes.
- -->
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* tree-hdr-setget </xsl:text>
- <xsl:value-of select='concat(name(.)," $class=",$class," @base=",@base,"*/ ")'/>
- </xsl:if>
- <xsl:choose>
- <xsl:when test='local-name(..)="simpleType" or (local-name(..)="simpleContent")'>
- <xsl:value-of
- select="concat('&INDENT2;',$class,' & ')"/><xsl:text> operator =(const </xsl:text>
- <xsl:value-of
- select='concat(" ",$cpp_type,"&v) {m_content=v;return *this;}; ")'/>
- <xsl:value-of
- select="concat('&INDENT2;',$class,'(const ',$cpp_type,' &v)')"/>
- <xsl:text>: m_content(v) {}; </xsl:text>
-
- <xsl:value-of select='concat(" &INDENT2;const ",$cpp_type," content() const {return m_content;}; ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup"
- mode="tree-hdr-setget">
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:extension' mode="tree-hdr-setget">
- <xsl:text>&INDENT2;/* tree-hdr-setget </xsl:text>
- <xsl:value-of select='concat(name(.)," @base=",@base," */ ")'/>
- <xsl:choose>
- <xsl:when test='local-name(..)="simpleContent"'>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- <!--
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup"
- mode="tree-hdr-setget">
- </xsl:apply-templates>
- -->
- </xsl:template>
- <!-- LIST -->
- <xsl:template match='xsd:list[not(@itemType)]' mode="tree-hdr-setget">
- <xsl:param name='class'></xsl:param>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* tree-hdr-setget </xsl:text>
- <xsl:value-of select='concat(name(.)," @itemType="," not given, go further */ ")'/>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match='xsd:list[@itemType]' mode="tree-hdr-setget">
- <xsl:param name='class'></xsl:param>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@itemType' mode='restriction-base'/>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* tree-hdr-setget </xsl:text>
- <xsl:value-of select='concat(name(.)," @itemType=",@itemType,"*/ ")'/>
- </xsl:if>
- <!-- Setter that splist the string -->
- <xsl:text>&INDENT2;</xsl:text><xsl:value-of select='concat($class," & operator=(const std::string &_s); ")'/>
- <!-- Getter that splist the string -->
- <xsl:text>&INDENT2;std::vector<</xsl:text><xsl:value-of select='concat($cpp_type,"> items() {return m_tokens;}; ")'/>
- <xsl:value-of select='concat("&INDENT2;",$cpp_type," operator [](int i) { return m_tokens[i]; } ; ")'/>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:union' mode="tree-hdr-setget">
- <xsl:param name='class'></xsl:param>
- <xsl:variable name='types'>
- <xsl:element name='schema' namespace="&XSD;">
- <xsl:copy-of select="namespace::*"/>
- <xsl:attribute name='targetNamespace'><xsl:value-of select="/xsd:schema/@targetNamespace"/></xsl:attribute>
- <xsl:if test="@memberTypes">
- <xsl:call-template
- name='space-string-list'>
- <xsl:with-param name='string' select='@memberTypes'/>
- </xsl:call-template>
- </xsl:if>
- <!-- ADD simple types -->
- <xsl:if test='./xsd:simpleType'><xsl:apply-templates select='./xsd:simpleType' mode='space-string-list'/></xsl:if>
- </xsl:element>
- </xsl:variable>
- <xsl:text>&INDENT2;/* tree-hdr-setget </xsl:text>
- <xsl:value-of select='concat(name(.),"*/ ")'/>
- <xsl:choose>
- <xsl:when test="@memberTypes">
- <xsl:message terminate='no'>xsd2xpp-tree-header end xsd:union with @memberTypes <xsl:value-of select="@memberTypes"/></xsl:message>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>&INDENT2;//xsd2cpp-tree-hdr-setget </xsl:text>
- <xsl:value-of select='concat(name(.)," $types=",$types)'/><xsl:text> </xsl:text>
- <xsl:text></xsl:text>
- <xsl:apply-templates select="xsd:simpleType[position()=1]" mode='tree-hdr-setget'>
- <xsl:with-param name='class' select='$class'/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="$types" mode='tree-hdr-setget-union-attributes'>
- <xsl:with-param name='class' select='$class'/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- tree-hdr-setget-union-attributes -->
- <xsl:template match='xsd:schema' mode='tree-hdr-setget-union-attributes'>
- <xsl:param name='class'></xsl:param>
- <xsl:apply-templates mode='tree-hdr-setget-union-attributes'>
- <xsl:with-param name='class' select='$class'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:field' mode='tree-hdr-setget-union-attributes'>
- <xsl:param name='class'></xsl:param>
- <xsl:message terminate='no'>xsd2xpp-tree-header xsd:field with union-attributes @type=<xsl:value-of select="@type"/></xsl:message>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@type' mode='restriction-base'/>
- </xsl:variable>
- <xsl:if test='not(@type = preceding-sibling::xsd:field/@type)'>
- <xsl:variable name='name'>
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
- <xsl:value-of
- select="concat('&INDENT2;',$class,' & ')"/><xsl:text> operator =(const </xsl:text>
- <xsl:value-of
- select='concat(" ",$cpp_type,"&v) {m_content.m_",$name,"=v;",$cls-tree-union-selector,"=CHOICE_",$name,";return *this;}; ")'/>
- <xsl:value-of
- select="concat('&INDENT2;',$class,'(const ',$cpp_type,' &v)')"/>
- <xsl:text>: m_content() </xsl:text>
- <xsl:value-of select='concat("{ m_content.m_",$name,"= v;}; ")'/>
- <!--
- <xsl:value-of select='concat(" &INDENT2;//const ",$cpp_type," content() const {return ")'/>
- <xsl:value-of select='concat("m_content.m_",text(),";}; ")'/>
- -->
- </xsl:if>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:group' mode="tree-hdr-setget">
- <xsl:text>/* tree-hdr-setget </xsl:text>
- <xsl:value-of select='concat(name(.),"*/ ")'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:all' mode="tree-hdr-setget">
- <xsl:text>/* tree-hdr-setget </xsl:text>
- <xsl:value-of select='concat(name(.),"*/ ")'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:choice|xsd:sequence' mode="tree-hdr-setget">
- <xsl:text>/* tree-hdr-setget </xsl:text>
- <xsl:value-of select='concat(name(.),"*/ ")'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:any' mode="tree-hdr-setget">
- <xsl:text>/* tree-hdr-setget </xsl:text>
- <xsl:value-of select='concat(name(.),"*/ ")'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attribute[@ref]' mode="tree-hdr-setget">
- <xsl:variable name='ns'>
- <xsl:apply-templates select="@ref" mode='namespace-uri-of-qname'>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:variable name='name'>
- <xsl:choose>
- <xsl:when test='substring-after(@ref,":")=""'> <xsl:value-of select="@ref"/> </xsl:when>
- <xsl:otherwise><xsl:value-of select="substring-after(@ref,':')"/> </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='cpp_ns'>
- <xsl:call-template name="cpp_namespace">
- <xsl:with-param name='type' select='$ns'/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='lref' select='key("attribute",$name)'/>
- <xsl:text>&INDENT2;/* tree-hdr-setget </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref,"*/ ")'/>
- <xsl:choose>
- <xsl:when test='($ns="&XSD;") or ($ns=/xsd:schema/@targetNamespace)'>
- <xsl:text>&INDENT;void </xsl:text>
- <xsl:value-of select='concat("attr_",$name,"(",$name,"_attr_type &v)")'/>
- <xsl:text> ; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>&INDENT;void </xsl:text>
- <xsl:value-of select='concat("attr_",$name,"(",$cpp_ns,"::",$name,"_attr_type &v)")'/>
- <xsl:text> ; </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attribute[not(@ref) and not(@type)]' mode="tree-hdr-setget">
- <xsl:param name='class'/>
- <xsl:variable name='name'><xsl:apply-templates select='@name' mode='normalize-name'/> </xsl:variable>
- <xsl:variable name='xsd-type'>
- <xsl:apply-templates select="./xsd:simpleType"
- mode="attribute-internal-type"/>
- </xsl:variable>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='./xsd:simpleType'
- mode='attribute-internal-cpp-type'/>
- </xsl:variable>
- <xsl:text>/* tree-hdr-setget anonymous </xsl:text>
- <xsl:value-of select='concat(name(.)," xsd-ns=",$xsd-type," cpp_type=",$cpp_type, "*/ ")'/>
- <xsl:variable name='nm'><xsl:apply-templates select='@name' mode='normalize-name'/></xsl:variable>
- <!-- Add typedefs -->
- <xsl:apply-templates select='.' mode='gen-tree-hdr-type-member'>
- <xsl:with-param name='name' select="$name"/>
- <xsl:with-param name='cpp_type' select="$cpp_type"/>
- </xsl:apply-templates>
-
- <xsl:apply-templates select='.' mode='gen-tree-hdr-type-member-set'>
- <xsl:with-param name='name' select='$name'/>
- <xsl:with-param name='class' select='$class'/>
- <xsl:with-param name='type' select='$cpp_type'/>
- <xsl:with-param name='sp'><xsl:text>&INDENT2;</xsl:text></xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:attribute[@name and @type]" mode="tree-hdr-setget">
- <xsl:param name='class'/>
- <xsl:variable name='btype' select="concat('xsd::',substring-after(@type,':'))"/>
- <xsl:variable name='name'><xsl:apply-templates select='@name' mode='normalize-name'/> </xsl:variable>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@type' mode='restriction-base'/>
- </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@type"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='vns'>
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="/xsd:schema/@targetNamespace"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:text>&INDENT2;// attribute </xsl:text>
- <xsl:value-of select='concat(" ",@name," ",$ns," &INDENT;// ")'/>
- <xsl:choose>
- <xsl:when test='($ns="&XSD;") or ($ns=/xsd:schema/@targetNamespace) or (substring-before(@type,":")="")'>
- <xsl:apply-templates select='.' mode='gen-tree-hdr-element'>
- <xsl:with-param name='name' select='$name'/>
- <xsl:with-param name='class' select='$class'/>
- <xsl:with-param name='sp'><xsl:text>&INDENT2;</xsl:text></xsl:with-param>
- </xsl:apply-templates>
- <xsl:text> </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>ERROR attribute type definition missing</xsl:message>
- <xsl:text>&INDENT2;// typedef missing </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <!-- Attributes are optional by default -->
- <xsl:if test='@use="optional"'>
- </xsl:if>
- <xsl:call-template name='member-optional'>
- <xsl:with-param name='type' select='concat($name,"_attr_type_")'/>
- </xsl:call-template>
- <!-- Ok, add datatype definitions -->
- <!-- Get function -->
- <xsl:text>&INDENT2;</xsl:text>
- <xsl:value-of
- select='concat($cpp_type," &INDENT2;attr_",$name,"(void) { return me_attr_",$name)'/>
- <xsl:choose>
- <xsl:when test='@use="optional"'>
- <xsl:value-of select='concat("",".content();}; ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("",";}; ")'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>&INDENT2;//</xsl:text>
- <xsl:value-of
- select='concat(@name,"_optional & &INDENT2;//",@name,"(void) { return me_attr_",@name,";}; ")'/>
- <!-- Setter's-->
- <xsl:value-of
- select='concat("&INDENT2;void &INDENT2;attr_",$name,"(",$cpp_type," &v) { me_attr_",$name,"=v;}; ")'/>
- <xsl:choose>
- <xsl:when test='@use and @use!="optional"'>
- <xsl:value-of
- select='concat("&INDENT2;void &INDENT2;attr_",$name,"(",$cpp_type," &v) { me_attr_",$name,"=v;}; ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of
- select='concat("&INDENT2;void &INDENT2;attr_",$name,"(",$name,"_optional &v) { me_attr_",$name,"=v;}; ")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:attributeGroup[@name]' mode="tree-hdr-setget">
- <xsl:param name='class'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* tree-hdr-setget </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name,"*/ ")'/>
- </xsl:if>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup"
- mode="tree-hdr-setget">
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attributeGroup[@ref]' mode="tree-hdr-setget">
- <xsl:param name='class'/>
- <xsl:variable name='local-name'>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'><xsl:value-of
- select='substring-after(@ref,":")'/>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select='@ref'/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@ref"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* tree-hdr-setget </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref," $class=",$class," refns=",$ns," */ ")'/>
- </xsl:if>
- <xsl:apply-templates mode="tree-hdr-setget" select="/xsd:schema/xsd:attributeGroup[@name=$local-name]">
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[@ref]' mode="tree-hdr-setget">
- <xsl:text>&INDENT2;/* tree-hdr-setget </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref,"*/ ")'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[@name and @type]' mode="tree-hdr-setget">
- <xsl:variable name='name'><xsl:apply-templates select='@name' mode='normalize-name'/> </xsl:variable>
- <xsl:text>&INDENT2;/* tree-hdr-setget </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name," @type=",@type," */ ")'/>
- <xsl:text>&INDENT2;void </xsl:text>
- <xsl:value-of select='concat($name,"(",$name,"_sptr &var); ")'/>
- <xsl:text>&INDENT2;void </xsl:text>
- <xsl:value-of select='concat($name,"(",$name,"_type &var); ")'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[@name and not(@type)]' mode="tree-hdr-setget">
- <xsl:text>/* tree-hdr-setget </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name,"*/ ")'/>
- </xsl:template>
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL " ">
- <!ENTITY TAB "	">
- <!ENTITY PV ";">
- <!ENTITY CLS_PREF "">
- <!ENTITY TYPE_SUFF "_skel">
- <!ENTITY ELEM_PREF "el_">
- <!ENTITY ELEM_SUFF "_skel">
- <!ENTITY ATTR_PREF "attr_">
- <!ENTITY ATTR_SUFF "_skel">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:saxon="http://exslt.org/common"
- extension-element-prefixes="saxon"
- version="2.0" >
-
-
- <!--
- ***
- *** gen-tree-hdr-type-member-get
- ***
- Here, I should put the prototype of
- -->
- <xsl:template match='xsd:attribute[@name and @type]' mode='gen-tree-hdr-type-member-get'>
- <xsl:param name='name'/>
- <xsl:param name='eltype'/>
- <xsl:param name='cpp_type'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text> &INDENT2;/* gen-tree-hdr-type-member-get </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name," @type=",@type," */ ")'/>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attribute[@ref]' mode='gen-tree-hdr-type-member-get'>
- <xsl:param name='name'/>
- <xsl:param name='eltype'/>
- <xsl:param name='cpp_type'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text> &INDENT2;/* gen-tree-hdr-type-member-get </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref," */ ")'/>
- </xsl:if>
- <xsl:choose>
- <xsl:when test='@use and @use="prohibited"'>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("&INDENT2;",$eltype," &INDENT2;attr_",$name,"(void); ") '/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- ** xsd:attribute @name and not @type
- ** generate get for attribute with name and no type
- -->
- <xsl:template match='xsd:attribute[@name and not(@type)]' mode='gen-tree-hdr-type-member-get'>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text> &INDENT2;/* gen-tree-hdr-type-member-get </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name," no type */ ")'/>
- </xsl:if>
- </xsl:template>
-
- <!--
- ** xsd:element @name and @type
- ** generate getter for element with name and type. Depends on maxOccurs.
- -->
- <xsl:template match='xsd:element[@name and @type]' mode='gen-tree-hdr-type-member-get'>
- <xsl:param name="nname"></xsl:param>
- <xsl:param name="cpp_type"></xsl:param>
- <xsl:param name="maxOccurs">
- <xsl:choose>
- <xsl:when test="@maxOccurs"><xsl:value-of select="@maxOccurs"/></xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:param>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text> &INDENT2;/* gen-tree-hdr-type-member-get </xsl:text>
- <xsl:value-of
- select='concat(name(.)," @name=",@name,
- " @type=",@type,
- " $maxOccurs=",$maxOccurs," */ ")'/>
- </xsl:if>
- <!--
-
- -->
- <xsl:choose>
- <xsl:when test='$maxOccurs="unbounded"'>
-
- <xsl:text> &INDENT2;</xsl:text>
- <xsl:value-of select='concat($nname,"_sequence & ")'/>
- <xsl:value-of
- select='concat("&INDENT2;",$nname,
- "( void ) { return me_",$nname," ;}; ")'/>
- </xsl:when>
- <xsl:when test='number($maxOccurs)>1'>
- <xsl:text> @INDENT2;//TODO </xsl:text>
- </xsl:when>
- <xsl:when test='number($maxOccurs)=1'>
- <xsl:text> &INDENT2;</xsl:text><xsl:value-of
- select='concat($cpp_type," & &INDENT2;",$nname,"( void ) {
- return (*me_",$nname,") ;}; ")'/>
- <!-- -->
- <xsl:text> &INDENT2;// ADDED &INDENT2;</xsl:text><xsl:value-of
- select='concat("","bool &INDENT2;isset_",
- $nname,"( void ) {
- return (!!me_",$nname,") ;}; ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">Wrong max Occurs for element</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- ** xsd:element @name and not @type
- -->
- <xsl:template match='xsd:element[@name and not(@type)]' mode='gen-tree-hdr-type-member-get'>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text> &INDENT2;/* gen-tree-hdr-type-member-get </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref," */ ")'/>
- </xsl:if>
- <xsl:message terminate='yes'><xsl:value-of select='concat("xsd2cpp-gen-tree-hdr-type-memeber-get: "
- ,name(.)," ",
- @name," Not yet implemented")'/></xsl:message>
- </xsl:template>
-
- <!--
- ** xsd:element @ref
- -->
- <xsl:template match='xsd:element[@ref]' mode='gen-tree-hdr-type-member-get'>
- <xsl:param name='nname'/>
- <xsl:param name='cpp_type'/>
- <xsl:param name='maxOccurs'/>
- <xsl:variable name="ns_type">
- <xsl:apply-templates select="@ref" mode='namespace-uri-of-qname'/>
- </xsl:variable>
- <xsl:variable name='cpp_ns'>
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="$ns_type"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text> &INDENT2;/* gen-tree-hdr-type-member-get </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref," maxOccurs=",$maxOccurs," */ ")'/>
- </xsl:if>
-
- <xsl:choose>
- <xsl:when test='($maxOccurs="unbounded")'>
- <!-- Get function-->
- <xsl:text> &INDENT2;</xsl:text>
- <xsl:value-of select='concat($nname,"_sequence & ")'/>
- <xsl:value-of select='concat("&INDENT2;",$nname,"( void ) { return me_",$nname," ;}; ")'/>
- </xsl:when>
- <xsl:when test='(number($maxOccurs)>1)'>
- <xsl:text> &INDENT2;//void &INDENT2;</xsl:text>
- <xsl:value-of select='concat($nname,"(const ",$nname,"_sequence &v) ; ")'/>
- <!-- Get function-->
- <xsl:text> &INDENT2;</xsl:text>
- <xsl:value-of select='concat($nname,"_sequence & ")'/>
- <xsl:value-of select='concat("&INDENT2;",$nname,"( void ) { return me_",$nname," ;}; ")'/>
- </xsl:when>
- <xsl:otherwise>
- <!-- Get function-->
- <xsl:text> &INDENT2;</xsl:text><xsl:value-of
- select='concat($cpp_type," & &INDENT2;",$nname,"( void ) ; ")'/>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:template>
-
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL " ">
- <!ENTITY TAB "	">
- <!ENTITY PV ";">
- <!ENTITY CLS_PREF "">
- <!ENTITY TYPE_SUFF "_skel">
- <!ENTITY ELEM_PREF "el_">
- <!ENTITY ELEM_SUFF "_skel">
- <!ENTITY ATTR_PREF "attr_">
- <!ENTITY ATTR_SUFF "_skel">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:saxon="http://exslt.org/common"
- extension-element-prefixes="saxon"
- version="2.0" >
-
- <!--
- ***
- *** gen-tree-hdr-type-member-set
- ***
- Here, I should put the prototype of
- -->
- <xsl:template match='xsd:attribute[@name and @type]' mode='gen-tree-hdr-type-member-set'>
- <xsl:param name='maxOccurs'/>
- <xsl:param name='name'/>
- <xsl:param name='eltype'/>
- <xsl:param name='cpp_type'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* gen-tree-hdr-type-member-set </xsl:text>
- <xsl:value-of select='concat(name(.)," @name",@name," ",@type," */ ")'/>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attribute[@ref]' mode='gen-tree-hdr-type-member-set'>
- <xsl:param name='maxOccurs'/>
- <xsl:param name='name'/>
- <xsl:param name='eltype'/>
- <xsl:param name='cpp_type'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* gen-tree-hdr-type-member-set </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref",@ref," */ ")'/>
- </xsl:if>
- <!--
- Attributes don't have min or maxOccurs. They are optional, required or prohibited
- -->
- <xsl:choose>
- <xsl:when test='@use and @use="prohibited"'>
- <xsl:value-of select='concat("&INDENT2;void attr_",$name,"(",$name,"_sptr &v); ") '/>
- </xsl:when>
- <xsl:when test='@use and @use="required"'>
- <xsl:value-of select='concat("&INDENT2;void attr_",$name,"(",$name,"_sptr &v); ") '/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("&INDENT2;void attr_",$name,"(",$name,"_optional &v); ") '/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attribute[@name and not(@type)]' mode='gen-tree-hdr-type-member-set'>
- <xsl:param name='name'/>
- <xsl:param name='eltype'/>
- <xsl:param name='cpp_type'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* gen-tree-hdr-type-member-set </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name," no type */ ")'/>
- </xsl:if>
- <!--<xsl:text> &INDENT2;void&INDENT2;attr_</xsl:text>
- <xsl:value-of select='concat($name,"(",$name,"_attr_type &v) ; ")'/>
- -->
- <xsl:choose>
- <xsl:when test='@use and @use="prohibited"'>
- <xsl:value-of select='concat("&INDENT2;void attr_",$name,"(",$name,"_sptr &v); ") '/>
- </xsl:when>
- <xsl:when test='@use and @use="required"'>
- <xsl:value-of select='concat("&INDENT2;void attr_",$name,"(",$name,"_attr_type &v); ") '/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("&INDENT2;void attr_",$name,"(",$name,"_optional &v); ") '/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[@ref]' mode='gen-tree-hdr-type-member-set'>
- <xsl:param name='maxOccurs'/>
- <xsl:param name='name'/>
- <xsl:param name='eltype'/>
- <xsl:variable name='local-name'>
- <xsl:choose>
- <xsl:when test="contains(@ref,':')"><xsl:value-of select="substring-after(@ref,':')"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="@ref"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text> &INDENT2;/* gen-tree-hdr-type-member-set xsd:element </xsl:text>
- <xsl:value-of select='concat("name=",$name," @ref=",@ref," no type and abstract")'/>
- <xsl:text>*/ </xsl:text>
- <xsl:choose>
- <xsl:when test='$maxOccurs="unbounded"'>
- <xsl:text>&INDENT2;void &INDENT2;</xsl:text>
- <xsl:value-of select='concat($name,"(const ",$name,"_sequence &v) ; ")'/>
- <xsl:value-of select='concat("&INDENT2;void ",$name,"(",$name,"_type &v); ") '/>
- <xsl:value-of select='concat("&INDENT2;void ",$name,"(",$name,"_sptr &v); ") '/>
- </xsl:when>
- <xsl:when test='$maxOccurs>1'>
- <xsl:text>&INDENT2;void &INDENT2;</xsl:text>
- <xsl:value-of select='concat($name,"(const ",$name,"_sequence &v) ; ")'/>
- <xsl:value-of select='concat("&INDENT2;void ",$name,"(",$name,"_type &v); ") '/>
- <xsl:value-of select='concat("&INDENT2;void ",$name,"(",$name,"_sptr &v); ") '/>
- </xsl:when>
- <xsl:when test='$maxOccurs=1'>
- <xsl:text>&INDENT2;void </xsl:text>
- <xsl:value-of select='concat($name,"(",$eltype,"_type &v) ; ")'/>
- <xsl:text>&INDENT2;void </xsl:text>
- <xsl:value-of select='concat($name,"(",$eltype,"_sptr &v) ; ")'/>
- <xsl:value-of select='concat("&INDENT2;void ",$name,"(",$eltype,"_type *v) ; ") '/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes"><xsl:value-of select='$name'/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- Need to be implemented
- because of abstract attribute, the generation of the classes is a bit more complicated.
- -->
- <xsl:template match='xsd:element[@name and not(@type) and @abstract and @abstract="true"]' mode='gen-tree-hdr-type-member-set'>
- <xsl:param name='maxOccurs'/>
- <xsl:param name='name'/>
- <xsl:param name='eltype'/>
- <xsl:param name='baseclass'></xsl:param>
- <xsl:variable name='local-name'>
- <xsl:choose>
- <xsl:when test="contains(@name,':')"><xsl:value-of select="substring-after(@name,':')"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="@name"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text> &INDENT2;/* gen-tree-hdr-type-member-set xsd:element </xsl:text>
- <xsl:value-of select='concat("@name=",@name," no type and abstract")'/>
- <xsl:text>*/ </xsl:text>
- <!-- does not work
- -->
- <xsl:apply-templates select='/xsd:schema/xsd:element[@equivClass=$local-name]' mode='gen-tree-hdr-type-member-set'>
- <xsl:with-param name='name' select="$name"></xsl:with-param>
- <xsl:with-param name='maxOccurs' select="$maxOccurs"></xsl:with-param>
- <xsl:with-param name='baseclass'>
- <xsl:choose>
- <xsl:when test='$baseclass=""'><xsl:value-of select='$name'/></xsl:when>
- <xsl:otherwise><xsl:value-of select='$baseclass'/></xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[@name and not(@type) and not(@abstract)]' mode='gen-tree-hdr-type-member-set'>
- <xsl:param name='maxOccurs'/>
- <xsl:param name='name'/>
- <xsl:param name='eltype'/>
- <xsl:param name='baseclass'></xsl:param>
- <xsl:text> &INDENT2;/* gen-tree-hdr-type-member-set xsd:element </xsl:text>
- <xsl:value-of select='concat("@name=",@name," no type and not abstract")'/>
- <xsl:text>*/ </xsl:text>
- <xsl:choose>
- <xsl:when test='$maxOccurs="unbounded"'>
- <xsl:text>&INDENT2;void &INDENT2;</xsl:text>
- <xsl:value-of select='concat($name,"(const ",$name,"_sequence &v) ; ")'/>
- <xsl:value-of select='concat("&INDENT2;void ",$name,"(",$name,"_type &v); ") '/>
- <xsl:value-of select='concat("&INDENT2;void ",$name,"(",$name,"_sptr &v); ") '/>
- </xsl:when>
- <xsl:when test='$maxOccurs>1'>
- <xsl:text>&INDENT2;void &INDENT2;</xsl:text>
- <xsl:value-of select='concat($name,"(const ",$name,"_sequence &v) ; ")'/>
- <xsl:value-of select='concat("&INDENT2;void ",$name,"(",$name,"_type &v); ") '/>
- <xsl:value-of select='concat("&INDENT2;void ",$name,"(",$name,"_sptr &v); ") '/>
- </xsl:when>
- <xsl:when test='$maxOccurs=1'>
- <xsl:text>&INDENT2;void </xsl:text>
- <xsl:value-of select='concat($name,"(",$eltype,"_type &v) ; ")'/>
- <xsl:text>&INDENT2;void </xsl:text>
- <xsl:value-of select='concat($name,"(",$eltype,"_sptr &v) ; ")'/>
- <xsl:value-of select='concat("&INDENT2;void ",$name,"(",$eltype,"_type *v) ; ") '/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes"><xsl:value-of select='$name'/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- ** xsd:element with @name and @type
- **
- ** Generate setter for element with name and type.
- -->
- <xsl:template match='xsd:element[@name and @type]' mode='gen-tree-hdr-type-member-set'>
- <xsl:param name='maxOccurs'/>
- <xsl:param name='name'/>
- <xsl:param name='eltype'/>
- <xsl:param name='baseclass'></xsl:param>
- <xsl:text> &INDENT2;/* gen-tree-hdr-type-member-set xsd:element </xsl:text>
- <xsl:value-of select='concat("@name=",@name," @type=",@type," @equivClass=",@equivClass," maxOccurs=",$maxOccurs)'/>
- <xsl:text>*/ </xsl:text>
- <xsl:choose>
- <xsl:when test='$baseclass'>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@type' mode='restriction-base'/>
- </xsl:variable>
- <xsl:variable name='lcpp'><xsl:apply-templates select='@name' mode='normalize-name'/> </xsl:variable>
- <xsl:text>&INDENT2;void </xsl:text>
- <xsl:value-of select='concat($name,"(",$lcpp,"_sptr &v) ; ")'/>
- <xsl:value-of select='concat("&INDENT2;void ",$name,"(",$lcpp,"_type &v) ; ") '/>
- </xsl:when>
- <xsl:when test='$maxOccurs="unbounded"'>
- <xsl:text>&INDENT2;void &INDENT2;</xsl:text>
- <xsl:value-of select='concat($name,"(const ",$name,"_sequence &v) ; ")'/>
- <xsl:value-of select='concat("&INDENT2;void ",$name,"(",$name,"_type &v); ") '/>
- <xsl:value-of select='concat("&INDENT2;void ",$name,"(",$name,"_sptr &v); ") '/>
- </xsl:when>
- <xsl:when test='$maxOccurs>1'>
- <xsl:text>&INDENT2;void &INDENT2;</xsl:text>
- <xsl:value-of select='concat($name,"(const ",$name,"_sequence &v) ; ")'/>
- <xsl:value-of select='concat("&INDENT2;void ",$name,"(",$name,"_type &v); ") '/>
- <xsl:value-of select='concat("&INDENT2;void ",$name,"(",$name,"_sptr &v); ") '/>
- </xsl:when>
- <xsl:when test='$maxOccurs=1'>
- <xsl:text>&INDENT2;void </xsl:text>
- <xsl:value-of select='concat($name,"(",$eltype,"_type &v) ; ")'/>
- <xsl:text>&INDENT2;void </xsl:text>
- <xsl:value-of select='concat($name,"(",$eltype,"_sptr &v) ; ")'/>
- <xsl:value-of select='concat("&INDENT2;void ",$name,"(",$eltype,"_type *v) ; ") '/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes"><xsl:value-of select='$name'/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-</xsl:stylesheet>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY PV ";">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
- vim:ts=2:sw=2:et:encoding=utf-8
- xmlns:saxon="http://icl.com"
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:saxon="http://exslt.org/common"
- extension-element-prefixes="saxon"
- version="2.0" >
-
-
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR " ">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY PV ";">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
- :vim:ts=2:sw=2:et:encoding=utf-8
- xmlns:saxon="http://icl.com"
- xmlns:xalan="http://xml.apache.org/xalan"
- exclude-result-prefixes="xalan"
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:exslt="http://exslt.org/common"
- extension-element-prefixes="exslt"
- version="2.0" >
- <!--
- xmlns:saxon="http://exslt.org/common"
- This below is an old extension used by saxon 6 and xsl version 1.0
- xmlns:saxon="http://icl.com/saxon"
- -->
- <xsl:import href="xsd2cpp-tree-hdr-root.xsl"/>
- <xsl:import href="xsd2cpp-tree-hdr-inherit.xsl"/>
- <xsl:import href="xsd2cpp-tree-hdr-mbr-elem.xsl"/>
- <xsl:import href="xsd2cpp-tree-hdr-mbr-attr.xsl"/>
- <xsl:import href="xsd2cpp-tree-hdr-typedef.xsl"/>
- <xsl:import href="xsd2cpp-tree-hdr-type-mbr-set.xsl" />
- <xsl:import href="xsd2cpp-tree-hdr-type-mbr-get.xsl" />
- <xsl:import href="xsd2cpp-tree-hdr-setget.xsl"/>
- <xsl:import href="xsd2cpp-tree-hdr-choice-union.xsl"/>
-
- <xsl:template name='generateTreeSkel_header-one'>
- <xsl:param name='dir'>res</xsl:param>
- <xsl:variable name='filename-org'>
- <xsl:call-template name='basename'>
- <xsl:with-param name='path' select="document-uri(/)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:call-template name='basename'>
- <xsl:with-param name='path' select="/xsd:schema/@targetNamespace"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name='filename'
- select='concat($dir,"/",substring-before($filename-org,".xsd"),".h")'/>
- <!-- We need to create a file per complex type
- -->
- <xsl:message>* * Generate Tree Header * </xsl:message>
- <xsl:result-document href="{$filename}" format="text">
- <xsl:text>#ifndef </xsl:text><xsl:value-of select="concat('TREE_',translate($filename-org,'.-:/','____'),'_H')"/>
- <xsl:text> </xsl:text>
- <xsl:text>#define </xsl:text><xsl:value-of select="concat('TREE_',translate($filename-org,'.-:/','____'),'_H')"/>
- <xsl:text> #include <xmlSerialize.h> </xsl:text>
- <xsl:text> #include <vector> </xsl:text>
- <xsl:choose>
- <xsl:when test='$shared-ptr="boost"'>
- <xsl:text> #include <boost/shared_ptr.hpp> </xsl:text>
- </xsl:when>
- <xsl:when test='$shared-ptr="aeb"'>
- <xsl:text> #include <aeb/shared_ptr.h> </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>#include <memory> </xsl:text>
- <xsl:text>#include <tr1/memory> </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>/*TODO: Add missing includes */ </xsl:text>
- <xsl:apply-templates select='/xsd:schema/xsd:import' mode='include'/>
- <xsl:text> namespace </xsl:text>
- <!--
- xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="/xsd:schema/@targetNamespace"/>
- </xsl:call-template>
- -->
- <xsl:value-of select="$namespace"/>
- <xsl:text> { </xsl:text>
- <!-- Forward class declarations -->
- <xsl:apply-templates select="/xsd:schema" mode="tree-forward"/>
-
- <xsl:choose>
- <xsl:when test='$deps!=""'>
- <xsl:call-template name='generate-through-deps'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates
- select='xsd:attribute|xsd:attributeGroup' mode='tree-hdr-root'>
- </xsl:apply-templates>
- <xsl:apply-templates
- select='.|xsd:element|xsd:simpleType|xsd:complexType|xsd:group' mode='tree-hdr-root'>
- <xsl:with-param name='sp' select="''"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- <!-- We add a factory class in parser to allow the creation
- of other inheritant types. For instance The Checksum
- will implement a graphical node for a tree view.
- -->
- <xsl:if test='$generate-factory="yes"'>
- <xsl:text>class Factory { </xsl:text>
- <xsl:text>public: </xsl:text>
- <xsl:text>&INDENT;typedef xmlSerializer* (*ptCreate)(void); </xsl:text>
- <xsl:text>&INDENT; </xsl:text>
- <xsl:text>&INDENT;Factory(); </xsl:text>
- <xsl:text>&INDENT;~Factory(); </xsl:text>
- <xsl:text>&INDENT;static xmlSerializer *create(int typ); </xsl:text>
- <xsl:text>&INDENT;void register_(int type,ptCreate *); </xsl:text>
- <xsl:text>protected: </xsl:text>
- <xsl:text>&INDENT;static ptCreate m_creators[];</xsl:text>
-
- <xsl:text> }; </xsl:text>
- </xsl:if>
-
- <xsl:text>} </xsl:text>
- <xsl:text>#endif </xsl:text>
- </xsl:result-document>
- </xsl:template>
-
- <xsl:template name='generate-trough-deps'>
- <xsl:variable name='root' select="/xsd:schema"/>
- <xsl:variable name='classes' select="exslt:node-set(document($deps))/depends"/>
- <xsl:for-each select='$classes/class'>
- <xsl:sort select="count(./on)" data-type='text' order="ascending"></xsl:sort>
- <xsl:variable name='n' select='./@name'/>
- <xsl:variable name='el' select='key("elementByName",$n)/@name'/>
- <xsl:variable name='el1' select='$root/xsd:complexType[@name=$n]/@name'/>
- <xsl:apply-templates select='$root/xsd:complexType[@name=$n]' mode="deps"/>
- <xsl:message terminate='no'>THROUGH DEPS <xsl:value-of select='concat(./@type," ",./@name," f=",$n," el=",name($root))'/></xsl:message>
- </xsl:for-each>
- </xsl:template>
-
- <xsl:template name='generate-through-deps'>
- <xsl:variable name='root' select="/xsd:schema"/>
- <!--
- <xsl:variable name='classes' select="saxon:node-set(document($deps))/depends"/>
- <xsl:apply-templates select='$classes' mode='through-deps'>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
- -->
- <xsl:apply-templates select='document($deps)/*' mode='tree-hdr-root'>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match='class' mode='through-deps'>
- <xsl:param name='root'/>
- <xsl:message terminate='no'>CLASS <xsl:value-of select='concat(" ",@name)'/></xsl:message>
- <xsl:apply-templates select='class' mode='through-deps'>
- <xsl:with-param name='root' select='$root'/>
- </xsl:apply-templates>
- <xsl:choose>
- <xsl:when test='@type="element"'>
- <xsl:apply-templates select='$root/xsd:element[@name=current()/@name]' mode='tree-hdr-root'/>
- </xsl:when>
- <xsl:when test='@type="complexType"'>
- <xsl:apply-templates select='$root/xsd:complexType[@name=current()/@name]' mode='tree-hdr-root'/>
- </xsl:when>
- <xsl:when test='@type="simpleType"'>
- <xsl:apply-templates select='$root/xsd:simpleType[@name=current()/@name]' mode='tree-hdr-root'/>
- </xsl:when>
- <xsl:when test='@type="group"'>
- <xsl:apply-templates select='$root/xsd:group[@name=current()/@name]' mode='tree-hdr-root'/>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="xsd:complexType" mode='deps'>
- <xsl:variable name='cname' select="@name"/>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name'
- mode='normalize-name'/></xsl:variable>
- <!-- Ok, now start the definition of the class -->
- <xsl:message terminate='no'><xsl:value-of select='concat($cname," ",./@name," ")'/></xsl:message>
- <xsl:call-template name='class-tree-skel'>
- <xsl:with-param name='class' select="concat($nname,'_skel')"/>
- </xsl:call-template>
- <xsl:text> </xsl:text>
- </xsl:template>
-
- <!--
- ***
- *** tree-forward
- ***
- -->
- <xsl:template match="xsd:schema" mode="tree-forward">
- <xsl:apply-templates select="xsd:simpleType|xsd:complexType" mode="tree-forward"/>
- <xsl:apply-templates select="xsd:element|xsd:attribute|xsd:attributeGroup" mode="tree-forward"/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:annotation" mode="tree-forward">
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:simpleType|xsd:complexType" mode="tree-forward">
- <xsl:param name="name"/>
- <xsl:text>class </xsl:text> <xsl:value-of select="concat('',$name,'_skel;')"/>
- <xsl:text> </xsl:text>
- <xsl:text>std::ostream &operator <<(</xsl:text><xsl:value-of select="concat('std::ostream &,const ',$name,'_skel &obj);')"/>
- <xsl:text> </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:simpleType[@name]|xsd:complexType[@name]" mode="tree-forward">
- <xsl:variable name='name' ><xsl:apply-templates select='@name'
- mode='normalize-name'/>
- </xsl:variable>
- <xsl:text>class </xsl:text> <xsl:value-of select="concat('',$name,'_skel;')"/>
- <xsl:text> </xsl:text>
- <xsl:text>std::ostream &operator <<(</xsl:text><xsl:value-of select="concat('std::ostream &,const ',$name,'_skel &obj);')"/>
- <xsl:text> </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@name and @type]" mode="tree-forward">
- <xsl:variable name='name' ><xsl:apply-templates select='@name'
- mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name="cpp_type">
- <xsl:apply-templates select='@type' mode='restriction-base'/>
- </xsl:variable>
- <xsl:variable name="ns_type">
- <xsl:apply-templates select="@type" mode="namespace-uri-of-qname">
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:apply-templates select="." mode='gen-tree-hdr-type-member'>
- <xsl:with-param name='name' select='$name'/>
- <xsl:with-param name='indent' select='""'/>
- <xsl:with-param name='cpp_type' select='$cpp_type'/>
- </xsl:apply-templates>
- <xsl:text> struct </xsl:text> <xsl:value-of select="concat('',$name,$elem_suff,';')"/>
- <xsl:text> </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@name and not(@type)]" mode="tree-forward">
- <xsl:variable name='name' ><xsl:apply-templates select='@name'
- mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name="ns_type">
- <xsl:apply-templates select="@type" mode="namespace-uri-of-qname">
- </xsl:apply-templates>
- </xsl:variable>
-
- <xsl:if test="@abstract and @abstract='true'">
- </xsl:if>
- <xsl:text>class </xsl:text><xsl:value-of select='concat($name,"_skel; ")'/>
- <xsl:apply-templates select="." mode='gen-tree-hdr-type-member'>
- <xsl:with-param name='name' select='$name'/>
- <xsl:with-param name='indent' select='""'/>
- <xsl:with-param name='cpp_type' select='concat($name,"_skel")'/>
- </xsl:apply-templates>
-
- <xsl:apply-templates select="xsd:simpleType|xsd:complexType" mode="tree-forward">
- <xsl:with-param name='name' select='$name'/>
- <xsl:with-param name='cpp_type' select='concat($name,"_skel")'/>
- </xsl:apply-templates>
- <xsl:text>struct </xsl:text> <xsl:value-of select="concat('',$name,$elem_suff,';')"/>
- <xsl:text> </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@ref]" mode="tree-forward">
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@name and not(@type)]" mode="tree-forward">
- <xsl:variable name='name' ><xsl:apply-templates select='@name'
- mode='normalize-name'/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="./xsd:simpleType">
- <xsl:apply-templates select="xsd:simpleType" mode="tree-forward">
- <xsl:with-param name='name' select='$name'/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>typedef </xsl:text>
- <xsl:value-of select='concat("xmlSerializer ",$name,"_skel; ")'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>struct </xsl:text>
- <xsl:value-of select="concat('',$name,'_attr_type_;')"/>
- <xsl:text> </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@name and @type]" mode="tree-forward">
- <xsl:variable name='name' ><xsl:apply-templates select='@name' mode='normalize-name'/></xsl:variable>
- <xsl:text>struct </xsl:text>
- <xsl:value-of select="concat('',$name,'_attr_type_;')"/>
- <xsl:text> </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@ref]" mode="tree-forward">
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attributeGroup" mode="tree-forward">
- <xsl:apply-templates select="xsd:attribute|xsd:anyAttribute" mode="tree-forward"/>
- </xsl:template>
-
- <!-- The class generation -->
- <!-- The class generation -->
- <!-- The class generation -->
- <!-- The class generation -->
- <!-- The class generation -->
- <xsl:template name='class-tree-skel'>
- <xsl:param name='class'/>
- <xsl:variable name="po"><xsl:number level="any" from="/" format="1" grouping-size="3" count='xsd:simpleType|xsd:complexType'/></xsl:variable>
-
- <xsl:message terminate='no'>xsd2cpp-tree-header: Generate Class: <xsl:value-of select="concat(@name,' ',$class)"/></xsl:message>
- <xsl:if test='local-name(.)="element" or local-name(.)="attribute"'>
- <xsl:message terminate='yes'>ERROR: must not happen <xsl:value-of select="concat(@name,' ',$class)"/></xsl:message>
- </xsl:if>
- <xsl:text> /** </xsl:text>
- <xsl:value-of select='concat(" * Define ",name(.)," ",@name," ")'/>
- <xsl:value-of select='concat(" * Class ",$class," ")'/>
- <xsl:value-of select='concat(" * Position ",$po," ")'/>
- <xsl:text> */ class </xsl:text>
- <xsl:value-of select="$class"/><xsl:text> : public </xsl:text>
- <!-- inheritance -->
- <xsl:apply-templates select="." mode="tree-hdr-inherit"/>
- <xsl:text> { &INDENT;public: &INDENT2;</xsl:text>
- <!-- Default constructor ... -->
- <xsl:value-of select="$class"/><xsl:text>(); &INDENT2;</xsl:text>
- <xsl:value-of select="$class"/><xsl:text>(const </xsl:text>
- <xsl:value-of select='$class'/><xsl:text> &v) ; </xsl:text>
- <xsl:text>&INDENT2;~</xsl:text><xsl:value-of select="$class"/><xsl:text>(); </xsl:text>
- <!-- Need a copy constructor-->
- <xsl:value-of select='concat("&INDENT2;",$class," & operator =(const ",$class," &); ")'/>
- <xsl:text>&INDENT2;static const int </xsl:text><xsl:value-of select="concat($class,'_type = ',$po)"/><xsl:text>; </xsl:text>
- <xsl:text>&INDENT2;// </xsl:text>
- <xsl:text>&INDENT2;static xmlSerializer *</xsl:text><xsl:value-of select="concat('createInstance()','; ')"/>
- <!-- Serialize prototypes -->
- <xsl:text>&INDENT2;friend std::ostream &operator <<(std::ostream &os,const </xsl:text><xsl:value-of select="$class"/><xsl:text>&); </xsl:text>
- <xsl:text>&INDENT2;virtual void serialize_any(std::ostream &os)
- {os<<*this;}; </xsl:text>
- <xsl:text> </xsl:text>
- <xsl:text>&INDENT2;virtual void serialize_attributes(std::ostream &os); </xsl:text>
- <!-- Here, I need to place the variables
- Depending on complexType or simpleTYpe, I will not apply the same
- templates !!! needs to be corrected
- simpleType: restriction union,list
- complexType : simpleContent, complexContent, choice,
- sequence,group,all
- -->
- <xsl:choose>
- <xsl:when test='local-name(.)="simpleType"'>
- <xsl:apply-templates
- select="xsd:restriction|xsd:union|xsd:list" mode="parse-tree"/>
- <xsl:apply-templates
- select="xsd:restriction|xsd:union|xsd:list" mode="tree-hdr-setget">
- <xsl:with-param name='class' select='$class'/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='local-name(.)="complexType"'>
- <xsl:apply-templates
- select="xsd:simpleContent|xsd:complexContent" mode="parse-tree">
- <xsl:with-param name='class' select='$class'/>
- </xsl:apply-templates>
- <xsl:apply-templates
- select="xsd:simpleContent|xsd:complexContent" mode="tree-hdr-setget">
- <xsl:with-param name='class' select='$class'/>
- </xsl:apply-templates>
- <!--
- -->
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>Error: untreated elemet <xsl:value-of select="concat(@name,' ',$class)"/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates
- select="xsd:choice|xsd:element|xsd:all|xsd:group|xsd:sequence" mode="parse-tree"/>
- <xsl:text>&INDENT;public: </xsl:text>
- <!-- Set anf Get for attributes-->
- <xsl:if test='local-name(.)!="simpleType"'>
- <xsl:text>&INDENT2;/* Set and Get for attributes parse-tree-setget-attribute */ </xsl:text>
- <xsl:apply-templates
- select="." mode="parse-tree-setget-attribute">
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- <!--
- -->
- </xsl:if>
- <xsl:text>&INDENT;protected: </xsl:text>
- <!-- Protected member elements-->
- <xsl:text>&INDENT2;/* apply-templates parse-tree-member-element*/ </xsl:text>
- <xsl:apply-templates
- select="." mode="parse-tree-member-element"/>
- <!-- Protected attribute elements-->
- <xsl:text>&INDENT2;/* apply-templates parse-tree-member-attribute*/ </xsl:text>
- <xsl:apply-templates
- select="." mode="tree-hdr-mbr-attr"/>
- <xsl:text>}; </xsl:text>
- </xsl:template>
-
- <!-- Generate the small class to handle optional elements -->
- <xsl:template name="member-optional">
- <xsl:param name='type'></xsl:param>
- <!--
- <xsl:param name='type'><xsl:value-of select='concat($name,"_type")'/></xsl:param>
- -->
- <xsl:variable name='name'><xsl:apply-templates select='@name' mode='normalize-name'/> </xsl:variable>
- <xsl:text>&INDENT2;typedef struct </xsl:text>
- <xsl:value-of select='concat($name,"_optional_ ")'/>
- <xsl:text>{ </xsl:text>
- <xsl:value-of select='concat("&INDENT3;","public: ")'/>
- <!-- constructor -->
- <xsl:value-of select='concat("&INDENT4;",$name,"_optional_() :m_present(false) {}; ")'/>
- <xsl:value-of select='concat("&INDENT4;",$name,"_optional_(",$type," t) :m_present(false),m_(t) {}; ")'/>
- <xsl:value-of select='concat("&INDENT4;",$name,"_optional_(const ",$name,"_optional_ &t) :m_present(t.m_present),m_(t.m_) {}; ")'/>
- <xsl:value-of select='concat("&INDENT4;","bool present() const { return m_present;}; ")'/>
- <!-- serializer -->
- <xsl:text>&INDENT4;friend std::ostream &operator <<(std::ostream &os,const </xsl:text>
- <xsl:value-of select='concat($name,"_optional_ &v) { if (v.m_present) os<<v.m_; return os;}; ")'/>
- <!-- cast conversions -->
- <xsl:value-of select='concat("&INDENT4;//const ",$name,"_optional_ & () const ")'/>
- <xsl:value-of select='concat("&INDENT4;//{return *this;}; ","")'/>
- <!-- Seters -->
- <xsl:value-of select='concat("&INDENT4;",$name,"_optional_ &operator =(const ",$type," &v) ")'/>
- <xsl:value-of select='concat("&INDENT4;{m_present=true; m_=v; return *this;}; ","")'/>
- <xsl:value-of select='concat("&INDENT4;",$name,"_optional_ &operator =(const ",$name,"_optional_ &v) ")'/>
- <xsl:value-of select='concat("&INDENT4;{m_present=v.m_present; m_=v.m_; return *this;}; ","")'/>
- <!-- content() ....-->
- <xsl:value-of select='concat("&INDENT4;const ",$type," & content() const ")'/>
- <xsl:value-of select='concat("&INDENT4;{return m_;}; ","")'/>
- <!-- -->
- <xsl:value-of select='concat("&INDENT3;","protected: ")'/>
- <xsl:value-of select='concat("&INDENT4;",$type," m_; ")'/>
- <xsl:value-of select='concat("&INDENT4;","bool&TAB;m_present; ")'/>
- <xsl:text>&INDENT2;} </xsl:text>
- <xsl:value-of select='concat($name,"_optional; ")'/>
- </xsl:template>
-
-
- <!--
- ***
- *** parse-tree
- ***
- -->
-
- <!-- parse-tree attributes of the element Parent is complexType....-->
- <xsl:template match='xsd:simpleType' mode="parse-tree">
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parse-tree </xsl:text>
- <xsl:value-of select='concat(name(.)," */ ")'/>
- </xsl:if>
- <xsl:if test="(@name and not(../xsd:schema)) or (not(@name) and ../xsd:schema)">
- <xsl:message terminate="yes">Simple type not under xsd:schema can't have name <xsl:value-of select="@name"/></xsl:message>
- </xsl:if>
- <!-- SimpleType content is restriction list and union. optional is annotation -->
- <xsl:apply-templates select="xsd:restriction|xsd:list|xsd:union"
- mode='parse-tree-simple-content'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexType' mode="parse-tree">
- <xsl:message terminate='no'>ERROR: TO BE DONE <xsl:value-of select="../@name"/></xsl:message>
- <xsl:apply-templates select="xsd:sequence|xsd:choice|xsd:group|xsd:all"
- mode='parse-tree'/>
- <xsl:apply-templates select="xsd:complexContent"
- mode='parse-tree'/>
- <xsl:apply-templates select="xsd:simpleContent"
- mode='parse-tree'/>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup|xsd:anyAttribute"
- mode='parse-tree'/>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:simpleContent' mode="parse-tree">
- <xsl:param name='class'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parse-tree </xsl:text>
- <xsl:value-of select='concat(name(.)," */ ")'/>
- </xsl:if>
- <xsl:apply-templates select="xsd:restriction|xsd:extension"
- mode='parse-tree-simple-content'>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:complexContent' mode="parse-tree">
- <xsl:param name='class'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parse-tree </xsl:text>
- <xsl:value-of select='concat(name(.)," */ ")'/>
- </xsl:if>
- <xsl:apply-templates select="xsd:restriction|xsd:extension"
- mode='parse-tree-complex-content'>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!--
- ***
- *** parse-tree-simple-content
- ***
- -->
- <xsl:template match='xsd:restriction' mode="parse-tree-simple-content">
- <xsl:param name='class'/>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@base' mode='restriction-base'/>
- </xsl:variable>
- <xsl:variable name='name'>
- <xsl:choose>
- <xsl:when test="../../@name">
- <xsl:apply-templates select='../../@name' mode='normalize-name'/>
- </xsl:when>
- <xsl:when test="../../../@name">
- <xsl:apply-templates select='../../../@name' mode='normalize-name'/>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:text>&INDENT2;// parse-tree-simple-content </xsl:text><xsl:value-of
- select='concat(name(.)," class=",$class,"../../@name=",../../@name)'/>
- <xsl:text> &INDENT;</xsl:text>
- <!--
- <xsl:value-of
- select="concat('&INDENT;',$name,'_skel & ')"/><xsl:text> operator =(const </xsl:text>
- <xsl:value-of
- select='concat(" ",$cpp_type,"&v) {m_content=v;return *this;}; ")'/>
- <xsl:value-of
- select="concat('&INDENT2;',$name,'_skel(const ',$cpp_type,' &v)')"/>
- <xsl:text>: m_content(v) {};</xsl:text>
- -->
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:extension' mode="parse-tree-simple-content">
- <xsl:param name='class'/>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@base' mode='restriction-base'/>
- </xsl:variable>
- <xsl:variable name='name'>
- <xsl:choose>
- <xsl:when test="../../@name">
- <xsl:apply-templates select='../../@name' mode='normalize-name'/>
- </xsl:when>
- <xsl:when test="../../../@name">
- <xsl:apply-templates select='../../../@name' mode='normalize-name'/>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>/* parse-tree-simple content xsd:extension */ </xsl:text>
-
- <xsl:value-of
- select="concat('&INDENT2;',$name,'_skel & ')"/><xsl:text> operator =(const </xsl:text>
- <xsl:value-of
- select='concat(" ",$cpp_type,"&v) {m_content=v;return *this;}; ")'/>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:union' mode="parse-tree-simple-content">
- <xsl:choose>
- <xsl:when test="local-name(..)='simpleType'">
- <xsl:text>&INDENT2;/* parse-tree-simple-cotent union on simpleType to be CODED*/ </xsl:text>
- <xsl:message terminate="no">WARNING xsd2cpp-tree-header: xsd:union in simpleContent TO BE CODED</xsl:message>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">ERROR: xsd:union in simpleContent Impossible</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- ***
- *** parse-tree-complex-content
- *** Restriction extension on complexContent
- -->
- <xsl:template match='xsd:restriction' mode="parse-tree-complex-content">
- <xsl:param name='class'/>
- <xsl:variable name="ns_type">
- <xsl:choose>
- <xsl:when test="substring-after(@base,':')">
- <xsl:call-template name="namespace-uri-of-qname">
- <xsl:with-param name='qname' select="@base"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/xsd:schema/@targetNamespace"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='name'>
- <xsl:apply-templates select='../../@name' mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@base' mode='restriction-base'/>
- </xsl:variable>
- <xsl:text>&INDENT;// process restriction on ComplexContent </xsl:text><xsl:value-of
- select='../../@name'/>
- <xsl:text> </xsl:text><xsl:value-of
- select='concat($cpp_type," m_content; public: ")'/>
- <xsl:text>&INDENT;</xsl:text><xsl:value-of
- select="concat('&INDENT;',$name,'_skel & ')"/><xsl:text> operator =(const </xsl:text>
- <xsl:value-of
- select='concat(" ",$cpp_type,"&v) {m_content=v;return *this;}; ")'/>
- <xsl:apply-templates select="xsd:sequence|xsd:choice" mode='parse-tree'/>
- <!--
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode='parse-tree'/>
- -->
- </xsl:template>
-
- <xsl:template match='xsd:extension' mode="parse-tree-complex-content">
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parse-tree-complex-content </xsl:text>
- <xsl:value-of select='concat(name(.)," @base=",@base,"*/ ")'/>
- </xsl:if>
- <xsl:choose>
- <xsl:when test='local-name(..)="complexContent"'>
- <xsl:apply-templates select="xsd:sequence|xsd:choice|xsd:group|xsd:all" mode='parse-tree'/>
- <!--TODO ALREADY taken into accout by setget-->
- <xsl:message terminate='no'>TODO parse-tree-complex-content
- xsd:extension issue with attributes. Redundant with setget <xsl:value-of select="@base"/></xsl:message>
- <!--
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup|xsd:anyAttribute" mode='parse-tree'/>
- -->
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup|xsd:anyAttribute" mode='parse-tree'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- ***
- *** parse-tree
- *** mode
- -->
- <xsl:template match='xsd:restriction' mode="parse-tree">
- <xsl:param name='class'/>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@base' mode='restriction-base'/>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;// parse-tree xsd:restriction </xsl:text>
- <xsl:value-of select='concat("base=",@base," ns=",namespace::*[name()=""])'/>
- <xsl:text> </xsl:text>
- </xsl:if>
- <xsl:choose>
- <xsl:when test='local-name(..) = "simpleType"'>
- <xsl:variable name='lname'>
- <xsl:choose>
- <xsl:when test="../@name">
- <xsl:apply-templates select='../@name' mode='normalize-name'/>
- </xsl:when>
- <xsl:when test="../../@name">
- <xsl:apply-templates select='../../@name' mode='normalize-name'/>
- </xsl:when>
- <xsl:when test="../../../@name">
- <xsl:apply-templates select='../../../@name' mode='normalize-name'/>
- </xsl:when>
- <xsl:when test="../../../../@name">
- <xsl:apply-templates select='../../../../@name' mode='normalize-name'/>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text></xsl:text>
- <!--
- -->
- </xsl:when>
- <xsl:when test='local-name(..) = "simpleContent"'>
- <xsl:message terminate='yes'>xsd:restricion on simple type error</xsl:message>
- </xsl:when>
- <xsl:when test='local-name(..) = "complexContent"'>
- <xsl:message terminate='no'>xsd:restricion on complex Content @base=<xsl:value-of select="@base"/></xsl:message>
- <xsl:apply-templates select="xsd:choice|xsd:sequence|xsd:all|xsd:group" mode='parse-tree'/>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup|xsd:anyAttribute" mode='parse-tree'>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- <!--
- -->
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>xsd:restricion Untreated for now <xsl:value-of select="local-name(..)"/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:extension' mode="parse-tree">
- <xsl:message terminate='yes'>No yet coded</xsl:message>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:list[not(@itemType)]' mode="parse-tree">
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parse-tree </xsl:text>
- <xsl:value-of select='concat(name(.)," */ ")'/>
- </xsl:if>
- <xsl:variable name='name'>
- <xsl:apply-templates select='../@name' mode='normalize-name'/>
- </xsl:variable>
- <xsl:message terminate='no'>WARNING xsd:list no itemType No yet coded ../@name=<xsl:value-of select='../@name'/></xsl:message>
- <xsl:text>&INDENT2;/* parse-tree </xsl:text>
- <xsl:value-of select='concat(name(.)," @itemType=empty")'/>
- <xsl:text> process list no @itemType */ </xsl:text>
- <xsl:apply-templates select="xsd:simpleType" mode='parse-tree'/>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:list[@itemType]' mode="parse-tree">
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parse-tree </xsl:text>
- <xsl:value-of select='concat(name(.)," */ ")'/>
- </xsl:if>
- <xsl:variable name='name'>
- <xsl:apply-templates select='../@name' mode='normalize-name'/>
- </xsl:variable>
- <xsl:message terminate='no'>WARNING xsd:list @itemType= <xsl:value-of select='@itemType'/> Not yet coded ../@name=<xsl:value-of select='../@name'/></xsl:message>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@itemType' mode='restriction-base'/>
- </xsl:variable>
- <xsl:text>&INDENT2;/* parse-tree </xsl:text>
- <xsl:value-of select='concat(name(.)," @itemType=",@itemType)'/>
- <xsl:text> should process list */ </xsl:text>
- <!--
- <xsl:value-of select='concat($name,"_skel & operator =(const ",$cpp_type,"&v) {m_content =v; return *this;}; ")'/>
- -->
- <xsl:text>&INDENT2;typedef std::vector<</xsl:text>
- <xsl:value-of select='concat($cpp_type,"> ",$name,"_sequence; ")'/>
- <xsl:text>&INDENT2;typedef std::vector<</xsl:text>
- <xsl:value-of select='concat($cpp_type,">::iterator iterator; ")'/>
- <xsl:text>&INDENT2;typedef std::vector<</xsl:text>
- <xsl:value-of select='concat($cpp_type,">::const_iterator const_iterator; ")'/>
- <xsl:text>&INDENT2;iterator begin() { return m_tokens.begin(); } </xsl:text>
- <xsl:text>&INDENT2;const_iterator begin() const { return m_tokens.begin(); } </xsl:text>
- <xsl:text>&INDENT2;iterator end() { return m_tokens.end(); } </xsl:text>
- <xsl:text>&INDENT2;const_iterator end() const { return m_tokens.end(); } </xsl:text>
- <xsl:text>&INDENT2;size_t size() const { return m_tokens.size(); } </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:union' mode="parse-tree">
- <xsl:variable name='types'>
- <xsl:element name='schema' namespace="&XSD;">
- <xsl:copy-of select="namespace::*"/>
- <xsl:attribute name='targetNamespace'><xsl:value-of select="/xsd:schema/@targetNamespace"/></xsl:attribute>
- <xsl:if test="@memberTypes">
- <xsl:call-template
- name='space-string-list'>
- <xsl:with-param name='string' select='@memberTypes'/>
- </xsl:call-template>
- </xsl:if>
- <!-- ADD simple types -->
- <xsl:if test='./xsd:simpleType'><xsl:apply-templates select='./xsd:simpleType' mode='space-string-list'/></xsl:if>
- </xsl:element>
- </xsl:variable>
- <xsl:variable name='sibling'>
- <xsl:choose>
- <xsl:when test='preceding-sibling::xsd:union'>
- <xsl:value-of select='count(preceding-sibling::xsd:union)'/>
- </xsl:when>
- <xsl:otherwise><xsl:text></xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:message terminate='no'>WARNING xsd:union No yet coded</xsl:message>
- <xsl:text>&INDENT2;//xsd2cpp-tree-header parse-tree xsd:union </xsl:text>
- <xsl:value-of select='concat(@memberTypes," $types=",$types)'/><xsl:text> </xsl:text>
- <xsl:message terminate='no'>xsd2xpp-tree-header begin xsd:union with @memberTypes <xsl:value-of select="concat(@memberTypes,' $types=',$types)"/></xsl:message>
- <!-- enumeration of possible field choice -->
- <xsl:text>&INDENT2;enum { </xsl:text>
- <xsl:apply-templates select='$types' mode='union-enum-attributes'/>
- <xsl:text>&INDENT2; </xsl:text>
- <xsl:text>&INDENT2; } </xsl:text>
- <xsl:value-of select='concat($cls-tree-union-selector," ; ")'/>
- <!-- union structure -->
- <xsl:value-of select='concat("&INDENT2;struct _u",$sibling," { ")'/>
- <xsl:apply-templates select='$types' mode='union-attributes'/>
- <!-- <xsl:text>&INDENT2;//_u() {}; </xsl:text> -->
- <xsl:text>&INDENT2;}; </xsl:text>
- <xsl:choose>
- <xsl:when test="@memberTypes">
- <xsl:message terminate='no'>xsd2xpp-tree-header end xsd:union with @memberTypes <xsl:value-of select="@memberTypes"/></xsl:message>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>&INDENT2;//xsd2cpp-tree-header parse-tree </xsl:text>
- <xsl:value-of select='concat(name(.)," $types=",$types)'/><xsl:text> </xsl:text>
- <xsl:text></xsl:text>
- <xsl:apply-templates select="xsd:simpleType[position()=1]" mode='parse-tree'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:value-of select='concat(" &INDENT2;const _u",$sibling," &"," content() const {return ")'/>
- <xsl:value-of select='concat("","m_content;}; ")'/>
- </xsl:template>
- <!-- union-attributes -->
- <xsl:template match='xsd:schema' mode='union-attributes'>
- <xsl:apply-templates mode='union-attributes'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:field' mode='union-attributes'>
- <xsl:message terminate='no'>xsd2xpp-tree-header xsd:field with union-attributes @type=<xsl:value-of select="@type"/></xsl:message>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@type' mode='restriction-base'/>
- </xsl:variable>
- <xsl:if test='not(@type = preceding-sibling::xsd:field/@type)'>
- <xsl:variable name='name'>
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
- <xsl:text>&INDENT3;</xsl:text><xsl:value-of select='concat($cpp_type," m_",$name,";//@type=",@type," ")'/>
- </xsl:if>
- </xsl:template>
- <!-- union-enum-attributes -->
- <xsl:template match='xsd:schema' mode='union-enum-attributes'>
- <xsl:apply-templates mode='union-enum-attributes'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:field' mode='union-enum-attributes'>
- <xsl:message terminate='no'>xsd2xpp-tree-header xsd:field with union-attributes @type=<xsl:value-of select="@type"/></xsl:message>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@type' mode='restriction-base'/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='not(@type = preceding-sibling::xsd:field/@type)'>
- <xsl:variable name='name'>
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
- <xsl:text>&INDENT3;</xsl:text><xsl:value-of select='concat(" CHOICE_",$name,"")'/>
- </xsl:when>
- <xsl:when test='@type = preceding-sibling::xsd:field/@type'>
- <xsl:variable name='type' select='@type'></xsl:variable>
- <xsl:text>&INDENT3;</xsl:text><xsl:value-of select='concat(" CHOICE_",text(),count(preceding-sibling::xsd:field[@type=$type]))'/>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test='position()!=last()'>
- <xsl:text>, </xsl:text>
- </xsl:if>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:attribute[@name and not(@type)]" mode="parse-tree">
- <xsl:text>&INDENT;/* attribute :</xsl:text>
- <xsl:value-of select="@name"/>
- <xsl:text> ERROR to be implemented */ </xsl:text>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:attribute[@name and @type]" mode="parse-tree">
- <xsl:param name='class'/>
- <xsl:variable name='btype' select="concat('xsd::',substring-after(@type,':'))"/>
- <xsl:variable name='name'><xsl:apply-templates select='@name' mode='normalize-name'/> </xsl:variable>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@type' mode='restriction-base'/>
- </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@type"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='vns'>
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="/xsd:schema/@targetNamespace"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:text>&INDENT;// parse-tree </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name," ",$ns," &INDENT;// ")'/>
- <xsl:choose>
- <xsl:when test='($ns="&XSD;") or ($ns=/xsd:schema/@targetNamespace) or (substring-before(@type,":")="")'>
- <xsl:apply-templates select='.' mode='gen-tree-hdr-element'>
- <xsl:with-param name='name' select='$name'/>
- <xsl:with-param name='class' select='$class'/>
- <xsl:with-param name='sp'><xsl:text>&INDENT2;</xsl:text></xsl:with-param>
- </xsl:apply-templates>
- <xsl:text> </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>ERROR attribute type definition missing</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test='@use="optional"'>
- <xsl:call-template name='member-optional'>
- <xsl:with-param name='type' select='concat($name,"_attr_type_")'/>
- </xsl:call-template>
- </xsl:if>
- <xsl:text>&INDENT2;</xsl:text><xsl:value-of select='concat("//",$cpp_type,"
- me_attr_",@name,"; ")'/>
- <!-- Ok, add datatype definitions -->
- <!-- Get function -->
- <xsl:text>&INDENT2;</xsl:text>
- <xsl:value-of
- select='concat($cpp_type," &INDENT2;attr_",$name,"(void) { return me_attr_",$name)'/>
- <xsl:choose>
- <xsl:when test='@use="optional"'>
- <xsl:value-of select='concat("",".content();}; ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("",";}; ")'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>&INDENT2;//</xsl:text>
- <xsl:value-of
- select='concat($name,"_optional & &INDENT2;//",$name,"(void) { return me_attr_",$name,";}; ")'/>
- <!-- Setter's-->
- <xsl:value-of
- select='concat("&INDENT2;void &INDENT2;attr_",$name,"(",$cpp_type," &v) { me_attr_",$name,"=v;}; ")'/>
- <xsl:if test='@use="optional"'>
- <xsl:value-of
- select='concat("&INDENT2;void &INDENT2;attr_",$name,"(",$name,"_optional &v) { me_attr_",$name,"=v;}; ")'/>
- </xsl:if>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:annotation" mode="parse-tree">
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@ref!='' and not(@type)]" mode="parse-tree">
- <xsl:param name='maxOccurs'>1</xsl:param>
- <xsl:variable name='name'>
- <xsl:choose>
- <xsl:when test='substring-after(@ref,":")!=""'>
- <xsl:value-of select='substring-after(@ref,":")'/>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="@ref"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='lref' select='key("attribute",$name)'/>
- <xsl:variable name='nname' ><xsl:apply-templates select='@ref' mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@ref"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='$lref/@type' mode='restriction-base'/>
- </xsl:variable>
- <xsl:text>&INDENT2;/*parse-tree </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref," */ ")'/>
-
- <xsl:choose>
- <xsl:when test='$lref'>
- <xsl:apply-templates select="." mode="gen-tree-hdr-type-member-set">
- <xsl:with-param name='name' select='$name'/>
- <xsl:with-param name='eltype' select='$name'/>
- <xsl:with-param name='indent' select="'&INDENT2;'"/>
- <xsl:with-param name='cpp_type'><xsl:value-of select='concat(substring-before($cpp_type,""),"")'/></xsl:with-param>
- <xsl:with-param name='maxOccurs'>
- <xsl:choose>
- <xsl:when test='@maxOccurs'><xsl:value-of select="@maxOccurs"/></xsl:when>
- <xsl:otherwise><xsl:value-of select='$maxOccurs'/></xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace'>
- <xsl:text>&INDENT;/*parse-tree xsd:attribute is this required ? */ </xsl:text>
- <xsl:apply-templates select="$lref" mode='parse-tree'>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>&INDENT;/*parse-tree TODO: nothing */ </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:attributeGroup" mode="parse-tree">
- <xsl:param name='class'/>
- <xsl:text>/* attributeGroupe </xsl:text><xsl:value-of select='concat(@ref,"",$class)'/><xsl:text>*/ </xsl:text>
- <xsl:choose>
- <xsl:when test='@ref'>
- <xsl:apply-templates mode="parse-tree" select="key('attrGroup',substring-after(@ref,':'))/*">
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>Parent should only by xsl:schema</xsl:message>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode="parse-tree">
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:group[@name]" mode="parse-tree">
- <xsl:message terminate="no">xsd2cpp-tree-header Process Group:<xsl:value-of select='@name'/></xsl:message>
- <xsl:text>&INDENT2;/* parse-tree </xsl:text><xsl:value-of select="concat(name(.),' @name=',@name,' ')"/><xsl:text>*/ </xsl:text>
- <xsl:apply-templates select="xsl:all|xsd:choice|xsd:sequence" mode='parse-tree'/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:group[@ref]" mode="parse-tree">
- <xsl:variable name='ns'>
- <xsl:apply-templates select='@ref' mode='namespace-uri-of-qname'/>
- </xsl:variable>
- <xsl:message terminate="no">xsd2cpp-tree-header Process Group Ref :<xsl:value-of select='@ref'/></xsl:message>
- <xsl:text>&INDENT2;/* parse-tree </xsl:text><xsl:value-of select="concat(name(.),' @ref=',@ref,' ns=',$ns)"/><xsl:text>*/ </xsl:text>
- <xsl:choose>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace'>
- <xsl:apply-templates select="key('group',substring-after(@ref,':'))" mode='parse-tree'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>ERROR: not yet treated</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- The elements must be orderer -->
- <xsl:template match="xsd:sequence" mode="parse-tree">
- <xsl:text>&INDENT2;/* mode=parse-tree sequence </xsl:text>
- <xsl:value-of select="concat('minOccurs=',@minOccurs,
- ' maxOccurs=',@maxOccurs)"/><xsl:text>*/ </xsl:text>
- <xsl:apply-templates
- select="xsd:element|xsd:group|xsd:choice|xsd:sequence|xsd:any" mode="parse-tree">
- <xsl:with-param name='maxOccurs'>
- <xsl:choose>
- <xsl:when test='@maxOccurs'><xsl:value-of select="@maxOccurs"/></xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:choice" mode="parse-tree">
- <xsl:variable name='sib'>
- <xsl:choose>
- <xsl:when test='../*[local-name()="choice"]'>
- <xsl:value-of select='concat(count(preceding-sibling::*[node() != current()]),"")'/>
- </xsl:when>
- <xsl:when test='./xsd:choice[node() != self]'>
- <xsl:value-of select='concat("_p_",position())'/>
- </xsl:when>
- <xsl:when test='./following-sibling::xsd:choice'>
- <xsl:value-of select='concat("_f_",count(following-sibling::xsd:choice[position()=1]))'/>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* xsd2cpp-tree-header parser-tree </xsl:text>
- <xsl:value-of select='concat(name(.)," @minOccurs=",@minOccurs," @maxOccurs=",@maxOccurs," sib=",$sib," p=",position())'/><xsl:text>*/ </xsl:text>
- </xsl:if>
- <xsl:apply-templates select="." mode='tree-hdr-choice-union'>
- <xsl:with-param name='maxOccurs'>
- <xsl:choose>
- <xsl:when test="@maxOccurs"><xsl:value-of select="@maxOccurs"/></xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- <!-- -->
- <xsl:text>&INDENT2;enum { </xsl:text>
- <xsl:apply-templates select="xsd:element|xsd:any|xsd:sequence|xsd:group|xsd:choice" mode='parse-tree-enum-choice'>
- </xsl:apply-templates>
- <xsl:value-of select='concat(" &INDENT2;} m_kind",$sib,"; ")'/>
- <!--
- <xsl:text>&INDENT2;} m_kind; </xsl:text>
- -->
- <xsl:apply-templates select="xsd:element|xsd:any|xsd:sequence|xsd:group|xsd:choice" mode='parse-tree'>
- <xsl:with-param name='maxOccurs'>
- <xsl:choose>
- <xsl:when test="@maxOccurs"><xsl:value-of select="@maxOccurs"/></xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
-
- <!--
- ***
- *** parse-tree-enum-choice
- ***
- -->
- <xsl:template match="xsd:element[@name]" mode="parse-tree-enum-choice">
- <xsl:variable name='nname' ><xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
- <xsl:value-of select='concat("&INDENT3;CHOICE_",$nname)'/>
- <xsl:if test='position()!=last()'><xsl:text>, </xsl:text></xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@ref]" mode="parse-tree-enum-choice">
- <xsl:variable name='nname' ><xsl:apply-templates select='@ref' mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='name'>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'><xsl:value-of select='substring-after(@ref,":")'/></xsl:when>
- <xsl:otherwise><xsl:value-of select="@ref"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='count(../xsd:element[substring-after(@ref,":") = $name]) > 1'>
- <xsl:value-of select='concat("&INDENT3;CHOICE_",substring-before(@ref,":"),"_",$nname,"")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("&INDENT3;CHOICE_",$nname)'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test='position()!=last()'><xsl:text>, </xsl:text></xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:group[@ref]" mode="parse-tree-enum-choice">
- <xsl:variable name="ref">
- <xsl:apply-templates select='@ref' mode='normalize-name'/>
- </xsl:variable>
- <xsl:value-of select='concat("&INDENT3;CHOICE_",local-name(.),"_",$ref)'/>
- <xsl:if test='preceding-sibling::xsd:sequence'>
- <xsl:value-of select='count(preceding-sibling::xsd:sequence)'/>
- </xsl:if>
- <xsl:if test='position()!=last()'><xsl:text>, </xsl:text></xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:choice" mode="parse-tree-enum-choice">
- <xsl:value-of select='concat("&INDENT3;CHOICE_",local-name(.))'/>
- <xsl:if test='preceding-sibling::xsd:sequence'>
- <xsl:value-of select='count(preceding-sibling::xsd:sequence)'/>
- </xsl:if>
- <xsl:if test='position()!=last()'><xsl:text>, </xsl:text></xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:sequence" mode="parse-tree-enum-choice">
- <xsl:value-of select='concat("&INDENT3;CHOICE_",local-name(.))'/>
- <xsl:if test='preceding-sibling::xsd:sequence'>
- <xsl:value-of select='count(preceding-sibling::xsd:sequence)'/>
- </xsl:if>
- <xsl:if test='position()!=last()'><xsl:text>, </xsl:text></xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:any" mode="parse-tree-enum-choice">
- <xsl:value-of select='concat("&INDENT3;CHOICE_",ANY)'/>
- <xsl:if test='position()!=last()'><xsl:text>, </xsl:text></xsl:if>
- </xsl:template>
- <!--
- TODO: what if type is not given in element ?
- -->
- <xsl:template match="xsd:element[@ref!='']" mode="parse-tree">
- <xsl:param name='class'/>
- <xsl:param name='maxOccurs'>1</xsl:param>
- <xsl:variable name='lname' ><xsl:apply-templates select='@ref' mode='local-name'/></xsl:variable>
- <xsl:variable name='nname' ><xsl:apply-templates select='@ref' mode='normalize-name'/></xsl:variable>
- <xsl:variable name="ns_type">
- <xsl:apply-templates select="@ref" mode='namespace-uri-of-qname'/>
- </xsl:variable>
- <xsl:variable name='cpp_ns'>
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="$ns_type"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='name'>
- <xsl:choose>
- <xsl:when test="contains(@ref,':') and
- count(./following-sibling::xsd:element[substring-after(@ref,':')=$lname])>0">
- <xsl:value-of select="concat($cpp_ns,'_',$nname)"/>
- </xsl:when>
- <xsl:when test="contains(@ref,':')"><xsl:value-of select="$nname"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="@ref"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='el_type'>
- <xsl:choose>
- <xsl:when test="$ns_type=/xsd:schema/@targetNamespace">
- <!-- Ha, what if element has a private type ?-->
- <xsl:variable name='el' select='/xsd:schema/xsd:element[@name=$name]'/>
- <xsl:variable name="dede">
- <xsl:apply-templates select='/xsd:schema/xsd:element[@name=$name]/@type'
- mode='restriction-base'/>
- </xsl:variable>
- <xsl:if test='$name="LookAt"'>
- <xsl:message terminate="no"><xsl:value-of select='concat("- dede=",$dede," key=",/xsd:schema/xsd:element[@name=$name]/@type )'/></xsl:message>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="$el and $el/@type">
- <xsl:value-of select="$dede"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat($nname,"_skel")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test='$name'>
- <xsl:variable name="tp">
- <xsl:apply-templates select="@ref" mode="restriction-base"/>
- </xsl:variable>
- <xsl:value-of select="$tp"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>DO not yet know how to treat <xsl:value-of select='@ref'/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test='$el_type=""'>
- <xsl:message terminate="yes">VERIFY ref element:<xsl:value-of select='concat(name(.)," ",@ref," el=",$el_type," ns=",$ns_type," nname=",$nname )'/></xsl:message>
- </xsl:if>
- <xsl:text>&INDENT2;// xsd2cpp-tree-header mode=parse-tree </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref," name=",$name," el_type=",$el_type," ns_type=",$ns_type)'/>
- <xsl:text> </xsl:text>
- <!-- Add typedefs -->
- <!--
- -->
- <xsl:if test="$ns_type!=/xsd:schema/@targetNamespace">
- <xsl:apply-templates select='.' mode='gen-tree-hdr-type-member'>
- <xsl:with-param name='name' select="$name"/>
- <xsl:with-param name='cpp_type' select="$el_type"/>
- <xsl:with-param name='indent' select="'&INDENT2;'"/>
- </xsl:apply-templates>
- </xsl:if>
- <!-- Set functions -->
- <xsl:apply-templates select="." mode="gen-tree-hdr-type-member-set">
- <xsl:with-param name='name' select='$nname'/>
- <xsl:with-param name='eltype' select='$nname'/>
- <xsl:with-param name='cpp_type'><xsl:value-of select='concat(substring-before($el_type,"_skel"),"_type")'/></xsl:with-param>
- <xsl:with-param name='maxOccurs'>
- <xsl:choose>
- <xsl:when test='@maxOccurs'><xsl:value-of select="@maxOccurs"/></xsl:when>
- <xsl:otherwise><xsl:value-of select='$maxOccurs'/></xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- <!-- Check if element is local and abstract -->
- <xsl:if test='/xsd:schema/xsd:element[@name=$name and @abstract="true"]'>
- <xsl:apply-templates select="/xsd:schema/xsd:element[@name=$name]" mode="gen-tree-hdr-type-member-set">
- <xsl:with-param name='name' select='$name'/>
- <xsl:with-param name='eltype' select='$nname'/>
- <xsl:with-param name='cpp_type'><xsl:value-of select='concat(substring-before($el_type,"_skel"),"_type")'/></xsl:with-param>
- <xsl:with-param name='maxOccurs'>
- <xsl:choose>
- <xsl:when test='@maxOccurs'><xsl:value-of select="@maxOccurs"/></xsl:when>
- <xsl:otherwise><xsl:value-of select='$maxOccurs'/></xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:if>
- <!-- Get Function -->
- <xsl:text>&INDENT2;</xsl:text>
- <xsl:apply-templates select="." mode="gen-tree-hdr-type-member-get">
- <xsl:with-param name='nname' select='$nname'/>
- <xsl:with-param name='cpp_type'><xsl:value-of select='concat($nname,"_type")'/></xsl:with-param>
- <xsl:with-param name='maxOccurs'>
- <xsl:choose>
- <xsl:when test='@maxOccurs'><xsl:value-of select="@maxOccurs"/></xsl:when>
- <xsl:otherwise><xsl:value-of select='$maxOccurs'/></xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:element[@name and not(@type)]" mode="parse-tree">
- <xsl:param name='class'/>
- <xsl:param name='maxOccurs'>1</xsl:param>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name'
- mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='tp'>
- <xsl:apply-templates select='xsd:simpleType|xsd:complexType'
- mode='parse-tree-type'/>
- </xsl:variable>
- <xsl:message terminate='no'>VERIFY element: <xsl:value-of select='@name'/> </xsl:message>
-
- <xsl:text>/* Element with integrated type */ </xsl:text>
- <xsl:text>&INDENT;public: </xsl:text>
- <xsl:choose>
- <xsl:when test="0">
- <xsl:call-template name='class-tree-skel'>
- <xsl:with-param name='class' select="concat($nname,'_skel')"/>
- </xsl:call-template>
- <xsl:value-of select='concat("&INDENT2;typedef class ",$nname,"_skel ",$nname,"_type; ")'/>
- <xsl:text>&INDENT2;typedef </xsl:text>
- <xsl:value-of select='concat($shared-ptr,"::shared_ptr<",$nname,"_type> ",$nname,"_sptr; ")'/>
- <xsl:text>&INDENT2;typedef </xsl:text>
- <xsl:value-of select='concat("std::vector<",$nname,"_sptr> ",$nname,"_sequence; ")'/>
- <xsl:value-of select='concat("// ",$nname,"_skel *me_",$nname)'/>
-
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="." mode='tree-hdr-root'>
- <xsl:with-param name='name' select="concat($nname,'')"/>
- <xsl:with-param name='sp' select="'&INDENT2;'"/>
- </xsl:apply-templates>
- <!--
- <xsl:apply-templates select='.' mode='gen-tree-hdr-type-member'>
- <xsl:with-param name='name' select="$nname"/>
- <xsl:with-param name='indent' select='"&INDENT2;"'></xsl:with-param>
- <xsl:with-param name='cpp_type'>
- <xsl:choose>
- <xsl:when test="not(./xsd:simpleType|./xsd:complexType)">
- <xsl:text>std::string</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($nname,'_skel')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- -->
- </xsl:otherwise>
- </xsl:choose>
-
- <xsl:text> /* End internal declaration */ </xsl:text>
- <xsl:text>; &INDENT;public: </xsl:text>
- <!-- Set function -->
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parse-tree </xsl:text>
- <xsl:value-of select='concat(name(.)," not type set/get */ ")'/>
- </xsl:if>
- <xsl:apply-templates select="." mode="gen-tree-hdr-type-member-set">
- <xsl:with-param name='name' select='$nname'/>
- <xsl:with-param name='eltype' select='$nname'/>
- <xsl:with-param name='cpp_type'><xsl:value-of select='concat($nname,"_type")'/></xsl:with-param>
- <xsl:with-param name='maxOccurs'>
- <xsl:choose>
- <xsl:when test='@maxOccurs'><xsl:value-of select="@maxOccurs"/></xsl:when>
- <xsl:otherwise><xsl:value-of select='$maxOccurs'/></xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- <!-- Get Function -->
- <xsl:text>&INDENT2;</xsl:text>
- <xsl:apply-templates select='.' mode='ten-tree-hdr-type-member-get'>
- <xsl:with-param name='nname' select='$nname'/>
- <xsl:with-param name='cpp_type'><xsl:value-of select='concat($nname,"_type")'/></xsl:with-param>
- <xsl:with-param name='maxOccurs'>
- <xsl:choose>
- <xsl:when test='@maxOccurs'><xsl:value-of
- select="@maxOccurs"/></xsl:when>
- <xsl:otherwise><xsl:value-of
- select='$maxOccurs'/></xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- <xsl:text> </xsl:text>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:element[@name and @type]" mode="parse-tree">
- <xsl:param name='class'/>
- <xsl:param name='maxOccurs'>
- <xsl:choose>
- <xsl:when test="@maxOccurs"><xsl:value-of select="@maxOccurs"/></xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:param>
- <xsl:variable name="cpp_type">
- <xsl:apply-templates select='@type' mode='restriction-base'/>
- </xsl:variable>
- <xsl:variable name="ns_type">
- <xsl:apply-templates select="@type" mode="namespace-uri-of-qname">
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name'
- mode='normalize-name'/>
- </xsl:variable>
- <xsl:text>&INDENT2;//xsd2cpp-tree-header mode=parse-tree xsd:element[@name and @type] ... </xsl:text>
- <xsl:value-of select="concat('maxOccurs= ',@maxOccurs,' Name=',@name,' Type=',@type,' cpp_type=',$cpp_type)"/>
- <xsl:text> &INDENT2;// </xsl:text>
- <xsl:choose>
- <xsl:when test="$ns_type='&XSD;'">
- <xsl:text>&INDENT2;// ns_type is XMLSchema </xsl:text>
- <xsl:text> </xsl:text>
- <!-- Add typedefs -->
- <xsl:apply-templates select='.' mode='gen-tree-hdr-type-member'>
- <xsl:with-param name='name' select="$nname"/>
- <xsl:with-param name='cpp_type' select="$cpp_type"/>
- <xsl:with-param name='indent' select="'&INDENT2;'"/>
- </xsl:apply-templates>
- <!-- Generate elem type class -->
- <xsl:apply-templates select='.' mode='gen-tree-hdr-element'>
- <xsl:with-param name='name' select='$nname'/>
- <xsl:with-param name='class' select='$class'/>
- <xsl:with-param name='sp'><xsl:text>&INDENT2;</xsl:text></xsl:with-param>
- </xsl:apply-templates>
- <xsl:text> </xsl:text>
- <!-- Set function -->
- <xsl:text>&INDENT2;/* parse-tree Set and get avec type and nom */ </xsl:text>
- <xsl:apply-templates select="." mode='gen-tree-hdr-type-member-set'>
- <xsl:with-param name='name' select='$nname'/>
- <xsl:with-param name='eltype' select='$nname'/>
- <xsl:with-param name='cpp_type'><xsl:value-of select='concat($nname,"_type")'/></xsl:with-param>
- <xsl:with-param name='maxOccurs'>
- <xsl:choose>
- <xsl:when test='@maxOccurs'><xsl:value-of select="@maxOccurs"/></xsl:when>
- <xsl:otherwise><xsl:value-of select='$maxOccurs'/></xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- <!-- Get function -->
- <xsl:text>&INDENT2;</xsl:text>
- <xsl:apply-templates select='.' mode='gen-tree-hdr-type-member-get'>
- <xsl:with-param name='nname' select='$nname'/>
- <xsl:with-param name='cpp_type'><xsl:value-of select='concat($nname,"_type")'/></xsl:with-param>
- <xsl:with-param name='maxOccurs'>
- <xsl:choose>
- <xsl:when test='@maxOccurs'><xsl:value-of
- select="@maxOccurs"/></xsl:when>
- <xsl:otherwise><xsl:value-of
- select='$maxOccurs'/></xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:when>
- <!-- Case type is not xsd type -->
- <xsl:when test='$ns_type!="&XSD;"'>
- <xsl:variable name='vns'>
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="$ns_type"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:text> &INDENT;public: </xsl:text>
- <!-- Add typedefs -->
- <xsl:apply-templates select='.' mode='gen-tree-hdr-type-member'>
- <xsl:with-param name='name' select="$nname"/>
- <xsl:with-param name='cpp_type' select="concat('',$cpp_type)"/>
- <xsl:with-param name='indent' select="'&INDENT2;'"/>
- </xsl:apply-templates>
- <!-- Gen elem type structure -->
- <xsl:apply-templates select='.' mode='gen-tree-hdr-element'>
- <xsl:with-param name='name' select='$nname'/>
- <xsl:with-param name='class' select='$class'/>
- <xsl:with-param name='sp'><xsl:text>&INDENT2;</xsl:text></xsl:with-param>
- </xsl:apply-templates>
- <xsl:text> </xsl:text>
- <!-- Set function -->
- <xsl:text>&INDENT2;/* parse-tree Set and get width xsd type*/ </xsl:text>
- <xsl:apply-templates select="." mode='gen-tree-hdr-type-member-set'>
- <xsl:with-param name='name' select='$nname'/>
- <xsl:with-param name='eltype' select='$nname'/>
- <xsl:with-param name='cpp_type'><xsl:value-of select='concat($nname,"_type")'/></xsl:with-param>
- <xsl:with-param name='maxOccurs'>
- <xsl:choose>
- <xsl:when test='@maxOccurs'><xsl:value-of select="@maxOccurs"/></xsl:when>
- <xsl:otherwise><xsl:value-of select='$maxOccurs'/></xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- <!-- Get function -->
- <xsl:apply-templates select="." mode="gen-tree-hdr-type-member-get">
- <xsl:with-param name='nname' select='$nname'/>
- <xsl:with-param name='cpp_type'><xsl:value-of select='$cpp_type'/></xsl:with-param>
- <xsl:with-param name='maxOccurs'>
- <xsl:choose>
- <xsl:when test='@maxOccurs'><xsl:value-of
- select="@maxOccurs"/></xsl:when>
- <xsl:otherwise><xsl:value-of
- select='$maxOccurs'/></xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
-
-
- <xsl:text> </xsl:text>
- </xsl:when>
- <xsl:when test='$ns_type!="&XSD;" and $ns_type!=/xsd:schema/@targetNamespace'>
- <xsl:variable name="cpp_ns">
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="$ns_type"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:message terminate='yes'>Should be removed and not pass by here</xsl:message>
- <xsl:text>; public: </xsl:text>
- <xsl:text> void </xsl:text><xsl:value-of
- select='concat($nname,"(",$cpp_ns,"::",$cpp_type," &v) /* {if (me_",$nname,"!=0) *me_",$nname," =v;}*/; ")'/>
- <xsl:text> protected: </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>Error unknown Element type </xsl:message>
- <xsl:text>/* untreated for now */ </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- get function definition for element -->
- <xsl:template name='get_function'>
- <xsl:param name='nname'/>
- <xsl:param name='cpp_type'/>
- <xsl:param name='maxOccurs'/>
-
- <xsl:choose>
- <xsl:when test='($maxOccurs="unbounded")'>
- <xsl:text> &INDENT2;//xsd2cpp-tree-header get_function maxOccurs=unbounded</xsl:text>
- <!-- Get function-->
- <xsl:text> &INDENT2;</xsl:text><xsl:value-of
- select='concat($nname,"_sequence & &INDENT2;",$nname,"( void ) {
- return (me_",$nname,") ;}; ")'/>
- </xsl:when>
- <xsl:when test='(number($maxOccurs)>1)'>
- <xsl:text> &INDENT2;//void &INDENT2;</xsl:text>
- <xsl:value-of select='concat($nname,"(const ",$nname,"_sequence &v) ; ")'/>
- <!-- Get function-->
- <xsl:text> &INDENT2;</xsl:text>
- <xsl:value-of select='concat($nname,"_sequence & ")'/>
- <xsl:value-of select='concat("&INDENT2;",$nname,"( void ) { return me_",$nname," ;}; ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text> &INDENT2;//xsd2cpp-tree-header get_function maxOccurs=1</xsl:text>
- <!-- Get function-->
- <xsl:text> &INDENT2;</xsl:text><xsl:value-of
- select='concat($cpp_type," & &INDENT2;",$nname,"( void ) {
- return (*me_",$nname,") ;}; ")'/>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:any" mode='parse-tree'>
- <xsl:text>&INDENT2;/* Any element, needs set/get it's in xmlSerialize */ </xsl:text>
- <!--
- <xsl:text> virtual void any(xmlSerializer *s) {me_any=s;};</xsl:text>
- <xsl:text> protected:</xsl:text>
- -->
- </xsl:template>
-
- <!--
- ***
- *** parse-tree-type
- ***
- for types in element
- -->
- <xsl:template match="xsd:simpleType" mode="parse-tree-type">
- <xsl:apply-templates select='xsd:restriction|xsd:list|xsd:simpleContent'
- mode='parse-tree-type'/>
- </xsl:template>
- <xsl:template match="xsd:complexType" mode="parse-tree-type">
- <xsl:apply-templates select='xsd:restriction|xsd:list|xsd:simpleContent'
- mode='parse-tree-type'/>
- </xsl:template>
-
- <xsl:template match="xsd:simpleContent" mode="parse-tree-type">
- <xsl:apply-templates select='xsd:restriction|xsd:list|xsd:simpleContent'
- mode='parse-tree-type'/>
- </xsl:template>
- <xsl:template match="xsd:complexContent" mode="parse-tree-type">
- <xsl:apply-templates select='xsd:restriction|xsd:extension'
- mode='parse-tree-type'/>
- </xsl:template>
-
-
- <xsl:template match="xsd:restriction" mode="parse-tree-type">
- <xsl:variable name="cpp_type">
- <xsl:apply-templates select='@base' mode='restriction-base'/>
- </xsl:variable>
- <xsl:value-of select='$cpp_type'/>
- </xsl:template>
- <xsl:template match="xsd:extension" mode="parse-tree-type">
- <xsl:variable name="cpp_type">
- <xsl:apply-templates select='@base' mode='restriction-base'/>
- </xsl:variable>
- <xsl:value-of select='$cpp_type'/>
- </xsl:template>
- <xsl:template match="xsd:list" mode="parse-tree-type">
- <xsl:message terminate='yes'>Not yet coded</xsl:message>
- <xsl:variable name="cpp_type">
- <xsl:apply-templates select='@itemType' mode='restriction-base'/>
- </xsl:variable>
- <xsl:value-of select='$cpp_type'/>
- </xsl:template>
-
- <!--
- ***
- *** parse-tree-setget-attribute
- ***
- -->
- <xsl:template match='xsd:annotation' mode="parse-tree-setget-attribute">
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:simpleType' mode="parse-tree-setget-attribute">
- <xsl:text>&INDENT2;/* parse-tree-setget-attribute </xsl:text>
- <xsl:value-of select='concat(name(.),"*/ ")'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexType' mode="parse-tree-setget-attribute">
- <xsl:text>&INDENT2;/* parse-tree-setget-attribute </xsl:text>
- <xsl:value-of select='concat(name(.),"*/ ")'/>
- <xsl:apply-templates select="xsd:simpleContent|xsd:complexContent"
- mode="parse-tree-setget-attribute">
- </xsl:apply-templates>
- <!-- Sequence choice, group and any do not have attributes -->
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup"
- mode="parse-tree-setget-attribute">
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:simpleContent' mode="parse-tree-setget-attribute">
- <xsl:if test="local-name(..)='complexType'">
- <xsl:apply-templates select="xsd:restriction|xsd:extension"
- mode="parse-tree-setget-attribute">
- </xsl:apply-templates>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexContent' mode="parse-tree-setget-attribute">
- <xsl:apply-templates select="xsd:restriction|xsd:extension"
- mode="parse-tree-setget-attribute">
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:restriction' mode="parse-tree-setget-attribute">
- <!-- sequence ,choice,group and any do not have attributes.
- -->
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup"
- mode="parse-tree-setget-attribute">
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:extension' mode="parse-tree-setget-attribute">
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup"
- mode="parse-tree-setget-attribute">
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:group' mode="parse-tree-setget-attribute">
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:all' mode="parse-tree-setget-attribute">
- <xsl:text>&INDENT2;/* parse-tree-setget-attribute </xsl:text>
- <xsl:value-of select='concat(name(.),"*/ ")'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:choice|xsd:sequence' mode="parse-tree-setget-attribute">
- <xsl:text>&INDENT2;/* parse-tree-setget-attribute </xsl:text>
- <xsl:value-of select='concat(name(.),"*/ ")'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:any' mode="parse-tree-setget-attribute">
- <xsl:text>&INDENT2;/* parse-tree-setget-attribute </xsl:text>
- <xsl:value-of select='concat(name(.),"*/ ")'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attribute[@ref]' mode="parse-tree-setget-attribute">
- <xsl:variable name='ns'>
- <xsl:apply-templates select="@ref" mode='namespace-uri-of-qname'>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:variable name='name'>
- <xsl:choose>
- <xsl:when test='substring-after(@ref,":")=""'> <xsl:value-of select="@ref"/> </xsl:when>
- <xsl:otherwise><xsl:value-of select="substring-after(@ref,':')"/> </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='cpp_ns'>
- <xsl:call-template name="cpp_namespace">
- <xsl:with-param name='type' select='$ns'/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='lref' select='key("attribute",$name)'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parse-tree-setget-attribute </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref,"*/ ")'/>
- </xsl:if>
- <xsl:choose>
- <xsl:when test='@use and @use!="optional"'>
- <xsl:choose>
- <xsl:when test='($ns="&XSD;") or ($ns=/xsd:schema/@targetNamespace)'>
- <xsl:text>&INDENT2;void </xsl:text>
- <xsl:value-of select='concat("attr_",$name,"(",$name,"_attr_type &v)")'/>
- <xsl:text> ; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>&INDENT2;void </xsl:text>
- <xsl:value-of select='concat("attr_",$name,"(",$cpp_ns,"::",$name,"_attr_type &v)")'/>
- <xsl:text> ; </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test='($ns="&XSD;") or ($ns=/xsd:schema/@targetNamespace)'>
- <xsl:choose>
- <xsl:when test='@use and @use!="optional"'>
- <xsl:text>&INDENT2;void </xsl:text>
- <xsl:value-of select='concat("attr_",$name,"(",$name,"_attr_type &v)")'/>
- <xsl:text> ; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>&INDENT2;void </xsl:text>
- <xsl:value-of select='concat("attr_",$name,"(",$name,"_optional &v)")'/>
- <xsl:text> ; </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>&INDENT2;void </xsl:text>
- <xsl:value-of select='concat("attr_",$name,"(",$cpp_ns,"::",$name,"_optional &v)")'/>
- <xsl:text> ; </xsl:text>
- <!--
- <xsl:text>&INDENT2;void </xsl:text>
- <xsl:value-of select='concat("attr_",$name,"(",$cpp_ns,"::",$name,"_attr_type &v)")'/>
- <xsl:text> ; </xsl:text>
- -->
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select='.' mode='gen-tree-hdr-type-member-get'>
- <xsl:with-param name='name' select='$name'/>
- <xsl:with-param name='eltype'>
- <xsl:choose>
- <xsl:when test='@use and @use="required"'>
- <xsl:value-of select='concat($cpp_ns,"::",$name,"_attr_type")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat($cpp_ns,"::",$name,"_optional")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name='sp'><xsl:text>&INDENT2;</xsl:text></xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attribute[not(@ref) and not(@type)]' mode="parse-tree-setget-attribute">
- <xsl:param name='class'/>
- <xsl:variable name='name'><xsl:apply-templates select='@name' mode='normalize-name'/> </xsl:variable>
- <xsl:variable name='xsd-type'>
- <xsl:apply-templates select="./xsd:simpleType"
- mode="attribute-internal-type"/>
- </xsl:variable>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='./xsd:simpleType'
- mode='attribute-internal-cpp-type'/>
- </xsl:variable>
- <xsl:text>&INDENT2;/* parse-tree-setget-attribute anonymous </xsl:text>
- <xsl:value-of select='concat(name(.)," xsd-ns=",$xsd-type," cpp_type=",$cpp_type, "*/ ")'/>
- <xsl:variable name='nm'><xsl:apply-templates select='@name' mode='normalize-name'/></xsl:variable>
-
- <!-- Ok, now start the definition of the class I think this is OK -->
- <xsl:apply-templates select="xsd:simpleType" mode='tree-hdr-root'>
- <xsl:with-param name='name' select="concat($name,'')"/>
- </xsl:apply-templates>
- <!-- Add typedefs -->
- <!--
- <xsl:apply-templates select='.' mode='gen-tree-hdr-type-member'>
- <xsl:with-param name='name' select="$name"/>
- <xsl:with-param name='cpp_type' select="$cpp_type"/>
- <xsl:with-param name='indent' select="'&INDENT2;'"/>
- </xsl:apply-templates>
- -->
- <!-- Generate the attr_type_ structure -->
- <xsl:apply-templates select='.' mode='gen-tree-hdr-element'>
- <xsl:with-param name='name' select='$nm'/>
- <xsl:with-param name='sp' select="''"></xsl:with-param>
- </xsl:apply-templates>
- <xsl:call-template name='member-optional'>
- <xsl:with-param name='type' select='concat($nm,"_attr_type_")'/>
- </xsl:call-template>
-
- <xsl:apply-templates select='.' mode='gen-tree-hdr-type-member-set'>
- <xsl:with-param name='name' select='$name'/>
- <xsl:with-param name='class' select='$class'/>
- <xsl:with-param name='type' select='$cpp_type'/>
- <xsl:with-param name='sp'><xsl:text>&INDENT2;</xsl:text></xsl:with-param>
- </xsl:apply-templates>
- <!--
- <xsl:choose>
- <xsl:when test='./xsd:simpleType'>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select='.' mode='gen-tree-hdr-element'>
- <xsl:with-param name='name' select='$nm'/>
- <xsl:with-param name='class' select='$class'/>
- <xsl:with-param name='sp'><xsl:text>&INDENT2;</xsl:text></xsl:with-param>
- </xsl:apply-templates>
- <xsl:text> </xsl:text>
- <xsl:value-of
- select='concat("&INDENT2;void &INDENT2;attr_",$nm,"(",$cpp_type," &v) { me_attr_",$name,"=v;}; ")'/>
- </xsl:otherwise>
- </xsl:choose>
- -->
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:attribute[@name and @type]" mode="parse-tree-setget-attribute">
- <xsl:param name='class'/>
- <xsl:variable name='btype' select="concat('xsd::',substring-after(@type,':'))"/>
- <xsl:variable name='name'><xsl:apply-templates select='@name' mode='normalize-name'/> </xsl:variable>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@type' mode='restriction-base'/>
- </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@type"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='vns'>
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="/xsd:schema/@targetNamespace"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:text>&INDENT2;// parse-tree-setget-attribute </xsl:text>
- <xsl:value-of select='concat(name(.)," ",@name," @type=",@type," $ns=",$ns," &INDENT2;// ")'/>
- <xsl:choose>
- <xsl:when test='($ns="&XSD;") or ($ns=/xsd:schema/@targetNamespace) or (substring-before(@type,":")="")'>
- <xsl:apply-templates select='.' mode='gen-tree-hdr-element'>
- <xsl:with-param name='name' select='$name'/>
- <xsl:with-param name='class' select='$class'/>
- <xsl:with-param name='sp'><xsl:text>&INDENT2;</xsl:text></xsl:with-param>
- </xsl:apply-templates>
- <xsl:text> </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>ERROR attribute type definition missing</xsl:message>
- <xsl:text>&INDENT2;// typedef missing </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test='@use="optional"'>
- </xsl:if>
- <xsl:call-template name='member-optional'>
- <xsl:with-param name='type' select='concat($name,"_attr_type_")'/>
- </xsl:call-template>
- <!-- Ok, add datatype definitions -->
- <!-- Get function -->
- <xsl:text>&INDENT2;</xsl:text>
- <xsl:value-of
- select='concat($cpp_type," &INDENT2;attr_",$name,"(void) { return me_attr_",$name)'/>
- <xsl:choose>
- <xsl:when test='@use and @use!="optional"'>
- <xsl:value-of select='concat("",";}; ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("",".content();}; ")'/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>&INDENT2;//</xsl:text>
- <xsl:value-of
- select='concat(@name,"_optional & &INDENT2;//",@name,"(void) { return me_attr_",@name,";}; ")'/>
- <!-- Setter's-->
- <!--
- <xsl:value-of
- select='concat("&INDENT2;/oid &INDENT2;attr_",$name,"(",$cpp_type," &v) { me_attr_",$name,"=v;}; ")'/>
- -->
- <xsl:choose>
- <xsl:when test='@use and @use!="optional"'>
- <xsl:value-of
- select='concat("&INDENT2;void &INDENT2;attr_",$name,"(",$cpp_type," &v) { me_attr_",$name,"=v;}; ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of
- select='concat("&INDENT2;void &INDENT2;attr_",$name,"(",$name,"_optional &v) { me_attr_",$name,"=v;}; ")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:attributeGroup[@name]' mode="parse-tree-setget-attribute">
- <xsl:text>&INDENT2;/* parse-tree-setget-attribute </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@anme,"*/ ")'/>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup"
- mode="parse-tree-setget-attribute">
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attributeGroup[@ref]' mode="parse-tree-setget-attribute">
- <xsl:param name='class'/>
- <xsl:variable name='local-name'>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'><xsl:value-of
- select='substring-after(@ref,":")'/>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select='@ref'/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT2;/* parse-tree-setget-attribute </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref," ",$class,"*/ ")'/>
- </xsl:if>
- <xsl:choose>
- <xsl:when test='@ref'>
- <xsl:apply-templates mode="parse-tree-setget-attribute" select="key('attrGroup',$local-name)/*">
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>Parent should only by xsl:schema</xsl:message>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode="parse-tree">
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
- vim:ts=2:sw=2:et:bs=2:
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- version="2.0" >
-
- <!--
- ***
- *** tree-src-constructor-params templates
- ***
- -->
- <xsl:template match="xsd:simpleType" mode="tree-src-constructor-params">
- <xsl:param name='operation'/>
- <xsl:text>&INDENT; &INDENT;/* tree-src-constructor-params </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref,"*/ ")'/>
- <xsl:apply-templates select="xsd:list|xsd:union|xsd:restriction"
- mode="tree-src-constructor-params">
- <xsl:with-param name='operation' select="$operation"/>
- </xsl:apply-templates>
-
- <xsl:choose>
- <xsl:when test="$operation='copy'">
- <xsl:text>&INDENT;m_content=f.m_content;// copy in simple type </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="xsd:simpleContent" mode="tree-src-constructor-params">
- <xsl:param name='operation'/>
- <xsl:apply-templates select="xsd:restriction|xsd:extension"
- mode="tree-src-constructor-params">
- <xsl:with-param name='operation' select="$operation"/>
- </xsl:apply-templates>
- <xsl:choose>
- <xsl:when test="$operation='copy'">
- <xsl:text>&INDENT;m_content=f.m_content; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:complexContent" mode="tree-src-constructor-params">
- <xsl:param name='operation'/>
- <xsl:apply-templates select="xsd:choice|xsd:sequence|xsd:all|xsd:group"
- mode="tree-src-constructor-params">
- <xsl:with-param name='operation' select="$operation"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup"
- mode="tree-src-constructor-params">
- <xsl:with-param name='operation' select="$operation"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:annotation" mode="tree-src-constructor-params">
- <xsl:param name='operation'/>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:group[@ref]" mode="tree-src-constructor-params">
- <xsl:param name='operation'/>
- <xsl:variable name='local-name'>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'><xsl:value-of select='substring-after(@ref,":")'/></xsl:when>
- <xsl:otherwise><xsl:value-of select="@ref"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>&INDENT;/* tree-src-constructor-params </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref,"*/ ")'/>
- <xsl:apply-templates select="/xsd:schema/xsd:group[@name=$local-name]"
- mode="tree-src-constructor-params">
- <xsl:with-param name='operation' select="$operation"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:group[@name]" mode="tree-src-constructor-params">
- <xsl:param name='operation'/>
- <xsl:text>&INDENT;/* tree-src-constructor-params </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref,"*/ ")'/>
- <xsl:apply-templates select="xsd:sequence|xsd:choice|xsd:all"
- mode="tree-src-constructor-params">
- <xsl:with-param name='operation' select="$operation"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:choice|xsd:sequence" mode="tree-src-constructor-params">
- <xsl:param name='operation'/>
- <xsl:text>&INDENT;/* tree-src-constructor-params </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref,"*/ ")'/>
- <xsl:apply-templates select="xsd:element|xsd:attribute|xsd:sequence|xsd:choice|xsd:any"
- mode="tree-src-constructor-params">
- <xsl:with-param name='operation' select="$operation"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:restriction|xsd:extension" mode="tree-src-constructor-params">
- <xsl:param name='operation'/>
- <xsl:variable name='ns'>
- <xsl:call-template name="namespace-uri-of-qname">
- <xsl:with-param name='qname' select="@base"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:text>&INDENT;/* tree-src-constructor-params </xsl:text>
- <xsl:value-of select='concat(name(.)," parent=",name(..),"*/ ")'/>
- <xsl:choose>
- <xsl:when test='$operation="const"'>
- <xsl:choose>
- <xsl:when test='$ns="http://www.w3.org/2001/XMLSchema"'>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@base'
- mode='restriction-base'/><!--
- <xsl:call-template name="xsl-type">
- <xsl:with-param name='type' select='@base'/>
- </xsl:call-template>
- -->
- </xsl:variable>
- <xsl:value-of select="concat('&INDENT;//',$cpp_type,' &p; ')"/>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:when test='$operation="copy"'>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup"
- mode="tree-src-constructor-params">
- <xsl:with-param name='operation' select="$operation"/>
- </xsl:apply-templates>
- <xsl:choose>
- <xsl:when test="local-name(..)='simpleType'">
- <xsl:text>&INDENT;m_content=f.m_content; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test='$operation="dest"'>
- <xsl:message terminate='no'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:union" mode="tree-src-constructor-params">
- <xsl:param name='operation'/>
- <xsl:text>&INDENT;/*generate-tree-skell-constructor-parmas xsd:union TO BE CODED */ </xsl:text>
- <xsl:choose>
- <xsl:when test='$operation="const"'>
- <xsl:value-of select="concat('&INDENT;: ',$cls-tree-union-selector,'()')"/>
- </xsl:when>
- <xsl:when test='$operation="copy"'>
- <xsl:value-of
- select='concat("&INDENT; ",$cls-tree-union-selector," = f.",$cls-tree-union-selector,"; ")'/>
- <xsl:text>&INDENT;m_content=f.m_content; </xsl:text>
- </xsl:when>
- <xsl:when test='$operation="dest"'>
- <xsl:message terminate='no'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- LIST -->
- <xsl:template match="xsd:list[not(@itemType)]" mode="tree-src-constructor-params">
- <xsl:param name='operation'/>
- <xsl:param name='foreign-namespace'/>
- <xsl:text>&INDENT;/* tree-src-constructor-params </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref,"*/ ")'/>
- <xsl:choose>
- <xsl:when test='$operation="const"'>
- </xsl:when>
- <xsl:when test='$operation="copy"'>
- <xsl:text>&INDENT;/* copy m_content for List*/ </xsl:text>
- <xsl:text>&INDENT;m_content=f.m_content; </xsl:text>
- </xsl:when>
- <xsl:when test='$operation="dest"'>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="xsd:list[@itemType]" mode="tree-src-constructor-params">
- <xsl:param name='operation'/>
- <xsl:param name='foreign-namespace'/>
- <xsl:text>&INDENT;/* tree-src-constructor-params </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref,"*/ ")'/>
- <xsl:choose>
- <xsl:when test='$operation="const"'>
- </xsl:when>
- <xsl:when test='$operation="copy"'>
- <xsl:text>&INDENT;/* copy m_content for List*/ </xsl:text>
- <xsl:text>&INDENT;m_content=f.m_content; </xsl:text>
- <xsl:text>&INDENT;m_tokens=f.m_tokens; </xsl:text>
- </xsl:when>
- <xsl:when test='$operation="dest"'>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:element[@ref!='']" mode="tree-src-constructor-params">
- <xsl:param name='operation'/>
- <xsl:param name='foreign-namespace'/>
- <xsl:variable name='nname'>
- <xsl:apply-templates select="@ref" mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='name'>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'><xsl:value-of
- select='substring-after(@ref,":")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='@ref'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!--
- <xsl:variable name='el' select='key("elementByName1",$name)'/>
- -->
- <xsl:variable name='el' select='/xsd:schema/xsd:element[@name=$name]'/>
- <xsl:apply-templates select='$el'
- mode="tree-src-constructor-params">
- <xsl:with-param name='operation' select='$operation'/>
- <xsl:with-param name='maxOccurs' select='@maxOccurs'/>
- </xsl:apply-templates>
-
- </xsl:template>
-
-
- <!-- -->
- <xsl:template match="xsd:element[@name!='']" mode="tree-src-constructor-params">
- <xsl:param name='operation'/>
- <xsl:param name='foreign-namespace'/>
- <xsl:param name='maxOccurs'>1</xsl:param>
- <xsl:variable name='nname'>
- <xsl:apply-templates select="@name" mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='cpp_type'>
- <xsl:choose>
- <xsl:when test='@type'>
- <xsl:apply-templates select='@type' mode='restriction-base'/>
- </xsl:when>
- <xsl:when test='not(@type)'>
- <!--
- <xsl:value-of select='concat("",$elem_pref,$nname,$elem_suff,"")'/>
- -->
- <xsl:value-of select='concat("",$nname,"_skel")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'> <xsl:value-of select='concat(@name," ",@type)'/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <!-- Constructor -->
- <xsl:when test='$operation="const"'>
- <xsl:choose>
- <xsl:when test="$cpp_type!=''">
- <xsl:text>&INDENT2;</xsl:text>
- <xsl:choose>
- <xsl:when test='$maxOccurs="unbounded"'>
- <xsl:value-of select='concat(" me_",$nname,"()/* cpp_type != empty */")'/>
- </xsl:when>
- <xsl:when test='@maxOccurs="unbounded"'>
- <xsl:value-of select='concat(" me_",$nname,"()/* cpp_type != empty */")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat(" me_",$nname,"()/* cpp_type != empty */")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>&INDENT2;</xsl:text>
- <xsl:value-of select='concat(" me_",$nname,"(NULL)/*new ",$nname,"_skel();*/")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- Constructor 1-->
- <xsl:when test='$operation="const1"'>
- <xsl:choose>
- <xsl:when test="$cpp_type!=''">
- <xsl:text>&INDENT2;</xsl:text>
- <xsl:choose>
- <xsl:when test='$maxOccurs="unbounded"'>
- <xsl:value-of select='concat(" me_",$nname,"(f.me_",$nname,")/* cpp_type != empty */")'/>
- </xsl:when>
- <xsl:when test='@maxOccurs="unbounded"'>
- <xsl:value-of select='concat(" me_",$nname,"(f.me_",$nname,")/* cpp_type != empty */")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat(" me_",$nname,"(f.me_",$nname,")/* cpp_type != empty */")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>&INDENT2;</xsl:text>
- <xsl:value-of select='concat(" me_",$nname,"(f.me_",$nname,")/*new ",$nname,"_skel();*/")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- Destructor stull -->
- <xsl:when test='$operation="dest"'>
- <xsl:text>&INDENT;</xsl:text>
- <xsl:choose>
- <xsl:when test='(@maxOccurs="unbounded") or ($maxOccurs="unbounded")'>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>/* remove delete temporarly */ </xsl:text>
- <!--
- <xsl:value-of select='concat(" if (me_",$nname," ) delete
- me_",$nname,"; ")'/>
- -->
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- Copy operation -->
- <xsl:when test='$operation="copy"'>
- <xsl:apply-templates select="." mode="gen-tree-impl-const-params-copy">
- <xsl:with-param name='name' select="$nname"/>
- <xsl:with-param name='cpp_type' select="$cpp_type"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>Bad operation <xsl:value-of
- select="$operation"/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:attribute[@ref!='']" mode="tree-src-constructor-params">
- <xsl:param name='operation'/>
- <xsl:param name='foreign-namespace'/>
- <xsl:variable name='lref' select='key("attribute",substring-after(@ref,":"))'/>
- <xsl:variable name='ns'>
- <xsl:apply-templates select="@ref" mode='namespace-uri-of-qname'>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:variable name="cpp_ns">
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="$ns"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='substring-before(@ref,":")=""'>
- <xsl:apply-templates select="key('attribute',@ref)"
- mode="tree-src-constructor-params">
- <xsl:with-param name='operation' select="$operation"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='$ns=/xsd:schema/@targetNamespace'>
- <xsl:apply-templates select="key('attribute',substring-after(@ref,':'))"
- mode="tree-src-constructor-params">
- <xsl:with-param name='operation' select="$operation"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name='loc-name' select='substring-after(@ref,":")'/>
- <xsl:variable name='loc'
- select="/xsd:schema/xsd:import[@namespace=$ns]/@schemaLocation">
- </xsl:variable>
- <xsl:variable name='doc'>
- <xsl:call-template name='import-document'>
- <xsl:with-param name='location' select='string($loc)'/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='attr'
- select="$doc/xsd:schema/xsd:attribute[@name=$loc-name]"/>
- <xsl:choose>
- <xsl:when test='not($attr)'>
- <xsl:message terminate='yes'>Attribute not found <xsl:value-of select='concat($loc-name," ns=",$ns)'/></xsl:message>
- </xsl:when>
- <xsl:when test='$attr/@type!=""'>
- <!-- The attribute has a type. if so check the namespace -->
- <xsl:variable name='ns_attr'><xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="$attr/@type"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:text>&INDENT;//ERROR 1200 Where is it taken into account ?</xsl:text><xsl:value-of select='concat("m_",$attr/@name," ")'/>
- </xsl:when>
- <xsl:when test='not($attr/@type)'>
- <xsl:message terminate='no'>ERROR Attribute reference <xsl:value-of select='@ref'/> Not treated</xsl:message>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'> Attribute not yet treated <xsl:value-of
- select='concat(@ref," - loca=",$loc," attr=",$doc/xsd:schema/xsd:attribute[@name=$loc-name]/@name," local name:" ,$loc-name)'/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="$doc/xsd:schema/xsd:attribute[@name=$loc-name]"
- mode="tree-src-constructor-params">
- <xsl:with-param name='operation' select="$operation"/>
- <!--
- <xsl:with-param name='foreign-namespace' select='concat($cpp_ns,"::")'/>
- -->
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:attribute[@name!='']" mode="tree-src-constructor-params">
- <xsl:param name='operation'/>
- <xsl:param name='foreign-namespace'/>
- <xsl:variable name='default_value'><xsl:apply-templates select='@type' mode='xsd-default-value-base'/>
- </xsl:variable>
- <xsl:variable name='nm'><xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='cpp_type'><xsl:apply-templates select='@type' mode='restriction-base'/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='$operation="const"'>
- <xsl:value-of select='concat("&INDENT;me_attr_",$nm,"(",$default_value,")")'/>
- </xsl:when>
- <xsl:when test='$operation="const1"'>
- <xsl:value-of select='concat("&INDENT;",$foreign-namespace,"me_attr_",$nm,"(f.me_attr_",$nm,")")'/>
- </xsl:when>
- <xsl:when test='$operation="copy"'>
- <xsl:if test='@use="optional"'>
- <xsl:text>&INDENT;if (f.me_attr_</xsl:text>
- <xsl:value-of select='concat($nm,".present( ) ) ")'/>
- </xsl:if>
- <xsl:value-of select='concat("&INDENT;me_attr_",$nm,"=f.me_attr_",$nm,"; ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text/>
- <xsl:value-of select='concat("/* Attribute of type ",$cpp_type,"; */ ")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attributeGroup[@name]" mode="tree-src-constructor-params">
- <xsl:param name='operation'/>
- <xsl:param name='foreign-namespace'/>
- <xsl:for-each select='xsd:attribute'>
- <xsl:apply-templates select='.' mode="tree-src-constructor-params">
- <xsl:with-param name='operation' select="$operation"/>
- </xsl:apply-templates>
- <xsl:if test='(position() != last()) and $operation="const1"'>
- <xsl:text> , </xsl:text>
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attributeGroup[@ref]" mode="tree-src-constructor-params">
- <xsl:param name='operation'/>
- <xsl:param name='foreign-namespace'/>
- <xsl:variable name='name'>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'><xsl:value-of select='substring-after(@ref,":")'/></xsl:when>
- <xsl:otherwise><xsl:value-of select='@ref'/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:apply-templates select='/xsd:schema/xsd:attributeGroup[@name=$name]' mode="tree-src-constructor-params">
- <xsl:with-param name='operation' select="$operation"/>
- </xsl:apply-templates>
- </xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
- vim:ts=2:sw=2:et:bs=2:
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- version="2.0" >
-
- <!-- Serialize attributes mode generate-tree-skell-sirialize_attr -->
- <xsl:template match="xsd:attribute[@ref]" mode="tree-src-serialize-attr">
- <xsl:variable name='ns'>
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@ref"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='name'>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'><xsl:value-of select='substring-after(@ref,":")'/></xsl:when>
- <xsl:otherwise><xsl:value-of select="@ref"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT;// tree-src-serialize-attr </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref," ns=",$ns," name=",$name," ")'/>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="$ns=/xsd:schema/@targetNamespace">
- <xsl:apply-templates select="." mode="gen-tree-impl-serialize">
- <xsl:with-param name="name" select="$name"/>
- <xsl:with-param name="ns" select="$ns"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>&INDENT;os<<me_attr_</xsl:text>
- <xsl:value-of select="concat($name,'; ')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attributeGroup[@name]" mode="tree-src-serialize-attr">
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT;// tree-src-serialize-attr </xsl:text>
- <xsl:value-of select='concat(name(.),"",@name," ")'/>
- </xsl:if>
- <xsl:apply-templates select="key('attrGroup',substring-after(@ref,':'))/*"
- mode="tree-src-serialize-attr">
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attributeGroup[@ref]" mode="tree-src-serialize-attr">
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT;// tree-src-serialize-attr </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref," ")'/>
- </xsl:if>
- <xsl:apply-templates select="key('attrGroup',substring-after(@ref,':'))/*"
- mode="tree-src-serialize-attr">
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match="xsd:attribute[@name!='']" mode="tree-src-serialize-attr">
- <xsl:variable name='elns'>
- <xsl:for-each select="namespace::*">
- <xsl:if test=".=/xsd:schema/@targetNamespace">
- <xsl:value-of select="name()"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:variable name='nm'><xsl:apply-templates select='@name'
- mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@type"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT;// tree-src-serialize-attr </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name," "," ")'/>
- </xsl:if>
- <xsl:if test='@use="optional"'>
- <xsl:text>&INDENT;if (</xsl:text>
- <xsl:value-of select='concat("me_attr_",$nm,".present()) { ")'/>
- </xsl:if>
- <xsl:text>&INDENT;os<<</xsl:text>
- <xsl:choose>
- <xsl:when test='0'/>
- <!-- -->
- <xsl:otherwise>
- <!-- -->
- <xsl:choose>
- <xsl:when test="substring-after(@type,':')='byte'">
- <xsl:value-of select="concat('static_cast<short>(me_attr_',$nm,')')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('me_attr_',$nm,'; ')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- <!--
- <xsl:text><<""; </xsl:text>
- -->
- <xsl:if test='@use="optional"'>
- <xsl:text>&INDENT;} </xsl:text>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match='xsd:annotation'
- mode="tree-src-serialize-attr">
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:union|xsd:list'
- mode="tree-src-serialize-attr">
- </xsl:template>
-
- <xsl:template match='xsd:simpleContent'
- mode="tree-src-serialize-attr">
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT;/* trees-src-serialize-attr </xsl:text>
- <xsl:value-of select='concat(name(.)," */ ")'/>
- </xsl:if>
- <xsl:apply-templates select="xsd:restriction|xsd:extension"
- mode="tree-src-serialize-attr"/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexContent'
- mode="tree-src-serialize-attr">
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT;/* trees-src-serialize-attr </xsl:text>
- <xsl:value-of select='concat(name(.)," */ ")'/>
- </xsl:if>
- <xsl:apply-templates select="xsd:restriction|xsd:extension"
- mode="generate-tree-skell-serialize_attr-complex-content"/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:choice|xsd:sequence|xsd:all|xsd:group'
- mode="tree-src-serialize-attr">
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT;/* trees-src-serialize-attr </xsl:text>
- <xsl:value-of select='concat(name(.)," */ ")'/>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match='xsd:restriction'
- mode="tree-src-serialize-attr">
- <xsl:if test='$verbose="yes"'>
- <xsl:message>xsd:restriction Serialize Attribute <xsl:value-of select="@base"/></xsl:message>
- </xsl:if>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* trees-src-serialize-attr </xsl:text>
- <xsl:value-of select='concat(name(.)," */ ")'/>
- </xsl:if>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup"
- mode="tree-src-serialize-attr"/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:restriction'
- mode="generate-tree-skell-serialize_attr-simple-content">
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup"
- mode="tree-src-serialize-attr"/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:extension'
- mode="tree-src-serialize-attr">
- <xsl:if test='$verbose="yes"'>
- <xsl:message>xsd:extension Serialize Attribute <xsl:value-of select="@base"/></xsl:message>
- </xsl:if>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* trees-src-serialize-attr </xsl:text>
- <xsl:value-of select='concat(name(.)," */ ")'/>
- </xsl:if>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup"
- mode="tree-src-serialize-attr"/>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:restriction'
- mode="generate-tree-skell-serialize_attr-complex-content">
- <xsl:if test='$verbose="yes"'>
- <xsl:message>Serialize Attribute <xsl:value-of select="@base"/></xsl:message>
- </xsl:if>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup"
- mode="tree-src-serialize-attr"/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:extension'
- mode="generate-tree-skell-serialize_attr-complex-content">
- <xsl:message>Serialize xsd:extension Attribute <xsl:value-of select="@base"/></xsl:message>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup"
- mode="tree-src-serialize-attr"/>
- </xsl:template>
-
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
- vim:ts=2:sw=2:et:bs=2:
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- version="2.0" >
-
- <!--
- ***
- *** generate-tree-src-serialize-element
- ***
- This is used to generate the serialization of elements struct @name _elem_type
- -->
- <xsl:template match='xsd:annotation' mode="tree-src-serialize-element">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- </xsl:template>
- <xsl:template match='xsd:simpleType' mode="tree-src-serialize-element">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- </xsl:template>
- <xsl:template match='xsd:complexType' mode="tree-src-serialize-element">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='name'/>
- <xsl:apply-templates select="xsd:simpleContent|xsd:complexContent"
- mode="tree-src-serialize-element">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select='$scope'/>
- <xsl:with-param name='name' select='$name'/>
- </xsl:apply-templates>
- <xsl:apply-templates select="xsd:group|xsd:all|xsd:choice|xsd:sequence"
- mode="tree-src-serialize-element">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select='$scope'/>
- <xsl:with-param name='name' select='$name'/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match='xsd:simpleContent' mode="tree-src-serialize-element">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexContent' mode="tree-src-serialize-element">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:apply-templates select="xsd:restriction|xsd:extension"
- mode="tree-src-serialize-element">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select='$scope'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:extension' mode="tree-src-serialize-element">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:apply-templates select="xsd:restriction|xsd:extension"
- mode="tree-src-serialize-element">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select='$scope'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:restriction' mode="tree-src-serialize-element">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:apply-templates select="xsd:sequence|xsd:group|xsd:all|xsd:choice"
- mode="tree-src-serialize-element">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select='$scope'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:choice|xsd:sequence' mode="tree-src-serialize-element">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='name'/>
- <xsl:apply-templates select="xsd:element|xsd:group|xsd:choice|xsd:sequence|xsd:any"
- mode="tree-src-serialize-element">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select='$scope'/>
- <xsl:with-param name='name' select='$name'/>
- <xsl:with-param name='maxOccurs'>
- <xsl:choose>
- <xsl:when test="@maxOccurs"><xsl:value-of select="@maxOccurs"/></xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:group[@ref]' mode="tree-src-serialize-element">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='name'/>
- <xsl:if test='$debug-comment'>
- <xsl:text>/* tree-src-serialize-element </xsl:text>
- <xsl:value-of select='concat(name(.),"*/ ")'/>
- </xsl:if>
- <xsl:apply-templates select="." mode="gen-tree-impl-element">
- <xsl:with-param name='name' select="$name"/>
- <xsl:with-param name='class' select="$class" />
- <xsl:with-param name='scope' select="$scope" />
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:group[@name]' mode="tree-src-serialize-element">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='name'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* tree-src-serialize-element </xsl:text>
- <xsl:value-of select='concat(name(.),"*/ ")'/>
- </xsl:if>
- <xsl:apply-templates select="." mode="gen-tree-impl-element">
- <xsl:with-param name='name' select="$name"/>
- <xsl:with-param name='class' select="$class" />
- <xsl:with-param name='scope' select="$scope" />
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:all' mode="tree-src-serialize-element">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='name'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* tree-src-serialize-element </xsl:text>
- <xsl:value-of select='concat(name(.),"*/ ")'/>
- </xsl:if>
- <xsl:apply-templates select="xsd:element" mode="tree-src-serialize-element">
- <xsl:with-param name='name' select="$name"/>
- <xsl:with-param name='class' select="$class" />
- <xsl:with-param name='scope' select="$scope" />
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:any' mode="tree-src-serialize-element">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='name'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* tree-src-serialize-element </xsl:text>
- <xsl:value-of select='concat(name(.),"*/ ")'/>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[@ref]' mode="tree-src-serialize-element">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='name'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* tree-src-serialize-element </xsl:text>
- <xsl:value-of select='concat(name(.),"@ref=",@ref,"*/ ")'/>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[not(@ref) and not(@type)]' mode="tree-src-serialize-element">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='name'/>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name' mode='normalize-name'/></xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* tree-src-serialize-element </xsl:text>
- <xsl:value-of select='concat(name(.),"@name=",@name," $nname=",$nname,"*/ ")'/>
- </xsl:if>
- <!-- generate code for this element -->
- <xsl:apply-templates select="." mode="gen-tree-impl-element">
- <xsl:with-param name='name' select="$nname"/>
- <xsl:with-param name='class' select="$class" />
- <xsl:with-param name='scope' select="$scope" />
- </xsl:apply-templates>
- <!-- walk through for next element -->
- <xsl:apply-templates select="xsd:simpleType|xsd:complexType" mode="tree-src-serialize-element">
- <xsl:with-param name='name' select="$nname"/>
- <xsl:with-param name='class' select="$class" />
- <xsl:with-param name='scope' select="concat($scope,$nname,'_skel::')" />
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[not(@ref) and(@type)]' mode="tree-src-serialize-element">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='name'/>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name' mode='normalize-name'/></xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* tree-src-serialize-element </xsl:text>
- <xsl:value-of select='concat(name(.),"@name=",@name," $nname=",$nname,"*/ ")'/>
- </xsl:if>
- <xsl:apply-templates select="." mode="gen-tree-impl-element">
- <xsl:with-param name='name' select="$nname"/>
- <xsl:with-param name='class' select="$class" />
- <xsl:with-param name='scope' select="$scope" />
- </xsl:apply-templates>
- </xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
- vim:ts=2:sw=2:et:bs=2:
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- version="2.0" >
-
-
- <!--
- ***
- *** tree-src-serialize-root
- ***
- That's for elements
- -->
- <xsl:template match="xsd:schema" mode='tree-src-serialize-root'>
- <xsl:apply-templates select="xsd:simpleType|xsd:complexType" mode='tree-src-serialize-root'>
-
- </xsl:apply-templates>
- <xsl:apply-templates select="xsd:element|xsd:attribute|xsd:attributeGroup|xsd:group" mode='tree-src-serialize-root'/>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:simpleType" mode='tree-src-serialize-root'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:text>//xsd2cpp-tree tree-src-serialize-root </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name," ")'/>
- <xsl:text>std::ostream &</xsl:text>
- <xsl:text>operator <<(std::ostream &os,const </xsl:text>
- <xsl:value-of select="concat($scope,$class)"/><xsl:text> &obj) { </xsl:text>
- <xsl:apply-templates select="xsd:restriction|xsd:list|xsd:union" mode="tree-src-serialize">
- <xsl:with-param name='class' select='$class'/>
- <xsl:with-param name='scope' select='$scope'/>
- </xsl:apply-templates>
- <xsl:value-of select='concat("","&INDENT;return os; ")'/>
- <xsl:text>} </xsl:text>
- <xsl:message terminate='no'>VERIFY sT <xsl:value-of select="@name"/></xsl:message>
- <!-- Only complexType can have attributes so empty method -->
- <xsl:text>void </xsl:text>
- <xsl:value-of select="concat($scope,$class,'::serialize_attributes(std::ostream &os) { ')"/>
- <xsl:value-of select='concat("&INDENT;// tree-src-serialize-root ",name(.)," @name=",@name," ")'/>
- <xsl:text>} </xsl:text>
- </xsl:template>
- <!-- Here is the complexity !!!!
- The complex Type only can generate what's inside
- Only Elements can generate the external envolope
- -->
- <xsl:template match="xsd:complexType" mode='tree-src-serialize-root'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:message terminate='no'>VERIFY cT <xsl:value-of select="concat(name(.),' ',@name)"/></xsl:message>
- <xsl:text>std::ostream &</xsl:text>
- <xsl:text>operator <<(std::ostream &os,const </xsl:text>
- <xsl:value-of select="concat($scope,$class)"/><xsl:text> &obj) { </xsl:text>
- <xsl:apply-templates select="xsd:simpleContent|xsd:complexContent" mode="tree-src-serialize">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="xsd:group|xsd:all|xsd:choice|xsd:sequence" mode="tree-src-serialize">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- <xsl:value-of select='concat("","&INDENT;return os; ")'/>
- <xsl:text>} </xsl:text>
- <!-- Only complexType can have attributes -->
- <xsl:text>void </xsl:text>
- <xsl:value-of select="concat($scope,$class,'::serialize_attributes(std::ostream &os) { ')"/>
- <xsl:value-of select='concat("&INDENT;// tree-src-serialize-root ",name(.)," @name=",@name," ")'/>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode="tree-src-serialize-attr"/>
- <xsl:apply-templates select="xsd:simpleContent|xsd:complexContent|xsd:choice|xsd:sequence|xsd:all" mode="tree-src-serialize-attr"/>
- <xsl:text> } </xsl:text>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:group[@name]" mode='tree-src-serialize-root'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attributeGroup[@ref]" mode='tree-src-serialize-root'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attributeGroup[@name]" mode='tree-src-serialize-root'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[not(@type) and @name]" mode='tree-src-serialize-root'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:text>/* * tree-src-serialize-root </xsl:text>
- <xsl:value-of select='concat(" * Scope :",$scope," ")'/>
- <xsl:value-of select='concat(" * Elem :",@name," ")'/>
- <xsl:text> */ </xsl:text>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name' mode='normalize-name'/></xsl:variable>
- <xsl:text>std::ostream &</xsl:text>
- <xsl:text>operator <<(std::ostream &os,const </xsl:text>
- <xsl:value-of select="concat($scope,$class)"/><xsl:text> &obj) { </xsl:text>
- <xsl:text>/*TO BE CODED element with no type. serialize*/ </xsl:text>
- <xsl:choose>
- <xsl:when test='@name="anyType"'>
- <xsl:message terminate='no'>IMPLEMENT: anyType<xsl:value-of select="@name"/></xsl:message>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='no'>IMPLEMENT: <xsl:value-of select="@name"/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="xsd:simpleType|xsd:complexType" mode="tree-src-serialize">
- <xsl:with-param name='class' select="concat($scope,$class)"></xsl:with-param>
- <xsl:with-param name='scope' select="$scope"></xsl:with-param>
- </xsl:apply-templates>
- <xsl:value-of select='concat("","&INDENT;return os; ")'/>
- <xsl:text>} </xsl:text>
- <!-- Only complexType can have attributes -->
- <xsl:text>void </xsl:text>
- <xsl:value-of select="concat($scope,$class,'::serialize_attributes(std::ostream &os) { ')"/>
- <xsl:text>#if 1 </xsl:text>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode="tree-src-serialize"/>
- <xsl:apply-templates select="xsd:simpleContent|xsd:complexContent|xsd:choice|xsd:sequence|xsd:all" mode="tree-src-serialize-attr"/>
- <xsl:text>#endif </xsl:text>
- <xsl:text>} </xsl:text>
- <xsl:text>/* end of generate-serialize-root xsd:element </xsl:text>
- <xsl:value-of select='concat(" * Scope : ",$scope," ")'/>
- <xsl:value-of select='concat(" * Name : ",$nname," ")'/>
- <xsl:text> */ </xsl:text>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:element[not(@ref) and not(@name)]" mode='tree-src-serialize-root'>
- <xsl:param name='class'/>
- <xsl:message terminate='yes'>IMPLEMENT: <xsl:value-of select="@name"/></xsl:message>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:element[@name and @type]" mode='tree-src-serialize-root'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name' mode='normalize-name'/></xsl:variable>
- <xsl:message terminate='yes'>IMPLEMENT: <xsl:value-of select="@name"/></xsl:message>
- <xsl:text>/** Generated Serialisation of </xsl:text>
- <xsl:value-of select="concat(name(.),' cl=',$class,' el_name= ',' name=',@name,' */ ')"/>
-
- <xsl:text>std::ostream &</xsl:text>
- <xsl:text>operator <<(std::ostream &os,const </xsl:text>
- <xsl:value-of select="concat($scope,$class)"/><xsl:text> &obj) { </xsl:text>
- <xsl:text>&INDENT;os<<"<</xsl:text>
- <xsl:if test='(@form and @form="qualified") or (not(@form) and /xsd:schema/@elementFormDefault)'>
- </xsl:if>
- <xsl:value-of select='concat(@name,">; ")'/>
-
- <xsl:text>&INDENT;os<<"</</xsl:text>
- <xsl:if test='(@form and @form="qualified") or (not(@form) and /xsd:schema/@elementFormDefault)'>
- </xsl:if>
- <xsl:value-of select='concat(@name,">; ")'/>
- <xsl:value-of select='concat("","&INDENT;return os; } ")'/>
- <xsl:text>} /* tree-src-serialize-root*/ </xsl:text>
-
- <xsl:apply-templates select="." mode="gen-tree-impl-element">
- <xsl:with-param name='name' select="$nname"/>
- <xsl:with-param name='class' select="$class" />
- </xsl:apply-templates>
- </xsl:template>
-
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
- vim:ts=2:sw=2:et:bs=2:
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- version="2.0" >
-
- <!--
- ***
- *** generate-tree-skell-serialize
- ***
- Serialisation stuff comes here
- -->
- <xsl:template name="tree-src-serialize">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:variable name='el_name'>
- <xsl:value-of select='key("elementByType",@name)[1]/@name'/>
- </xsl:variable>
- <xsl:variable name='el'>
- <xsl:value-of select='key("elementByType",@name)[1]/@form'/>
- </xsl:variable>
- <xsl:variable name='elns'>
- <xsl:for-each select="namespace::*">
- <xsl:if test=".=/xsd:schema/@targetNamespace">
- <xsl:value-of select="name()"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
-
- <xsl:text>/** Generated Serialisation of </xsl:text>
- <xsl:value-of select="concat('cl=',$class,' el_name=',$el_name,' name=',@name,' ',name(.),' */ ')"/>
- <xsl:text>std::ostream &</xsl:text>
- <!-- <xsl:value-of select="$class"/> -->
- <xsl:text>operator <<(std::ostream &os,const </xsl:text>
- <xsl:value-of select="concat($scope,$class)"/><xsl:text> &obj) { </xsl:text>
- <!-- From here, I need to know if I am a simple type or an
- element or a complex type.
- It is clear to me that each element in root xsd should have an associated parser !
- As an Element refers to a type !!!! There is still a litte work to clarify the serialization
- -->
- <xsl:text> os<<"<</xsl:text>
- <xsl:if test="$el='qualified' or (/xsd:schema/@elementFormDefault='qualified' )">
- <xsl:value-of select="concat($elns,':')"/>
- </xsl:if>
- <xsl:choose>
- <xsl:when test='$el_name=""'>
- <xsl:value-of select="concat(@name,'')"/>
- <xsl:text>"; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$el_name"/>
- <xsl:if test="$el_name=$root-element">
- <xsl:apply-templates select="namespace::*" mode="generate-tree-skell-serialize-ns"/>
- <xsl:for-each select="namespace::*">
- <xsl:variable name='ns' select='.'/>
- <xsl:if test='$ns!="http://www.w3.org/XML/1998/namespace" and $ns!="http://www.w3.org/2001/XMLSchema"'>
- <xsl:text> </xsl:text>
- <xsl:value-of select="concat('xmlns:',name(),'=')"/>
- <xsl:text>\"</xsl:text>
- <xsl:value-of select="."/>
- <xsl:text>\"</xsl:text>
- </xsl:if>
- </xsl:for-each>
- </xsl:if>
- <xsl:text>"; </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <!-- add one name space on m_withNamespace-->
- <xsl:text>&INDENT;if (obj.m_withNamespace) { os<<" xmlns:</xsl:text>
- <xsl:for-each select="namespace::*">
- <xsl:if test='.=/xsd:schema/@targetNamespace'>
- <xsl:value-of select="concat(name(),'=')"/>
- <xsl:text>\"</xsl:text>
- <xsl:value-of select="."/>
- <xsl:text>\"</xsl:text>
- </xsl:if>
- </xsl:for-each>
- <xsl:text>"; &INDENT;} </xsl:text>
- <!-- Ok add attributs -->
- <xsl:apply-templates
- select="xsd:attribute|xsd:attributeGroup|xsd:simpleContent|xsd:complexContent" mode="tree-src-serialize-attr">
- </xsl:apply-templates>
- <!-- Add simpleType -->
- <xsl:apply-templates
- select="xsd:restriction|xsd:union|xsd:list"
- mode="tree-src-serialize-attr">
- </xsl:apply-templates>
- <xsl:text>/* 1 */ </xsl:text>
- <xsl:text>&INDENT;os<<">"; </xsl:text>
- <!--
- -->
- <!-- Add simpleType -->
- <xsl:apply-templates
- select="xsd:restriction|xsd:union|xsd:list"
- mode="tree-src-serialize">
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- <!-- Add elements -->
- <xsl:apply-templates
- select="xsd:choice|xsd:sequence|xsd:group|xsd:all"
- mode="tree-src-serialize">
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- <xsl:text>/* 2 */ </xsl:text>
- <xsl:apply-templates select="xsd:simpleContent|xsd:complexContent"
- mode="tree-src-serialize">
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- <!-- -->
- <xsl:text> os<<"</</xsl:text>
- <xsl:if test="$el='qualified' or /xsd:schema/@elementFormDefault='qualified'">
- <xsl:value-of select="concat($elns,':')"/>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="$el_name=''">
- <xsl:value-of select="@name"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$el_name"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>>"; } </xsl:text>
- </xsl:template>
-
-
- <!--
- ***
- *** generate-tree-skell-serialize
- ***
- That's for elements
- -->
- <!-- -->
- <xsl:template match='xsd:simpleType' mode="tree-src-serialize">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <!--
- xsl:message terminate='no'>sT:<xsl:value-of select="concat(@name,' ',$scope,' ',$class)"/></xsl:message>
- -->
- <xsl:apply-templates select="xsd:restriction|xsd:list|xsd:union" mode="tree-src-serialize">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexType[not(@name)]' mode="tree-src-serialize">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:message terminate='no'><xsl:value-of select="concat(@name,' ',$scope,' ',$class)"/></xsl:message>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode="tree-src-serialize-attr">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="xsd:simpleContent|xsd:complexContent|xsd:group|xsd:all|xsd:choice|xsd:sequence" mode="tree-src-serialize">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexType[@name]' mode="tree-src-serialize">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:message terminate='no'><xsl:value-of select="concat(@name,' ',$scope,' ',$class)"/></xsl:message>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode="tree-src-serialize-attr">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="xsd:simpleContent|xsd:complexContent|xsd:group|xsd:all|xsd:choice|xsd:sequence" mode="tree-src-serialize">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <!-- -->
- <xsl:template match="xsd:complexContent|xsd:any" mode="tree-src-serialize">
- <xsl:param name='class'/>
- <xsl:choose>
- <xsl:when test="local-name()='any'">
- <xsl:text> /* See how to treat any*/ </xsl:text>
- <xsl:text> if (obj.me_any != NULL) obj.me_any->serialize_any(os); </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>/* </xsl:text>
- <xsl:value-of select="concat(local-name(),' el ',../@name)"/>
- <xsl:text>*/ </xsl:text>
- <xsl:apply-templates select="xsd:restriction|xsd:extenstion" mode="tree-src-serialize">
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <xsl:template match='xsd:simpleContent' mode="tree-src-serialize">
- <xsl:param name='class'/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT;/* tree-src-serialize </xsl:text>
- <xsl:value-of select="concat(name(.),' parent=',name(..),' */ ')"/>
- </xsl:if>
- <xsl:apply-templates select="xsd:restriction|xsd:extension" mode="tree-src-serialize">
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match='xsd:restriction|xsd:extension' mode="tree-src-serialize">
- <xsl:param name='class'/>
- <xsl:variable name='ns'>
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@base"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT;/* tree-src-serialize </xsl:text>
- <xsl:value-of select="concat(name(.),' ns=',$ns,' parent=',name(..),' @base=',@base)"/>
- <xsl:text>*/ </xsl:text>
- </xsl:if>
- <xsl:choose>
- <xsl:when test='local-name(..)="simpleContent"'>
- <xsl:choose>
- <xsl:when test='($ns="&XSD;") and (substring-after(@base,":") = "boolean")'>
- <xsl:text>&INDENT;os<<((obj.m_content)?"true":"false"); </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>&INDENT;os<<obj.m_content; </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test='local-name(..)="complexContent"'>
- <xsl:text>/* I think this is wrong.*/ </xsl:text>
- <xsl:text>&INDENT;os<<obj.m_content; </xsl:text>
- <xsl:text>/* This should be better*/ </xsl:text>
- <xsl:apply-templates select="xsd:group|xsd:all|xsd:choice|xsd:sequence" mode="tree-src-serialize">
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='local-name(..)="simpleType"'>
- <xsl:text>&INDENT;os<<obj.m_content; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>xsl:restriction serialize untreated</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:annotation' mode="tree-src-serialize">
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:union' mode="tree-src-serialize">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:variable name='types'>
- <xsl:element name='schema' namespace="&XSD;">
- <xsl:copy-of select="namespace::*"/>
- <xsl:attribute name='targetNamespace'><xsl:value-of select="/xsd:schema/@targetNamespace"/></xsl:attribute>
- <xsl:if test="@memberTypes">
- <xsl:call-template
- name='space-string-list'>
- <xsl:with-param name='string' select='@memberTypes'/>
- </xsl:call-template>
- </xsl:if>
- <!-- ADD simple types -->
- <xsl:if test='./xsd:simpleType'><xsl:apply-templates select='./xsd:simpleType' mode='space-string-list'/></xsl:if>
- </xsl:element>
- </xsl:variable>
- <xsl:text>&INDENT;//WARNING: generate-treee-skell-serialize </xsl:text>
- <xsl:value-of select='concat(name(.)," to be coded TODO: $class=",$class," ")'/>
- <xsl:text>&INDENT;//os<<obj.m_content; </xsl:text>
- <xsl:value-of select='concat("&INDENT;switch (obj.",$cls-tree-union-selector,") { ")'/>
- <xsl:apply-templates select='$types' mode='union-switch-attributes'>
- <xsl:with-param name='class' select='$class'/>
- <xsl:with-param name='scope' select='$scope'/>
- </xsl:apply-templates>
- <xsl:text>&INDENT2;default: </xsl:text>
- <xsl:text>&INDENT;os<<"EXCEPTION :"; </xsl:text>
- <xsl:value-of select='concat("&INDENT3;os<<obj.",$cls-tree-union-selector,"; ")'/>
- <xsl:text>&INDENT3;break; </xsl:text>
- <xsl:text>&INDENT;}; </xsl:text>
- </xsl:template>
- <!-- union-switch-attributes -->
- <xsl:template match='xsd:schema' mode='union-switch-attributes'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:apply-templates mode='union-switch-attributes'>
- <xsl:with-param name='class' select='$class'/>
- <xsl:with-param name='scope' select='$scope'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:field' mode='union-switch-attributes'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:message terminate='no'>xsd2xpp-tree-header xsd:field with union-attributes @type=<xsl:value-of select="@type"/></xsl:message>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='@type' mode='restriction-base'/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='not(@type = preceding-sibling::xsd:field/@type)'>
- <xsl:value-of select='concat("&INDENT2;case ",$scope,$class,"::CHOICE_",text(),": ")'/>
- <xsl:text>&INDENT3;os<<obj.m_content.m_</xsl:text>
- <xsl:value-of select='concat(text(),"; ")'/>
- <xsl:text>&INDENT3;break; </xsl:text>
- </xsl:when>
- <xsl:when test='@type = preceding-sibling::xsd:field/@type'>
- <xsl:variable name='type' select='@type'></xsl:variable>
- <xsl:text>&INDENT2;</xsl:text><xsl:value-of select='concat("case ",scope,$class,"::CHOICE_",text(),count(preceding-sibling::xsd:field[@type=$type]),": ")'/>
- <xsl:text>&INDENT3;os<<obj.m_content.m_</xsl:text>
- <xsl:value-of select='concat(text(),"; ")'/>
- <xsl:text>&INDENT3;break; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test='position()!=last()'>
- <xsl:text> </xsl:text>
- </xsl:if>
- </xsl:template>
-
-
- <!-- -->
- <xsl:template match='xsd:attribute[@name and @type]' mode="tree-src-serialize">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:variable name='ns'></xsl:variable>
- <xsl:variable name='nm'>
- <xsl:apply-templates select="@name" mode='normalize-name'/>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT;// tree-src-serialize </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name," @type=",@type," ")'/>
- </xsl:if>
- <xsl:value-of select='concat("&INDENT;os<<me_attr_",$nm,"; ")'/>
- </xsl:template>
-
- <xsl:template match='xsd:attribute[@name and not(@type)]' mode="tree-src-serialize">
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT;// tree-src-serialize </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name)'/><xsl:text> without type to be coded </xsl:text>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attribute[@ref]' mode="tree-src-serialize">
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT;// tree-src-serialize </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref)'/><xsl:text> to be coded </xsl:text>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attributeGroup[@ref]' mode="tree-src-serialize">
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT;// tree-src-serialize </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref)'/><xsl:text> to be coded </xsl:text>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attributeGroup[@name]' mode="tree-src-serialize">
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT;// tree-src-serialize </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name)'/><xsl:text> to be coded </xsl:text>
- </xsl:if>
- </xsl:template>
- <!-- xsd:list -->
- <xsl:template match='xsd:list[@itemType]' mode="tree-src-serialize">
- <xsl:variable name='name'>
- <xsl:apply-templates select='../@name' mode='normalize-name'/>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT;// tree-src-serialize </xsl:text>
- <xsl:value-of select='concat(name(.)," @itemType=",@itemType)'/><xsl:text> to be coded </xsl:text>
- </xsl:if>
- <xsl:text>&INDENT;for(</xsl:text>
- <xsl:value-of select='concat($name,$cls-tree-suff)'/>
- <xsl:text>::const_iterator it = obj.begin() ; it != obj.end() ; ++it)</xsl:text>
- <xsl:text>&INDENT;if (it == obj.begin() ) { os<<(*it); } else </xsl:text>
- <xsl:text>os<<" "<<(*it); </xsl:text>
- </xsl:template>
-
- <xsl:template match='xsd:list[not(@itemType)]' mode="tree-src-serialize">
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>&INDENT;// tree-src-serialize </xsl:text>
- <xsl:value-of select='concat(name(.)," @itemType=",@itemType)'/><xsl:text> to be coded </xsl:text>
- </xsl:if>
- <xsl:text>&INDENT;os<<obj.m_content; </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:sequence|xsd:choice' mode="tree-src-serialize">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:apply-templates
- select="xsd:element|xsd:groupe|xsd:choice|xsd:sequence|xsd:any" mode="tree-src-serialize">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='maxOccurs'>
- <xsl:choose>
- <xsl:when test="@maxOccurs"><xsl:value-of select="@maxOccurs"/></xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:element[@ref!=""]' mode="tree-src-serialize">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='maxOccurs'/>
- <xsl:variable name='nname'>
- <xsl:apply-templates select="@ref" mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='el' select="substring-after(@ref,':')"/>
- <xsl:apply-templates select="." mode='gen-tree-impl-serialize'>
- <xsl:with-param name='class' select="$class"></xsl:with-param>
- <xsl:with-param name='name' select="$nname"/>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='maxOccurs' select="$maxOccurs"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:element[@name and not(@type)]' mode="tree-src-serialize">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='maxOccurs'>1</xsl:param>
- <xsl:variable name='nname'>
- <xsl:apply-templates select="@name" mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='ns' select='/xsd:schema/@targetNamespace'/>
- <xsl:choose>
- <xsl:when test='(@maxOccurs="unbounded") or ($maxOccurs = "unbounded")'>
- <xsl:call-template name='generate-tree-skell-serialize-sequence'>
- <xsl:with-param name='element' select="$nname"/>
- <xsl:with-param name='ns' select="$ns"/>
- <xsl:with-param name='class' select="concat($class,'')"/>
- </xsl:call-template>
-
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>&INDENT;/* Serialize element with internal type */ </xsl:text>
- <xsl:apply-templates select="." mode='gen-tree-impl-serialize'>
- <xsl:with-param name='name' select="$nname"/>
- <xsl:with-param name='class' select="concat($scope,$class)"/>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[@name!="" and @type]' mode="tree-src-serialize">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='maxOccurs'>1</xsl:param>
- <xsl:variable name='nname'>
- <xsl:apply-templates select="@name" mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="@type"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='(@maxOccurs="unbounded") or ($maxOccurs = "unbounded")'>
- <xsl:call-template name='generate-tree-skell-serialize-sequence'>
- <xsl:with-param name='element' select="$nname"/>
- <xsl:with-param name='ns' select="$ns"/>
- <xsl:with-param name='class' select="concat($class,'')"/>
- </xsl:call-template>
-
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="rootscope">
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="/xsd:schema/@targetNamespace"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:text>&INDENT;/* Serialize element with type </xsl:text>
- <xsl:value-of select="concat(@name,' ',@type)"/>
- <xsl:text>*/ </xsl:text>
- <xsl:apply-templates select="." mode='gen-tree-impl-serialize'>
- <xsl:with-param name='name' select="$nname"/>
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="/*/@*" mode="generate-tree-skell-serialize-ns">
- <xsl:text>/</xsl:text>
- <xsl:value-of select="concat(name(),' ')"/>
- </xsl:template>
-
- <xsl:template name='generate-tree-skell-serialize-sequence'>
- <xsl:param name='class'/>
- <xsl:param name='element'/>
- <xsl:param name='ns'/>
- <xsl:variable name='nname'>
- <xsl:apply-templates select="$element" mode='normalize-name'/>
- </xsl:variable>
- <xsl:text>/* generate-tree-skell-serialize-sequence </xsl:text><xsl:value-of select='concat($class," ",$element)'/><xsl:text>*/ </xsl:text>
- <xsl:text>&INDENT;</xsl:text>
- <xsl:value-of select='concat($class,"::",$element,"_sequence::const_iterator ",$element,"_it; ")'/>
- <xsl:text>&INDENT;for (</xsl:text>
- <xsl:value-of select='concat($element,"_it = obj.me_",$element,".begin(); &INDENT2;")'/>
- <xsl:value-of select='concat($element,"_it != obj.me_",$element,".end(); &INDENT2;")'/>
- <xsl:value-of select='concat($element,"_it++) { ")'/>
- <!--
- <xsl:text>&INDENT2;os<<"<</xsl:text><xsl:value-of select="$nname"/>
- <xsl:text>>"; </xsl:text>
- <xsl:text>&INDENT2;os<<*(*</xsl:text>
- -->
- <xsl:text>&INDENT2;os<<</xsl:text>
- <xsl:value-of select='concat($class,"::",$element,$elem_suff,"(((*",$element,"_it))); ")'/>
- <!--
- <xsl:text>&INDENT2;os<<"</</xsl:text><xsl:value-of select="$nname"/>
- <xsl:text>>"; </xsl:text>
- -->
- <xsl:text>&INDENT;} </xsl:text>
- </xsl:template>
- <!-- Too complex and does not work properly ! -->
- <xsl:template name='generate-tree-skell-serialize-simpletype'>
- <xsl:param name='element'/>
- <xsl:param name='ns'/>
- <xsl:variable name='nname'>
- <xsl:apply-templates select="$element" mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='stp'>
- <xsl:choose>
- <xsl:when test='substring-before(@type,":")'>
- <xsl:value-of select="key('simpleTypeByName',substring-after(@type,':'))/@name"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="key('simpleTypeByName',@type)/@name"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="elns">
- <xsl:for-each select='namespace::*'>
- <xsl:if test='.=/xsd:schema/@targetNamespace'>
- <xsl:value-of select='name()'/>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <!-- -->
- <xsl:text>&INDENT;if (</xsl:text>
- <xsl:value-of select='concat("obj.me_",$nname,"!=NULL) ")'/>
- <xsl:text> os<<</xsl:text>
- <xsl:choose>
- <xsl:when test="$ns='http://www.w3.org/2001/XMLSchema'">
- <xsl:text>"<</xsl:text>
- <xsl:if test="@form='qualified' or /xsd:schema/@elementFormDefault='qualified'">
- <xsl:value-of select='concat($elns,":")'/>
- </xsl:if>
- <xsl:value-of select="$element"/>
- <xsl:text>>"<<*obj.me_</xsl:text>
- <xsl:value-of select="$nname"/>
- <xsl:text><<"</</xsl:text>
- <xsl:if test="@form='qualified' or /xsd:schema/@elementFormDefault='qualified'">
- <xsl:value-of select='concat($elns,":")'/>
- </xsl:if>
- <xsl:value-of select="$element"/>
- <xsl:text>>"; </xsl:text>
- </xsl:when>
- <xsl:when test="$stp='0'">
- <!-- Wrong, because if they are attributes !!! -->
- <xsl:text>>"<<(*obj.me_</xsl:text>
- <xsl:value-of select="concat($element,').content()')"/>
- </xsl:when>
- <xsl:when test="$stp='1'">
- <!-- Wrong, because if they are attributes !!! -->
- <xsl:text>>"<<(*obj.me_</xsl:text>
- <xsl:value-of select="concat($element,').content()')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>*obj.me_</xsl:text>
- <xsl:value-of select="concat($element,'; ')"/>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:template>
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY PV ";">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
- ]>
-
-
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:saxon="http://exslt.org/common"
- extension-element-prefixes="saxon"
- version="2.0" >
-
-<!--
- vim:ts=2:sw=2:et:encoding=utf-8
- xmlns:saxon="http://icl.com"
--->
-
-
-
-
- <!--
- ***
- *** tree-src-setget
- ***
- should be replace by generate-tree-skell-setget
- -->
-
- <xsl:template name='tree-src-setget'>
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:text> /** * tree-src-setget </xsl:text>
- <xsl:value-of select='concat(" * ",name(.)," class=",$class)'/>
- <xsl:text>*/ </xsl:text>
- <xsl:apply-templates
- select="xsd:choice|xsd:sequence|xsd:simpleType|xsd:complexType|xsd:element|xsd:simpleContent"
- mode='tree-src-setget'>
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- <xsl:text>/* end generate tree skell post*/</xsl:text>
- </xsl:template>
-
- <xsl:template match="xsd:annotation" mode='tree-src-setget'>
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:simpleType" mode='tree-src-setget'>
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:apply-templates
- select="xsd:restriction|xsd:union|xsd:list"
- mode="tree-src-setget">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:complexType" mode='tree-src-setget'>
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:apply-templates
- select="xsd:choice|xsd:sequence|xsd:group|xsd:all|xsd:complexContent|xsd:simpleContent"
- mode="tree-src-setget">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- <!-- What happen with attributes ?-->
- <xsl:apply-templates
- select="xsd:attribute|xsd:attributeGroup"
- mode="tree-src-setget">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:restriction" mode='tree-src-setget'>
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:text>/* tree-src-setget </xsl:text>
- <xsl:value-of select='concat(name(.)," @base=",@base)'/>
- <xsl:text>*/ </xsl:text>
- <xsl:apply-templates
- select="xsd:group|xsd:all|xsd:choice|xsd:sequence"
- mode="tree-src-setget">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- <xsl:apply-templates
- select="xsd:attribute|xsd:attributeGroup"
- mode="tree-src-setget">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:extension" mode='tree-src-setget'>
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:text>/* tree-src-setget </xsl:text>
- <xsl:value-of select='concat(name(.)," @base=",@base)'/>
- <xsl:text>*/ </xsl:text>
- <xsl:apply-templates
- select="xsd:group|xsd:all|xsd:choice|xsd:sequence"
- mode="tree-src-setget">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- <xsl:apply-templates
- select="xsd:attribute|xsd:attributeGroup"
- mode="tree-src-setget">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:simpleContent" mode='tree-src-setget'>
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* tree-src-setget </xsl:text>
- <xsl:value-of select='concat(name(.)," */ ")'/>
- </xsl:if>
- <xsl:apply-templates
- select="xsd:restriction|xsd:extension"
- mode="tree-src-setget">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:complexContent" mode='tree-src-setget'>
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* tree-src-setget </xsl:text>
- <xsl:value-of select='concat(name(.)," */ ")'/>
- </xsl:if>
- <xsl:apply-templates
- select="xsd:restriction|xsd:extension"
- mode="tree-src-setget">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- LIST -->
- <xsl:template match="xsd:list[not(@itemType)]" mode='tree-src-setget'>
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:text>// tree-src-setget </xsl:text>
- <xsl:value-of select='concat(name(.)," ")'/>
- </xsl:template>
-
- <xsl:template match="xsd:list[@itemType]" mode='tree-src-setget'>
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:text>// tree-src-setget with @itemType </xsl:text>
- <xsl:value-of select='concat(name(.)," scope=",$scope," class=",$class," ")'/>
-
- <xsl:value-of select='concat($class,"& ",$scope,$class,"::operator =(const std::string &s) {"," ")'/>
- <xsl:text> std::stringstream ss(s); </xsl:text>
- <xsl:text> std::string buf; </xsl:text>
- <xsl:text> //m_content = s; </xsl:text>
- <xsl:text> while(ss>>buf) </xsl:text>
- <xsl:text> m_tokens.push_back(buf); </xsl:text>
- <xsl:text> return *this; </xsl:text>
- <xsl:text>}</xsl:text>
- </xsl:template>
-
-
-
- <!-- -->
- <xsl:template match="xsd:union" mode='tree-src-setget'>
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:text>// tree-src-setget </xsl:text>
- <xsl:value-of select='concat(name(.)," @memberTypes=",@memberTypes," ")'/>
- <xsl:apply-templates
- select="xsd:simpleType"
- mode='tree-src-setget'>
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:choice|xsd:sequence" mode='tree-src-setget'>
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:text>/** tree-src-setget </xsl:text>
- <xsl:value-of select='concat(" elem=",name(.)," ")'/>
- <xsl:value-of select='concat(" class=",$class," @maxOccurs=",@maxOccurs," ")'/>
- <xsl:value-of select='concat(" scope=",$scope,"")'/>
- <xsl:text> */ </xsl:text>
- <xsl:apply-templates
- select="xsd:choice|xsd:sequence|xsd:element|xsd:complexContent"
- mode='tree-src-setget'>
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='maxOccurs'>
- <xsl:choose>
- <xsl:when test="@maxOccurs"><xsl:value-of select="@maxOccurs"/></xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- Set Get functions -->
- <xsl:template match="xsd:element[@ref!='']" mode='tree-src-setget'>
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:param name="maxOccurs">1</xsl:param>
- <xsl:variable name='el'>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'>
- <xsl:value-of select="substring-after(@ref,':')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='@ref'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='el_type' select='key("elementByName",$el)/@type'/>
- <xsl:message terminate="no">VERIFY: setget @ref with no name <xsl:value-of select='@ref'/></xsl:message>
- <xsl:text>/** xsd2cpp-tree-src-setget </xsl:text>
- <xsl:value-of select='concat(" elem=",name(.)," @ref=",@ref)'/>
- <xsl:value-of select='concat(" * class=",$class," @maxOccurs=",@maxOccurs," ")'/>
- <xsl:value-of select='concat(" * scope=",$scope,"")'/>
- <xsl:text> */ </xsl:text>
- <xsl:apply-templates select="." mode="gen-tree-impl-setget">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='maxOccurs' select="$maxOccurs"/>
- <xsl:with-param name="name">
- <xsl:apply-templates select="@ref" mode='normalize-name'/>
- </xsl:with-param>
- <xsl:with-param name="eltype">
- <xsl:apply-templates select="$el_type" mode="restriction-base"/>
- </xsl:with-param>
- </xsl:apply-templates>
- <xsl:if test="/xsd:schema/xsd:element[@name=$el]/@abstract">
- <xsl:text>#if 0 </xsl:text>
- <xsl:apply-templates select="/xsd:schema/xsd:element[@name=$el]" mode="tree-src-setget">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='maxOccurs' select="$maxOccurs"/>
- <xsl:with-param name="name">
- <xsl:apply-templates select="@ref" mode='normalize-name'/>
- </xsl:with-param>
- <xsl:with-param name="baseclass">
- <xsl:apply-templates select="@ref" mode='normalize-name'/>
- </xsl:with-param>
- <xsl:with-param name="eltype">
- <xsl:apply-templates select="$el_type" mode="restriction-base"/>
- </xsl:with-param>
- </xsl:apply-templates>
- <xsl:text>#endif </xsl:text>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="xsd:element[@name and not(@type) and @abstract and @abstract='true']" mode='tree-src-setget'>
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:param name="maxOccurs">1</xsl:param>
- <xsl:param name="baseclass"></xsl:param>
- <xsl:variable name='local-name'>
- <xsl:choose>
- <xsl:when test='contains(@name,":")'> <xsl:value-of select="substring-after(@name,':')"/></xsl:when>
- <xsl:otherwise><xsl:value-of select='@name'/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>/** xsd2cpp-tree-src-setget </xsl:text>
- <xsl:value-of select='concat(" elem=",name(.)," @name=",@name)'/>
- <xsl:value-of select='concat(" * class=",$class," @maxOccurs=",@maxOccurs," ")'/>
- <xsl:value-of select='concat(" * scope=",$scope," * abstract $baseclass=",$baseclass)'/>
- <xsl:text> */ </xsl:text>
- <xsl:apply-templates select="/xsd:schema/xsd:element[@equivClass=$local-name]" mode="tree-src-setget">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='baseclass' select="$baseclass"/>
- <xsl:with-param name='maxOccurs' select="$maxOccurs"/>
- <xsl:with-param name="name">
- <xsl:apply-templates select="@name" mode='normalize-name'/>
- </xsl:with-param>
- <xsl:with-param name="eltype">
- <xsl:apply-templates select="@type" mode="restriction-base"/>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
- <!-- Element with internal type... -->
- <xsl:template match="xsd:element[@name and not(@type) and not(@abstract)]" mode='tree-src-setget'>
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:param name="maxOccurs">1</xsl:param>
- <xsl:param name="baseclass"></xsl:param>
- <xsl:variable name='nname'>
- <xsl:apply-templates select="@name" mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='el' select="$nname"/>
- <xsl:variable name='el_type' select='$nname'/>
- <xsl:message terminate="no">VERIFY: setget with no type <xsl:value-of select='@name'/></xsl:message>
- <xsl:text>// Element without type tree-src-setget </xsl:text>
- <xsl:value-of select="@name"/>
- <xsl:text> </xsl:text>
- <xsl:choose>
- <xsl:when test='@maxOccurs="unbounded" or $maxOccurs="unbounded"'>
- <xsl:apply-templates select="." mode="gen-tree-impl-setget">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name="name" select="$nname"/>
- <xsl:with-param name='maxOccurs' select="$maxOccurs"/>
- <xsl:with-param name="eltype" select="$el_type"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='number(@maxOccurs)>1 or number($maxOccurs)>1'>
- <xsl:message terminate='no'>TO BE CODED <xsl:value-of
- select="concat(@name,' ',@maxOccurs)"/></xsl:message>
- <xsl:apply-templates select="." mode="gen-tree-impl-setget">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name="name" select="$nname"/>
- <xsl:with-param name='maxOccurs' select="$maxOccurs"/>
- <xsl:with-param name="eltype" select="$el_type"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test='number(@maxOccurs)=1 or number($maxOccurs)=1'>
- <!-- I need to add the auto_ptr function functions .... -->
- <xsl:choose>
- <xsl:when test='./xsd:simpleType or ./xsd:complexType'>
- <xsl:value-of select='concat(" void ",$class,"::",$el,"(",$el,"_skel &v) { ") '/>
- <xsl:value-of select='concat("&INDENT;",$cls-tree-mbr-elem-prefix,$el,".reset(new ",$el,"_skel(v)); /* BUG */ } ")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat(" void ",$class,"::",$el,"(",$class,"::",$el,"_type &v) { ") '/>
- <xsl:value-of select='concat("&INDENT;",$cls-tree-mbr-elem-prefix,$el,".reset( new ",$class,"::",$el,"_type(v)); /* BUG */ } ")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'><xsl:value-of select='concat(@ref," ",$maxOccurs)'/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select='xsd:simpleType|xsd:complexType'
- mode='tree-src-setget'>
- <xsl:with-param name='class' select='concat($nname,"_skel")'/>
- <xsl:with-param name='scope' select='concat($class,"::")'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:group[@ref]" mode='tree-src-setget'>
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:param name="maxOccurs">1</xsl:param>
- <xsl:param name="baseclass"></xsl:param>
- <xsl:variable name='local-name'>
- <xsl:choose>
- <xsl:when test='contains(@ref,":")'><xsl:value-of select='substring-after(@ref,":")'/></xsl:when>
- <xsl:otherwise><xsl:value-of select='@ref'/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>/** xsd2cpp-tree-src-setget </xsl:text>
- <xsl:value-of select='concat(" elem=",name(.)," @ref=",@ref)'/>
- <xsl:value-of select='concat(" scope=",$scope," abstract $baseclass=",$baseclass)'/>
- <xsl:text> */ </xsl:text>
- <xsl:apply-templates select='/xsd:schema/xsd:group[@name=$local-name]'
- mode='tree-src-setget'>
- <xsl:with-param name='class' select='concat($class,"")'/>
- <xsl:with-param name='scope' select='concat($scope,"")'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:group[@name]" mode='tree-src-setget'>
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:param name="maxOccurs">1</xsl:param>
- <xsl:param name="baseclass"></xsl:param>
- <xsl:apply-templates select='xsd:sequence|xsd:choice|xsd:all'
- mode='tree-src-setget'>
- <xsl:with-param name='class' select='concat($class,"")'/>
- <xsl:with-param name='scope' select='concat($scope,"")'/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@name and @type]" mode='tree-src-setget'>
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:param name="maxOccurs">1</xsl:param>
- <xsl:param name="baseclass"></xsl:param>
- <xsl:variable name='nname'>
- <xsl:apply-templates select="@name" mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='ns'><xsl:apply-templates select='@type' mode='namespace-uri-of-qname'/></xsl:variable>
- <xsl:variable name='cpp_type'>
- <xsl:choose>
- <xsl:when test='@type'>
- <xsl:apply-templates select='@type' mode='restriction-base'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat($nname,"_skel")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>/** xsd2cpp-tree-src-setget </xsl:text>
- <xsl:value-of select='concat(" elem=",name(.)," @name=",@name," @type=",@type)'/>
- <xsl:value-of select='concat(" * class=",$class," @maxOccurs=",@maxOccurs," ")'/>
- <xsl:value-of select='concat(" * scope=",$scope," * abstract $baseclass=",$baseclass)'/>
- <xsl:text> */ </xsl:text>
- <xsl:choose>
- <xsl:when test='(@maxOccurs="unbounded") or ($maxOccurs="unbounded")'>
- <xsl:text>/*TO BE CODED sequence */ </xsl:text>
- <xsl:apply-templates select="." mode="gen-tree-impl-setget">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name="name" select="$nname"/>
- <xsl:with-param name="baseclass" select="$baseclass"/>
- <xsl:with-param name="eltype" select="$cpp_type"/>
- <xsl:with-param name='maxOccurs' select="$maxOccurs"/>
- </xsl:apply-templates>
- <xsl:text>/*blblbl*/ </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="." mode="gen-tree-impl-setget">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name="name">
- <xsl:value-of select="$nname"/>
- </xsl:with-param>
- <xsl:with-param name="baseclass" select="$baseclass"/>
- <xsl:with-param name="eltype" select="$cpp_type"/>
- <xsl:with-param name='maxOccurs' select="$maxOccurs"/>
- </xsl:apply-templates>
- <xsl:text>/*blblbl 2*/ </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- -->
- <xsl:template match="xsd:attribute[@ref]" mode='tree-src-setget'>
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:param name="maxOccurs">1</xsl:param>
- <xsl:variable name='el' >
- <xsl:choose>
- <xsl:when test='substring-after(@ref,":")!=""'> <xsl:value-of select="substring-after(@ref,':')"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="@ref"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:apply-templates select="@ref" mode='namespace-uri-of-qname'>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:variable name="cpp_ns">
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="$ns"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:text>/* tree-src-setget </xsl:text>
- <xsl:value-of select='concat(name(.)," @ref=",@ref)'/>
- <xsl:text>*/ </xsl:text>
- <xsl:message terminate="no">VERIFY: setget @ref with no name <xsl:value-of select='@ref'/></xsl:message>
- <xsl:apply-templates select="." mode="gen-tree-impl-setget">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name="name" select="$el"/>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name="eltype">
- <xsl:choose>
- <xsl:when test='($ns="&XSD;") or ($ns=/xsd:schema/@targetNamespace)'>
- <xsl:choose>
- <xsl:when test='@use and @use!="optional"'>
- <xsl:value-of select='concat($el,"_attr_type")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat($el,"_optional")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat($cpp_ns,"::",$el,"_attr_type")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@name and @type]" mode='tree-src-setget'>
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:variable name='nname'>
- <xsl:apply-templates select="@name" mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:apply-templates select="@type" mode='namespace-uri-of-qname'>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:variable name="cpp_ns">
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="$ns"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* tree-src-setget </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name," @type=",@type," */ ")'/>
- </xsl:if>
- <xsl:apply-templates select="." mode="gen-tree-impl-setget">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name="name" select="$nname"/>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name="eltype">
- <xsl:choose>
- <xsl:when test='($ns="&XSD;") or ($ns=/xsd:schema/@targetNamespace)'>
- <xsl:value-of select='concat($nname,"_attr_type")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat($cpp_ns,"::",$nname,"_attr_type")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@name and not(@type)]" mode='tree-src-setget'>
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:variable name='nname'>
- <xsl:apply-templates select="@name" mode='normalize-name'/>
- </xsl:variable>
- <xsl:variable name='cpp_type'>
- <xsl:apply-templates select='./xsd:simpleType'
- mode='attribute-internal-cpp-type'/>
- </xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>/* tree-src-setget for xsd:attribute name not type </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name," no type */ ")'/>
- </xsl:if>
-
- <!-- This is an internal type. Generate the implementation of the simpleType-->
-
- <xsl:apply-templates select='./xsd:simpleType|./xsd:complexType' mode='class-tree-skel-source'>
- <xsl:with-param name='class' select="concat($nname,'_skel')"/>
- <xsl:with-param name='name' select="concat($nname,'')"/>
- <xsl:with-param name='scope' select="concat($class,'::')" />
- </xsl:apply-templates>
-
- <xsl:apply-templates select="." mode="gen-tree-impl-setget">
- <xsl:with-param name="class" select="$class"/>
- <xsl:with-param name="name" select="$nname"/>
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name="eltype">
- <xsl:choose>
- <xsl:when test='@use and @use="prohibited"'>
- <xsl:value-of select='concat($nname,"_attr_type")'/>
- </xsl:when>
- <xsl:when test='@use and @use="required"'>
- <xsl:value-of select='concat($nname,"_attr_type")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat($nname,"_optional")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attributeGroup[@name]" mode='tree-src-setget'>
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:text>/* post method for xsd:attributeGroup name*/ </xsl:text>
- <xsl:apply-templates mode="tree-src-setget"
- select="xsd:attribute">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attributeGroup[@ref]" mode='tree-src-setget'>
- <xsl:param name="class"/>
- <xsl:param name="scope"/>
- <xsl:variable name='ns'><xsl:apply-templates select='@ref' mode='namespace-uri-of-qname'/></xsl:variable>
- <xsl:text>/* post method for xsd:attributeGroup */ </xsl:text>
- <xsl:apply-templates mode="tree-src-setget"
- select="key('attrGroup',substring-after(@ref,':'))/*">
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- </xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
- vim:ts=2:sw=2:et:bs=2:
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- version="2.0" >
-
- <!--
- This file will contain the necessary stuff
- to create the parser objects.
- Parser works all
- complexType,simpleType, extension, sequence,choice
-
- -->
-
- <xsl:template name='generateTreeSkel'>
- <xsl:param name='dir'>test</xsl:param>
- <xsl:call-template name='generateTreeSkel_header-one'>
- <xsl:with-param name='dir' select="concat($dir,$incdir)"/>
- </xsl:call-template>
- <xsl:call-template name='generateTreeSkel_source-one'>
- <xsl:with-param name='dir' select="concat($dir,$srcdir)"/>
- </xsl:call-template>
- </xsl:template>
-
- <!--
- Generate headers
- -->
-
- <!-- -->
- <xsl:template match="xsd:import" mode='include-tree'>
-
- <xsl:choose>
- <xsl:when test="document(@schemaLocation)">
- <xsl:text>#include <</xsl:text>
- <xsl:value-of
- select="concat(substring-before(@schemaLocation,'.xsd'),'.h')"/>
- <xsl:text>> </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>/* import not supported */ </xsl:text>
- <xsl:message terminate='no'>TO BE CODED</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- What are complex types made of ?? -->
- <!--
- Generate headers
- -->
-
- <!--
- We also need an implementation of the skeleton object.
- -->
- <xsl:template name='generateTreeSkel_source-one'>
- <xsl:param name='dir'>res</xsl:param>
- <xsl:variable name='filename-org'>
- <xsl:call-template name='basename'>
- <xsl:with-param name='path' select="document-uri(/)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='ns'>
- <xsl:call-template name='basename'>
- <xsl:with-param name='path' select="/xsd:schema/@targetNamespace"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name='filename'
- select='concat($dir,"/",substring-before($filename-org,".xsd"),".cpp")'/>
- <xsl:message>* * Generate Tree Source * </xsl:message>
- <!-- We need to create a file per complex type
- -->
- <xsl:result-document href="{$filename}" format="text">
- <xsl:text> </xsl:text>
- <xsl:text> #include <string></xsl:text>
- <xsl:text> #include <iostream></xsl:text>
- <xsl:text> #include <sstream></xsl:text>
- <xsl:text> #include <vector></xsl:text>
- <xsl:text> #include <xsd/xsd.h> </xsl:text>
- <xsl:text>#include <xmlSerialize.h> </xsl:text>
- <xsl:text>/* Include imports */ </xsl:text>
- <!-- Include imports -->
- <xsl:apply-templates select='/xsd:schema/xsd:import' mode='include-tree'/>
- <xsl:text>#include <</xsl:text><xsl:value-of select="concat(substring-before($filename-org,'.xsd'),'.h')"/><xsl:text>> </xsl:text>
- <!-- DEBUG MACRO-->
- <xsl:text>&CR;/* DEBUG MACRO */ </xsl:text>
- <xsl:text>#ifdef DEBUG&CR;</xsl:text>
- <xsl:text>#define LOG_DEBUG(f) do {} while (0)&CR;</xsl:text>
- <xsl:text>#define LOG_DEBUG_FMT(f,args...) do {} while (0)&CR;</xsl:text>
- <xsl:text>#define LOG_DEBUG_CONSTRUCT(f) do {} while (0)&CR;</xsl:text>
- <xsl:text>#define LOG_DEBUG_CONSTRUCT_FMT(f,args...) do {} while (0)&CR;</xsl:text>
- <xsl:text>#define LOG_INFO_FMT(f,args...) do {} while (0)&CR;</xsl:text>
- <xsl:text>#define LOG_ERROR_FMT(f,args...) do {} while (0)&CR;</xsl:text>
- <xsl:text>#else&CR;</xsl:text>
- <xsl:text>#define LOG_DEBUG(f) do {} while (0)&CR;</xsl:text>
- <xsl:text>#define LOG_DEBUG_CONSTRUCT(f) do {} while (0)&CR;</xsl:text>
- <xsl:text>#define LOG_DEBUG_FMT(f,args...) do {} while (0)&CR;</xsl:text>
- <xsl:text>#define LOG_INFO_FMT(f,args...) do {} while (0)&CR;</xsl:text>
- <xsl:text>#define LOG_ERROR_FMT(f,args...) do {} while (0)&CR;</xsl:text>
- <xsl:text>#endif&CR;</xsl:text>
- <xsl:text> namespace </xsl:text>
- <!--
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="/xsd:schema/@targetNamespace"/>
- </xsl:call-template>
- -->
- <xsl:value-of select="$namespace"/>
- <xsl:text> { </xsl:text>
- <!-- Declare classes
- -->
- <xsl:apply-templates select="/xsd:schema" mode='class-tree-skel-source-root'/>
- <!-- Factory code comes here -->
- <xsl:text>Factory::ptCreate Factory::m_creators[] = { NULL/* Elements start a 1 */, </xsl:text>
- <xsl:apply-templates select="/xsd:schema" mode='class-tree-skel-source-create'/>
- <xsl:text>NULL}; </xsl:text>
- <xsl:text>xmlSerializer *Factory::create(int type) { </xsl:text>
- <xsl:text>&INDENT;if (m_creators[type] != NULL ) { </xsl:text>
- <xsl:text>&INDENT2;return m_creators[type](); </xsl:text>
- <xsl:text>&INDENT;} else </xsl:text>
- <xsl:text>&INDENT2;return new xmlSerializer(); </xsl:text>
- <xsl:text> } </xsl:text>
- <xsl:text> } </xsl:text>
- </xsl:result-document>
- </xsl:template>
-
- <!--
- ***
- *** class-tree-skel-source-create
- ***
- -->
- <xsl:template name="gen-con">
- <xsl:param name="name"/>
- <xsl:param name="position"/>
- <xsl:value-of select='concat("&INDENT;",$name,"_skel::createInstance ",",")'/>
- <xsl:text>/* </xsl:text>
- <xsl:value-of select='concat($name,"_skel::createInstance ",$position)'/>
- <xsl:text>*/ </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:schema" mode="class-tree-skel-source-create">
- <xsl:apply-templates select="xsd:simpleType|xsd:complexType|xsd:element|xsd:attribute"
- mode="class-tree-skel-source-create">
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:simpleType[@name]" mode="class-tree-skel-source-create">
- <xsl:variable name='c'>
- <xsl:number level="any" from="/" format="1" grouping-size="3" count='xsd:simpleType|xsd:complexType'/>
- </xsl:variable>
- <xsl:call-template name="gen-con">
- <xsl:with-param name='name'>
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:with-param>
- <xsl:with-param name='position' select="$c"/>
- </xsl:call-template>
- <xsl:apply-templates select="xsd:union" mode="class-tree-skel-source-create-int">
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:simpleType[not(@name)]" mode="class-tree-skel-source-create">
- <xsl:param name="name"/>
- <xsl:variable name='c'>
- <xsl:number level="any" from="/" format="1" grouping-size="3" count='xsd:simpleType|xsd:complexType'/>
- </xsl:variable>
- <xsl:call-template name="gen-con">
- <xsl:with-param name='name' select="$name">
- </xsl:with-param>
- <xsl:with-param name='position' select="$c"/>
- </xsl:call-template>
- <xsl:apply-templates select="xsd:simpleContent" mode="class-tree-skel-source-create-int">
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:complexType[@name]" mode="class-tree-skel-source-create">
- <xsl:variable name='c'>
- <xsl:number level="any" from="/" format="1" grouping-size="3" count='xsd:simpleType|xsd:complexType'/>
- </xsl:variable>
- <xsl:variable name='name'>
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
- <xsl:call-template name="gen-con">
- <xsl:with-param name='name'>
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:with-param>
- <xsl:with-param name='position' select="$c"/>
- </xsl:call-template>
- <xsl:apply-templates select="xsd:simpleContent|xsd:complexCotent|xsd:restriction|xsd:extension|xsd:sequence" mode="class-tree-skel-source-create-int">
- <xsl:with-param name="scope" select="concat($name,'_skel')">
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:complexType[not(@name)]" mode="class-tree-skel-source-create">
- <xsl:param name="name"/>
- <xsl:variable name='c'>
- <xsl:number level="any" from="/" format="1" grouping-size="3" count='xsd:simpleType|xsd:complexType'/>
- </xsl:variable>
- <xsl:call-template name="gen-con">
- <xsl:with-param name='name' select="$name">
- </xsl:with-param>
- <xsl:with-param name='position' select="$c"/>
- </xsl:call-template>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@ref]" mode="class-tree-skel-source-create">
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@name and not(@type)]" mode="class-tree-skel-source-create">
- <xsl:variable name='c'>
- <xsl:number level="any" from="/" format="1" grouping-size="3" count='xsd:simpleType|xsd:complexType'/>
- </xsl:variable>
- <xsl:if test='./xsd:simpleType|./xsd:complexType'>
- <xsl:apply-templates select="xsd:simpleType|xsd:complexType" mode="class-tree-skel-source-create">
- <xsl:with-param name='name'>
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@name and @type]" mode="class-tree-skel-source-create">
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@ref]" mode="class-tree-skel-source-create">
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@name and not(@type)]" mode="class-tree-skel-source-create">
- <xsl:apply-templates select="xsd:simpleType|xsd:complexType" mode="class-tree-skel-source-create">
- <xsl:with-param name='name'>
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@name and @type]" mode="class-tree-skel-source-create">
- </xsl:template>
-
-
- <!--
- ***
- *** class-tree-skel-source-create-int
- ***
- -->
- <!-- -->
- <xsl:template match="xsd:simpleType" mode="class-tree-skel-source-create-int">
- <xsl:param name="scope"/>
- <xsl:text>&INDENT;NULL,</xsl:text>
- <xsl:value-of select='concat("/* paren=",name(..)," is null */ ")'/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:complextype" mode="class-tree-skel-source-create-int">
- <xsl:param name="scope"/>
- </xsl:template>
- <xsl:template match="xsd:simpleContent" mode="class-tree-skel-source-create-int">
- <xsl:param name="scope"/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:complexContent" mode="class-tree-skel-source-create-int">
- <xsl:param name="scope"/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:restriction" mode="class-tree-skel-source-create-int">
- <xsl:param name="scope"/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:extension" mode="class-tree-skel-source-create-int">
- <xsl:param name="scope"/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:union" mode="class-tree-skel-source-create-int">
- <xsl:param name="scope"/>
- <xsl:apply-templates select="xsd:simpleType" mode='class-tree-skel-source-create-int'>
- <xsl:with-param name="scope" select="$scope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:sequence|xsd:choice" mode="class-tree-skel-source-create-int">
- <xsl:param name="scope"/>
- <xsl:apply-templates select="xsd:element|xsd:choice|xsd:sequence" mode='class-tree-skel-source-create-int'>
- <xsl:with-param name="scope" select="$scope"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@ref]|xsd:element[@name and @type]" mode="class-tree-skel-source-create-int">
- <xsl:param name="scope"/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@name and not(@type)]" mode="class-tree-skel-source-create-int">
- <xsl:param name="scope"/>
- <xsl:variable name='c'>
- <xsl:number level="any" from="/" format="1" grouping-size="3" count='xsd:simpleType|xsd:complexType'/>
- </xsl:variable>
- <xsl:apply-templates select="xsd:simpleType|xsd:complexType" mode='class-tree-skel-source-create'>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="name" select="concat($scope,'::',@name)"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute" mode="class-tree-skel-source-create-int">
- <xsl:param name="scope"/>
- </xsl:template>
-
- <!--
- ***
- ***
- ***
- -->
- <!-- class-tree-skel-source-root -->
- <xsl:template match='xsd:schema' mode='class-tree-skel-source-root'>
- <xsl:variable name="scope">
- <xsl:value-of select="$namespace"/>
- </xsl:variable>
- <xsl:apply-templates select='xsd:simpleType|xsd:complexType' mode='class-tree-skel-source-root'>
- <!--
- <xsl:with-param name="scope" select="$scope"/>
- -->
- </xsl:apply-templates>
- <xsl:apply-templates select='xsd:element|xsd:attribute|xsd:group|xsd:attributeGroup' mode='class-tree-skel-source-root'>
- <!--
- <xsl:with-param name="scope" select="$scope"/>
- -->
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match='xsd:annotation' mode='class-tree-skel-source-root'>
- </xsl:template>
- <xsl:template match='xsd:import' mode='class-tree-skel-source-root'>
- <xsl:message terminate='yes'>STOP <xsl:value-of select="concat(name(.),' ')"/></xsl:message>
- </xsl:template>
- <xsl:template match='xsd:include' mode='class-tree-skel-source-root'>
- <xsl:message terminate='yes'>STOP <xsl:value-of select="concat(name(.),' ')"/></xsl:message>
- </xsl:template>
-
- <xsl:template match='xsd:element[@ref]' mode='class-tree-skel-source-root'>
- <xsl:message terminate='yes'>STOP <xsl:value-of select="concat(name(.),' ',@ref)"/></xsl:message>
- </xsl:template>
- <xsl:template match='xsd:element[@name and @type]' mode='class-tree-skel-source-root'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name' mode='normalize-name'/></xsl:variable>
- <xsl:apply-templates select="." mode="gen-tree-impl-element">
- <xsl:with-param name='name' select="$nname"/>
- <xsl:with-param name='class' select="$class" />
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[@name and not(@type)]' mode='class-tree-skel-source-root'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name' mode='normalize-name'/></xsl:variable>
- <xsl:message terminate='no'>WARNING Implement <xsl:value-of select="concat(name(.),' ',$nname,' of internal type')"/></xsl:message>
- <xsl:text>/* class-tree-skel-source-root SPECIAL CASE*/ </xsl:text>
- <xsl:apply-templates select="./xsd:complexType|./xsd:simpleType" mode='class-tree-skel-source'>
- <xsl:with-param name='class' select="concat($nname,'_skel')"/>
- <xsl:with-param name='scope' select='concat($scope,"")'/>
- <xsl:with-param name='name' select="$nname"/>
- </xsl:apply-templates>
- <xsl:text> </xsl:text>
-
- <xsl:text>/* class-tree-skel-source-root SPECIAL CASE </xsl:text>
- <xsl:value-of select='concat(" * Name : ",$nname," ")'/>
- <xsl:value-of select='concat(" * scope : ",$scope," ")'/>
- <xsl:text>*/ </xsl:text>
- <xsl:apply-templates select="." mode="tree-src-serialize-element">
- <xsl:with-param name='name' select="$nname"/>
- <xsl:with-param name='class' select="$class" />
- <xsl:with-param name='scope' >
- <xsl:if test='$scope!=""'>
- <xsl:value-of select="concat($scope,'::','')" />
- </xsl:if>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:attribute[@ref]' mode='class-tree-skel-source-root'>
- <xsl:param name='scope'/>
- <xsl:text>/** class-tree-skel-source-root Should not happen xsd:attribute[@ref] **/ </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attribute[@name and not (@type)]' mode='class-tree-skel-source-root'>
- <xsl:param name='scope'/>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name' mode='normalize-name'/></xsl:variable>
- <xsl:apply-templates select='./xsd:simpleType|./xsd:complexType' mode='class-tree-skel-source'>
- <xsl:with-param name='class' select="concat($nname,'_skel')"/>
- <xsl:with-param name='name' select="concat($nname,'')"/>
- <xsl:with-param name='scope' select="concat($scope,'')" />
- </xsl:apply-templates>
- <xsl:text> </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attribute[@name and @type]' mode='class-tree-skel-source-root'>
- <xsl:param name='scope'/>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name' mode='normalize-name'/></xsl:variable>
- <xsl:message terminate='no'>WARNING <xsl:value-of select="concat(name(.),' ',$nname,' ',@type)"/></xsl:message>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:simpleType' mode='class-tree-skel-source-root'>
- <xsl:param name='scope'/>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name' mode='normalize-name'/></xsl:variable>
- <xsl:apply-templates select="." mode='class-tree-skel-source'>
- <xsl:with-param name='class' select="concat($nname,'_skel')"/>
- <xsl:with-param name='scope' select="concat($scope,'')" />
- </xsl:apply-templates>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="." mode="tree-src-serialize-element">
- <xsl:with-param name='name' select="$nname"/>
- <xsl:with-param name='scope' select="concat($scope,'')" />
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexType' mode='class-tree-skel-source-root'>
- <xsl:param name='scope'/>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name' mode='normalize-name'/></xsl:variable>
- <xsl:apply-templates select="." mode='class-tree-skel-source'>
- <xsl:with-param name='class' select="concat($nname,'_skel')"/>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- <xsl:text> </xsl:text>
- <xsl:text>#if 1 </xsl:text>
- <xsl:apply-templates select="." mode="tree-src-serialize-element">
- <xsl:with-param name='name' select="$nname"/>
- <xsl:with-param name='class' select="concat($nname,'_skel')" />
- <xsl:with-param name='scope' >
- <xsl:choose>
- <xsl:when test='$scope!=""'>
- <xsl:value-of select="concat($scope,'::',$nname,'_skel::')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('',$nname,'_skel::')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- <xsl:text>#endif </xsl:text>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:group' mode='class-tree-skel-source-root'>
- <xsl:param name='scope'/>
- <xsl:text>// group </xsl:text>
- <xsl:value-of select="concat(@name,' not yet ')"/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attributeGroup[@name]' mode='class-tree-skel-source-root'>
- <xsl:param name='scope'/>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name' mode='normalize-name'/></xsl:variable>
- <xsl:if test='$debug-comment="yes"'>
- <xsl:text>// class-tree-skel-source-root </xsl:text>
- <xsl:value-of select='concat(name(.)," @name=",@name," not yet ")'/>
- </xsl:if>
- <xsl:apply-templates select="xsd:attribute" mode='class-tree-skel-source-root'>
- <xsl:with-param name='class' select="concat($nname,'_skel')" />
- <xsl:with-param name='scope' >
- <xsl:choose>
- <xsl:when test='$scope!=""'>
- <xsl:value-of select="concat($scope,'::',$nname,'_attrg_type::')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('',$nname,'_attrg_type::')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:attributeGroup[@ref]' mode='class-tree-skel-source-root'>
- <xsl:text>// attributeGroup </xsl:text>
- <xsl:value-of select="concat(@ref,' not yet ')"/>
- </xsl:template>
-
-
- <!--
- ***
- *** class-tree-skel-source
- ***
- 4 periods , constructors - serialization, seter, getter have to be generated
- for complexTy
- -->
- <!-- -->
- <xsl:template match='xsd:simpleContent' mode='class-tree-skel-source'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:apply-templates select="xsd:restriction|xsd:extension">
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:complexContent' mode='class-tree-skel-source'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:apply-templates select="xsd:restriction|xsd:extension">
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:restriction|xsd:extension' mode='class-tree-skel-source'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:sequence' mode='class-tree-skel-source'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:apply-templates select="xsd:element|xsd:group|xsd:choice|xsd:sequence|xsd:any">
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='maxOccurs'>
- <xsl:choose>
- <xsl:when test="@maxOccurs"><xsl:value-of select="@maxOccurs"/></xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:choice' mode='class-tree-skel-source'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:apply-templates select="xsd:element|xsd:group|xsd:choice|xsd:sequence|xsd:any">
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='maxOccurs'>
- <xsl:choose>
- <xsl:when test="@maxOccurs"><xsl:value-of select="@maxOccurs"/></xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:all' mode='class-tree-skel-source'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:apply-templates select="xsd:element">
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:group' mode='class-tree-skel-source'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:apply-templates select="xsd:all|xsd:choice|xsd:sequence">
- <xsl:with-param name='scope' select="$scope"/>
- <xsl:with-param name='class' select="$class"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[@name and not(@type)]' mode='class-tree-skel-source'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:variable name='nname' ><xsl:apply-templates select='@name' mode='normalize-name'/></xsl:variable>
- <xsl:text>/*class-tre-skel-source ELEMENT WITHOUT TYPE */ </xsl:text>
- <xsl:apply-templates select="./xsd:simpleType|./xsd:complexType" mode='class-tree-skel-source'>
- <xsl:with-param name='class' select="concat($nname,'_skel')"/>
- <xsl:with-param name='scope' select="$scope"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="." mode="gen-tree-impl-element">
- <xsl:with-param name='name' select="$nname"/>
- <xsl:with-param name='class' select="$class"/>
- <xsl:with-param name='scope' select="concat($scope,'')"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:annotation' mode='class-tree-skel-source'>
- <xsl:message>/**/</xsl:message>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:element[@name and @type]' mode='class-tree-skel-source'>
- <xsl:param name='scope'/>
- <xsl:param name='class'/>
- <xsl:message terminate='yes'>To see</xsl:message>
- </xsl:template>
-
- <!--
- Complex method I might think to split it again.
- $name is given for root element and integrated type
- -->
- <xsl:template match='xsd:complexType|xsd:simpleType' mode='class-tree-skel-source'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:param name='name'/>
- <xsl:variable name='cname' >
- <xsl:choose>
- <xsl:when test='@name'><xsl:apply-templates select='@name' mode='normalize-name'/></xsl:when>
- <xsl:otherwise><xsl:value-of select="$name"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>/* START class-tree-skel-source * New class implementation generation </xsl:text>
- <xsl:value-of select='concat(" * Element :",name(.)," tp",@type," rt nm=",../@name," ")'/>
- <xsl:value-of select='concat(" * Name :",@name," $name=",$name," ")'/>
- <xsl:value-of select='concat(" * Type :",@type," ")'/>
- <xsl:value-of select='concat(" * scope :",$scope," ")'/>
- <xsl:text> */ </xsl:text>
- <xsl:call-template name='generate-tree-skell-constructor'>
- <xsl:with-param name='class' select="concat($cname,'_skel')"/>
- <xsl:with-param name='scope' select="concat($scope,'')"/>
- </xsl:call-template>
-
- <xsl:apply-templates select="." mode='generate-tree-create-instance'>
- <xsl:with-param name='class' select="concat($cname,'_skel')"/>
- <xsl:with-param name='scope' select="concat($scope,'')"/>
- </xsl:apply-templates>
-
- <!-- Try to generate constructors for elements without type -->
- <xsl:for-each select='(.//xsd:element)[not(@type) and @name]'>
- <xsl:text> /* Internal Elements without type </xsl:text>
- <xsl:value-of select='./@name'/><xsl:text> */ </xsl:text>
- <xsl:if test='./xsd:simpleType or ./xsd:complexType'>
- <xsl:call-template name='generate-tree-skell-constructor'>
- <xsl:with-param name='class'
- select="concat(./@name,'_skel')"/>
- <xsl:with-param name='scope'>
- <xsl:choose>
- <xsl:when test='$scope!=""'>
- <xsl:value-of select="concat($scope,'::',$cname,'_skel::')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($cname,'_skel::')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- <xsl:apply-templates select="." mode='generate-tree-create-instance'>
- <xsl:with-param name='class' select="concat(./@name,'_skel')"/>
- <xsl:with-param name='scope'>
- <xsl:choose>
- <xsl:when test='$scope!=""'>
- <xsl:value-of select="concat($scope,'::',$cname,'_skel::')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($cname,'_skel::')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:for-each>
- <xsl:text>/* class tree-skel-source </xsl:text><xsl:value-of select="name(.)"/>
- <xsl:text> implementation generation after constructor*/ </xsl:text>
- <xsl:choose>
- <xsl:when test='local-name(.)= "simpleType"'>
- <xsl:apply-templates select='.' mode='tree-src-serialize-root'>
- <xsl:with-param name='class' select="concat($cname,'_skel')"/>
- <xsl:with-param name='scope' select="concat($scope,'')" />
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select='.' mode='tree-src-serialize-root'>
- <xsl:with-param name='class' select="concat($cname,'_skel')"/>
- <xsl:with-param name='scope'>
- <xsl:if test='$scope'>
- <xsl:value-of select="concat($scope,'::')"/>
- </xsl:if>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:for-each select='(.//xsd:element)[not(@type) and @name]'>
- <xsl:variable name='nname' >
- <xsl:apply-templates select='@name' mode='normalize-name'/>
- </xsl:variable>
- <xsl:text> /* Internal Elements without type serialize </xsl:text>
- <xsl:value-of select='./@name'/><xsl:text> */ </xsl:text>
-
- <xsl:if test='./xsd:simpleType or ./xsd:complexType'>
- <xsl:apply-templates select='.' mode='tree-src-serialize-root'>
- <xsl:with-param name='class' select="concat(@name,'_skel')"/>
- <xsl:with-param name='scope' >
- <xsl:choose>
- <xsl:when test='$scope!=""'>
- <xsl:value-of select="concat($scope,'::',$cname,'_skel::')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($scope,'',$cname,'_skel::')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:for-each>
-
- <xsl:text>/* implementation generation after serialize */ </xsl:text>
-
- <!-- I think I should add the implementation of elements seter and getter -->
- <xsl:text>/* class-tree-skel-source LA call tree-src-setget*/ </xsl:text>
- <xsl:apply-templates select="." mode='tree-src-setget'>
- <xsl:with-param name='class' select="concat($cname,'_skel')"/>
- </xsl:apply-templates>
- <xsl:text> /* * END new class implementation generation </xsl:text>
- <xsl:value-of select='concat(name(.)," ",@name," ",@type," ",../@name)'/>
- <xsl:text> */ </xsl:text>
- </xsl:template>
-
- <xsl:template name="generate-tree-skell-constructor">
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:variable name="signature1" select='concat($scope,$class,"::",$class,"()")'/>
- <!-- default constructor -->
- <xsl:value-of select="concat($scope,$class)"/><xsl:text>::</xsl:text>
- <xsl:value-of select='concat($class,"() ")'/>
- <xsl:if test='local-name(.)="simpleType"'>
- <xsl:apply-templates
- select="."
- mode="tree-src-constructor-params">
- <xsl:with-param name='operation' >const</xsl:with-param>
- </xsl:apply-templates>
- </xsl:if>
- <!-- Here i need to put the build of -->
- <xsl:for-each
- select="(.//xsd:element)[not(count(ancestor::xsd:element)>1)]|.//xsd:attribute">
- <xsl:if test='position() = 1'><xsl:text> : </xsl:text></xsl:if>
- <xsl:apply-templates
- select="."
- mode="tree-src-constructor-params">
- <xsl:with-param name='operation' >const</xsl:with-param>
- </xsl:apply-templates>
- <xsl:if test='position() != last()'>
- <xsl:text> , </xsl:text>
- </xsl:if>
- </xsl:for-each>
- <xsl:text> { </xsl:text>
- <xsl:value-of select='concat("/* elements=",count(.//xsd:element)," attributes=",count(.//xsd:attribute)," */ ")'/>
- <xsl:call-template name='debug'>
- <xsl:with-param name='mode' />
- <xsl:with-param name='indent' select='concat("&INDENT;","")'/>
- <xsl:with-param name='string'>
- <xsl:text>LOG_DEBUG_CONSTRUCT_FMT("</xsl:text>
- <xsl:value-of select='concat($class,"::",$class," adresse=%p")'/>
- <xsl:text>",(void *)this);</xsl:text>
- </xsl:with-param>
- </xsl:call-template>
- <xsl:variable name="cparam">
- <xsl:choose>
- <xsl:when test='local-name(.)="element"'>
- <xsl:apply-templates select="./xsd:simpleType|./xsd:complexType" mode="generate-tree-skel-const-list"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="." mode="generate-tree-skel-const-list"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>/* I have </xsl:text><xsl:value-of select='count($cparam/xsd:element)'/>
- <xsl:text> */ </xsl:text>
- <xsl:for-each select="$cparam/xsd:element|$cparam/xsd:attribute">
- <xsl:text>/* Element </xsl:text><xsl:value-of select='./@name'/>
- <xsl:text> */ </xsl:text>
- </xsl:for-each>
- <xsl:text>} </xsl:text>
- <!-- Copy Constructor -->
- <xsl:value-of select="concat($scope,$class)"/><xsl:text>::</xsl:text>
- <xsl:value-of select='concat($class,"(const ",$class,"&f) ")'/>
- <!-- Here i need to put the build of
- does not work !
- TODO: This needs to be improved, with extensions ....
- -->
- <xsl:for-each select="(.//xsd:element)[not(count(ancestor::xsd:element)>1)]|.//xsd:attribute|.//xsd:attributeGroup">
- <xsl:if test='position() = 1'><xsl:text> : </xsl:text></xsl:if>
- <xsl:apply-templates
- select="."
- mode="tree-src-constructor-params">
- <xsl:with-param name='operation' >const1</xsl:with-param>
- </xsl:apply-templates>
- <xsl:if test='position() != last()'>
- <xsl:text> , </xsl:text>
- </xsl:if>
- </xsl:for-each>
- <xsl:text> { </xsl:text>
- <xsl:call-template name='debug'>
- <xsl:with-param name='mode' />
- <xsl:with-param name='indent' select='concat("&INDENT;","")'/>
- <xsl:with-param name='string'>
- <xsl:text>LOG_DEBUG_CONSTRUCT_FMT("</xsl:text>
- <xsl:value-of select='concat($class,"::",$class," copy constructor adresse=%p")'/>
- <xsl:text>",(void *)this);</xsl:text>
- </xsl:with-param>
- </xsl:call-template>
- <!-- A but lazy ...-->
- <xsl:if test='local-name(.)="simpleType" or ./xsd:simpleContent or ./xsd:simpleType'>
- <xsl:text>&INDENT;//m_content=v.m_content; </xsl:text>
- <xsl:apply-templates
- select="."
- mode="tree-src-constructor-params">
- <xsl:with-param name='operation' >copy</xsl:with-param>
- </xsl:apply-templates>
- <xsl:if test='./xsd:union'>
- <xsl:text>&INDENT;m_union_kind =v.m_union_kind; </xsl:text>
- </xsl:if>
- </xsl:if>
- <xsl:text>} </xsl:text>
- <!-- Copy Constructor -->
- <!-- Destructor-->
- <xsl:value-of select="concat($scope,$class)"/><xsl:text>::~</xsl:text>
- <xsl:value-of select="$class"/><xsl:text>() { </xsl:text>
- <xsl:call-template name='debug'>
- <xsl:with-param name='mode' />
- <xsl:with-param name='indent' select='concat("&INDENT;","")'/>
- <xsl:with-param name='string'>
- <xsl:text>LOG_DEBUG_CONSTRUCT_FMT("</xsl:text>
- <xsl:value-of select='concat($class,"::~",$class," adresse=%p")'/>
- <xsl:text>",(void *)this);</xsl:text>
- </xsl:with-param>
- </xsl:call-template>
- <xsl:apply-templates
- select="xsd:simpleContent|xsd:complexContent|xsd:choice|xsd:sequence|xsd:attribute|xsd:attributeGroup"
- mode="tree-src-constructor-params">
- <xsl:with-param name='operation'>dest</xsl:with-param>
- </xsl:apply-templates>
- <xsl:text> } </xsl:text>
- <xsl:text>// generate-tree-skell-constructor </xsl:text>
- <xsl:value-of select="concat($scope,$class,' &',$scope,$class)"/><xsl:text>::operator=(</xsl:text>
- <xsl:value-of select="concat('const ',$scope,$class,' &f)')"/>
- <xsl:text> { </xsl:text>
- <xsl:apply-templates
- select="xsd:simpleContent|xsd:complexContent|xsd:choice|xsd:sequence|xsd:all|xsd:group|xsd:attribute|xsd:attributeGroup"
- mode="tree-src-constructor-params">
- <xsl:with-param name='operation'>copy</xsl:with-param>
- </xsl:apply-templates>
- <xsl:apply-templates
- select="xsd:restriction|xsd:union|xsd:list"
- mode="tree-src-constructor-params">
- <xsl:with-param name='operation'>copy</xsl:with-param>
- </xsl:apply-templates>
- <xsl:text>&INDENT;return *this; } </xsl:text>
-
- </xsl:template>
-
- <!--
- ***
- *** generate-tree-create-instance
- ***
- -->
- <xsl:template match='xsd:simpleType|xsd:complexType' mode='generate-tree-create-instance'>
- <xsl:param name='class'/>
- <xsl:param name='scope'/>
- <xsl:text>/** </xsl:text>
- <xsl:value-of select='concat(" generate-tree-create-instance ",name(.)," @name=",@name)'/>
- <xsl:text> */ </xsl:text>
- <xsl:text>xmlSerializer *</xsl:text><xsl:value-of select='concat($scope,$class,"::createInstance() {&INDENT;")'/>
- <xsl:value-of select='concat(" return new ",$class,"; } ")'/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:annotation" mode="generate-tree-create-instance" >
- </xsl:template>
- <!--
- ***
- *** generate-tree-skel-const-list
- ***
- -->
- <!-- -->
- <xsl:template match="xsd:complexType" mode="generate-tree-skel-const-list">
- <xsl:apply-templates select="xsd:simpleContent|xsd:complexContent" mode="generate-tree-skel-const-list">
- </xsl:apply-templates>
- <xsl:apply-templates select="xsd:sequence|xsd:choice|xsd:group|xsd:all" mode="generate-tree-skel-const-list">
- </xsl:apply-templates>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode="generate-tree-skel-const-list">
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:simpleType" mode="generate-tree-skel-const-list">
- <xsl:apply-templates select="xsd:simpleContent|xsd:list|xsd:union" mode="generate-tree-skel-const-list">
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:simpleContent" mode="generate-tree-skel-const-list">
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:complexContent" mode="generate-tree-skel-const-list">
- <xsl:apply-templates select="xsd:restriction|xsd:extension" mode="generate-tree-skel-const-list">
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:restriction" mode="generate-tree-skel-const-list">
- <xsl:apply-templates select="xsd:element|xsd:sequence|xsd:choice" mode="generate-tree-skel-const-list">
- </xsl:apply-templates>
- <xsl:apply-templates select="xsd:attribute|xsd:attributeGroup" mode="generate-tree-skel-const-list">
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:extension" mode="generate-tree-skel-const-list">
- <xsl:apply-templates select="xsd:element|xsd:sequence|xsd:choice" mode="generate-tree-skel-const-list">
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:list" mode="generate-tree-skel-const-list">
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:union" mode="generate-tree-skel-const-list">
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:sequence|xsd:choice" mode="generate-tree-skel-const-list">
- <xsl:apply-templates select="xsd:element|xsd:sequence|xsd:choice" mode="generate-tree-skel-const-list">
- </xsl:apply-templates>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:group[@name]" mode="generate-tree-skel-const-list">
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:group[@ref]" mode="generate-tree-skel-const-list">
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:all" mode="generate-tree-skel-const-list">
-
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@name and @type]" mode="generate-tree-skel-const-list">
- <xsl:copy-of select='.'/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[not(@type) and not(@ref)]" mode="generate-tree-skel-const-list">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- </xsl:copy>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:element[@ref]" mode="generate-tree-skel-const-list">
- <xsl:copy>
- <xsl:attribute name='name'><xsl:value-of select="@ref"/></xsl:attribute>
- </xsl:copy>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute[@ref]" mode="generate-tree-skel-const-list">
- <xsl:copy>
- <xsl:attribute name='name'><xsl:value-of select="@ref"/></xsl:attribute>
- </xsl:copy>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute" mode="generate-tree-skel-const-list">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- </xsl:copy>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:annotation" mode="generate-tree-skel-const-list">
- </xsl:template>
-
-
- <!--
- ***
- *** generate-tree-skel-serialize-element-ano
- ***
- Indirection used to change scope. So, I can travers the whole file
- -->
- <xsl:template match='xsd:element[@ref]' mode='generate-tree-skel-serialize-element-ano'>
- </xsl:template>
-</xsl:stylesheet>
-
+++ /dev/null
-<?xml version="1.0" ?>
-<!-- :vim:ts=2:sw=2:et: -->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- version="2.0" >
-
- <xsl:template name="namespace-uri-of-qname">
- <xsl:param name="qname"/>
- <xsl:if test="contains($qname,':')">
- <!--
- <xsl:value-of select="namespace::*[name()=substring-before($qname,':')]"/>
- -->
- <xsl:value-of select="namespace-uri-from-QName(resolve-QName($qname,/wsdl:definitions))"/>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match='@base|@type|@name' mode="xsd-types-base">
- <xsl:variable name="ns_type">
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname'><xsl:value-of select="."/></xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$ns_type='http://www.w3.org/2001/XMLSchema'">
- <xsl:apply-templates select="." mode="xsd-types"/>
- </xsl:when>
- <xsl:when test="$ns_type=/xsd:schema/@targetNamespace">
- <!--
- <xsl:message> <xsl:value-of select="concat(' type: ',$ns_type,' ',.)"/></xsl:message>
- -->
- <xsl:value-of select="concat(substring-after(translate(.,'.','_'),':'),'_skel')"/>
- </xsl:when>
- <xsl:when test='name(.)="name"'>
- <!-- Most of the time, elements do not have an ns -->
- <xsl:value-of select="concat(translate(.,'.','_'),'_skel')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="import"
- select="/xsd:schema/xsd:import[@namespace=$ns_type]/@schemaLocation">
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$import!=''">
- <xsl:variable name="et" select="document($import)">
- </xsl:variable>
- <xsl:value-of select="concat(key('elementByName',.),'')"/>
- <xsl:message terminate='no'>not good ext type -<xsl:value-of
- select='concat($ns_type,"- base=",.," loc=",$import," ")'/>
- <xsl:value-of select="substring-after(.,':')"/>
- </xsl:message>
- <xsl:value-of select='concat("","std::string ")'/>
- </xsl:when>
- <xsl:when test="$ns_type=''">
- <!--
- <xsl:message> <xsl:value-of select="concat('xsd2cpp-types xsd-types-base type: ',$ns_type,' ',.)"/></xsl:message>
- -->
- <xsl:value-of select="concat(translate(.,'.','_'),'_skel')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>not goodd -<xsl:value-of
- select='concat("tp=",$ns_type,"- base=",.," loc=",$import)'/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- Basic types -->
- <xsl:template
- match='@base[substring-after(.,":")="anySimpleType"]|@type[substring-after(.,":")="anySimpleType"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="string"]|@type[substring-after(.,":")="string"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="hexBinary"]|@type[substring-after(.,":")="hexBinary"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="base64Binary"]|@type[substring-after(.,":")="base64Binary"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="boolean"]|@type[substring-after(.,":")="boolean"]' mode="xsd-types">
- <xsl:text>bool</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="decimal"]|@type[substring-after(.,":")="decimal"]' mode="xsd-types">
- <xsl:text>long</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="float"]|@type[substring-after(.,":")="float"]' mode="xsd-types">
- <xsl:text>float</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="double"]|@type[substring-after(.,":")="double"]' mode="xsd-types">
- <xsl:text>double</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="duration"]|@type[substring-after(.,":")="duration"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="dateTime"]|@type[substring-after(.,":")="dateTime"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="time"]|@type[substring-after(.,":")="time"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="date"]|@type[substring-after(.,":")="date"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="gYearMonth"]|@type[substring-after(.,":")="gYearMonth"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="gYear"]|@type[substring-after(.,":")="gYear"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="gMonth"]|@type[substring-after(.,":")="gMonth"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="gMonthDay"]|@type[substring-after(.,":")="gMonthDay"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="gDay"]|@type[substring-after(.,":")="gDay"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
-
- <!-- Derived from basic Types -->
- <xsl:template
- match='@base[substring-after(.,":")="normalizedString"]|@type[substring-after(.,":")="normalizedString"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="token"]|@type[substring-after(.,":")="token"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="language"]|@type[substring-after(.,":")="language"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="IDREFS"]|@type[substring-after(.,":")="IDREFS"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="ENTITIES"]|@type[substring-after(.,":")="ENTITIES"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="NMTOKEN"]|@type[substring-after(.,":")="NMTOKEN"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="NMTOKENS"]|@type[substring-after(.,":")="NMTOKENS"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="Name"]|@type[substring-after(.,":")="Name"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="NCName"]|@type[substring-after(.,":")="NCName"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="QName"]|@type[substring-after(.,":")="QName"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="anyURI"]|@type[substring-after(.,":")="anyURI"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="ID"]|@type[substring-after(.,":")="ID"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="IDREF"]|@type[substring-after(.,":")="IDREF"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="ENTITY"]|@type[substring-after(.,":")="ENTITY"]' mode="xsd-types">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="integer"]|@type[substring-after(.,":")="integer"]' mode="xsd-types">
- <xsl:text>long</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="nonPositiveInteger"]|@type[substring-after(.,":")="nonPositiveInteger"]' mode="xsd-types">
- <xsl:text>long</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="negativeInteger"]|@type[substring-after(.,":")="negativeInteger"]' mode="xsd-types">
- <xsl:text>long</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="long"]|@type[substring-after(.,":")="long"]' mode="xsd-types">
- <xsl:text>long</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="int"]|@type[substring-after(.,":")="int"]' mode="xsd-types">
- <xsl:text>int</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="short"]|@type[substring-after(.,":")="short"]' mode="xsd-types">
- <xsl:text>short</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="byte"]|@type[substring-after(.,":")="byte"]' mode="xsd-types">
- <xsl:text>signed char</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="nonNegativeInteger"]|@type[substring-after(.,":")="nonNegativeInteger"]' mode="xsd-types">
- <xsl:text>unsigned long</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="unsignedLong"]|@type[substring-after(.,":")="unsignedLong"]' mode="xsd-types">
- <xsl:text>unsigned long</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="unsignedInt"]|@type[substring-after(.,":")="unsignedInt"]' mode="xsd-types">
- <xsl:text>unsigned int</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="unsignedShort"]|@type[substring-after(.,":")="unsignedShort"]' mode="xsd-types">
- <xsl:text>unsigned short</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="unsignedByte"]|@type[substring-after(.,":")="unsignedByte"]' mode="xsd-types">
- <xsl:text>unsigned char</xsl:text>
- </xsl:template>
- <xsl:template
- match='@base[substring-after(.,":")="positiveInteger"]|@type[substring-after(.,":")="positiveInteger"]' mode="xsd-types">
- <xsl:text>unsigned long</xsl:text>
- </xsl:template>
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY CR "
">
- <!ENTITY NL "<xsl:text> </xsl:text>">
- <!ENTITY TAB "	">
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY INDENT3 "&INDENT2;&INDENT;">
- <!ENTITY INDENT4 "&INDENT3;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<!--
- :vim:ts=2:sw=2:et:bs=2:
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- version="2.0" >
-
- <!-- -->
- <xsl:template match='@*' mode='local-name'>
- <xsl:choose>
- <xsl:when test='contains(.,":")'>
- <xsl:value-of select='substring-after(.,":")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='.'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- *** This function is too complicated. It is suposed to return the proper
- namespace.
- -->
- <xsl:template match='@*' mode="namespace-uri-of-qname">
- <xsl:variable name='qname'>
- <xsl:value-of select="."/>
- </xsl:variable>
- <xsl:variable name='maybe'>
- <!--
- <xsl:value-of select='namespace-uri(/xsd:schema)'/>
- <xsl:value-of select='namespace-uri-from-QName(resolve-QName(xsd:schema,/xsd:schema))'/>
- -->
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='contains(.,":")'>
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="."/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test='(../namespace::*[name()=""]!="") and
- not(contains(.,":"))'>
- <xsl:value-of select="../namespace::*[name()='']"/>
- </xsl:when>
- <xsl:when test='/xsd:schema/@targetNamespace'>
- <xsl:value-of select="/xsd:schema/@targetNamespace"/>
- </xsl:when>
- <xsl:when test='($maybe!="") and (name(.) != "name")'>
- <xsl:message>MAYBE=<xsl:value-of select="$maybe"/></xsl:message>
- <xsl:value-of select="$maybe"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/xsd:schema/@targetNamespace"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template name="namespace-uri-of-qname">
- <xsl:param name="qname"/>
- <xsl:choose>
- <xsl:when test='contains($qname,":")'>
- <xsl:value-of select="namespace-uri-from-QName(resolve-QName($qname,/xsd:schema))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='/xsd:schema/namespace::*[name()=""]'/>
- <xsl:message terminate="no">xsd2cpp: namespace-uri-of-qname qname=(<xsl:value-of
- select='$qname'/>) - <xsl:value-of select='/xsd:schema/namespace::*[name()=""]'/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="contains($qname,':')">
- <!--
- <xsl:value-of select="namespace::*[name()=substring-before($qname,':')]"/>
- -->
- </xsl:if>
- <!--
- <xsl:message terminate="no">xsd2cpp: namespace-uri-of-qname qname=<xsl:value-of
- select='$qname'/>-</xsl:message><xsl:message terminate="no"><xsl:value-of
- select="namespace-uri-from-QName(resolve-QName($qname,/xsd:schema))"/></xsl:message>
- <xsl:message terminate="no">xsd2cpp: namespace-uri-of-qname qname=<xsl:value-of
- select='$qname'/>-<xsl:value-of
- select="namespace-uri-from-QName(resolve-QName($qname,/xsd:schema))"/></xsl:message>
- -->
- </xsl:template>
-
- <!--
- ***
- *** space string list
- ***
- *** For each member, I build an element structure :
- <field type="%type">%name%</field>
- -->
- <xsl:template name='space-string-list'>
- <xsl:param name='string'/>
- <xsl:if test="not($string='')">
- <xsl:message terminate="no">xsd2xpp: space-string-list: <xsl:value-of
- select="$string"/> </xsl:message>
- <xsl:choose>
- <xsl:when test='contains($string," ")'>
- <xsl:variable name='type'
- select='substring-before($string," ")'/>
- <xsl:variable name='ns'>
- <xsl:choose>
- <xsl:when test='contains($type,":")'>
- <xsl:value-of
- select='../namespace::*[name()=substring-before($type,":")]'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of
- select='../namespace::*[name()=""]'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='local-name'>
- <xsl:choose>
- <xsl:when test="contains($type,':')"><xsl:value-of select="substring-after($type,':')"/></xsl:when>
- <xsl:otherwise><xsl:value-of select='$type'/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:message terminate='no'><xsl:value-of select='concat("type=",$type," NS=",$ns)'/></xsl:message>
- <!--TODO compute the proper namespace if contains : -->
- <xsl:element name='field' namespace='&XSD;'>
- <xsl:attribute name='type' namespace="">
- <xsl:value-of
- select='substring-before($string," ")'/>
- </xsl:attribute>
- <xsl:attribute name='name' namespace="">
- <xsl:value-of
- select='$local-name'/>
- </xsl:attribute>
- <xsl:value-of
- select='$local-name'/>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name='type'
- select='$string'/>
- <xsl:variable name='ns'>
- <xsl:choose>
- <xsl:when test='contains($type,":")'>
- <xsl:value-of
- select='../namespace::*[name()=substring-before($type,":")]'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of
- select='../namespace::*[name()=""]'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='local-name'>
- <xsl:choose>
- <xsl:when test="contains($type,':')"><xsl:value-of select="substring-after($type,':')"/></xsl:when>
- <xsl:otherwise><xsl:value-of select='$type'/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:element name='field' namespace='&XSD;'>
- <xsl:attribute name='type' namespace="">
- <xsl:value-of select='$string'/>
- </xsl:attribute>
- <xsl:attribute name='name' namespace="">
- <xsl:value-of select='$local-name'/>
- </xsl:attribute>
- <xsl:value-of select='$local-name'/>
- </xsl:element>
- <xsl:message terminate="no">xsd2xpp: space-string-list: Built:<xsl:value-of
- select="concat($string,' namespace=',$ns)"/> </xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test='string-length(substring-after($string," "))>0'>
- <xsl:call-template name='space-string-list'>
- <xsl:with-param name='string' select='substring-after($string," ")'/>
- </xsl:call-template>
- </xsl:if>
- </xsl:if>
- </xsl:template>
- <!-- for simpleTypes in union-->
- <xsl:template match="xsd:simpleType" mode='space-string-list'>
- <xsl:apply-templates select='xsd:restriction' mode='space-string-list'/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:restriction" mode='space-string-list'>
- <xsl:variable name='local-name'>
- <xsl:apply-templates select='@base' mode='normalize-name'/>
- </xsl:variable>
- <xsl:element name='field' namespace='&XSD;'>
- <xsl:attribute name='type' namespace="">
- <xsl:value-of select='@base'/>
- </xsl:attribute>
- <xsl:attribute name='name' namespace="">
- <xsl:value-of select='$local-name'/>
- </xsl:attribute>
- <xsl:value-of select='$local-name'/>
- </xsl:element>
- </xsl:template>
-
-
- <xsl:template match='xsd:list' mode='space-string-list'>
- <xsl:if test="@itemType">
- <xsl:call-template
- name='space-string-list'>
- <xsl:with-param name='string' select='@memberTypes'/>
- </xsl:call-template>
- </xsl:if>
- <!-- ADD simple types -->
- <xsl:if test='./xsd:simpleType'><xsl:apply-templates select='./xsd:simpleType' mode='space-string-list'/></xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:union' mode='space-string-list'>
- <xsl:if test="@memberTypes">
- <xsl:call-template
- name='space-string-list'>
- <xsl:with-param name='string' select='@memberTypes'/>
- </xsl:call-template>
- </xsl:if>
- <!-- ADD simple types -->
- <xsl:if test='./xsd:simpleType'><xsl:apply-templates select='./xsd:simpleType' mode='space-string-list'/></xsl:if>
- </xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-import org.apache.xalan.transformer.TransformerImpl;
-import org.apache.xalan.trace.TraceManager;
-import org.apache.xalan.trace.PrintTraceListener;
-import java.io.InputStream;
-
-
-public class xsd2cpp {
- public static void main(String[] argv) {
- String inFileName = "";
- System.out.println("xsd2cpp filename ");
- for ( int i = 0 ; i < argv.length ; i++)
- {
- if ("-T".equalsIgnoreCase(argv[i])) {
- }
- else if ("-IN".equalsIgnoreCase(argv[i]))
- {
- if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-')
- inFileName = argv[++i];
- else
- System.err.println("-IN Option missing parameter"
- ); //"Missing argument for);
- } else {
- System.err.println("Undefined Option"
- ); //"Missing argument for);
- }
-
- }
- xsd2cpp t= new xsd2cpp();
- t.test(inFileName);
- }
-
- public void test(String filename) {
-
- // Set up a PrintTraceListener object to print to a file.
- try {
- String pathWithinJar = "Users/aeb/Devs/home/tools/xml-transform/xsd2cpp.xsl";
- InputStream is = java.lang.ClassLoader.getSystemResourceAsStream(pathWithinJar);
-
- java.io.FileWriter fw = new java.io.FileWriter("events.log");
- java.io.PrintWriter pw = new java.io.PrintWriter(fw);
- PrintTraceListener ptl = new PrintTraceListener(pw);
-
- // Print information as each node is 'executed' in the stylesheet.
- ptl.m_traceElements = true;
- // Print information after each result-tree generation event.
- ptl.m_traceGeneration = true;
- // Print information after each selection event.
- ptl.m_traceSelection = true;
- // Print information whenever a template is invoked.
- ptl.m_traceTemplates = true;
- // Print information whenever an extension is called.
- ptl.m_traceExtension = true;
-
- // Set up the transformation
- javax.xml.transform.TransformerFactory tFactory =
- javax.xml.transform.TransformerFactory.newInstance();
- //ResourceResolver resloader = new ResourceResolver();
- ResourceResolver resloader = new ResourceResolver(tFactory.getURIResolver());
- tFactory.setURIResolver(resloader);
-
- javax.xml.transform.Transformer transformer =
- tFactory.newTransformer(new javax.xml.transform.stream.StreamSource
- (is));
-
- // Cast the Transformer object to TransformerImpl.
- if (transformer instanceof TransformerImpl) {
- TransformerImpl transformerImpl = (TransformerImpl)transformer;
-
-
-
- // Register the TraceListener with the TraceManager associated
- // with the TransformerImpl.
- TraceManager trMgr = transformerImpl.getTraceManager();
- trMgr.addTraceListener(ptl);
-
- // Perform the transformation --printing information to
- // the events log during the process.
- transformer.transform
- ( new javax.xml.transform.stream.StreamSource(filename),
- new javax.xml.transform.stream.StreamResult
- (new java.io.FileWriter("foo.out")) );
- }
- // Close the PrintWriter and FileWriter.
- pw.close();
- fw.close();
- } catch (Exception e) {
- }
- }
-}
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE xslt [
-
- <!-- Formating -->
- <!ENTITY INDENT " ">
- <!ENTITY INDENT2 "&INDENT;&INDENT;">
- <!ENTITY XSD "http://www.w3.org/2001/XMLSchema">
-]>
-<xsl:transform
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xsd2cpp="http:/ebersold.fr/dede"
- xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
- xmlns:saxon="http://icl.com/saxon"
- xmlns:xt="http://www.jclark.com/xt"
- xmlns:ex="http://regenstrief.org/org.regenstrief.saxon7."
- extension-element-prefixes="redirect saxon xt ex"
-
- version="1.1" >
-
-<!-- :vim:ts=2:sw=2:et: -->
- <xsl:import href="xsd2cpp-parser.xsl"/>
- <xsl:import href="xsd2cpp-parser-src-event.xsl"/>
- <xsl:import href="xsd2cpp-parser-src-end.xsl"/>
- <xsl:import href="xsd2cpp-parser-src-attribute.xsl"/>
- <xsl:import href="xsd2cpp-parser-src-post.xsl"/>
- <xsl:import href="xsd2cpp-parser-header.xsl"/>
- <xsl:import href="xsd2cpp-parser-hdr-event.xsl"/>
- <xsl:import href="xsd2cpp-parser-hdr-member.xsl"/>
- <xsl:import href="xsd2cpp-tree.xsl"/>
- <xsl:import href="xsd2cpp-tree-header.xsl"/>
- <xsl:import href="xsd2cpp-tree-src-setget.xsl"/>
- <xsl:import href="xsd2cpp-tree-src-constructor-params.xsl"/>
- <xsl:import href="xsd2cpp-tree-src-serialize-root.xsl"/>
- <xsl:import href="xsd2cpp-tree-src-serialize.xsl"/>
- <xsl:import href="xsd2cpp-tree-src-serialize-element.xsl"/>
- <xsl:import href="xsd2cpp-tree-src-serialize-attribute.xsl"/>
- <xsl:import href="xsd2cpp-default-value.xsl"/>
- <xsl:import href="xsd2cpp-gen.xsl"/>
-
- <xsl:output name='text' method="text"/>
- <xsl:param name='out'></xsl:param>
- <xsl:param name='prefix'></xsl:param>
- <xsl:param name='xsd-prefix' select='"xsd"'></xsl:param>
- <xsl:param name='rootdir'></xsl:param>
- <xsl:param name='root-element'>XMI</xsl:param> <!-- What is the doc root
- element-->
- <xsl:param name='polymorphic'>no</xsl:param>
- <xsl:param name='validation'>no</xsl:param> <!-- yes or no. Do we generate
- validation code-->
- <xsl:param name='debug-traces'>no</xsl:param> <!-- add traces in code -->
- <xsl:param name='debug-comment'>yes</xsl:param> <!-- add traces in code -->
- <xsl:param name='debug-console'>yes</xsl:param> <!-- add traces in code -->
- <xsl:param name='verbose'>no</xsl:param> <!-- add verbose messages when converting the file -->
- <xsl:param name='target'>debug</xsl:param> <!-- debug or release -->
- <xsl:param name='with-factory'>yes</xsl:param> <!-- debug or release -->
- <xsl:param name='with-fastcgi'>yes</xsl:param> <!-- debug or release -->
- <xsl:param name='with-openssl'>yes</xsl:param> <!-- debug or release -->
- <xsl:param name='with-gnutls'>yes</xsl:param> <!-- debug or release -->
- <xsl:param name='with-ipv6'>yes</xsl:param> <!-- debug or release -->
- <xsl:param name='with-namespace'>yes</xsl:param> <!-- debug or release -->
-
- <xsl:param name='namespace-file'/>
- <xsl:param name='namespace-map' select="document($namespace-file)"/>
- <xsl:param name='namespace-mapa'>
- <xsl:element name="maps">
- <xsl:element name="map">
- <xsl:attribute name='name'>soapenv</xsl:attribute>
- <xsl:attribute name='ns'>http://schemas.xmlsoap.org/soap/envelope/</xsl:attribute>
- </xsl:element>
- <xsl:element name="map">
- <xsl:attribute name='name'>soapenc</xsl:attribute>
- <xsl:attribute name='ns'>http://schema.xmlsoap.org/encoding/</xsl:attribute>
- </xsl:element>
- <xsl:element name="map">
- <xsl:attribute name='name'>filter</xsl:attribute>
- <xsl:attribute name='ns'>http://www.alcatel-lucent.com/wsp/ns/2009/10/15/ics/subscriptionFilter</xsl:attribute>
- </xsl:element>
- <xsl:element name="map">
- <xsl:attribute name='name'>IncsNs</xsl:attribute>
- <xsl:attribute name='ns'>http://www.alcatel-lucent.com/wsp/ns/2009/10/01/ics/notifierServiceSchema</xsl:attribute>
- </xsl:element>
- <xsl:element name="map">
- <xsl:attribute name='name'>xsd</xsl:attribute>
- <xsl:attribute name='ns'>http://www.w3.org/2001/XMLSchema</xsl:attribute>
- </xsl:element>
- </xsl:element>
- </xsl:param>
- <xsl:param name='incdir'>/include</xsl:param>
- <xsl:param name='srcdir'>/src</xsl:param>
- <xsl:param name='xsddir'>./</xsl:param>
- <xsl:param name='deps'></xsl:param>
- <xsl:param name='shared-ptr'>boost</xsl:param>
- <xsl:param name='generate-print'>yes</xsl:param>
- <xsl:param name='generate-factory'>yes</xsl:param>
- <xsl:param name='generate-tree'>yes</xsl:param>
- <xsl:param name='generate-parse'>yes</xsl:param>
-
- <xsl:param name='cls-tree-suff'>_skel</xsl:param>
- <xsl:param name='cls-tree-pref'></xsl:param>
- <xsl:param name='cls-tree-mbr-elem-prefix'>me_</xsl:param>
- <xsl:param name='cls-tree-mbr-elem-grp-prefix'>me_</xsl:param>
- <xsl:param name='cls-tree-mbr-attr-prefix'>me_attr_</xsl:param>
- <xsl:param name='cls-tree-mbr-attr-grp-prefix'>me_attr_</xsl:param>
- <xsl:param name='cls-tree-union-selector'>m_union_kind</xsl:param>
- <xsl:param name='cls-tree-choice-selector'>m_choice_kind</xsl:param>
- <xsl:param name='cls-parser-suff'>_skel</xsl:param>
- <xsl:param name='cls-parser-pref'>p_</xsl:param>
- <xsl:param name='group-suff'>_elemg_type</xsl:param>
- <xsl:param name='attribute-group-suff'>_attrg_type</xsl:param>
- <xsl:param name='attribute-group-member-prefix'>me_attrg_</xsl:param>
-
- <xsl:variable name='namespace'>
- <xsl:choose>
- <xsl:when test='/xsd:schema/@targetNamespace'>
- <xsl:call-template name='cpp_namespace'>
- <xsl:with-param name='type' select="/xsd:schema/@targetNamespace"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$out"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:key name='attrGroup' match="xsd:attributeGroup" use="@name"/>
- <xsl:key name='attribute' match="xsd:attribute" use="@name"/>
- <xsl:key name='complexTypeByName' match="xsd:complexType" use="@name"/>
- <xsl:key name='simpleTypeByName' match="xsd:simpleType" use="@name"/>
- <xsl:key name='elementByName' match="xsd:element|xsd:simpleType|xsd:complexType" use="@name"/>
- <xsl:key name='elementByName1' match="xsd:element" use="@name"/>
- <xsl:key name='elementByType' match="xsd:element" use='substring-after(@type,":")'/>
- <xsl:key name='elements' match="xsd:element" use='local-name(@type)'/>
- <xsl:key name='element' match="xsd:element" use='@name'/>
- <xsl:key name='group' match="xsd:group" use='@name'/>
- <!--
- <xsl:key name='complexType' match="xsd:complexType"/>
- <xsl:key name='simpleType' match="xsd:complexType"/>
- -->
-
- <!-- The main entry point -->
- <xsl:template match='/'>
- <!-- I need saxon EE with extension suport if I want to use output extention
- -->
- <xsl:if test="element-available('saxon:output')">
- <saxon:output href="test.txt">
- Hello worlds the extention is available
- </saxon:output>
- </xsl:if>
- <xsl:message terminate="no">Start Processing : <xsl:call-template name='basename'>
- <xsl:with-param name='path' select="substring-after(document-uri(/),'/')"/>
- </xsl:call-template>
- </xsl:message>
- <xsl:if test="$generate-parse='yes'">
- <xsl:call-template name="generateParseSkel">
- <xsl:with-param name='dir' select="$rootdir"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="$generate-tree='yes'">
- <xsl:call-template name="generateTreeSkel">
- <xsl:with-param name='dir' select="$rootdir"/>
- </xsl:call-template>
- </xsl:if>
- <!-- We need to create a file per complex type
- -->
- <!-- We need to include all include files for elements -->
-
- </xsl:template>
- <!-- Will be removed soon -->
-<xsl:template name="generateCMakelist">
- <!-- We need to generate a parser function per element -->
- <xsl:result-document href="{$rootdir}/CMakeLists.txt" format="text">
- <xsl:text>PROJECT(</xsl:text>
- <xsl:value-of select='concat($root-element,") ")'/>
- <xsl:text>#SET(XML_PARSER "") </xsl:text>
- <!-- Elements that is not rootelement must also be processed -->
- <xsl:for-each
- select="/xsd:schema/xsd:complexType|/xsd:schema/xsd:simpleType|/xsd:schema/xsd:element[@name!=$root-element and @type='']">
- <xsl:message>Create cmake entry for : <xsl:value-of
- select="@name"/> - <xsl:value-of select='namespace-uri(.)'/></xsl:message>
- <xsl:text>SET(XML_PARSER ${XML_PARSER} </xsl:text>
- <!--
- <xsl:value-of select="concat('${CMAKE_CURRENT_BINARY_DIR}/',@name,'_tskel.cpp')"/>
- -->
- <xsl:value-of select="concat('',@name,'_tskel.cpp')"/>
- <xsl:text>) </xsl:text>
- <xsl:text>SET(XML_PARSER ${XML_PARSER} </xsl:text>
- <!--
- <xsl:value-of select="concat('${CMAKE_CURRENT_BINARY_DIR}/','p_',@name,'.cpp')"/>
- -->
- <xsl:value-of select="concat('','p_',@name,'.cpp')"/>
- <xsl:text>) </xsl:text>
- <xsl:text>#SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/ </xsl:text>
- <xsl:text>SET_SOURCE_FILES_PROPERTIES(</xsl:text>
- <xsl:value-of select='concat("p_",@name,".cpp ")'/>
- <xsl:text>GENERATED) </xsl:text>
- <xsl:text>#SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/ </xsl:text>
- <xsl:text>SET_SOURCE_FILES_PROPERTIES(</xsl:text>
- <xsl:value-of select='concat("",@name,"_tskel.cpp ")'/>
- <xsl:text>GENERATED) </xsl:text>
-
- </xsl:for-each>
-
- <xsl:text>ADD_LIBRARY(</xsl:text><xsl:value-of select="$root-element"/>
- <xsl:text> STATIC ${XML_PARSER})</xsl:text>
- </xsl:result-document>
- </xsl:template>
-
-<xsl:template name="basename">
- <xsl:param name="path"/>
- <xsl:variable name='res' select="substring-after($path,'/')"/>
- <xsl:choose>
- <xsl:when test='contains($path,"/") and $res=""'>
- <xsl:value-of select="$path"/>
- </xsl:when>
- <xsl:when test="contains($path, '/') and $res!='' ">
- <xsl:call-template name="basename">
- <xsl:with-param name="path" select="substring-after($path, '/')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$path"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
- <!-- index-of function -->
- <xsl:function name="xsd2cpp:index-of" as="xsd:integer">
- <xsl:param name="seq" as="node()*"/>
- <xsl:param name="item" as="node()"/>
- <xsl:for-each select='$seq'>
- <xsl:if test='. is $item'>
- <xsl:sequence select='position()'/>
- </xsl:if>
- </xsl:for-each>
- </xsl:function>
- <!-- Try to find the document for the given shema location ?
- I might need to use xsddir global variable too.
- -->
- <xsl:template name='import-document'>
- <xsl:param name='location'/>
- <xsl:param name='paths'><xsl:value-of select='$xsddir'/></xsl:param>
- <xsl:message terminate='no'>import-document look at: <xsl:value-of select='concat(substring-before($paths,";"),$location)'/></xsl:message>
- <xsl:variable name="document" select='document(concat(substring-before($paths,";"),$location))'>
- </xsl:variable>
- <!--<xsl:variable name="document-lo" select='document($location)'/>
- -->
-
- <xsl:choose>
- <xsl:when test='document($location)'>
- <xsl:message terminate='no'>import-document case 1 look at: <xsl:value-of select='concat(substring-before($paths,";"),$location)'/></xsl:message>
- <xsl:sequence select='document($location)'/>
- </xsl:when>
- <xsl:when test='$document'>
- <xsl:message terminate='no'>import-document case 2 look at: <xsl:value-of select='concat(substring-before($paths,";"),$location)'/></xsl:message>
- <xsl:sequence select='$document'/>
- </xsl:when>
- <xsl:when test='(not($document) and substring-after($paths,";")!="")'>
- <xsl:message terminate='no'>import-document case 3 look at: <xsl:value-of select='concat(substring-before($paths,";"),$location)'/></xsl:message>
- <xsl:call-template name='import-document'>
- <xsl:with-param name='location' select='$location'/>
- <xsl:with-param name='paths' select='substring-after($paths,";")'/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>ERROR we definitly do not find the path for <xsl:value-of select='concat($paths," - ",substring-before($paths,";")," - ",$location)'/> </xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:fallback>
- <xsl:message terminate="no">Fallback <xsl:value-of select='substring-after("",";")'/></xsl:message>
- </xsl:fallback>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='@*' mode='local-name'>
- <xsl:choose>
- <xsl:when test='contains(.,":")'>
- <xsl:value-of select='substring-after(.,":")'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='.'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- Normalize debug string in code -->
- <xsl:template name='debug'>
- <xsl:param name='mode'></xsl:param>
- <xsl:param name='indent'></xsl:param>
- <xsl:param name='string'></xsl:param>
- <xsl:value-of select='concat("#ifdef DEBUG ","")'/>
- <xsl:value-of select='concat($indent,$string," ")'/>
- <xsl:value-of select='concat("#endif ","")'/>
- </xsl:template>
-
- <!--
- ***
- *** element-form
- ***
- -->
- <xsl:template match="xsd:element" mode="element-form">
- <xsl:choose>
- <xsl:when test="@form"><xsl:value-of select="@form"/></xsl:when>
- <xsl:when test="/xsd:schema/@elementFormDefault"><xsl:value-of select="/xsd:schema/@elementFormDefault"/>
- </xsl:when>
- <xsl:otherwise>unqualified</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:attribute" mode="element-form">
- <xsl:choose>
- <xsl:when test="@form"><xsl:value-of select="@form"/></xsl:when>
- <xsl:when test="/xsd:schema/@attributeFormDefault"><xsl:value-of select="/xsd:schema/@attributeFormDefault"/>
- </xsl:when>
- <xsl:otherwise>unqualified</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- ***
- *** element-max-occurs
- ***
- -->
- <xsl:template match="xsd:element" mode="element-max-occurs">
- <xsl:choose>
- <xsl:when test="@maxOccurs"><xsl:value-of select="@maxOccurs"/></xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!--
- ***
- *** normalize-name
- ***
- -->
- <xsl:template match="@*" mode='normalize-name'>
- <xsl:variable name="nm">
- <xsl:choose>
- <xsl:when test='contains(.,":")'>
- <xsl:value-of select='substring-after(.,":")'/>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='$nm="operator"'>
- <xsl:text>_operator</xsl:text>
- </xsl:when>
- <xsl:when test='$nm="class"'>
- <xsl:text>_class</xsl:text>
- </xsl:when>
- <xsl:when test='$nm="const"'>
- <xsl:text>_const</xsl:text>
- </xsl:when>
- <xsl:when test='$nm="private"'>
- <xsl:text>_private</xsl:text>
- </xsl:when>
- <xsl:when test='$nm="template"'>
- <xsl:text>_template</xsl:text>
- </xsl:when>
- <xsl:when test='$nm="if"'>
- <xsl:text>_if</xsl:text>
- </xsl:when>
- <xsl:when test='$nm="switch"'>
- <xsl:text>_switch</xsl:text>
- </xsl:when>
- <xsl:when test='$nm="case"'>
- <xsl:text>_case</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='translate($nm,".-:/","__")'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name='cpp_namespace'>
- <xsl:param name='type'/>
- <xsl:variable name='cp_ns'>
- <xsl:call-template name='basename'>
- <xsl:with-param name='path' select="$type"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name='nns'>
- <xsl:value-of select='translate($cp_ns,"./:-#","")'/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='string(number(substring($nns,1))) != "NaN"'>
- <xsl:value-of select='concat("ns_",$nns)'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("",$nns)'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- The class generation -->
- <!-- This template tranforms a xsd type into cpp type-->
- <xsl:template name='xsl-type'>
- <xsl:param name='type'/>
- <xsl:variable name="ns_type"><xsl:value-of select='substring-before($type,":")'/></xsl:variable>
- <xsl:variable name='tp'><xsl:value-of select='substring-after($type,":")'/></xsl:variable>
- <xsl:message terminate='yes'>Should not use this anymore</xsl:message>
- </xsl:template>
-
- <!--
- *** This function is too complicated. It is suposed to return the proper
- namespace.
- -->
- <xsl:template match='@*' mode="namespace-uri-of-qname">
- <xsl:variable name='qname'>
- <xsl:value-of select="."/>
- </xsl:variable>
- <xsl:variable name='maybe'>
- <!--
- <xsl:value-of select='namespace-uri(/xsd:schema)'/>
- <xsl:value-of select='namespace-uri-from-QName(resolve-QName(xsd:schema,/xsd:schema))'/>
- -->
- </xsl:variable>
- <xsl:choose>
- <xsl:when test='contains(.,":")'>
- <xsl:call-template name='namespace-uri-of-qname'>
- <xsl:with-param name='qname' select="."/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test='(../namespace::*[name()=""]!="") and
- not(contains(.,":"))'>
- <xsl:value-of select="../namespace::*[name()='']"/>
- </xsl:when>
- <xsl:when test='/xsd:schema/@targetNamespace'>
- <xsl:value-of select="/xsd:schema/@targetNamespace"/>
- </xsl:when>
- <xsl:when test='($maybe!="") and (name(.) != "name")'>
- <xsl:message>MAYBE=<xsl:value-of select="$maybe"/></xsl:message>
- <xsl:value-of select="$maybe"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/xsd:schema/@targetNamespace"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="namespace-uri-of-qname">
- <xsl:param name="qname" select='""'/>
- <xsl:choose>
- <xsl:when test='contains($qname,":")'>
- <xsl:value-of select="namespace-uri-from-QName(resolve-QName($qname,/xsd:schema))"/>
- </xsl:when>
- <xsl:when test='not($qname)'>
- <xsl:message terminate="yes">xsd2cpp: namespace-uri-of-qname qname=(<xsl:value-of
- select='$qname'/>) - <xsl:value-of select='/xsd:schema/namespace::*[name()=""]'/></xsl:message>
- </xsl:when>
- <xsl:when test='$qname=""'>
- <xsl:message terminate="yes">xsd2cpp: namespace-uri-of-qname qname=(<xsl:value-of
- select='$qname'/>) - <xsl:value-of select='/xsd:schema/namespace::*[name()=""]'/></xsl:message>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='/xsd:schema/namespace::*[name()=""]'/>
- <xsl:message terminate="no">xsd2cpp: default namespace-uri-of-qname qname=(<xsl:value-of
- select='$qname'/>) - <xsl:value-of select='/xsd:schema/namespace::*[name()=""]'/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="contains($qname,':')">
- <!--
- <xsl:value-of select="namespace::*[name()=substring-before($qname,':')]"/>
- -->
- </xsl:if>
- <!--
- <xsl:message terminate="no">xsd2cpp: namespace-uri-of-qname qname=<xsl:value-of
- select='$qname'/>-</xsl:message><xsl:message terminate="no"><xsl:value-of
- select="namespace-uri-from-QName(resolve-QName($qname,/xsd:schema))"/></xsl:message>
- <xsl:message terminate="no">xsd2cpp: namespace-uri-of-qname qname=<xsl:value-of
- select='$qname'/>-<xsl:value-of
- select="namespace-uri-from-QName(resolve-QName($qname,/xsd:schema))"/></xsl:message>
- -->
- </xsl:template>
-
- <xsl:template match='@*' mode='qualified-namespace'>
- <xsl:choose>
- <xsl:when test='.="qualified" or /xsd:schema/@elementFormDefault="qualified"'>
- <xsl:text>ns == "</xsl:text>
- <xsl:value-of select='/xsd:schema/@targetNamespace'/>
- <xsl:text>"</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text> ns.empty()</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- Templates to get types for restriction and extension
- <xsl:template match='xsd:restriction/[@base="string" and namespace::*[name()=substring-before(@base,":")]] mode=restriction-base'>
- <xsl:template match="*[@base='xsd:string']" mode="restriction-base">
- <xsl:template match='@base[substring-after(.,":")="string"] and namespace::*[name()=substring-before(@base,":")]="http://www.w3.org/2001/XMLSchema"' mode="restriction-base">
- The main issue with the solution below is the management of
- the namespaces
- And what if there is no string schema description ?
- -->
- <xsl:template match='@*' mode="restriction-base">
- <xsl:variable name="nm">
- <xsl:apply-templates select="."
- mode="normalize-name"/>
- </xsl:variable>
- <xsl:variable name="ns_type">
- <xsl:apply-templates select="." mode='namespace-uri-of-qname'>
- </xsl:apply-templates>
- </xsl:variable>
- <!--
- <xsl:message>xsd2cpp: mode=restriction-base DEBUG: <xsl:value-of select="concat('name=',name(.),' ',.,' ns_type=',$ns_type)"/></xsl:message>
- -->
- <xsl:choose>
- <xsl:when test="$ns_type='http://www.w3.org/2001/XMLSchema'">
- <xsl:apply-templates select="." mode="restriction-base-xsd"/>
- </xsl:when>
- <xsl:when test='../namespace::*[name()=""]="&XSD;" and
- not(contains(.,":")) '>
- <xsl:message terminate="no"/>
- <xsl:apply-templates select="." mode="restriction-base-xsd"/>
- </xsl:when>
- <xsl:when test="$ns_type=/xsd:schema/@targetNamespace ">
- <xsl:value-of select='concat(translate($nm,".-","__"),"_skel")'/>
- </xsl:when>
- <xsl:when test='name(.)="name"'>
- <!-- Most of the time, elements do not have ns -->
- <xsl:value-of select="concat(translate(.,'.-','__'),'_skel')"/>
- </xsl:when>
- <xsl:when test="$ns_type=''">
- <xsl:value-of select="concat(translate($nm,'.-','__'),'_skel')"/>
- <!--
- <xsl:message terminate='no'> <xsl:value-of select="concat('el=',name(.),' type: ',$ns_type,' ',.,' is nul?')"/></xsl:message>
- -->
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="import"
- select="/xsd:schema/xsd:import[@namespace=$ns_type]/@schemaLocation">
- </xsl:variable>
- <xsl:variable name='base' select="substring-after(.,':')"/>
- <xsl:choose>
- <xsl:when test="$import!=''">
- <xsl:variable name="et" select="document($import)">
- </xsl:variable>
- <xsl:variable name='cpp_ns'><xsl:call-template
- name='cpp_namespace'>
- <xsl:with-param name='type' select="$ns_type"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="concat(key('elementByName',.),'')"/>
- <xsl:if test='$et//xsd:ComplexType[local-name(@name)=$base]'>
- <xsl:message terminate='yes'>not good ext type -<xsl:value-of
- select='concat($ns_type,"- base=",.," loc=<",$import,"> ")'/>
- <xsl:value-of select="substring-after(.,':')"/>
- </xsl:message>
- </xsl:if>
- <xsl:message terminate='no'>CORRECT - <xsl:value-of
- select='concat("Type base=",.," =",substring-after(.,":"),"_skel cpp_ns=",$cpp_ns)'/>
- </xsl:message>
- <xsl:value-of select='concat($cpp_ns,"::",substring-after(.,":"),"_skel ")'/>
- </xsl:when>
- <xsl:when test="$ns_type=''">
- <xsl:message terminate="no">TODO xsd2cpp.xsl <xsl:value-of select="concat(' type: ',$ns_type,' ',.)"/></xsl:message>
- <xsl:value-of select="concat(translate(.,'.-','__'),'_skel')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate='yes'>not good - <xsl:value-of
- select='concat("tp=",$ns_type,"- base=",.," loc=(",$import,")")'/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- Basic types -->
- <xsl:template
- match='@*[substring-after(.,":")="anyType"]|@*[.="anyType"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="anySimpleType"]|@*[.="anySimpleType"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="string"]|@*[.="string"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="hexBinary"]|@*[.="hexBinary"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="base64Binary"]|@*[.="base64Binary"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="boolean"]|@*[.="boolean"]' mode="restriction-base-xsd">
- <xsl:text>bool</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="decimal"]|@*[.="decimal"]' mode="restriction-base-xsd">
- <xsl:text>long</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="float"]|@*[.="float"]' mode="restriction-base-xsd">
- <xsl:text>float</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="double"]|@*[.="double"]' mode="restriction-base-xsd">
- <xsl:text>double</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="duration"]|@*[.="duration"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="dateTime"]|@*[.="dateTime"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="time"]|@*[.="time"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="date"]|@*[.="date"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="gYearMonth"]|@*[.="gYearMonth"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="gYear"]|@*[.="gYear"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="gMonth"]|@*[.="gMonth"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="gMonthDay"]|@*[.="gMonthDay"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="gDay"]|@*[.="gDay"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
-
- <!-- Derived from basic Types -->
- <xsl:template
- match='@*[substring-after(.,":")="normalizedString"]|@*[.="normalizedString"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="token"]|@*[.="token"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="language"]|@*[.="language"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="IDREFS"]|@*[.="IDREFS"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="ENTITIES"]|@*[.="ENTITIES"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="NMTOKEN"]|@*[.="NMTOKEN"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="NMTOKENS"]|@*[.="NMTOKENS"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="Name"]|@*[.="Name"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="NCName"]|@*[.="NCName"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="QName"]|@*[.="QName"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="anyURI"]|@*[.="anyURI"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="ID"]|@*[.="ID"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="IDREF"]|@*[.="IDREF"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="ENTITY"]|@*[.="ENTITY"]' mode="restriction-base-xsd">
- <xsl:text>std::string</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="integer"]|@*[.="integer"]' mode="restriction-base-xsd">
- <xsl:text>long</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="nonPositiveInteger"]|@*[.="nonPositiveInteger"]' mode="restriction-base-xsd">
- <xsl:text>long</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="negativeInteger"]|@*[.="negativeInteger"]' mode="restriction-base-xsd">
- <xsl:text>long</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="long"]|@*[.="long"]' mode="restriction-base-xsd">
- <xsl:text>long</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="int"]|@*[.="int"]' mode="restriction-base-xsd">
- <xsl:text>int</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="short"]|@*[.="short"]' mode="restriction-base-xsd">
- <xsl:text>short</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="byte"]|@*[.="byte"]' mode="restriction-base-xsd">
- <xsl:text>signed char</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="nonNegativeInteger"]|@*[.="nonNegativeInteger"]' mode="restriction-base-xsd">
- <xsl:text>unsigned long</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="unsignedLong"]|@*[.="unsignedLong"]' mode="restriction-base-xsd">
- <xsl:text>unsigned long</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="unsignedInt"]|@*[.="unsignedInt"]' mode="restriction-base-xsd">
- <xsl:text>unsigned int</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="unsignedShort"]|@*[.="unsignedShort"]' mode="restriction-base-xsd">
- <xsl:text>unsigned short</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="unsignedByte"]|@*[.="unsignedByte"]' mode="restriction-base-xsd">
- <xsl:text>unsigned char</xsl:text>
- </xsl:template>
- <xsl:template
- match='@*[substring-after(.,":")="positiveInteger"]|@*[.="positiveInteger"]' mode="restriction-base-xsd">
- <xsl:text>unsigned long</xsl:text>
- </xsl:template>
-
- <!-- -->
- <xsl:template match='xsd:simpleType' mode='element-internal-type'>
- <xsl:apply-templates select='xsd:restriction|xsd:list|xsd:union' mode='element-internal-type-st'/>
- </xsl:template>
-
- <xsl:template match='xsd:complexType' mode='element-internal-type'>
- <xsl:apply-templates select='xsd:simpleContent|xsd:complexContent'/>
- </xsl:template>
-
- <xsl:template match='xsd:simpleContent' mode='element-internal-type'>
- </xsl:template>
- <xsl:template match='xsd:complexContent' mode='element-internal-type'>
- </xsl:template>
-
- <!-- simple type has restriction, union, list -->
- <xsl:template match='xsd:restriction' mode='element-internal-type-st'>
- <xsl:apply-templates mode='restriction-base' select='@base'/>
- </xsl:template>
- <xsl:template match='xsd:union' mode='element-internal-type-st'>
- <xsl:message terminate='yes'>TO BE CODED xsd:</xsl:message>
- </xsl:template>
- <xsl:template match='xsd:list' mode='element-internal-type-st'>
- <xsl:message terminate='yes'>TO BE CODED xsd:</xsl:message>
- </xsl:template>
-
- <!--
- ***
- *** attribute-internal-type
- ***
- -->
- <xsl:template match='xsd:simpleType' mode='attribute-internal-type'>
- <xsl:apply-templates select='xsd:restriction|xsd:list|xsd:union' mode='attribute-internal-type' />
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:restriction' mode='attribute-internal-type'>
- <xsl:value-of select="@base"/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:list' mode='attribute-internal-type'>
- <xsl:choose>
- <xsl:when test="@itemType">
- <xsl:value-of select="@itemType"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="xsd:simpleType"
- mode='attribute-internal-type'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:union' mode='attribute-internal-type'>
- <xsl:choose>
- <xsl:when test="@memberTypes">
- <xsl:value-of select="@mamberTypes"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="xsd:simpleType"
- mode='attribute-internal-type'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- ***
- *** space string list
- ***
- *** For each member, I build an element structure :
- <field type="%type">%name%</field>
- -->
- <xsl:template name='space-string-list'>
- <xsl:param name='string'/>
- <xsl:if test="not($string='')">
- <xsl:message terminate="no">xsd2xpp: space-string-list: <xsl:value-of
- select="$string"/> </xsl:message>
- <xsl:choose>
- <xsl:when test='contains($string," ")'>
- <xsl:variable name='type'
- select='substring-before($string," ")'/>
- <xsl:variable name='ns'>
- <xsl:choose>
- <xsl:when test='contains($type,":")'>
- <xsl:value-of
- select='../namespace::*[name()=substring-before($type,":")]'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of
- select='../namespace::*[name()=""]'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='local-name'>
- <xsl:choose>
- <xsl:when test="contains($type,':')"><xsl:value-of select="substring-after($type,':')"/></xsl:when>
- <xsl:otherwise><xsl:value-of select='$type'/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:message terminate='no'><xsl:value-of select='concat("type=",$type," NS=",$ns)'/></xsl:message>
- <!--TODO compute the proper namespace if contains : -->
- <xsl:element name='field' namespace='&XSD;'>
- <xsl:attribute name='type' namespace="">
- <xsl:value-of
- select='substring-before($string," ")'/>
- </xsl:attribute>
- <xsl:attribute name='name' namespace="">
- <xsl:value-of
- select='$local-name'/>
- </xsl:attribute>
- <xsl:value-of
- select='$local-name'/>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name='type'
- select='$string'/>
- <xsl:variable name='ns'>
- <xsl:choose>
- <xsl:when test='contains($type,":")'>
- <xsl:value-of
- select='../namespace::*[name()=substring-before($type,":")]'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of
- select='../namespace::*[name()=""]'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name='local-name'>
- <xsl:choose>
- <xsl:when test="contains($type,':')"><xsl:value-of select="substring-after($type,':')"/></xsl:when>
- <xsl:otherwise><xsl:value-of select='$type'/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:element name='field' namespace='&XSD;'>
- <xsl:attribute name='type' namespace="">
- <xsl:value-of select='$string'/>
- </xsl:attribute>
- <xsl:attribute name='name' namespace="">
- <xsl:value-of select='$local-name'/>
- </xsl:attribute>
- <xsl:value-of select='$local-name'/>
- </xsl:element>
- <xsl:message terminate="no">xsd2xpp: space-string-list: Built:<xsl:value-of
- select="concat($string,' namespace=',$ns)"/> </xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test='string-length(substring-after($string," "))>0'>
- <xsl:call-template name='space-string-list'>
- <xsl:with-param name='string' select='substring-after($string," ")'/>
- </xsl:call-template>
- </xsl:if>
- </xsl:if>
- </xsl:template>
- <!-- for simpleTypes in union-->
- <xsl:template match="xsd:simpleType" mode='space-string-list'>
- <xsl:apply-templates select='xsd:restriction' mode='space-string-list'/>
- </xsl:template>
- <!-- -->
- <xsl:template match="xsd:restriction" mode='space-string-list'>
- <xsl:variable name='local-name'>
- <xsl:apply-templates select='@base' mode='normalize-name'/>
- </xsl:variable>
- <xsl:element name='field' namespace='&XSD;'>
- <xsl:attribute name='type' namespace="">
- <xsl:value-of select='@base'/>
- </xsl:attribute>
- <xsl:attribute name='name' namespace="">
- <xsl:value-of select='$local-name'/>
- </xsl:attribute>
- <xsl:value-of select='$local-name'/>
- </xsl:element>
- </xsl:template>
- <!--
- ***
- *** attribute-internal-cpp-type
- ***
- -->
- <xsl:template match='xsd:simpleType' mode='attribute-internal-cpp-type'>
- <xsl:apply-templates select='xsd:restriction|xsd:list|xsd:union' mode='attribute-internal-cpp-type' />
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:restriction' mode='attribute-internal-cpp-type'>
- <xsl:apply-templates mode='restriction-base' select='@base'/>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:list' mode='attribute-internal-cpp-type'>
- <xsl:choose>
- <xsl:when test="@itemType">
- <xsl:apply-templates mode='restriction-base' select='@itemType'/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="xsd:simpleType"
- mode='attribute-internal-cpp-type'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- -->
- <xsl:template match='xsd:union' mode='attribute-internal-cpp-type'>
- <xsl:choose>
- <xsl:when test="@memberTypes">
- <xsl:value-of select="@mamberTypes"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="xsd:simpleType"
- mode='attribute-internal-cpp-type'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
-</xsl:transform>
-
+++ /dev/null
-import java.io.*;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URI;
-
-
-public class xsd2cpp_saxon {
- public static void main(String[] argv) {
- String inFileName = "";
- System.out.println("xsd2cpp filename ");
- for ( int i = 0 ; i < argv.length ; i++)
- {
- if ("-T".equalsIgnoreCase(argv[i])) {
- }
- else if ("-IN".equalsIgnoreCase(argv[i]))
- {
- if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-')
- inFileName = argv[++i];
- else
- System.err.println("-IN Option missing parameter"
- ); //"Missing argument for);
- } else {
- System.err.println("Undefined Option"
- ); //"Missing argument for);
- }
-
- }
- xsd2cpp_saxon t= new xsd2cpp_saxon();
- t.test(inFileName);
- }
-
- public void test(String filename) {
-
- // Set up a PrintTraceListener object to print to a file.
- try {
-
- // Set up the transformation
- String pathWithinJar = "Users/aeb/Devs/home/tools/xml-transform/xsd2cpp.xsl";
- InputStream is = java.lang.ClassLoader.getSystemResourceAsStream(pathWithinJar);
-
- String xmlSystemId = new File(filename).toURL().toExternalForm( );
-
- java.io.FileWriter fw = new java.io.FileWriter("events.log");
- java.io.PrintWriter pw = new java.io.PrintWriter(fw);
-
- System.setProperty("javax.xml.transform.TransformerFactory", "net.sf.saxon.TransformerFactoryImpl");
- // Set up the transformation
- javax.xml.transform.TransformerFactory tFactory =
- javax.xml.transform.TransformerFactory.newInstance();
- // TransformerFactory.newInstance("net.sf.saxon.TransformerFactoryImpl",null);
-
- ResourceResolver resloader = new ResourceResolver(tFactory.getURIResolver());
- tFactory.setURIResolver(resloader);
-
- javax.xml.transform.Transformer transformer =
- tFactory.newTransformer(new javax.xml.transform.stream.StreamSource
- (is));
-
- transformer.setParameter("rootdir","./");
- transformer.setParameter("target","release");
- transformer.setParameter("shared-ptr","aeb");
- transformer.setParameter("xsddir","./;./;/Users/aeb/Devs/home/data-models/;./../ ../../data-models/");
- // Cast the Transformer object to TransformerImpl.
- // Perform the transformation --printing information to
- // the events log during the process.
- transformer.transform
- ( new javax.xml.transform.stream.StreamSource(filename),
- new javax.xml.transform.stream.StreamResult
- (new java.io.FileWriter("foo.out")) );
- // Close the PrintWriter and FileWriter.
- pw.close();
- fw.close();
-
-
-
- } catch (Exception e) {
- }
- }
-
-
- public void test1(String filename) {
-
-
- }
-}