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 7839977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:37:08+00:00 2026-06-02T15:37:08+00:00

I am converting an older data set to schema/xml. It contains a few elements

  • 0

I am converting an older data set to schema/xml. It contains a few elements that are arrays with default values. I am close to a solution with xs:list;

    <xs:element name="pressure"
            default="0.22 0.33 0.44 0.55 0.66 0.77 0.88 0.88 0.88 0.88">
  <xs:simpleType>
    <xs:list>
      <xs:simpleType>
        <xs:restriction base="xs:float">
           <xs:minInclusive value="0.0" />
           <xs:maxInclusive value="2.0" />
        </xs:restriction>
      </xs:simpleType>
    </xs:list>
  </xs:simpleType>
</xs:element>

How can i limit the length of the list to 10? I.e., where in this would I put the

    <xs:length value="10">?
  • 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-06-02T15:37:10+00:00Added an answer on June 2, 2026 at 3:37 pm

    The base type is a xs:restriction on xs:float.

    <xs:simpleType name="ptype">
      <xs:restriction base="xs:float">
        <xs:minInclusive value="0.0" />
        <xs:maxInclusive value="2.0" />
      </xs:restriction>
    </xs:simpleType>
    

    This is wrapped in an xs:list.

    <xs:simpleType name="ltype">
      <xs:list itemType="ptype"/>
    </xs:simpleType>
    

    Next, place a length restriction on the list.

    <xs:simpleType name="rtype">
      <xs:restriction base="ltype">
        <xs:length value="10"/>
      </xs:restriction>
    </xs:simpleType>
    

    Finally, the element, with the default values

    <xs:element name="pressure"
        default="0.22 0.33 0.44 0.55 0.66 0.77 0.88 0.88 0.88 0.88">
      <xs:simpleType>
        <xs:restriction base="rtype"/>
      </xs:simpleType>
    </xs:element>
    

    TO get the fully anonymous element, start at the top, and nest each construct into the next lower construct which references it. Finally, ended up with this;

    <xs:element name="pressure"
            default="0.22 0.33 0.44 0.55 0.66 0.77 0.88 0.88 0.88 0.88">
      <xs:simpleType>
        <xs:restriction>
          <xs:simpleType>
            <xs:list>
              <xs:simpleType>
                <xs:restriction base="xs:float">
                   <xs:minInclusive value="0.0" />
                   <xs:maxInclusive value="2.0" />
                </xs:restriction>
              </xs:simpleType>
            </xs:list>
          </xs:simpleType>
          <xs:length value="10"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:element>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Recently I noticed that when I am converting a list to set the order
I have xml data that is retrieved from a server and I need to
I have a Python set that contains objects with __hash__ and __eq__ methods in
Can anyone help with converting data from an XML document into an associative array?
I'm writing an application that convert data serialized in ruby (file A) to xml
I am converting an older C# Website Project into a Web Application Project so
Converting to ODB.NET from System.Data.OracleClient and need help converting my connection string. Here is
I have a data set with latitude and longitude coordinates (two separate decimal columns).
I am getting the following error in my code. Error converting data type nvarchar
I am using a custom tool for converting data from a proprietary format to

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.