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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:00:06+00:00 2026-06-09T19:00:06+00:00

I am developing an XSD document to validate XML Import files. Nearly all elements

  • 0

I am developing an XSD document to validate XML Import files. Nearly all elements of the import file ‘can’ have an ID attribute (UPDATE). The UPDATE attribute must be limited to 4 possible values, so I have this pre-set type to use for the attribute restriction…

<xs:simpleType name="MyUpDir">
  <xs:restriction base="xs:string">
    <xs:enumeration value="OVERWRITE"/>
    <xs:enumeration value="ADDONLY" />
    <xs:enumeration value="NOERASE" />
    <xs:enumeration value="IGNORE" />
  </xs:restriction>
</xs:simpleType>

In addition to the attribute restrictions, each element’s value is limited by a variety of pre-set custom types
Example:

<xs:simpleType name="MyChar50">
  <xs:restriction base="xs:string">
    <xs:maxLength value="50" />
  </xs:restriction>
</xs:simpleType>

To combine the two, I know I can do it in-line for each element as follows:

<xs:element name="FullName">
  <xs:complexType>
    <xs:simpleContent>
      <xs:extension base="MyChar50">
        <xs:attribute name="UPDATE" type="MyUpDir" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
</xs:element>

The problem is that there are over 1000 elements in the import file, each having varying length/regEx/precision restrictions (roughly 20 custom types) as well as have the potential for the UPDATE attribute. Without the UPDATE attribute, I could do each element on its own line by using the custom types, greatly reducing the ‘content’ portion of the XSD. But from what I’ve read, it appears that to accomodate the custom types AND the potential for the attribute mentioned, I’m forced to use the expanded sample (last example) instead of being able to retain a single line for each such element. Is there not a way to minimize this further by creating a custom type that combines the two?

  • 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-09T19:00:08+00:00Added an answer on June 9, 2026 at 7:00 pm

    I would think that you could do 20 custom types more (for a total of 40) and then use the appropriate ones (w/ or w/o attribute). In your case:

    <xs:complexType name="MyChar50Attr"><!-- This one has attributes -->
        <xs:simpleContent>
            <xs:extension base="MyChar50">
                <xs:attribute name="UPDATE" type="MyUpDir"/>
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>
    <xs:element name="FullName" type="MyChar50Attr"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a software based upon Spring and ICEFaces. I have a file at
I am developing my first application in spring security. My applicationContext-security.xml file looks like
Developing for Android 2.3, I have a question regarding layouts. I use a vertival
Developing a project of mine I realize I have a need for some level
iam developing one application.In that i need to get the music files from the
I am developing a system that will receive a XML (XmlDocument) via webservice. I
developing iphone app, I have used a UIImageview and i have set an image
Developing search utility to search a file entire computer system, works fine on windows
Developing for iPhone, I have a collection of points that I need to make
developing an application in Access. The access file will be located on a db

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.