XSD any elements in any order

Hi,
I'm trying to figure out how to create an element that permits any number of certain elements to occur in any order, and I seem to be quite stuck. For example, given the special elements foo, bar, and foobar, I'd like to be able to create an XSD definition for the following:
<root>
<foo/>
<bar/>
<bar/>
<foo/>
<foobar/>
<bar/>
<foobar/>
<bar/>
<foo/>
</root>
Any ideas? I can do this:
<xsd:element name="root">
<xsd:complexType>
<xsd:sequence>
<xsd:choice minOccurs="0">
<xsd:element name="foo" type="FooType">
<xsd:element name="bar" type="BarType">
<xsd:element name="foobar" type="FooBarType">
</xsd:choice>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
But this seems not to work quite as expected. It lets me create:
<root><foo/></root>, <root><bar/></root>, or <root><foobar/></root>
But it doesn't permit having multiple occurrences of <foo> or even an occurrence of <foo> and one of <bar>.
Thanks

This seems to work for me<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="root">
  <xsd:complexType>
    <xsd:sequence>
      <xsd:element ref="foobarelements" maxOccurs="unbounded"/>
    </xsd:sequence>
  </xsd:complexType>
</xsd:element>
<xsd:element name="foo" type="xsd:anyType"  substitutionGroup="foobarelements"/>
<xsd:element name="bar" type="xsd:anyType"  substitutionGroup="foobarelements"/>
<xsd:element name="foobar" type="xsd:anyType"  substitutionGroup="foobarelements"/>
<xsd:element name="foobarelements" type="xsd:anyType"/>
</xsd:schema>

Similar Messages

  • [Axis2] WSDL2Java seems to ignore xsd:any element

    Hi,
    Since I need to have some kind of extensibility in a web service i'm currently defining, I decided to play with the Axis2 userguide sample and tried to change the original WSDL so that the "SOAPStruct" message type would include an xsd:any element :
    <complexType name="SOAPStruct">
    <all>
    <element type="float" name="varFloat" />
    <element type="int" name="varInt" />
    <element type="string" name="varString" />
    <any maxOccurs="1"/>
    </all>
    </complexType>When I run WSDL2Java, the xsd:any element isn't mapped anywhere in the generated SOAPStruct.java, whereas the other are. I also tried just the following :
    <complexType name="SOAPStruct">
    <sequence>
    <any/>
    </sequence>
    </complexType>And then I've got barely nothing in the SOAPStruct.java (except the declaration of the Factory class)
    Could someone please help me with this ? I'm sure I made some kind of stupid error since using xsd:any shouldn't be really hard, I guess.
    I'm using Axis2 1.0.

    This seems to work for me<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="root">
      <xsd:complexType>
        <xsd:sequence>
          <xsd:element ref="foobarelements" maxOccurs="unbounded"/>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:element>
    <xsd:element name="foo" type="xsd:anyType"  substitutionGroup="foobarelements"/>
    <xsd:element name="bar" type="xsd:anyType"  substitutionGroup="foobarelements"/>
    <xsd:element name="foobar" type="xsd:anyType"  substitutionGroup="foobarelements"/>
    <xsd:element name="foobarelements" type="xsd:anyType"/>
    </xsd:schema>

  • XML Schema any element

    I have a list of schema files and they a number of elements in them. But for my data extraction i use only close to 300 tags. When i register the schema I get an error that a table cannot of have more than 1000 columns. My work mate is working on Annotations and I am planning to build a new schema to make extract only these 300 tag names and also make sure the XML file can be validated like it did earlier. Explaining this i came across a complex type element called *<any>* which can be used to allow elements to be available which are not declared within the schema file.
    My Original schema file looks something like below,
    <xsd:complexType name="WfInformation">
    <xsd:all minOccurs="0">
    <xsd:element name="Company" type="WfCompany" minOccurs="0" />
    <xsd:element name="HeadOffice" type="WfOffice" minOccurs="0" />
    <xsd:element name="IndependentOffice" type="WfIOffice" minOccurs="0" />
    <xsd:element name="AffiliateCompany" type ="WfIAOffice" minOccurs="0" />
    <xsd:element name="Number" type="xsd:string" minOccurs="0" />
    <xsd:element name="ReferenceID" type="xsd:string" minOccurs="0" />
    </xsd:all>
    </xsd:complexType>
    of the above list of items i use only elements Company, HeadOffice, Number. After reading through some documentation I wanted to <any> tag like below,
    <xsd:complexType name="WfInformation">
    *<xsd:sequence>*
    <xsd:element name="Company" type="WfCompany" minOccurs="0" />
    <xsd:element name="HeadOffice" type="WfOffice" minOccurs="0" />
    *<xsd:any processContents="lax"/>*
    *<xsd:any processContents="lax"/>*
    <xsd:element name="Number" type="xsd:string" minOccurs="0" />
    *<xsd:any processContents="lax"/>*
    *</xsd:sequence>*
    </xsd:complexType>
    My question is if I am correcting the lines as i mentioned above will be Register schema again fail with same reason that i have 1000 columns. As i understand every element inside an Complex element is stored as a column value. In that case will this redesign work. Or is there any other way to approach re-desgin the XML Schema.

    Thanks. I think that leaves out my option to create a totally new Schema to suit my XML files.
    Only other option we have is to use Annotations.
    I think my colleague - eoin62 would have shared the XML Schema files earlier through your oracle email address.
    Please refer thread - How to register multiple XSD files
    But we received a reply and we knew very little on how to make changes to Admin.xsd and how would that solve our problem. Please correct me if i am incorrect. Because the biggest Schema was estimate.xsd that has close to 800+ elements. I am not sure if my colleague sent you the necessary tag names we use within the Schema. We have close to around 300 tags we use. But our combined XML Schema has close to 1600+ If we have to annotate, i thought it would be better we tell Oracle which tagswe need, which inturn should should help better create XMLtype table against a Schema and work on performance.
    Your earlier reply was,
    Basically in XML Schema Admin.xsd element AdminCompin WorkfileTypeneeds to be stored Out of line..
    Add the annotations xdb:SQLInline=”false” and xdb:defaultTable=”ADMIN_COMP_XML”. to the element..
    if you can share with our XML Schema on how to annotate or if you can share a location that shows how an annotated or non-annotated Schema works that would help us correcting our Schema files.
    Thanks for all your support. We have gone a long way in XML Parsing in the last 6 weeks.
    Edited by: beta32c on Feb 19, 2013 12:09 AM

  • Mapping of any element in BPEL

    Hello Experts,
    Need some help on this.I am unable to understand how to map <any> element with the <any> element.In my xsd i have a input element with any any an Output element with any i am unable to map.While mapping it pops up the message as "cannot map any to anyAttribute from source" Enter xpath-expression manually.Plz help
    Thanks in Advance
    Edited by: Irfan Shaikh on Feb 8, 2013 2:10 PM
    Edited by: Irfan Shaikh on Feb 8, 2013 2:25 PM

    Just open the source view and Enter xpath-expression manually as the message suggests...

  • Any Element Support

    Does XDB support xml schema with any elements? What will the any element mapped to?
    Thanks
    Bob

    The reason I'm asking is that the following test case is not working for me - Please help.
    1). My xsd file "Test.xsd" -
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" version="1.0">
         <xs:element name="TestAny" type="ComplexType" xdb:defaultTable="TEST_ANY"/>
         <xs:complexType name="ComplexType" xdb:SQLType="XDB_COMPLEX_TYPE">
              <xs:sequence>
                   <xs:any minOccurs="1" maxOccurs="unbounded"/>
              </xs:sequence>
         </xs:complexType>
    <xs:element name="Element1" type="xs:string" />
    <xs:element name="Element2" type="xs:string" />
    </xs:schema>
    2). After registering with Oracle, the following Objects generated -
    TNAME TABTYPE
    Element1413_TAB TABLE
    Element2412_TAB TABLE
    TEST_ANY TABLE
    SQL> desc test_any
    Name Null? Type
    TABLE of SYS.XMLTYPE(XMLSchema "http://MOB5164:8080/Test.xsd" Element "TestAny") STORAGE Object-rela
    tional TYPE "XDB_COMPLEX_TYPE"
    SQL> desc "XDB_COMPLEX_TYPE"
    "XDB_COMPLEX_TYPE" is NOT FINAL
    Name Null? Type
    SYS_XDBPD$ XDB.XDB$RAW_LIST_T
    SYS_XDBANY411$ VARCHAR2(4000)
    SQL> desc "Element1413_TAB"
    Name Null? Type
    TABLE of SYS.XMLTYPE(XMLSchema "http://MOB5164:8080/Test.xsd" Element "Element1")
    SQL> desc "Element2412_TAB"
    Name Null? Type
    TABLE of SYS.XMLTYPE(XMLSchema "http://MOB5164:8080/Test.xsd" Element "Element2")
    3). ftp xml file "Test.xml" to XDB - (the file has been validated by XMLSpy)
    <?xml version="1.0" encoding="utf-8"?>
    <TestAny xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://mob5164:8080/Test.xsd">
         <Element1>this is element 1</Element1>
         <Element1>this is element 1</Element1>
         <Element2>this is element 2</Element2>
         <Element2>this is element 2</Element2>
         <Element1>this is element 1</Element1>
    </TestAny>
    4). The file is loaded into the XDB repository instead of to table TEST_ANY.
    Bob

  • JDev 11.1.1.2 - How to map fixed xml tags in "any" element of the target?

    I have a target schema that has "any" element as below:
    <xs:element name="USERAREA">
    <xs:complexType mixed="true">
    <xs:sequence minOccurs="0" maxOccurs="unbounded">
    <xs:any/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    I want to map as below in JDev xslt. The 2 new elements are fixed and do not change. I tried to use copy-of but did not know how to do this? Any sample would help.
    <USERAREA>
    <ORACLE.BOOKEDFLAG>Y</ORACLE.BOOKEDFLAG>
    <ORACLE.ORDERTYPE>Standard Order</ORACLE.ORDERTYPE>
    </USERAREA>
    Any help is appreciated.
    Thanks
    Shanthi

    I would think if you intanciate the XMLReference and use IIDXMLElement GetChildCount / GetNthChild would do what you are looking for.
    Ian

  • HT5622 I don't get why my Apple ID keeps saying this device is already associated with an Apple ID and something about 90 days but also it doesn't let me download any of my pre orders when available it has happened to me twice and my past purchases help m

    I don't get why my Apple ID keeps saying this device is already associated with an Apple ID and something about 90 days but also it doesn't let me download any of my pre orders when available it has happened to me twice and my past purchases can someone contact me and give me some help sorting this out
    Much appreciated
    <Email Edited by Host>

    Hi there
    I'm getting a similar problem with my Macbook Pro. itunes match was working fine until two days ago when i created another 'user id' for the laptop and then an itunes account for that user under their profile. Now i cant turn on itunes match on my itunes under my user account. Contacted Apple today who said to use the Express Lane and email the problem and they might be able to make an 'exception' on the account. Otherwise I'll have to wait 88 days to access a lot of my music on the macbook pro. itunes match is still working on the iphone 4S and ipad2.
    Can anyone help? The only thought was too re-stream the laptop. Ive already tried deauthorising the other user but it made no difference.
    Thanks
    Jules

  • In LabVIEW6i, is there a way to make particular elements of an array invisible while the others stay visible (without losing any element's info.)?

    I have an array of clusters. Each cluster pertains to a certain oscilloscope I am controlling. There is another control which specifies which oscilloscopes I have "on".
    If a particular oscilloscope is "on" I want its cluster to be VISIBLE in the array. If a particular oscilloscope is "off" I want its cluster to be INVISIBLE in the array.
    How can I implement this in my program without losing ANY of the info. in my array?

    I suggest to use two arrays; one for user interface holding the ON clusters,
    and one for internal use holding all clusters. The diagram periodically
    updates the internal array with user interface array data.
    By INVISIBLE do you mean "skipped from the array" or displayed as an empty
    placeholder? To hide an OFF cluster you could put in the cluster a flat
    button boolean that is small and transparent when ON and large enough to
    cover the whole cluster area (and other controls) when OFF.
    Jean-Pierre Drolet
    Scientech R&D
    "mcmastal" a écrit dans le message news:
    [email protected]..
    > In LabVIEW6i, is there a way to make particular elements of an array
    > invisible while the others stay visible (without losing any element's
    > info.)?
    >
    > I have an array of clusters. Each cluster pertains to a certain
    > oscilloscope I am controlling. There is another control which
    > specifies which oscilloscopes I have "on".
    > If a particular oscilloscope is "on" I want its cluster to be VISIBLE
    > in the array. If a particular oscilloscope is "off" I want its
    > cluster to be INVISIBLE in the array.
    > How can I implement this in my program without losing ANY of the
    > info. in my array?
    LabVIEW, C'est LabVIEW

  • How to restrict the user from making any changes in Sales order- item level

    Hi to all
    How to restrict the users from making any changes in sales order at item level if the same sales order is released by senior user through status profile.
    Regards
    Anish Parikh
    Edited by: anish parikh on Jan 24, 2008 5:16 AM

    Hi Anish,
    This can be achieved through the roles and authorization.
    This can be done through the basis team. they can create user profiles and roles.
    For the roles they assign some transaction codes so that they can view the only assigned tr. codes.
    Like that ur requirement can be done.
    Also u can prevent the user to change any fields in the sales order screen (VA02). for that please modify the authorisations.
    Hope i answers.
    Reward points if useful.
    Edited by: kaleeswaran bhoopathy on Jan 24, 2008 9:57 AM

  • In Consignment is there any case of  Purchase order or purchase requisition

    Hi All,
    Can u tell me In Consignment is there any case of  Purchase order or purchase requisition ? Also in fill up is there any PGI ???  How to keep special stock in Fill up ?
    My id : [email protected]
    Appreciate your information and will definitely reward points.
    Regards
    Rajarshi

    Hi
    Here's a General thumb rule,
    Consignment <b>fill up</b>
    -Sales order>delivery[ PGI]->no billing
    Item Cat = KBN, Schd ln = E1
    *In this step, you are not invoicing the customer. document flow is sales order -
    delivery item category. It will not be relevent for billing and pricing because you are not charging money for these goods in this step.
    In schedule line category, you will set movement type 631 & set for availability check and TOR.
    Consignment <b>issue</b>
    -Sales order>delivery[ PGI]->billing
    Item Cat = KEN, Schd ln = C1
    Consignment <b>pick up</b>
    -Sales order>delivery[PGR]->no billing
    Consignment <b>RETURNS</b>
    -Sales order>delivery[PGR]->Credit Memo
    Item cat = KAN ,schd. line F1
    Hope this helps

  • Any element with JAXB are always empty

    Hi guys!
    I'm trying to use the any element to specify some content for my web service. My XML schema contains this:
    <complexType name="casObject">
      <sequence>
        <element name="type"     type="string"/>
        <element name="key"          type="long"     nillable="true" />
        <any namespace="##targetNamespace" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
      </sequence>
    </complexType>I'm using jaxb 1.6 and it provides a method to get my any elements. In my example: List fieldList = casObject.getAny();
    The schema validation doesn't complain, the logging interceptor shows that the additional elements (from any element) are transfered, but the list is always empty. Any idea why this list is always empty?
    I've also have a question to the xsi:type element and jaxb in the web service forum called "missing xsi:type", maybe it it fits better in this forum. Please take a look.
    http://forum.java.sun.com/thread.jspa?threadID=743719&tstart=0
    Cheers,
    Ingo

    Hi Achim,
    According to my knowledge, there are no known problems with a "required Extended Protection" / "Always On" / "Livelink Server" combination.
    Extended Protection helps to prevent an authentication relay attack by using service binding and channel binding. We need to note that when Extended Protection is set to
    Required, only connections from protected applications on protected operating systems are accepted. This setting is the most secure but connections from operating systems or applications that do not support Extended Protection will not be able
    to connect to SQL Server. For more details, please review the following article.
    Connect to the Database Engine Using Extended Protection
    https://msdn.microsoft.com/en-us/library/ff487261(v=sql.110).aspx
    Thanks,
    Lydia Zhang
    If you have any feedback on our support, please click
    here.
    Lydia Zhang
    TechNet Community Support

  • Jaxb and xs:any element binding  (REPOSTING)

    My schema has an element whose content is not known at schema design time so, my XML may look like:
    <client-submission>
    <aaa>
    <bbb/>
    </aaa>
    </client-submission>
    Or it may look like:
    <client-submission>
    <xxx>
    <yyy>
    <zzz/>
    </yyy>
    </xxx>
    </client-submission>
    This cab be implemented in xml schema with <any> element:
    <any
    id =
    maxOccurs =
    minOccurs =
    namespace =
    processContents = >
    </any>
    BUT IN JAXB, HOW CAN I insert that unknown xml tree as content of <client-submission>, to get proper XML when marshalling??
    Thanx.

    hi JAXB specification does not support full W3C schema
    support in version 1.0.
    u cant do "any"

  • Update structure does not contain any elements error

    Dear Friends in am a newbie in WDA. My Function Module  has the following decalarations.
    TABLES
    *"      U_P9006 STRUCTURE  P9006
    *"      IT_P9006 STRUCTURE  P9006
    IT_P9006 is used to fill all the values in the Table, if the user wants to create a new entry in the table then he will click on the new button and U_9006 will be used to hold the new value and save in the database.
    when i binded U_9006-EmployeeNumber to a Input box to accept values and tested the application dumps giving the error
    "Adapter error in INPUT_FIELD "TC_1_EMPLOYEE_CODE" of view "ZHOLIDAY.MAINVIEW": Context binding of property STATE cannot be resolved: Node COMPONENTCONTROLLER.1.ZESS_EDU.1.CHANGING_1.1.U_P9006 does not contain any elements "
    i have 3 basic questions please help me.
    1. Currently the cardinality of the Node U_9006 is 0..n and Selection 0..1 , i reffered few sdn threads where it says change the cardinality to 0..n and issue will resolve , my issue is cardinality is already 0...n and even if i try to change it at the context tab it is not changing.
    2. if map the INPUT BOX a String attribute ctx_employee rather than mapping it to the U_P9006-EmployeeNumber the page does not dumps , but how do i assign this ctx_employee value to the u_9006-employeenumber in the coding?
    3. any sample of SAVE code so that on those lines i write SAVE coding and try to update the record.
    Regards,
    Jack

    Jack,
    Bind_table , bind_element methods are used to insert records into NODE, not into database table.
    As you said you want to insert records into custom infotype, you need to use function modules to create .
    For infotype tables we use below function module to insert records
    HR_INFOTYPE_OPERATION
      DATA return1 TYPE bapireturn1.
    DATA: wa_9006 TYPE p9006.
    NOW PASS ALL THE VALUES OF WA_9006.
    WA_9006-PERNR = LV_EMPID.
        wa_9006-begda = " provide start date'
        wa_9006-endda = ' provide end date
        wa_9006-aedtm = sy-datum.
        wa_9006-uname = sy-uname. ///LY PASS ALL THE VALUES OF P9006 TABLE( CHECK SE11 FOR FIELDS )
    THEN CALL BELOW FUNCTION MODULE.
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
                   EXPORTING
                            infty                  = '9006'
                             number                 = wa_9006-pernr
    *                         subtype                = wa_9006-subty
    *               OBJECTID               =
    *               LOCKINDICATOR          =
                            validityend            = wa_9006-endda
                            validitybegin          = wa_9006-begda
    *               RECORDNUMBER           =
                            record                 = wa_9006
                            operation              = 'INS'
    *                TCLAS                  = 'A'
    *                DIALOG_MODE            = '0'
    *                NOCOMMIT               =
    *                 VIEW_IDENTIFIER        =
    *                 SECONDARY_RECORD       =
                  IMPORTING
                          return                 = return1
    *              KEY                    =
    Hope this will be useful
    Regards
    Srinivas
    Edited by: sanasrinivas on Feb 13, 2012 12:28 PM

  • Error:The node does not contain any elements

    Hi Experts,
    I am getting this error.
      The following error text was processed in the system SR6 :  The node does not contain any elements. COMPONENTCONTROLLER.1.ROADMAP
    The error occurred on the application server server6_SR6_00 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
          Method: RAISEELEMENT_NOT_FOUND of program CL_WDR_CONTEXT_NODE===========CP
          Method: IF_WD_CONTEXT_NODE~SET_STATIC_ATTRIBUTES of program CL_WDR_CONTEXT_NODE_VAL=======CP
          Method: WDDOINIT of program /1BCWDY/G25NECI0LTPP66VI3KOI==CP
          Method: IF_WDR_COMPONENT_DELEGATE~WD_DO_INIT of program /1BCWDY/G25NECI0LTPP66VI3KOI==CP
          Method: DO_INIT of program CL_WDR_DELEGATING_COMPONENT===CP
          Method: INIT_CONTROLLER of program CL_WDR_CONTROLLER=============CP
          Method: INIT_CONTROLLER of program CL_WDR_COMPONENT==============CP
          Method: INIT of program CL_WDR_CONTROLLER=============CP
          Method: INIT of program CL_WDR_CLIENT_COMPONENT=======CP
          Method: INIT of program CL_WDR_CLIENT_APPLICATION=====CP
    What is the problem here?
    Thank you.
    Lalitha.

    (Assuming you have created elements for node...)
    Definitely it is cardinality problem, please check that... Try to understand below points to avoid such error.
    When a node is created in the context of a Web Dynpro component, the cardinality of the node is specified. The cardinality defines how often a node is to be instantiated at runtime u2013 that is, how many elements of this node are available at runtime.
    u2022        1u20261          Only one element is instantiated.
    u2022        0u20261          At runtime, no more than one element is instantiated, but it is also possible that no element is instantiated.
    u2022        1u2026n          n elements can be instantiated, but at least one element must be instantiated.
    u2022        0u2026n          The number of instantiated elements of the context node can vary.
    The cardinalities 0..n and 1..n correspond to the declaration of an internal table. The cardinality 1..1 corresponds to the declaration of a structure.
    Thanks,
    Swanand.

  • Dump showing that table does not contain any elements.

    Hi All,
    I have a table, with lead select.Based on the row selected, corresponding values of the row are filled in the input fields.
           I filter the table and only those rows are displayed which has status "waiting". Now the problem is when there is only one row with status "waiting", and process it, its status changes to "done", as a result of which there is no row in the table, and i get following error:
    Adapter error in INPUT_FIELD "IF_STATUS" of view "ZPWB.DISTRIBUTE_VIEW": Context binding for property VALUE cannot be resolved: The DISTRIBUTE_VIEW.1.PD_ITEMS_TAB node does not contain any elements
    Can you please help out:)

    I have now the same problem.
    somebody found out what the solution is for that issue?
    if i have an empty context i get a dump due to the context binding. what is the work around?

Maybe you are looking for