This document discusses attribute groups and attributes in XSD schemas. It provides examples of attribute group definitions from the Open Travel schema, including the NegotiatedFareAttributes, DirectAndStopsGroup, and DiscountPricingGroup attribute groups. It describes how an XSD generator handles different attribute group content models, such as those containing simple attributes, simple types with enumerations, and named simple types. Documentation and unit tests for the generated classes corresponding to the example attribute groups are included in appendices.
The document discusses JavaScript and the DOM (Document Object Model). It covers:
1. How JavaScript can be inserted into HTML pages using the <script> tag, including inline code and external files.
2. How the DOM represents and interacts with elements in an HTML document, allowing JavaScript to dynamically access and update elements.
3. JavaScript language basics, including data types, variables, operators, and comments.
The document discusses code generation from an XSD schema containing complex types. It analyzes the ComplexType "AdvResTicketingType" which has a nested structure including elements, sequences, and attributes. The generator represents this structure using an intermediate "Structure Element Repository" format. It generates classes for the complex type and its dependent types, ensuring optional elements and attributes are handled correctly. The generator also produces internal classes to represent sequences and elements within the complex type.
This article describes the functionality within Schema Studio which allows a user to establish the landscape of dependent types for a selected top-level type in a Schema.
The document summarizes some of the key new features in Java 17 including:
1. Long-term support for Java 17 which will be available in September 2021 and include features like records, text blocks, and enhanced null pointer exceptions.
2. Records, text blocks, helpful null pointer exceptions, pattern matching for switches, and sealed classes as some of the top new features in Java 17.
3. Enhancements to pseudo-random number generators with a new RandomGenerator interface and refactoring of legacy random classes.
This document discusses common web application security vulnerabilities like cross-site scripting (XSS) and SQL injection. It provides several approaches to prevent these vulnerabilities, including filtering HTML characters, allowing a limited character set, and safely allowing some HTML tags. It also demonstrates how XSS and SQL injection attacks can occur if user input is not sanitized properly before being displayed or used in database queries. The document recommends validating all user input and escaping special characters to prevent these attacks from being successful.
Integrating SAP the Java EE Way - JBoss One Day talk 2012hwilming
Cuckoo is an open source Resource Adapter for SAP that is compatible to the Java Connector Architecture (JCA) version 1.5.
It enables developers of Java EE applications to call functions in a SAP backend, making use of Java EE features like Container Managed Transactions and Security.
Hibersap helps developers of Java applications to call business logic in SAP backends. It defines a set of Java annotations to map SAP function modules to Java classes as well as a small, clean API to execute these function modules and handle transaction and security aspects.
Hibersap's programming model is quite similar to those of modern O/R mappers, significantly speeding up the development of SAP interfaces and making it much more fun to write the integration code.
The document discusses JavaScript and the DOM (Document Object Model). It covers:
1. How JavaScript can be inserted into HTML pages using the <script> tag, including inline code and external files.
2. How the DOM represents and interacts with elements in an HTML document, allowing JavaScript to dynamically access and update elements.
3. JavaScript language basics, including data types, variables, operators, and comments.
The document discusses code generation from an XSD schema containing complex types. It analyzes the ComplexType "AdvResTicketingType" which has a nested structure including elements, sequences, and attributes. The generator represents this structure using an intermediate "Structure Element Repository" format. It generates classes for the complex type and its dependent types, ensuring optional elements and attributes are handled correctly. The generator also produces internal classes to represent sequences and elements within the complex type.
This article describes the functionality within Schema Studio which allows a user to establish the landscape of dependent types for a selected top-level type in a Schema.
The document summarizes some of the key new features in Java 17 including:
1. Long-term support for Java 17 which will be available in September 2021 and include features like records, text blocks, and enhanced null pointer exceptions.
2. Records, text blocks, helpful null pointer exceptions, pattern matching for switches, and sealed classes as some of the top new features in Java 17.
3. Enhancements to pseudo-random number generators with a new RandomGenerator interface and refactoring of legacy random classes.
This document discusses common web application security vulnerabilities like cross-site scripting (XSS) and SQL injection. It provides several approaches to prevent these vulnerabilities, including filtering HTML characters, allowing a limited character set, and safely allowing some HTML tags. It also demonstrates how XSS and SQL injection attacks can occur if user input is not sanitized properly before being displayed or used in database queries. The document recommends validating all user input and escaping special characters to prevent these attacks from being successful.
Integrating SAP the Java EE Way - JBoss One Day talk 2012hwilming
Cuckoo is an open source Resource Adapter for SAP that is compatible to the Java Connector Architecture (JCA) version 1.5.
It enables developers of Java EE applications to call functions in a SAP backend, making use of Java EE features like Container Managed Transactions and Security.
Hibersap helps developers of Java applications to call business logic in SAP backends. It defines a set of Java annotations to map SAP function modules to Java classes as well as a small, clean API to execute these function modules and handle transaction and security aspects.
Hibersap's programming model is quite similar to those of modern O/R mappers, significantly speeding up the development of SAP interfaces and making it much more fun to write the integration code.
This document provides an overview of Angular and TypeScript. It begins with an introduction to Angular and its features like cross-platform support, speed, productivity tools, and full development story. It then compares Angular, AngularJS, and React. Next it discusses tools like NodeJS, Angular CLI, and Visual Studio Code. It covers TypeScript fundamentals like data types, variables, functions, tuples, unions, interfaces, classes, namespaces and modules. It explains Angular architecture components like components, directives, routes, services and NgModule. Finally, it wraps up with a discussion of components in Angular and the topics that will be covered in the next session.
Workshop: EmberJS - In Depth
- Ember Data - Adapters & Serializers
- Routing and Navigation
- Templates
- Services
- Components
- Integration with 3rd party libraries
Presentado por ingenieros: Mario García y Marc Torrent
DSL - expressive syntax on top of a clean semantic modelDebasish Ghosh
Does a DSL mean compromising the domain model purity for an ultra-expressive syntax. This presentation discusses how to evolve your DSL syntax as a sublanguage of combinators on top of an expressive domain model.
Its very happy to introduced ourself. Our
Institution Adroit Infogen Pvt. Ltd. Corporation is
the industry leader in reliability consulting and
training services
Has been founded in 2007 by Mr.R.Praneeth
Reddy .
It is to inform that we have been chosen as one
of the outsourcing agencies to start IT related
ESDP's [Entrepreneurship & Skill Development
Programs] by NI-MSME. In this connection we
wish to inform that we are conducting free
training programs for the students which
provided the certification in different programs
by NI-MSME, Ministry of MSME, Govt of India)
The document discusses the Sahana Eden emergency development environment. It provides an overview of key concepts like the model-view-controller architecture and describes how to build a new module for incident reporting with models, controllers and views. Instructions are given for setting up the development environment and performing common tasks like defining data models, creating forms and joining resources.
This document provides an overview of JavaScript including:
1. How JavaScript code can be embedded in HTML pages using <script> tags internally or externally.
2. How JavaScript code is executed, with code outside of functions running on page load and code in functions only running when called.
3. The structure of JavaScript functions and how they are used to return values.
4. How external JavaScript files can be used to store common functions for reuse across multiple HTML pages.
5. The basic language elements of JavaScript like variables, data types, and operators.
The document discusses different ways of implementing type conversion in Java. It covers widening and narrowing conversions, as well as assignment conversion, promotion, and casting. It provides examples of each type of conversion and discusses how conversions can occur during arithmetic expressions and assignments. It also covers wrapper classes and their role in type conversions.
OGNL is an expression language used in Struts 2 to retrieve values from the value stack, which holds objects used by actions. OGNL expressions can be used in JSP views and XML configuration files to extract values. Struts 2 provides tags for control flow, data retrieval, and creating UI elements to build model-view-controller web applications. Validation can be done declaratively using XML files or programmatically in Java code.
This article describes how the W3C Schema SimpleType definitions can be transformed through generation to strong-types that can be used directly in development projects.
SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling Sencha
To connect real model data to a view model, mess around with it, validate it, and then save it back to the server is crucial for any modern application. I will help you understand how some of the key features of the Sencha Ext JS classes work together to handle many of the real world challenges. We will take a closer look at the classes and configs that help us consume and handle the more advanced data structures. I will explain how they are connected and how you can tweak them to your needs. The focus will be on view models, data models, data sessions, proxies, stores, and associations, and how they all come together in a real world application.
Twig is a template engine for PHP. It parses templates into tags, prints, and blocks. The lexer tokenizes templates into tokens, and the parser converts tokens into an AST. The compiler generates PHP code from the AST. Twig supports tags like for loops and if/else, macros, and internationalization. It can be extended with custom tags, filters, functions. Security features include escaping, sandboxing and permissions. Templates can access objects and be rendered without controllers.
Relevance trilogy may dream be with you! (dec17)Woonsan Ko
Introducing new BloomReach Experience Plugins which changes the game of DREAM (Digital Relevance Experience & Agility Management), to increase productivity and business agility.
This document discusses Elasticsearch and how to implement it beyond basic usage covered in Railscasts episodes. It covers Elasticsearch features like being schemaless, distributed, and RESTful. It then discusses how to configure mappings and analyzers for indexing partial words. Examples are given for searching, sorting results, and keeping the index in sync with database changes. Resources for further reading are also provided.
This article is the first in a series which takes a detailed look at generating strong types, in languages such as C# and Java, from W3C XSD schemas.
W3C Schema definitions are very much active in business areas such as Finance, Air Transportation, government messaging, hospitality and international goods and services
This document provides an overview of JavaScript concepts and features. It introduces JavaScript, its uses, basic syntax like variables, operators, and popup boxes. It also covers conditional statements, loops, functions, arrays, objects like Date and Math objects, regular expressions, and cookies. The document is intended as an introduction to JavaScript for learning its basic concepts.
This document provides an overview of JavaScript reversing techniques. It discusses JavaScript technologies like the DOM, Ajax, and JSON. It covers security aspects like the same-origin policy. It provides tips for analyzing JavaScript using tools like Firebug. It also demonstrates finding vulnerabilities like DOM-based XSS and reversing obfuscated JavaScript.
Last updated on Dec 12, 2014
The Sightly template language, shipped with Adobe Experience Manager 6.0, simplifies a lot the component development workflow by allowing front-end developers to edit components themselves directly.
Learn about the main features of that template language, and about the tools available to make project development work more efficient.
This document describes some recent refactoring of the W3C Schema processor which is part of the Schema Studio application. This processor turns Schema definitions into C# strong types ready to use in a development project.
This article looks at a specific "record-and-playback" testing tool, TestIm, and finds that it performs surprisingly well. It seems that the long-held view that such approaches are unreliable and lead to flaky tests is unfounded. The Phoenix Rises ...
This document provides an overview of Angular and TypeScript. It begins with an introduction to Angular and its features like cross-platform support, speed, productivity tools, and full development story. It then compares Angular, AngularJS, and React. Next it discusses tools like NodeJS, Angular CLI, and Visual Studio Code. It covers TypeScript fundamentals like data types, variables, functions, tuples, unions, interfaces, classes, namespaces and modules. It explains Angular architecture components like components, directives, routes, services and NgModule. Finally, it wraps up with a discussion of components in Angular and the topics that will be covered in the next session.
Workshop: EmberJS - In Depth
- Ember Data - Adapters & Serializers
- Routing and Navigation
- Templates
- Services
- Components
- Integration with 3rd party libraries
Presentado por ingenieros: Mario García y Marc Torrent
DSL - expressive syntax on top of a clean semantic modelDebasish Ghosh
Does a DSL mean compromising the domain model purity for an ultra-expressive syntax. This presentation discusses how to evolve your DSL syntax as a sublanguage of combinators on top of an expressive domain model.
Its very happy to introduced ourself. Our
Institution Adroit Infogen Pvt. Ltd. Corporation is
the industry leader in reliability consulting and
training services
Has been founded in 2007 by Mr.R.Praneeth
Reddy .
It is to inform that we have been chosen as one
of the outsourcing agencies to start IT related
ESDP's [Entrepreneurship & Skill Development
Programs] by NI-MSME. In this connection we
wish to inform that we are conducting free
training programs for the students which
provided the certification in different programs
by NI-MSME, Ministry of MSME, Govt of India)
The document discusses the Sahana Eden emergency development environment. It provides an overview of key concepts like the model-view-controller architecture and describes how to build a new module for incident reporting with models, controllers and views. Instructions are given for setting up the development environment and performing common tasks like defining data models, creating forms and joining resources.
This document provides an overview of JavaScript including:
1. How JavaScript code can be embedded in HTML pages using <script> tags internally or externally.
2. How JavaScript code is executed, with code outside of functions running on page load and code in functions only running when called.
3. The structure of JavaScript functions and how they are used to return values.
4. How external JavaScript files can be used to store common functions for reuse across multiple HTML pages.
5. The basic language elements of JavaScript like variables, data types, and operators.
The document discusses different ways of implementing type conversion in Java. It covers widening and narrowing conversions, as well as assignment conversion, promotion, and casting. It provides examples of each type of conversion and discusses how conversions can occur during arithmetic expressions and assignments. It also covers wrapper classes and their role in type conversions.
OGNL is an expression language used in Struts 2 to retrieve values from the value stack, which holds objects used by actions. OGNL expressions can be used in JSP views and XML configuration files to extract values. Struts 2 provides tags for control flow, data retrieval, and creating UI elements to build model-view-controller web applications. Validation can be done declaratively using XML files or programmatically in Java code.
This article describes how the W3C Schema SimpleType definitions can be transformed through generation to strong-types that can be used directly in development projects.
SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling Sencha
To connect real model data to a view model, mess around with it, validate it, and then save it back to the server is crucial for any modern application. I will help you understand how some of the key features of the Sencha Ext JS classes work together to handle many of the real world challenges. We will take a closer look at the classes and configs that help us consume and handle the more advanced data structures. I will explain how they are connected and how you can tweak them to your needs. The focus will be on view models, data models, data sessions, proxies, stores, and associations, and how they all come together in a real world application.
Twig is a template engine for PHP. It parses templates into tags, prints, and blocks. The lexer tokenizes templates into tokens, and the parser converts tokens into an AST. The compiler generates PHP code from the AST. Twig supports tags like for loops and if/else, macros, and internationalization. It can be extended with custom tags, filters, functions. Security features include escaping, sandboxing and permissions. Templates can access objects and be rendered without controllers.
Relevance trilogy may dream be with you! (dec17)Woonsan Ko
Introducing new BloomReach Experience Plugins which changes the game of DREAM (Digital Relevance Experience & Agility Management), to increase productivity and business agility.
This document discusses Elasticsearch and how to implement it beyond basic usage covered in Railscasts episodes. It covers Elasticsearch features like being schemaless, distributed, and RESTful. It then discusses how to configure mappings and analyzers for indexing partial words. Examples are given for searching, sorting results, and keeping the index in sync with database changes. Resources for further reading are also provided.
This article is the first in a series which takes a detailed look at generating strong types, in languages such as C# and Java, from W3C XSD schemas.
W3C Schema definitions are very much active in business areas such as Finance, Air Transportation, government messaging, hospitality and international goods and services
This document provides an overview of JavaScript concepts and features. It introduces JavaScript, its uses, basic syntax like variables, operators, and popup boxes. It also covers conditional statements, loops, functions, arrays, objects like Date and Math objects, regular expressions, and cookies. The document is intended as an introduction to JavaScript for learning its basic concepts.
This document provides an overview of JavaScript reversing techniques. It discusses JavaScript technologies like the DOM, Ajax, and JSON. It covers security aspects like the same-origin policy. It provides tips for analyzing JavaScript using tools like Firebug. It also demonstrates finding vulnerabilities like DOM-based XSS and reversing obfuscated JavaScript.
Last updated on Dec 12, 2014
The Sightly template language, shipped with Adobe Experience Manager 6.0, simplifies a lot the component development workflow by allowing front-end developers to edit components themselves directly.
Learn about the main features of that template language, and about the tools available to make project development work more efficient.
This document describes some recent refactoring of the W3C Schema processor which is part of the Schema Studio application. This processor turns Schema definitions into C# strong types ready to use in a development project.
Similar to Generation_XSD_Article - Part 3.pdf (20)
This article looks at a specific "record-and-playback" testing tool, TestIm, and finds that it performs surprisingly well. It seems that the long-held view that such approaches are unreliable and lead to flaky tests is unfounded. The Phoenix Rises ...
To anyone interested in accelerating their Test Automation work, here's an article that could well help to point the way ahead!
It also covers the production of multi-lingual validation data.
This Article explores the Test Automation challenges associated with the GridGain Control Centre (https://www.gridgain.com/).
The test framework is based on BDD/Selenide/Java/IntelliJ.
The exploratory tests look at five key User Journeys in the application.
In this article, I take a brief look at a tool which performs, essentially, Record Playback test creation and Execution - TestIm Chrome extension.
I was very pleasantly surprised by what I discovered.
This tool has definitely a place in the Test Automation toolbox, but, in my view, for business-related settings.
This document describes a test data value store approach for handling test data needs in behavior-driven development (BDD) automated tests. It involves storing test data in a JSON file organized by feature, scenario, example case, page, and language. The data store is initialized by resolving keys to the current test from Cucumber scenario tags. Test code can then retrieve data values from the store as needed to validate page elements for each test case execution. The approach aims to provide flexibility in retrieving test-dependent data while avoiding cluttering the clean BDD syntax with data tables or excessive scenario outlines.
This article provides a comparison of the Classic (Cucumber/Gherkin) and Technical (Karate/Gherkin) uses of the BDD style. It turns out that they are very complimentary.
Babble article - Test Automation & Text TranslationDavid Harrison
This article shows a pattern for Test Automation that embraces the testing (validation) of web applications that allow different spoken languages (EN, IT etc). It also presents a novel way of writing BDD statements that improves the Test Automation development and maintenance process.
This publication provides an innovative approach to documenting BDD-based test automation projects.
In particular, it introduces the BddDocumenter tool which merges the Business and Developer/(Test Automater) views of a test automation codebase into consistent and fluent documentation. Both the BDD statements and the Step Definition code can be changed as required, the new documentation can be easily regenerated.
This document describes a UI testing pattern using React, Material-UI, BDD with Cucumber, and Kotlin/Selenide. It utilizes the Se34 page object generator to generate page object classes from metadata. This separates page representation from test logic for improved maintenance. Tests are defined in BDD style and cover use cases like login, account creation, and password recovery. Page objects and step definitions enable clear and maintainable automation code. Test results are output to the console.
The document proposes a data-driven automated testing platform for web services using SoapUI. The platform utilizes Excel files to store test case data, request and response exemplars defined in XML, and Groovy scripts to build requests and validate responses. This allows testing web services in a maintainable and scalable way that is accessible for various roles.
This is the first part of a 3-part series covering Selenium-based test automation in the context of validation, workflow (Specflow), Zalenium and Azure cloud.
The slide deck provides insight into the features of a Selenium-based test automation approach that allows rapid test development and maintenance, such as would be needed in an AGile project context.
This slide pack describes an innovative approach to designing automated tests. This approach bridges the "language" gap that can sometimes exist between test automators/developers and business stakeholders.
This slide-pack describes a prototype application for building contextual documentation from Agile stories. The impact on normal Story writing is minimal, a set of business-related tags form the first line of the Story description.
This slide pack describes the challenges of We application test automation as well as provides a list of items that we would "prefer" to achieve when we automate. Finally, it provides an overview of a novel generative approach that cuts through the challenges, meets the "prefer" list items and allows Selenium-based test automation to be done at Agile speed.
Italy Agriculture Equipment Market Outlook to 2027harveenkaur52
Agriculture and Animal Care
Ken Research has an expertise in Agriculture and Animal Care sector and offer vast collection of information related to all major aspects such as Agriculture equipment, Crop Protection, Seed, Agriculture Chemical, Fertilizers, Protected Cultivators, Palm Oil, Hybrid Seed, Animal Feed additives and many more.
Our continuous study and findings in agriculture sector provide better insights to companies dealing with related product and services, government and agriculture associations, researchers and students to well understand the present and expected scenario.
Our Animal care category provides solutions on Animal Healthcare and related products and services, including, animal feed additives, vaccination
Instagram has become one of the most popular social media platforms, allowing people to share photos, videos, and stories with their followers. Sometimes, though, you might want to view someone's story without them knowing.
Understanding User Behavior with Google Analytics.pdfSEO Article Boost
Unlocking the full potential of Google Analytics is crucial for understanding and optimizing your website’s performance. This guide dives deep into the essential aspects of Google Analytics, from analyzing traffic sources to understanding user demographics and tracking user engagement.
Traffic Sources Analysis:
Discover where your website traffic originates. By examining the Acquisition section, you can identify whether visitors come from organic search, paid campaigns, direct visits, social media, or referral links. This knowledge helps in refining marketing strategies and optimizing resource allocation.
User Demographics Insights:
Gain a comprehensive view of your audience by exploring demographic data in the Audience section. Understand age, gender, and interests to tailor your marketing strategies effectively. Leverage this information to create personalized content and improve user engagement and conversion rates.
Tracking User Engagement:
Learn how to measure user interaction with your site through key metrics like bounce rate, average session duration, and pages per session. Enhance user experience by analyzing engagement metrics and implementing strategies to keep visitors engaged.
Conversion Rate Optimization:
Understand the importance of conversion rates and how to track them using Google Analytics. Set up Goals, analyze conversion funnels, segment your audience, and employ A/B testing to optimize your website for higher conversions. Utilize ecommerce tracking and multi-channel funnels for a detailed view of your sales performance and marketing channel contributions.
Custom Reports and Dashboards:
Create custom reports and dashboards to visualize and interpret data relevant to your business goals. Use advanced filters, segments, and visualization options to gain deeper insights. Incorporate custom dimensions and metrics for tailored data analysis. Integrate external data sources to enrich your analytics and make well-informed decisions.
This guide is designed to help you harness the power of Google Analytics for making data-driven decisions that enhance website performance and achieve your digital marketing objectives. Whether you are looking to improve SEO, refine your social media strategy, or boost conversion rates, understanding and utilizing Google Analytics is essential for your success.
Gen Z and the marketplaces - let's translate their needsLaura Szabó
The product workshop focused on exploring the requirements of Generation Z in relation to marketplace dynamics. We delved into their specific needs, examined the specifics in their shopping preferences, and analyzed their preferred methods for accessing information and making purchases within a marketplace. Through the study of real-life cases , we tried to gain valuable insights into enhancing the marketplace experience for Generation Z.
The workshop was held on the DMA Conference in Vienna June 2024.
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC
Ellisha Heppner, Grant Management Lead, presented an update on APNIC Foundation to the PNG DNS Forum held from 6 to 10 May, 2024 in Port Moresby, Papua New Guinea.
2. TABLE OF
CONTENTS
Introduction.............................................................................1
The AttributeGroup...................................................................1
Handling Enumerations .............................................................4
Handling AttributeGroup Content................................................8
Remarks ............................................................................... 19
Appendix: Class Documentation ............................................... 20
NegotiatedFareAttributes ...................................................20
DirectAndStopsGroup ........................................................29
DiscountPricingGroup ........................................................37
Appendix: Unit Tests............................................................... 49
NegotiatedFareAttributes ...................................................49
DirectAndStopsGroup ........................................................51
DiscountPricingGroup ........................................................52
Appendix: Base Class Documentation ....................................... 54
W3cAttribute....................................................................54
W3cAttributeGroup ...........................................................68
3. INTRODUCTION
In the previous article in this series, we looked at the SimpleType and its related
XSD elements W3C Primitives and type restrictions.
In this article we will look in detail at the Attribute (xs:attribute) and
AttributeGroup (xs:AttributeGroup).
We will use the same Schema set as in the previous article, the second version of
Open Travel (www.opentravel.org) for the year 2014 – 2014B.
THE ATTRIBUTEGROUP
The W3C AttributeGroup has the general definition:
<attributeGroup
id=ID
name=NCName
ref=QName
any attributes>
(annotation?),((attribute|attributeGroup)*,anyAttribute?))
</attributeGroup>
So, using Open Travel as our example Schema set, we see such definitions as:
<xs:attributeGroup name="NegotiatedFareAttributes">
<xs:annotation>
<xs:documentation xml:lang="en">Attribute collection providing negotiated fare
profile.</xs:documentation>
</xs:annotation>
<xs:attribute name="NegotiatedFareInd" type="xs:boolean" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">If true, this is a negotiated fare.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="NegotiatedFareCode" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">A code used to identify the negotiated
fare.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="ATPCO_NegCategoryCode" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">The ATPCO category code for this negotiated
fare.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:attributeGroup>
where the attribute group, NegotiatedFareAttributes, is a collection of xs:attribute
elements with no content but with base types from the W3c Primitive set, e.g.
xs:boolean and xs:string. These we encountered in the previous article.
4. 2
Additionally, we see such definitions as:
<xs:attributeGroup name="DirectAndStopsGroup">
<xs:annotation>
<xs:documentation xml:lang="en">Attribute collection providing information on direct flight
categorization and the number of stops made.</xs:documentation>
</xs:annotation>
<xs:attribute name="DirectFlightsOnly" type="xs:boolean" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">Indicates the same flight number on the same airline
regardless of number of stops in most cases.</xs:documentation>
<xs:documentation xml:lang="en">
<LegacyDefaultValue>false</LegacyDefaultValue>
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="NumberStops" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en"> Information regarding the number of stops made.
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:nonNegativeInteger">
<xs:maxInclusive value="9"/>
<xs:minInclusive value="0"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:attributeGroup>
Where the xs:attribute collection represented in this definition comprises one with
no content, DirectFlightsOnly, and one specified by a SimpleType with a min/max
restriction and a base type represented by the W3c Primitive numeric type,
xs:nonNegativeInteger.
We also find, in the Open Travel set, an AttributeGroup definition as:
<xs:attributeGroup name="DiscountPricingGroup">
<xs:annotation>
<xs:documentation xml:lang="en">The information needed for applying a discount to a fare.
</xs:documentation>
</xs:annotation>
<xs:attribute name="Purpose" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">Used to specify the purpose of the discount pricing.
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Airline">
<xs:annotation>
<xs:documentation xml:lang="en">The discount pricing is from the airline.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="Custom">
<xs:annotation>
<xs:documentation xml:lang="en">The discount pricing is a custom discount.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
5. 3
</xs:attribute>
<xs:attribute name="Type" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">Specifies the type of amount being sent.
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Amount">
<xs:annotation>
<xs:documentation xml:lang="en">The discount is an amount.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="Percent">
<xs:annotation>
<xs:documentation xml:lang="en">The discount is a percentage.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="PlusUpAmount">
<xs:annotation>
<xs:documentation xml:lang="en">A discount on an international fare that is not
a stored fare.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="Usage" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">Used to specify how the discount is to be applied.
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Plus">
<xs:annotation>
<xs:documentation xml:lang="en">The discount being applied is an increase to the
fare.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="Minus">
<xs:annotation>
<xs:documentation xml:lang="en">The discount being applied is subtracted from
the fare.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="Discount" type="MoneyOrPercentageType" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">The monetary amount or percentage of discount that should
be applied.
</xs:documentation>
</xs:annotation>
</xs:attribute>
6. 4
<xs:attribute name="TicketDesignatorCode" type="StringLength1to16" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">Specifies the code applicable to the fare that is being
discounted.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Text" type="StringLength1to128" use="optional"/>
</xs:attributeGroup>
In this, rather more substantial definition, we see a mix of Attribute styles. As
before, xs:attribute elements with no content, e.g. “Text”, but also ones that have
SimpleType restrictions, such as “Purpose” (enumeration restriction). We also see
ones where the attribute type is a SimpleType which is defined elsewhere in the
Schema set, like “”Discount”, and also where the attribute value is a W3C Primitive
type such as “TicketDesignatorCode” and “Text”.
All these forms need to be embraced in our generator, specifically in the Schema
Studio extension that handles the global AttributeGroup generation process.
HANDLING ENUMERATIONS
If we look at the definition of DiscountPricingGroup we see that there are a number
of SimpleType items based on an enumeration restriction, e.g. “Purpose”, “Type” and
“Usage”. If we take the case of “Type” our generator emits a C# enumeration which
looks like:
7. 5
As can be see the individual enumeration values are transformed from the values
specified in the schema, “Active” and “Custom”, to have an “e” prefix. Why is this?
In the NIEM1 Schema, for example, set we see enumerations that look like:
The values shown here are not consistent with enumeration values in our target
programming languages (C#, Java), so in order to provide a general purpose
transformation, we generate all enumeration values with an “e” prefix, at least.
However, this is not the only challenge when considering enumeration values. We
need to cater for such forms as (again from NIEM):
1
NIEM - Home | NIEM | National Information Exchange Model
8. 6
In this case we need to account for embedded spaces.
In this case we have, not only embedded spaces, but also punctuation characters, in
this case “,”.
9. 7
We also need to take account of cases where the enumeration value starts with the
character “+” or “-“.
Our generator has a Naming Factory designed, among other things, to transform
these enumeration values into forms acceptable to the target development
language.
But, once transformed, how can we know the original value? We must know this
when we come to serialize/deserialize our strong type objects. To enable us to
recover the original form, enumeration values have a custom attribute, which in C#
looks as in the example below, EnumerationFieldBasisAttribute:
The parameter to the custom attribute is the original enumeration value. In
addition, the XML comments also show this original value, which means that the
developer gets to see it via Intellisense (in C#, for example). So, whatever
transformations are applied to the original form we can retrieve the original form via
a method call as exemplified below:
Where the method is an extension to the standard Enum class and takes the form:
10. 8
HANDLING ATTRIBUTEGROUP CONTENT
As we saw in the previous section, AttributeGroup elements can have a variety of
content. The Generator needs to cater for this and emit code that reflects this
landscape of content models.
General
The AttributeGroup classes all have a base class of W3cAttributeGroup, providing the
necessary support.
In terms of content, this base class defines a collection to hold the content items:
One of the constructors that can be used by inheritors causes populates this
collection:
11. 9
The content array parameter contains all W3cAttribute- or W3cAttributeGroup-based
elements defined in the source schema and thus required by the inheritor.
We also need to consider the general need for both a stringified form of the base
class as well as a formatted string which reflects the actual attribute or attribute
group as it would appear in an XML document.
In the W3cAttributeGroup class we have a ToString() method, which looks like this:
In this method, the content of the object, including the type-specific elements in the
content collection, is stringified and returned to the inheritor.
The ToString() method deals with the state of the complete object, which is fine,
but it would be useful to have a representation of the W3cAttributeGroup as it would
12. 10
appear in an XML document, for example. The AttributeGroup() method provides
this service:
In this method the content collection is iterated and each of the elements is handled
in a type-specific way to give the sequence of “name=value” pairs which comprise the
resulting string.
Both the ToString() and AttributeGroup() methods are validated for the various
types, in the Unit Tests presented in a later section.
DirectAndStopsGroup
This attribute group contains two W3cAttribute elements, “DirectFlightsOnly” and
“NumberStops”. To initialise the representation of this class in the DirectAndStops
class, we have a constructor in the form:
13. 11
Here you can see how the individual W3cAttribute elements are instantiated, and
specifically how the restriction information appearing in the source schema enters
the picture, “NumberStops” in particular. The pair of W3cAttribute items are passed
to the base class collection via the call to SetAttributeGroupContent().
The class specific ToString() and AttributeGroup() methods are as shown below:
14. 12
Where the interaction between the inheritor information and that in the base class
can be clearly seen. The AttributeGroup() method looks like:
Here you can see how the base class (W3cAttributeGroup) in this case, since all
content items are based on W3cAttribute, supplies the entire stringified form, i.e.
there are no other content elements.
15. 13
DiscountPricingGroup
In the case of DiscountPricingGroup we have an entirely different situation: all the
items are either SimpleType elements with enumeration restrictions or other
named SimpleType types from our Open Travel schema set. In this case, the
individual items are generated as enumerations directly.
The constructor for this class looks like this:
Notice that base call to the base class method SetAttributeGroupContent() now has
an empty array parameter.
The ToString() method for this case is as shown below:
16. 14
The ToString() method still calls the appropriate base method but since there are
no items being held by the base class collection, the empty string is returned. The
AttributeGroup() method is similar in structure to the form we saw in the previous
17. 15
section. We now have all the items in the inheritor class, DiscountPricingGroup,
appearing in the method to give the special format string:
18. 16
NegotiatedFareAttributes
This class is composed entirely of W3cAttribute items which have distinct restriction
conditions, and this is reflected in the constructor of the class:
Here we can see how the base attribute content collection is populated with the
individual W3cAttribute items.
The ToString() method, in this case, looks as shown below:
19. 17
In the case of the AttributeGroup() method, the following is emitted:
20. 18
Here we see that all the content for the resultant string form comes from the base
method since that is where all the actual content resides.
21. 19
REMARKS
In this article, we have looked at several styles of AttributeGroup classes as emitted
by our generator, all taken from the Open Travel 2014B specification.
The configuration of Schema Studio allows us to specify if the generated classes
should have appropriate methods to serialize/deserialize class instances. The topic
of serialization/deserialization is pended to a later article.
The AttributeGroup/Attribute types generated, are described in the Class
Documentation Appendix below, for which corresponding tests are provided in the
Unit Test Appendix following.
22. 20
APPENDIX: CLASS DOCUMENTATION
One of the key assets for a developer when using a class library is documentation.
This appendix gives an overview of the documentation available from the generated
types we saw in the above sections.
It should be noted that the types we consider here are but a small subset of all the
types that can be generated from the OpenTravel/OTA/V2014B Schema set.
SimpleType Name Content-Type XSD Comment
NegotiatedFareAttributes None Attribute collection providing negotiated
fare profile.
DirectAndStopsGroup None
Restricted-
SimpleType/Min-Max
Attribute collection provides information on
direct flight categorization and the number
of stops made.
DiscountPricingGroup Restricted-
SimpleType/Enumeration
The information needed for applying a
discount to a fare.
NegotiatedFareAttributes
51. 49
APPENDIX: UNIT TESTS
As part of our generation process, we need to assert that the emitted classes meet
their specification. This we do using unit testing.
In this section, we illustrate the tests applied to the AttributeGroup classes noted in
the previous sections.
Index
NegotiatedFareAttributes
DirectAndStopsGroup
DiscountPricingGroup
NegotiatedFareAttributes
56. 54
APPENDIX: BASE CLASS DOCUMENTATION
In this section we provide the documentation for the key base classes we have used
in the generated code we have seen in earlier sections, W3cAttribute and
W3cAttributeGroup.
W3cAttribute