Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 459319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:45:38+00:00 2026-05-12T22:45:38+00:00

I have an XSD that I created. A Transaction Header can one or more

  • 0

I have an XSD that I created. A Transaction Header can one or more Transaction-Items. This XSD will only allow ONE Transaction Header and multiple Transaction-Items in an XML file. I am looking for MULTIPLE Transaction Headers with it’s related multiple Transaction-Items. What is missing in the XSD to allow me to do this? Thanks.

<?xml version="1.0" encoding="UTF-8"?>
<!--W3C Schema generated by XMLSpy v2010 (http://www.altova.com)-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="transaction-item">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="StartDate"/>
                <xs:element ref="EndDate"/>
                <xs:element ref="Amount"/>
                <xs:element ref="BusinessPartnerID"/>
                <xs:element ref="Description"/>
            </xs:sequence>
            <xs:attribute name="type" use="required">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="Production or Import"/>
                        <xs:enumeration value="Transfer: Release Obligation"/>
                        <xs:enumeration value="Transfer: Retain Obligation"/>
                        <xs:enumeration value="Acquire: Without Obligation"/>
                        <xs:enumeration value="Acquire: With Obligation"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
        </xs:complexType>
    </xs:element>
    <xs:element name="Amount">
        <xs:simpleType>
            <xs:restriction base="xs:positiveInteger"/>
        </xs:simpleType>
    </xs:element>
    <xs:element name="Year">
        <xs:simpleType>
            <xs:restriction base="xs:short"/>
        </xs:simpleType>
    </xs:element>
    <xs:element name="TransactionHeader">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="Quarter"/>
                <xs:element ref="Year"/>
                <xs:element ref="FuelPathwayCode"/>
                <xs:element ref="PhysicalPathwayCode"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="StartDate">
        <xs:simpleType>
            <xs:restriction base="xs:date"/>
        </xs:simpleType>
    </xs:element>
    <xs:element name="Quarter">
        <xs:simpleType>
            <xs:restriction base="xs:byte"/>
        </xs:simpleType>
    </xs:element>
    <xs:element name="PhysicalPathwayCode">
        <xs:simpleType>
            <xs:restriction base="xs:string">
                <xs:enumeration value="PP001"/>
                <xs:enumeration value="PP002"/>
                <xs:enumeration value="PP003"/>
                <xs:enumeration value="PP004"/>
                <xs:enumeration value="PP005"/>
                <xs:enumeration value="PP006"/>
                <xs:enumeration value="PP007"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>
    <xs:element name="LCFS-report">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="TransactionHeader"/>
                <xs:element ref="transaction-item" maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:attribute name="total-sum" use="required">
                <xs:simpleType>
                    <xs:restriction base="xs:byte"/>
                </xs:simpleType>
            </xs:attribute>
            <xs:attribute name="detailed" type="xs:boolean" use="required"/>
            <xs:attribute name="currency" use="required">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="USD"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
        </xs:complexType>
    </xs:element>
    <xs:element name="FuelPathwayCode">
        <xs:simpleType>
            <xs:restriction base="xs:string">
                <xs:enumeration value="CARBOB001"/>
                <xs:enumeration value="CARBOB002-HIGH"/>
                <xs:enumeration value="CARBOB002-INC"/>
                <xs:enumeration value="Ethanol001"/>
                <xs:enumeration value="Ethanol002"/>
                <xs:enumeration value="Ethanol003"/>
                <xs:enumeration value="Ethanol004"/>
                <xs:enumeration value="Ethanol005"/>
                <xs:enumeration value="Ethanol006"/>
                <xs:enumeration value="Ethanol007"/>
                <xs:enumeration value="Ethanol008"/>
                <xs:enumeration value="Ethanol009"/>
                <xs:enumeration value="Ethanol0010"/>
                <xs:enumeration value="Ethanol0012"/>
                <xs:enumeration value="Fossil CNG001"/>
                <xs:enumeration value="Fossil CNG002"/>
                <xs:enumeration value="Biogas CNG001"/>
                <xs:enumeration value="Electricity001_30"/>
                <xs:enumeration value="Electricity002_27"/>
                <xs:enumeration value="ULSD-CA Diesel Fuel"/>
                <xs:enumeration value="Compressed Hydrogen001"/>
                <xs:enumeration value="Liquid Hydrogen001"/>
                <xs:enumeration value="Compressed Hydrogen002"/>
                <xs:enumeration value="Compressed Hydrogen003"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>
    <xs:element name="EndDate">
        <xs:simpleType>
            <xs:restriction base="xs:date"/>
        </xs:simpleType>
    </xs:element>
    <xs:element name="Description">
        <xs:simpleType>
            <xs:restriction base="xs:string"/>
        </xs:simpleType>
    </xs:element>
    <xs:element name="BusinessPartnerID">
        <xs:simpleType>
            <xs:restriction base="xs:short"/>
        </xs:simpleType>
    </xs:element>
</xs:schema>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T22:45:38+00:00Added an answer on May 12, 2026 at 10:45 pm

    First, I would convert your TransactionHeader to a separate type:

        <xs:complexType name="TransactionHeaderType">
                <xs:sequence>
                        <xs:element ref="Quarter"/>
                        <xs:element ref="Year"/>
                        <xs:element ref="FuelPathwayCode"/>
                        <xs:element ref="PhysicalPathwayCode"/>
                </xs:sequence>
        </xs:complexType>
    

    Then you can define a new element of complex type that can contain any number of transaction headers:

      <xs:element name="Root">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="TransactionHeader" 
                        type="TransactionHeaderType"  
                        minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    

    By default, in XML Schema, minOccurs and maxOccurs both are set to 1 – but in a sequence, you can change that number to anything you like – including the “unbounded” for maxOccurs.

    Marc

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an xsd that looks like this (snippet): <xs:complexType name=IDType> <xs:choice minOccurs=1 maxOccurs=2>
I have a an XSD that looks like this (roughly) <xs:schema id=Appointment targetNamespace=http://tempuri.org/Record.xsd elementFormDefault=qualified
I have created an XSD and have run XSD.exe on top of that .xsd
I have an element that looks something like this. <xsd:element name=container> <xsd:complexType> <xsd:choice minOccurs=0
I have one Servlet that does insertion into my database. This is working fine.
We have a netbeans project that has an xsd that we use to create
I have an XML file that I used to create an XSD File and
I have an XSD file that is encoded in UTF-8, and any text editor
I am working on Jboss 4.05 , I have an xsd file that was
I have a project where a xsd document is loaded, and based on that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.