Xsd:complexType with extension and unordered (sometimes not all) elements

Hello, I have a schema definition that I need to change.
I have the following BASE (from which I extend) elements Entity and Record Info, and I have a Quote element that extends from entity.
Some times a Quote (title, context, quoted, written) will have all its elements and some times the user will not enter the [context] for example (as the quote maybe self explanatory),
so I am in need of a definition that will allow me that.
Also I have a User entity that is working fine, but when I run the JUnit test it changes the order of userName and userPassword and what happens is that it throws an error because it is expecting the order (userName then userPassword, and not userPassword firs, and userName second) is this possible to change also?
The ideal would be a Definition that will allow me unordered elements and some of the elements can be missing also, well now that I think about it I could just put the element with an empty string, but what could I do about the order?
I need some field like id and record info, but the rest, I really don't care if title is the first element or the last.
These are my schema parts I used to have sequence but I am trying with xsd:all but it crashes:
    <xsd:complexType name="entity">
        <xsd:sequence>
            <xsd:element name="synapseId" type="xsd:string"></xsd:element>
            <xsd:element name="recordInfo" type="tns:recordInformation" xmlns:tns="http://xml.fdt.com/Schemas/Cognoscere/mainRepository"></xsd:element>
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:string"/>
        <xsd:attribute name="languageCode" type="xsd:string"/>
        <xsd:attribute name="countryCode" type="xsd:string"/>
        <xsd:attribute name="regenerateAs" type="xsd:string" use="optional"/>
    </xsd:complexType>
    <xsd:complexType name="recordInformation">
        <xsd:sequence>
            <xsd:element name="createdBy" type="xsd:string"></xsd:element>
            <xsd:element name="createdDate" type="xsd:long"></xsd:element>
            <xsd:element name="modifiedBy" type="xsd:string"></xsd:element>
            <xsd:element name="modifiedDate" type="xsd:long"></xsd:element>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="quote">
        <xsd:complexContent>
            <xsd:extension base="tns:entity">
                <xsd:sequence>
                        <xsd:element name="title" type="xsd:string"></xsd:element>
                        <xsd:element name="context" type="xsd:string"></xsd:element>
                        <xsd:element name="preface" type="xsd:string"></xsd:element>
                        <xsd:element name="quoted" type="xsd:string"></xsd:element>
                        <xsd:element name="written" type="xsd:long"></xsd:element>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>by the way, when I tried with xsd:all minOccur etc, this is the error it threw:
s4s-elt-must-match.1: The content of 'sequence' must match (annotation?, (element | group | choice | sequence | any)*). A problem was found starting at: all. [58]
f(t)

sorry the error was
cos-all-limited.1.2: An all model group must appear in a particle with {min occurs} = {max occurs} = 1, and that particle must be part of a pair which constitutes the {content type} of a complex type definition.
not the other one.
I found it is working with choice. Is this ok?
<xsd:complexType name="quote">
        <xsd:complexContent>
            <xsd:extension base="tns:entity">
                <xsd:choice minOccurs="0" maxOccurs="unbounded">
                    <xsd:element name="title" type="xsd:string"></xsd:element>
                    <xsd:element name="context" type="xsd:string"></xsd:element>
                    <xsd:element name="preface" type="xsd:string"></xsd:element>
                    <xsd:element name="quoted" type="xsd:string"></xsd:element>
                    <xsd:element name="written" type="xsd:long"></xsd:element>
                </xsd:choice>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>Doesn't look right to me, but my app is working, I would like to do it well not just have it working. (welcome to the nice happy and easy going place that is my mind) ;-)
f(t)

Similar Messages

  • Macbook Air Late 2010 model, 10.6.7, 2.13 4g ram. Trackpad is not working properly and in sometimes not at all.

    Macbook Air Late 2010 model, 10.6.7, 2.13 4g ram. Trackpad is not working properly and in sometimes not at all. Need suggestions to resolve this issue?  I have applied all Mac updates and still having problems with the trackpad.

    The machine has a 1 year warranty, book an appointment with your local Apple Store or AASP to have it looked at.
    You can try doing a SMC reset however I don't think that is the solution.
    SMC RESET
    • Shut down the computer.
    • Plug in the MagSafe power adapter to a power source, connecting it to the Mac if its not already connected.
    • On the built-in keyboard, press the (left side) Shift-Control-• Option keys and the power button at the same time.
    • Release all the keys and the power button at the same time.
    • Press the power button to turn on the computer.
    PRAM RESET
    • Shut down the computer.
    • Locate the following keys on the keyboard: Command, Option, P, and R. You will need to hold these keys down simultaneously in step 4.
    • Turn on the computer.
    • Press and hold the Command-Option-P-R keys. You must press this key combination before the gray screen appears.
    • Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    • Release the keys.

  • On 3G we cannot send emails from either our iPhones or iPad and this also happens with some WiFi connections but not all.  Yet we can always send emails from our Hotmail Email account.  What is causing this and what do we need to do to resolve it?

    On 3G we cannot send  Business emails from either our iPhones or Ipad and this also happens with some WiFi connections but not all.  Yet we can always send emails from our Hotmail Account using both 3G and WiFi.
    We bought the iPhones and Ipad so that we could send emails while we are out of the Office, but we are not able to do this unless we can find a WiFi connection. Incoming emails are fine.  We use IMAP, for Business emails just incase this is relevant and I know that Hotmail is POP3.
    Our technical IT knowledge is not great, so we look forward to your suggestions as to how to resolve this. 

    Contact whomever supports the email account and get the correct Outgoing email server settings from them.

  • I was trying to get the iOS 8.2 on my iPhone 5 but then it stopped and my phone is now on recovery mode I have pictures I need and they did not all fit on iCloud  how can I use the phone again with ALL my pictures and videos without restoring it?

    I was trying to get the iOS 8.2 on my iPhone 5 but then it stopped and my phone is now on recovery mode I have pictures I need and they did not all fit on iCloud  how can I use the phone again with ALL my pictures and videos without restoring it?

    Contacts are designed to be synced to a supported application on the computer or a cloud service.
    Pictures taken with the device are designed to regularly be copied off the device to a computer as would be done with any digital camera.
    If you have failed to use the device as designed it may be too late to recovery anything.
    Is the device regularly backed up to a computer via iTunes?  If so, the most recent backup (when restored to a replacement iOS device) should contain all contacts and pictures as of when the backup was created.

  • I have a toshiba lap top computer with vista and I can not get my iphone to connect all the way .. it says "connected with limited activity"?

    I have a toshiba lap top computer with vista and I can not get my new iphone to connect all the way .... it says "connected with limited activity". which means I don't get on. Any help would be appreciated. Thanks.  

    Hi all,
    Guess I understand what is going on as I'm also experiencing the problem.
    Basically the issue is about the iPhone 4's personal hotspot.
    I'm trying to hook on personal hotspot to my toshiba laptop but it couldnt work as the connection is limited to local only without Internet access.
    The hotspot works well on other laptop and I-devices, but not my toshiba...
    Hope to get assistance here. Thanks

  • I downloaded Firefox 4.0 and it says to re-install the toolbar but I have not been successful in doing so. Can I go back to the older version? I had no trouble with that and I do not like this new version at all.

    I downloaded Firefox 4.0 and it says to re-install the toolbar but I have not been successful in doing so. I went to the forums and tried all the suggested fixes but none worked. Can I go back to the older version? I had no trouble with that and I do not like this new version at all. I tried a system restore twice and it did not fix the problem.

    I would imagine it's the MyWay Searchbar which is classified by most anti-malware scanners as adware, or even worse as spyware. I say that because I see "SmileyCentral" in your list of plugins and that's an add-on for that particular toolbar. You can disable that via Tools | Add-ons | Plugins.
    There are a number of toolbars which won't work with Firefox 4 anymore due to the enhanced protection mechanisms in the browser.
    Mozilla recommends that you only install add-ons from its own security site @ https://addons.mozilla.org/en-US/firefox/?browse=featured Generally speaking, those have all been tested and approved. The exceptions are those currently under review which are marked with a yellow banner to warn users that they haven't passed Mozilla's labs yet.

  • I have updated my iphone 4s with ios6 and now im not able to connect to itunes store. I can open the apps store but cannot install any app?  Anyone facing the same issue..

    I have updated my iphone 4s with ios6 and now im not able to connect to itunes store. I can open the apps store but cannot install any app?  Anyone facing the same issue..

    I have a 4S and upgraded to iOS 6 last week without any issues.
    Have you tried resetting your phone (hold the power and home buttons down together until the silver apple appears)?

  • I updated my macbook with lion and airdrop does not show up in the finder, how could this be?

    I updated my macbook with lion and airdrop does not show up in the finder, how could this be?

    shldr2thewheel wrote:
    If this is the case: How to enable AirDrop over ethernet and AirDrop on unsupported macs running Lion  .
    http://osxdaily.com/2011/09/16/enable-airdrop-ethernet-and-unsupported-macs/
    Interesting.  Googling, I see that someone posted that on these discussions as well:
    https://discussions.apple.com/thread/3331216?start=0&tstart=0
    which mentions what I recall: that Airdrop (as implemented by Apple) would create an on-demand ad-hoc Wi-Fi connection, even if you were already connected to an access point.  Normally, you can't connect to multiple Wi-Fi networks, thus the reason for Airdrop only supported on newer Wi-Fi chips.
    And Apple's KB:
    http://support.apple.com/kb/HT4783

  • HT1212 what if the person is not with you and you do not know which email they had used

    what if the person is not with you and you do not know which email they had used

    Maybe:
    Is there a way to find my Apple ID Name if I can't remember it?
    Yes. Visit My Apple ID and click Find your Apple ID. See Finding your Apple ID if you'd like more information.
    How do I change or recover a forgotten Apple ID Password?
    If you've forgotten your Apple ID Password or want to change it, go to My Apple ID and follow the instructions. SeeChanging your Apple ID password if you'd like more information.
    Or contact the person and have them remove it from their account
    Find My iPhone Activation Lock: Removing a device from a previous owner’s account

  • HT3574 The personal hotspot is not working with me and I did not fine the icon for iphone 4 version 5.1.1

    The personal hotspot is not working with me and I did not fine the icon for iphone 4 version 5.1.1

    Check with your carrier or telephone service provider.  Not all carriers provide this service.

  • I entered my email in word with friends and it did not allow me to sign on. It said I needed to activate the email. How do I do that?

    I entered my email in word with friends and it did not allow me to sign on. It said I needed to activate the email. How do I do that?

    What does: "I entered my email in word with friends" mean?  Please explain better your problem and what you want to do.

  • I have an iPhone 4 and getting a iPod touch for my child, my question is whether to create separate account or have a shared account? I want to share some music and apps but not all and I also want her to be able to iMessage and face time with her owniPod

    I have an iPhone 4 and getting a iPod touch for my child, my question is whether to create separate account or have a shared account? I want to share some music and apps but not all and I also want her to be able to iMessage and face time with her own iPod and own account .   What's the best way to go?

    You can use one Apple ID for purchasing (App Store & iTunes Store) and shared with your child whereas your child uses a different Apple ID for Game Center, e-mail, FaceTime, iMessage. Even on iCloud there you'll get an extra 5GB free. 

  • My iCloud on my phone is undJer another persons account I however am no longer with them and want to cut all ties and is there any way for me to change my iCloud account or will it affect my phone? And it's photos, apps, music?

    My iCloud on my phone is under another persons account I however am no longer with them and want to cut all ties and is there any way for me to change my iCloud account or will it affect my phone? And it's photos, apps, music?

    You have to delete the iCloud account but you can keep all your data such as Contacts, Calendars etc. when you delete the account you will prompted to "Keep on my iPhone".
    All your purchased content (like apps and music from iTunes Store) belongs to the original ID and you have to re-Purchase them under your Apple ID.
    Photos in Camera Roll remains in Camera Roll.
    Photos in photo stream that are not in Camera Roll must be saved in Camera Roll.
    Photo that previously synced from iTunes remains in photo library until you synced with another iTunes library (another computer).
    Also sign out from iMessages, FaceTime and Home sharing (Settings>Music)

  • Safari (3.0.4) on Mac OS 10.4.11 has started quitting when viewing news and weather sites - not all sites, not the same sites every time.

    Safari (3.0.4) on Mac OS 10.4.11 has started quitting when viewing news and weather sites - not all sites, not the same sites every day. Help?

    Hi Gary...
    I see you are running v10.4.11 and you have updated Safari but make certain all the system software is up to date by clicking your Apple menu / Software Update.
    If everything is up to date, try resetting Safari from the menu bar.
    Select the top 7 buttons, click Reset.
    Restart your Mac. Launch Safari. Try several of the sites you mentioned.
    has started quitting
    If resetting didn't help, post a crash report.
    If Safari has just crashed, press the Report button on the CrashReporter dialog box to view the crash  information.
    Copy/paste the entire contents of the Crash Reporter window into your reply. If the crash report dialog does not appear or the crash is hard to reproduce, crash logs can be retrieved from the ~/Library/Logs/CrashReporter> folder.

  • I recently bought the i pod touch 4 and noticed that not all of my songs transferred over-The songs that didn't, say original file cannot be found. What should I do?

    I recently bought the i pod touch 4 and noticed that not all of my songs transferred over from my i tunes library-The songs that didn't, say original file cannot be found, when clicked. What should I do? I tried using the tips on this site, but they weren't too helpful...I downloaded the songs from cd's and purchased them from i tunes.
    Any help would be much appreciated! Thank you!

    I doubt that your music files are gone. Do a spotlight search and look for The Cure. What likely happened is that for whatever reason, your iTunes lost track of the location of your songs.. which happens on occasion.
    What you need to do is go to the folder where your music library is - where the song files are - and check to see if they are there. If so, then go into your iTunes preferences and in the 'Advanced' pane put in the location of the folder where it says 'iTunes Media folder location'. iTunes should then be able to 'see' the songs again.
    Deb.

Maybe you are looking for

  • Giving Error while forwarding a page from another page

    Hi I am getting below error while forwarding a page from another page. Please reply as i am new to OA frame work. oracle.apps.fnd.framework.OAException: No data found for region (/mhe/oracle/apps/ak/susanta/webui/EmployeeUpdatePG).      at oracle.app

  • My ipod touch 4g wifi randomly disconnects, any solution? my firmware is 4.3.1.

    Hi, I have an ipod 4th gen. It has firmware 4.3.1. I have a very annoying problem that my wifi gets disconnected randomly with no particular reason. The signal strength is excellent in my laptop. Also, when I see safari not responding, and then when

  • N660 TF 2GD5/OC and DOS mode

    I have Dell U2311H 23" FullHD monitor. With N660 TF 2GD5/OC in DOS mode (BIOS setup an so on) I don't have image extension to whole screen - there is 1.5-2cm black border around it. It is very strange because monitor shows 1920x1080x60Hz mode in menu

  • Java SE5 and Java EE5 difference

    What is the difference between Java SE5 and Java EE5? Also difference btwn SDK and JDK? I am confused about these basic concepts. Thanks Geet

  • External services mgt - Purchase order - Text

    Hi, when I add an external service into a PO i d like to copy the short text (MEPO1211-TXZ01) into a text of mine (into position section) I tried through customizing but no way. Are there any exit, badi to accomplish this task?? Thank you