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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:49:30+00:00 2026-06-17T15:49:30+00:00

I need an advice how to design xsd schema to represent objects. I have

  • 0

I need an advice how to design xsd schema to represent objects.

I have a such interface

public interface Validator{
     boolean validate(Q query);   
}

And I have some implementations –

public class SimpleValidator implements Validator{

     private R param;

     public boolean validate(Q Query){
          //some logic with using param   
     }

     public void setParam(R param){
         this.param = param;
     }
}


public class AnotherValidator implements Validator{

     private Data data1;
     private Data data1;

     public boolean validate(Q Query){
          //some logic with using data1 and data2   
     }

     public void setData1(Data data1){
         this.data1 = data1;
     }

     public void setData2(Data data2){
         this.data2 = data2;
     }
}

I have such decision –

I create root element – <xsd:element name="validator" type="validatorType"/>

And such elements –

<xsd:element name="simpleValidator" type="simpleValidatorType"  substitutionGroup="validator"/>

<xsd:element name="anotherValidator" type="anotherValidatorType"  substitutionGroup="validator"/>

Now I can use tags simpleValidator and anotherValidator in the place where is needing validator. Example –

<anotherValidator>
     <data1 value="value1"/>
     <data2 value="value2"/>
</anotherValidator>

The problem is, that I want to use only tag validator. As example, I want something like this –

<validator type="simpleValidator>
     //simpleValidator data
</validator>

<validator type="anotherValidator>
     //anotherValidator data
</validator>
  • 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-17T15:49:32+00:00Added an answer on June 17, 2026 at 3:49 pm

    I think this can be done using Runtime Polymorphism via xsi:type and Abstract Types
    I found a related question also : May be helpful.

    In one of my project i was dellign with , but there are different type of address namely shippingAddress, billingAddress ..we used this techniqe to solve our problem.

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

Sidebar

Related Questions

I need some advice for a design which I have to implement in application.
I need some advice about the design on my app. I have several screens
I need advice on the best way to accomplish the following design schema. I
I need your advice regarding my design and if you have a better idea
I need some advice on MongoDB schema design for a natural language database. I
I need an advice about USB programming in linux. i have to design a
I'd need advice on following situation with Oracle/PostgreSQL: I have a db table with
I really need advice on how to do the following. I have tried several
I think I have this working but I need advice. I'd like to know
I have 3 tables, I need advice on how to get data from them.

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.