Binding a sequence XSD Schema to repeating subform elements

Hi, I am creating a form with repeated table rows using an Add button to add rows dynamically. I am binding the row with the xsd schema with [*] at the end in the data binding option with checked repeat row for each data item. While submitting the form as XML data to the java controller I am getting only one table row and not other rows added dynamically by add button functionality.
I want to know that how to generate the xml of dynamically added rows bonded with XSD schema.
I have also explore the below link but doesn't resolve the issues:
http://www.adobe.com/devnet/livecycle/articles/binding-xsd.html
Thanks in advance

I have resolved the issues by adding maxOccurs="unbounded" in xsd schema with the binded element name.

Similar Messages

  • Binding XML Schema to Repeating Elements - What am I doing wrong?

    I managed to successfully bind a schema to a basic form and aside from some Reader Enabled issues it works as expected.
    My next project is to do the same but with a form that features repeating subforms.
    I have written my schema and validated and all seems well.  When I bind it to the form though it makes certain fields behave in an odd way.
    The form is made up of three sections.  The first is a single subform of non repeating fields.  Parts Two is a table with repeating rows and Part Three is a collection of fields with an Add/Delete button using the instance manager script.
    When I bind these fields and add rows I get strange results.  In Part Two pressing the Add button copies the entire row rather than creating a new one.  Changing the value of one row changes the others.
    In Part Three I can create entirely new subforms using the Add button but the this.parent.index +1; script stops working.
    Does anyone know why this might be happening and how I can resolve it?
    The schema is below:
    <xsd:element name = "RemoteWorking">
    <xsd:complexType>
      <xsd:sequence>
       <xsd:element name = "PartZero">
        <xsd:complexType>
         <xsd:sequence>
          <xsd:element name = "RequireAddHardWare" />
          <xsd:element name = "RequireRemoteWork" />
         </xsd:sequence>
        </xsd:complexType>
       </xsd:element>
       <xsd:element name = "PartOne">
        <xsd:complexType>
         <xsd:sequence>
          <xsd:element name = "Surname" />
          <xsd:element name = "FirstName" />
          <xsd:element name = "UserName" />
          <xsd:element name = "JobTitle" />
          <xsd:element name = "Role" />
          <xsd:element name = "LineManager" />
          <xsd:element name = "Directorate" />
          <xsd:element name = "PersonnelCategory" />
          <xsd:element name = "CONumber" />
          <xsd:element name = "TelephoneNumber" />
          <xsd:element name = "BuildingCode" />
          <xsd:element name = "RoomNumber" />
          <xsd:element name = "WorkingHours" />
          <xsd:element name = "AltContact" />
         </xsd:sequence>
        </xsd:complexType>
       </xsd:element>
       <xsd:element name = "PartTwo" maxOccurs = "unbounded">
        <xsd:complexType>
         <xsd:sequence>
          <xsd:element name = "AdditionalHardware" maxOccurs = "unbounded" />
         </xsd:sequence>
        </xsd:complexType>
       </xsd:element>
       <xsd:element name = "PartThree" maxOccurs = "unbounded">
        <xsd:complexType>
         <xsd:sequence>
          <xsd:element name = "ItemRequired" />
          <xsd:element name = "UserAccountName" />
          <xsd:element name = "CostCentre" />
          <xsd:element name = "BusinessCase" />
          <xsd:element name = "Device" />
         </xsd:sequence>
         <xsd:attribute name="ItemNo" type="xsd:integer" use="required"/>
        </xsd:complexType>
       </xsd:element>
       <xsd:element name = "PartFour">
        <xsd:complexType>
         <xsd:sequence>
          <xsd:element name = "Unite" />
         </xsd:sequence>
        </xsd:complexType>
       </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>

    The binding expressions needs to indicate that you can have more than one PartTwo section. To accomplish this you will need to add a [*] to the binding expressions that use teh PartTwo node. If you want to keep it simply, bind the subform that holds th information for PartTwo to the PartTwo node, then add the [*] to the end of the expression. Then al children of that node will get expressions like $.Name of the Node that it is referencing.
    Hope that helps
    Paul

  • XML Schema to generate table data from a repeating subform data

    Hi All, I would like to have a check box that when checked, will hide a quotation form, and make a purchase order form visible, carrying over some of the field data from the quotation form into a new table on the Purchase order form. I've attached this form at https://workspaces.acrobat.com/?d=pqpsXx5VPi*LkMeVKrX57w if you would like to take a look. When the checkbox is unchecked, it will hid the PO form, and make the quite form visible.
    The idea behind this is that my client will create his quote and send t to his customer. Once the customer accepts the quote, he can just click a button to generate his purchase order that he will send to his supplier.
    It seems that because I've got buttons to add rows on the quote form that the problem is more complex. I would be able to do this myself if the table had a fixed number of rows and I was able to use global fields and naming each cell something different, but beacuse it's a single repeating subform, I can't seem to make it work at all.
    I understand that because its a repeating subform that I need to create an XML schema to accomplish this, but also can't figure out for the life of me how to actually create the schema. I've been reading tons of tutorials, but no clue how to apply it to my specific need. I have only been able only find info on how to bind the data source once it's been created.
    I would be forever grateful if anyone could help me out.
    Thank you!

    I've edited your form and put it here.
    Here's what I've done:
    Inserted script into your checkbox renamed Accpted that hides/shows the Purchase Order/ Sales Quotation
    I've included a scripting object with a function I wrote to transfer data from like named fields/subforms from one section to another
    Inserted a few common fields into your Purchase Order table
    What you need to do is complete the development of your Purchase Order table. Make sure the common fields between the quote and purchase tables have the same names in order to transfer the data.
    No schema necessary.
    Kyle

  • Multiple repeating SubForms binding to the same data node

    Having multiple repeating SubForms binding to the same data node : In our documents, many times we need to display information from same table in multiple locations. For example, if document displays information of Insureds on one page and information of drivers on another page, we need to create a LiveCycle document with two SubForms. Each SubForm needs to have a repeating binding to CommonInsured element in XSD.  LiveCycle Designer is not able to handle such case. We cannot have two subforms bound to the same node, ONLY in a case where repeating option is selected for data binding.
    The only way I have found out is the following Javascript
    //Get the data node from XML. You will find the code for this function in //JavaHelperFunctions library.
    // InsuredDataRepeatingSubForm is a second subform.
    //You need to manually add instances to this subform at the
    //runtime and Insured data to each instance.
    var insuArray = JavaHelperFunctions.getInsureds();
        var i=0;
        for( i=0; i<insuArray.length; i++)
           if (i>0)
    var thesubform = this.InsuredDataRepeatingSubForm.instanceManager.addInstance(i);
                  thesubform.InsuredName.rawValue = insuArray[i].fullName.value;
           else
                   this.InsuredDataRepeatingSubForm.InsuredName.rawValue = insuArray[i].fullName.value;
    Is there any way I can achieve directly using bindings since we are trying to minimize javascript that changes the layout of the form?
    Thanks in advance!

    Unfortunately not. I've spent countless hours/days trying to do the same thing. You have to use code. The form consumes all the data it can into the repeating elements until there is none left and it is not reused.
    Here's a function I wrote just for that purpose. Feel free to use it:
    function loadData(source,target){
    target.setInstances(source.count);//set the target's subform instances to match the source's
    for (var a=0;a<source.count;a++){//loop through each subform instance
      var sourceSubform=source.resolveNode(source.name.substr(1)).all.item(a);
      var targetSubform=target.resolveNode(target.name.substr(1)).all.item(a);
      for (var b=0;b<sourceSubform.nodes.length;b++){//loop through the children of each
       if (sourceSubform.nodes.item(b).className=="field" && targetSubform.resolveNode(sourceSubform.nodes.item(b).name)!=null)//check for matching fields
        if (typeof(targetSubform.resolveNode(sourceSubform.nodes.item(b).name).value.exData)=="undefined" ||
         typeof(targetSubform.resolveNode(sourceSubform.nodes.item(b).name).value.exData.body)=="undefined")
         targetSubform.resolveNode(sourceSubform.nodes.item(b).name).rawValue=sourceSubform.nodes.item(b).rawValue;
        else
         targetSubform.resolveNode(sourceSubform.nodes.item(b).name).value.exData.loadXML(sourceSubform.nodes.item(b).value.exData.saveXML(),1,1);
       if (sourceSubform.nodes.item(b).className=="instanceManager" && targetSubform.resolveNode(sourceSubform.nodes.item(b).name)!=null)//check for matching subforms
        loadData(sourceSubform.nodes.item(b),targetSubform.resolveNode(sourceSubform.nodes.item(b).name));
    Just make sure the source and target subform hierarchies are identifal, same name and all. It will recurse down the tree and transfer source fields (rich text and plain) to their sister targets.
    Kyle

  • Repeating subforms written out of sequence in XML submission

    I have a form with a repeating subform that I am submitting as XML. The problem I'm seeing is that the XML elements for the 2nd thru N occurrences of the subform are written out of sequence toward the bottom of the XML. Here's the form structure...
    And here's what I'm seeing in the aubmitted XML, with 3 instances of the repeating subform created...
    Any clues ?

    I don't believe you have any control over this - at runtime, the newly generated instances are appended to what's already in the container. Can you change the process that's working with this file to not depend on them being in a particular arrangement? For example if you're processing with something that supports XPath, ask for all the repeatingSubform children of topSubform and you'll get those three together..
    SteveX
    Adobe Systems

  • Binding Xml file with Xsd Schema

    Hello
    everybody there.
    I am trying to make an application where word files are converted into xml.
    For that i have used org.exolab.castor and org.apache.poi.hwpf.
    Now the problem is that i was able to generate the xml file from word, but when i am binding it with XMLSchema.xsd following error is coming.
    java.lang.IllegalArgumentException: getSimpleType: the simple type 'formChoice' is not a built-in type as defined in XML Schema specification.
         at org.exolab.castor.xml.schema.Schema.getSimpleType(Schema.java:1289)
         at org.exolab.castor.xml.schema.Schema.addSimpleType(Schema.java:583)
         at org.exolab.castor.xml.schema.reader.SchemaUnmarshaller.endElement(SchemaUnmarshaller.java:643)
         at org.exolab.castor.xml.schema.reader.Sax2ComponentReader.endElement(Sax2ComponentReader.java:198)
         at org.apache.xerces.parsers.SAXParser.endElement(SAXParser.java:1392)
         at org.apache.xerces.validators.common.XMLValidator.callEndElement(XMLValidator.java:1550)
         at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1149)
         at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
         at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
         at org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:430)
         at org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:485)
         at TempHwpf.<init>(TempHwpf.java:35)
         at TempHwpf.main(TempHwpf.java:44)the code for binding my xml file with xsd schema is as under:-
    SourceGenerator sourcegen = new SourceGenerator();
    sourcegen.getVersion();
    System.out.println(sourcegen.getVersion());
    sourcegen.generateSource("XMLSchema.xsd","packagename");I have checked XMLSchema.xsd file, in that formChoice is already defined, than also error is coming.
    can anyone help me out. first i thought that XMLSchema.xsd which i have is not proper, but i downloaded it again from w3c.org,
    than also same error is shown.
    please help me out.
    waiting for reply.
    milind

    Please do not double-post. http://forum.java.sun.com/thread.jspa?threadID=5134447&tstart=0
    Then use Stax (Woodstock) or Saxon.
    - Saish

  • Designer: repeating subforms over same xsd nodelist.

    I have a
    Members Nodelist with PersonalInfo, EmploymentInfo, IncomeSources etc..
    like
    <Application>
         <Member>
              <PersonalInfo>
                   <Name>New Designer 707</Name>
              </PersonalInfo>
              <EmploymentInfo>
                   <Position>Developer</Position>
                   <StartDate>....</StartDate>
              </EmploymentInfo>
         </Member>
         <Member>
              <PersonalInfo>
                   <Name>New Designer 707</Name>
              </PersonalInfo>
              <EmploymentInfo>
                   <Position>Developer</Position>
                   <StartDate>....</StartDate>
              </EmploymentInfo>
           </Member>
    </Application>
    In designer first page I have to show the personal info of all members (I am using subform in subform to repeat for all members)
    Then I have few static no-repeat data pages.
    Now in the next page I need to show the employment info of all members (I am using subform in subform to repeat for all members)
    Here it is not showing any data. If I remove the first member element iteration, then it will show. Seems like I cant iterate multiple times over the same nodelist.
    Could anybody please help me to solve this issue?
    Thanks

    Hi Bruce,
    This is exactly what I want my Form looks something like below, the French subform is an exact duplicate of the english subform. The ItemBody subform is the repeating subform it works Ok in the first page but in the second page cannot see the items.
    My XML is something like below
    <Invoice>
              <InvoiceHeader>
              </InvoiceHeader>
              <InvoiceDetail>
                             <ListOfInvoiceItemDetail>
                                            <InvoiceItemDetail>
                                                           <InvoiceBaseItemDetail>
                                                                          <LineItemNum>
                                                                                          <BuyerLineItemNum>1</BuyerLineItemNum>
                               <SellerLineItemNum>1</SellerLineItemNum>
                                                                          </LineItemNum>
                                                           </InvoiceBaseItemDetail>
                                            </InvoiceItemDetail>
                <InvoiceItemDetail>
                     <InvoiceBaseItemDetail>
                          <LineItemNum>
                               <BuyerLineItemNum>2</BuyerLineItemNum>
                               <SellerLineItemNum>2</SellerLineItemNum>
                          </LineItemNum>
                     </InvoiceBaseItemDetail>
                 </InvoiceItemDetail>
      <InvoiceSummary>
              </InvoiceSummary>
    </Invoice>
    The Binding I have in the first occurence of Subform ItemBody is InvoiceDetail.ListOfInvoiceItemDetail.InvoiceItemDetail[*]which works perfectly fine.
    I have used the script in calculate event for ItemBody in the French Subform by making a change to the line as below
    match(this, English.dataNode.resolveNodes("$.*"));
    But I cannot see any change in my output, leaving the binding for ItemBody to None is not giving me any results.
    Appreciate your inputs.
    Regards,
    Harry

  • Binding XML to Adobe Live Cycle - Nested Subform Repeat

    I have a nested repeating subform. The nested subform  is repeating more than what it is supposed to do. Any suggestions appreciated.
    Here is an example to explain it better -
    For User1, form needs to render 3 instances of subform; For User 2, form needs to render 1 instance of subform. But 4 instances of nested subform is displayed for User 1 & User 2.
    <test>
      <user id="1">
        <name>User1</name>
        <child>User Child 1</child>
        <child>User Child 2</child>
        <child>User Child 3</child>
      </user>
      <user id="2">
        <name>User2</name>
        <child>User Child 1</child>
      </user> 
    </test>
    Thank You.

    How are you showing the subforms or making the instances of the subform? Are you using a setInstance() or addInstance() ?
    Thanks,
    Bibhu.

  • Repeating Subforms Incrementally

    This is going to sound kind of funky...
    We have a business requirement that a repeating subform ONLY repeat in multiples of 5. The subform is a column that counts five times across a page horizontally. Our form can never have more or less than 5 columns across any page, not matter how many of the have data.
    For instance, if our data should only need 8 columns to fill, the form should build 2 sets of 5 columns (which are on seperate pages). The five on the first page would be filled and the first three on the second page would be filled. That would leave to empty columns on the second page.
    Here's the real kicker. Our business requirements forbid us from using JavaScript or FormCalc. We have to do it via form object settings. Does anyone have ANY ideas on how to possibly go about doing this?
    Thank you so much for any help! If this is unclear or it would be easier to solve with conversation, feel free to email me.
    Ryan D. Lunka
    Cardinal Solutions Group
    [email protected]

    Ok. We actually did manage to figure it out. For reference here's what we did:
    Instead of setting up the columns as one repeatable subform, we put all 5 columns on as seperate (not repeatable) items. We used the same id for all 5 of them so they auto-index themselves as (column[0], column[1], etc). Then we bound the schema to the fields in all 5 of the columns. So each field in each column had a binding to node.repeatableNode[*].whatever_value. Then the larger subform that all of those columns reside in, is set to repeatable.
    LiveCycle automatically fills those "columns" one at a time because of their indexing. When it gets past five, it repeats the entire subform (which HAS to have five columns) but only fills the neccesary columns as it continues.
    Ask a funky question, get a funky answer. But it works.
    Ryan D. Lunka
    Cardinal Solutions Group
    [email protected]

  • Assigning values to repeating subforms using a script

    I am using a script to add values to a repeating subform. Below is a simple example. In the real script I would use a loop to do the inserts.
    //declare XML structure
    String hrxdproot = /process_data/hrxfaform/object/data/xdp/datasets/data/form1";
    //assigning repeating subform number
    int i = 1;
    //assign a value to the first repeating subform
    patExecContext.setProcessDataStringValue(hrxdproot + "/Details[" + i +"]/employee_name", "Aditya");
    However, the error I get is
    "Target exception: org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified. "
    I also tried to use a SetValue module to perform the same function and got the above error.
    /process_data/hrxfaform/object/data/xdp/datasets/data/form1/Details[1]/employee_name = "Aditya"
    Finally, I manually merged a sample xml (with 2 instances of the repeating subform) with the pdf and it worked fine. So I don't think there is a problem in the XML.
    Can someone please help...
    Aditya

    But the question is wether or not you're going to dynamically add nodes to your structure. Even if the schema permits to have multiple nodes under a specific section, it's hard to use xPath to do that. For example if you have a structure like the following:
    <Root>
      <Node1/>
    </Root>
    and use the following xPath /process_data/xmlvar/Root/Node1/Child1, you're going to end up with the following:
    <Root>
      <Node1>
          <Child1>
       </Node1>
    </Root>
    Now if you try to add another node under child node with a similar xPath /process_data/xmlvar/Root/Node1/Child2, you're going to end up with the following:
    <Root>
      <Node1>
          <Child2>
       </Node1>
    </Root>
    It won't append the node, it will replace everything under Node 1.
    So if this is what you're trying to do (add multiple children nodes), then you would have to create the xml structure using standard DOM objects within a custom component or the script service and the set the resulted xml to an xml variable.
    I hope this clears thigns up.
    Jasmin

  • Based on an xsd schema create a table

    Hi all,
    i need a way that allow me to create a table having an xsd file, in others word i load the xsd schema and create a table accordingly to the element that the xsd schema has respecting also the datatype of every element.
    Is the some functionality that allow me to do a thing like that?
    thanks to every one
    Francesco
    Italy

    I should now give the following output
    Connected.
    SQL> set termout on
    SQL> set feed on
    SQL>
    SQL> drop user test cascade;
    User dropped.
    SQL>
    SQL> purge dba_recyclebin;
    DBA Recyclebin purged.
    SQL>
    SQL> create user test identified by test;
    User created.
    SQL>
    SQL> grant xdbadmin, dba to test;
    Grant succeeded.
    SQL>
    SQL>
    SQL> connect test/test
    Connected.
    SQL>
    SQL> set echo on
    SQL> set termout on
    SQL> set feed on
    SQL> set long 100000
    SQL> set pages 5000
    SQL>
    SQL> var schemaPath varchar2(256)
    SQL> var schemaURL  varchar2(256)
    SQL>
    SQL> pause
    SQL> ----------------------------------------------------------
    SQL>
    SQL> -- Create an XML Schema root.xsd in directory /public/
    SQL>
    SQL> ----------------------------------------------------------
    SQL> declare
      2    res boolean;
      3    xmlSchema xmlType := xmlType(
      4  '<?xml version="1.0" encoding="UTF-8"?>
      5   <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
      6              xmlns:xdb="http://xmlns.oracle.com/xdb"
      7              elementFormDefault="qualified"
      8              attributeFormDefault="unqualified"
      9              xdb:storeVarrayAsTable="true">
    10   <xs:element name="ROOT" xdb:defaultTable="ROOT_TABLE" xdb:maintainDOM="false">
    11    <xs:annotation>
    12     <xs:documentation>Example XML Schema</xs:documentation>
    13    </xs:annotation>
    14    <xs:complexType xdb:maintainDOM="false">
    15     <xs:sequence>
    16      <xs:element name="ID" type="xs:integer" xdb:SQLName="ID"/>
    17      <xs:element ref="INFO" xdb:SQLInline="false" />
    18     </xs:sequence>
    19    </xs:complexType>
    20   </xs:element>
    21   <xs:element name="INFO" xdb:SQLName="INFO_TYPE">
    22    <xs:complexType xdb:maintainDOM="false">
    23     <xs:sequence>
    24      <xs:element name="INFO_ID" type="xs:integer" xdb:SQLName="TYPE_INFO_ID"/>
    25      <xs:element name="INFO_CONTENT"
    26                  xdb:SQLName="TYPE_INFO_CONTENT" type="xs:string"/>
    27     </xs:sequence>
    28    </xs:complexType>
    29   </xs:element>
    30  </xs:schema>');
    31  begin
    32  if (dbms_xdb.existsResource(:schemaPath)) then
    33      dbms_xdb.deleteResource(:schemaPath);
    34  end if;
    35   res := dbms_xdb.createResource(:schemaPath,xmlSchema);
    36  end;
    37  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> pause
    SQL> ----------------------------------------------------------
    SQL>
    SQL> -- Selecting repository files and folders via XDBUriType
    SQL>
    SQL> ----------------------------------------------------------
    SQL> select xdbURIType ('/public/root.xsd').getClob()
      2  from   dual;
    XDBURITYPE('/PUBLIC/ROOT.XSD').GETCLOB()
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.o
    racle.com/xdb" elementFormDefault="qualified" attributeFormDefault="unqualified"
    xdb:storeVarrayAsTable="true">
      <xs:element name="ROOT" xdb:defaultTable="ROOT_TABLE" xdb:maintainDOM="false">
        <xs:annotation>
          <xs:documentation>Example XML Schema</xs:documentation>
        </xs:annotation>
        <xs:complexType xdb:maintainDOM="false">
          <xs:sequence>
            <xs:element name="ID" type="xs:integer" xdb:SQLName="ID"/>
            <xs:element ref="INFO" xdb:SQLInline="false"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="INFO" xdb:SQLName="INFO_TYPE">
        <xs:complexType xdb:maintainDOM="false">
          <xs:sequence>
            <xs:element name="INFO_ID" type="xs:integer" xdb:SQLName="TYPE_INFO_ID"/
    >
            <xs:element name="INFO_CONTENT" xdb:SQLName="TYPE_INFO_CONTENT" type="xs
    :string"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>
    1 row selected.
    SQL> pause
    SQL> ----------------------------------------------------------
    SQL>
    SQL> -- Create an XML Document root.xml in directory /public/
    SQL>
    SQL> ----------------------------------------------------------
    SQL> begin
      2    :schemaURL := 'http://www.myserver.com/root.xml';
      3    :schemaPath := '/public/root.xml';
      4  end;
      5  /
    PL/SQL procedure successfully completed.
    SQL> declare
      2    res boolean;
      3    xmlSchema xmlType := xmlType(
      4  '<?xml version="1.0" encoding="UTF-8"?>
      5  <ROOT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:noNamespaceSchemaLocation="root.xsd">
      6   <ID>0</ID>
      7   <INFO>
      8     <INFO_ID>0</INFO_ID>
      9     <INFO_CONTENT>Text</INFO_CONTENT>
    10   </INFO>
    11  </ROOT>');
    12  begin
    13  if (dbms_xdb.existsResource(:schemaPath)) then
    14      dbms_xdb.deleteResource(:schemaPath);
    15  end if;
    16   res := dbms_xdb.createResource(:schemaPath,xmlSchema);
    17  end;
    18  /
    PL/SQL procedure successfully completed.
    SQL> pause
    SQL> ----------------------------------------------------------
    SQL>
    SQL> -- Selecting repository files and folders via XDBUriType
    SQL>
    SQL> ----------------------------------------------------------
    SQL> select xdbURIType ('/public/root.xml').getClob()
      2  from   dual;
    XDBURITYPE('/PUBLIC/ROOT.XML').GETCLOB()
    <?xml version="1.0" encoding="UTF-8"?>
    <ROOT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchem
    aLocation="root.xsd">
      <ID>0</ID>
      <INFO>
        <INFO_ID>0</INFO_ID>
        <INFO_CONTENT>Text</INFO_CONTENT>
      </INFO>
    </ROOT>
    1 row selected.
    SQL> pause
    SQL> ----------------------------------------------------------
    SQL>
    SQL> -- Register the XML Schema and create the OR objects
    SQL>
    SQL> ----------------------------------------------------------
    SQL> select * from tab;
    no rows selected
    SQL> --
    SQL> alter session set events='31098 trace name context forever';
    Session altered.
    SQL> --
    SQL> BEGIN
      2   DBMS_XMLSCHEMA.registerSchema
      3   (SCHEMAURL => 'root.xsd',
      4    SCHEMADOC => xdbURIType('/public/root.xsd').getClob(),
      5    LOCAL     => FALSE, -- local
      6    GENTYPES  => TRUE,  -- generate object types
      7    GENBEAN   => FALSE, -- no java beans
      8    GENTABLES => TRUE,  -- generate object tables
      9    OWNER     => USER
    10   );
    11  END;
    12  /
    PL/SQL procedure successfully completed.
    SQL> select * from tab;
    TNAME                          TABTYPE  CLUSTERID
    INFO1902_TAB                   TABLE
    INFO1904_TAB                   TABLE
    ROOT_TABLE                     TABLE
    3 rows selected.
    SQL> pause
    SQL> ----------------------------------------------------------
    SQL>
    SQL> -- Insert some data with XDBURIType
    SQL>
    SQL> ----------------------------------------------------------
    SQL> DECLARE
      2     XMLData xmlType := xmlType(xdbURIType ('/public/root.xml').getClob());
      3  BEGIN
      4    for i in 1..10
      5    loop
      6        insert into ROOT_TABLE
      7        VALUES
      8        (XMLData);
      9    end loop;
    10  END;
    11  /
    PL/SQL procedure successfully completed.
    SQL> -- randomize the data a little
    SQL> update ROOT_TABLE
      2  set object_value = updateXML(object_value,
      3                              '/ROOT/ID/text()',
      4                              substr(round(dbms_random.value*100),0,2)
      5                              );
    10 rows updated.
    SQL> update ROOT_TABLE
      2  set object_value = updateXML(object_value,
      3                              '/ROOT/INFO/INFO_ID/text()',
      4                              substr(round(dbms_random.value*100),0,2)
      5                              );
    10 rows updated.
    SQL> pause
    SQL> ----------------------------------------------------------
    SQL>
    SQL> -- End Result
    SQL>
    SQL> ----------------------------------------------------------
    SQL> select count(*) from root_table;
      COUNT(*)
            10
    1 row selected.
    SQL> select * from root_table where rownum <= 2;
    SYS_NC_ROWINFO$
    <?xml version="1.0" encoding="US-ASCII"?>
    <ROOT>
      <ID>54</ID>
      <INFO>
        <INFO_ID>28</INFO_ID>
        <INFO_CONTENT>Text</INFO_CONTENT>
      </INFO>
    </ROOT>
    <?xml version="1.0" encoding="US-ASCII"?>
    <ROOT>
      <ID>33</ID>
      <INFO>
        <INFO_ID>35</INFO_ID>
        <INFO_CONTENT>Text</INFO_CONTENT>
      </INFO>
    </ROOT>
    2 rows selected.
    SQL>

  • How to read a file with data in Hierarchical Structure using XSD Schema

    Hi
    We have requirement in which we have to read a FIXED LENGTH file with FILE ADAPTER. File contains the data in hierarchical structure. Hierarchy in the file is identified by the first 3 characters of every line which could be any of these : 000,001,002,003 and 004. Rest files are followed after these. So structure is like:
    000 -- Header of File. Will come only once in file. Length of this line is 43 characters
    -- 001 -- Sub Header. Child for 000. Can repeat in file. Length of this line is 51 characters
    --- 002 -- Detail record. Child for 001. Can repeat multiple times in given 001. Length of this line is 43 characters 1353
    -- 003 -- Sub Footer record at same level of 001. Will always come once with 001 record. Child for 000. Length of this line is 48 characters
    004 -- Footer of file.At same level of 000. Will come only once in file. Length of this line is 48 characters
    Requirement is to create an XSD which should validate this Hierarchical Structure also i.e data should come in this hierarchy only else raise an error while parsing the file.
    Now while configuring the FILE ADAPTER to read this file we are using Native Schema UI to create the XSD to parse this structure using an example data file. But we are not able to create a valid XSD for this file which should validate the Hierarchy also on the file.
    Pls provide any pointers or solution for this.
    Link to download the file, file structure details and XSD that we have created:
    https://docs.google.com/file/d/0B9mCtbxc3m-oUmZuSWRlUTBIcUE/edit?usp=sharing
    Thanks
    Amit Rattan
    Edited by: user11207269 on May 28, 2013 10:16 PM
    Edited by: user11207269 on May 28, 2013 10:31 PM
    Edited by: user11207269 on May 28, 2013 10:33 PM

    Heloo.. Can anyone help me on this. I need to do Hierarchial read / validation while reading the file using File Adapter using Native XSD schema.

  • Problem with Repeating Subform bnot displaying

    I have a reapting subform but when I use the addInstance or InsertInstance, it is not adding a row onto the screen.  I can see from the instanceManager.count that the number of rows has increaes but they are not visible. 
    The Hierarchy is:
    CreateMaterialForm - Subform Flowed, top to bottom    binding: $record.MaterialNode
    ==== ClassificationForm - Subform Flowed, top to bottom     binding: CLASS
    ======== ClassLevelForm - Subform Flowed, top to bottom , Repeat Subform, Min count 1    binding: CLASSTAB[*]
    ============ ClassLevelValue - Text Field     binding: VALUE
    I only ever have the first row regardless of how many rows I add to the data structure at run time.    If I start the table with Min of 5, then the rows will be displayed as I add them to the data table.   
    How do I get the subform to expand to display the additional rows?   I have even tried placing a Button where the click event I did the AddInstance and sthat still did not add more visible rows.  It added rows according to the instanceManager.count. 
    NWDS 7.0.19
    Live Cycle 8.01
    Glenn

    Hi Glenn,
    Have you set the dynamic property of the form true?
    Please write the following code in wddoModifyView mthod of the view:
      if(firstTime) {
        IWDInteractiveForm iForm = (IWDInteractiveForm)view.getElement("YOUR_FORM");
        iForm.setDynamicPDF(true);
    Also do the following:
    In Adobe LiveCycle Designer 7.1 you can discover whether your adobe form was created as dynamic. Open your created pdf file in LiveCycle Designer. Menu File -> Form Properties -> tab Compatibility, Form Type. There must be Acrobat 7.x Dynamic PDF Form File.
    Hope this helps.
    Amit
    Edited by: Amit on Oct 28, 2009 8:43 AM

  • Schema Validation on attributes of an element in XML againt XSD schema

    Hi,
    I had generated artifact java classes from XSD schema file.Now i am validatiing one sample XML document by using these classes in JAXB.The XML document is validated successfully.but only elements are validated ,but not attributes of that elements.for example ,i am giving wrong element which is not defined inside the schema file,it throws validation error as expected ,whereas validation against wrong attributes of elements in XML it is not working anyway,it does not throw any validation errors,but it should throw validation errors.kindly help me to solve this issue.
    Here The sample validation code snippets :
    import javax.xml.bind.ValidationEvent;
    import javax.xml.bind.ValidationEventHandler;
    import javax.xml.bind.ValidationEventLocator;
    public class MyEventHandler implements ValidationEventHandler{
         public boolean handleEvent(ValidationEvent ve) {
              if (ve.getSeverity()==ValidationEvent.FATAL_ERROR ||
                        ve .getSeverity()==ValidationEvent.ERROR){
                   ValidationEventLocator locator = ve.getLocator();
                   //Print message from valdation event
                   System.out.println("Invalid booking document: "
                             + locator.getURL());
                   System.out.println("Error: " + ve.getMessage());
                   //Output line and column number
                   System.out.println("Error at column " +
                             locator.getColumnNumber() +
                             ", line "
                             + locator.getLineNumber());
              return true;
    Unmarshaller unmarshaller = jc.createUnmarshaller();
    unmarshaller.setEventHandler(new MyEventHandler());

    Here is my analagous 'strange' behavior. I am jaxb processing and then marshalling generated classes to XML ( following the simple Sun 'PurchaseOrder' example )
    1. This works:
    <xsd:schema....>
    <xsd:complextType name = "myName">
    <xsd:attribute name='name1'>
    </xsd:complextType>
    </xsd:schema>
    2. This doesn't:
    <xsd:schema....>
    <xsd:complextType name = "myName">
    <xsd:attribute name='name1'/>
    <xsd:attribute name='name2'/>
    </xsd:complextType>
    </xsd:schema>
    That is, using more than one attribute line within this simple complex type causes nothing to be marshalled to XML.
    Ideas?

  • Dynamic Table with repeating Subform

    Hello,
    I am maiking a form which has a Dynamic Table with a repeating Subform.  The repeating subform has a dropdown list field which has three options for the user to pic.  "LABOR", "EQUIPT.", & "MATL."
    The way I want the form to work is the user will choose which item they want to add to the form with the dropdown list.  Whatever amount they put into the "Amount" column will go to the corresponding total "LABORTotal", "EQUIPTTotal", & "MATLTotal"
    The repeating Subform is basically the Row1, but I have the table split up into subforms because of issues I had eariler with the form.  The repeating subform title is "detail". 
    I cannot get the sums for the 3 items to go into the corresponding totals field.  This is the script that I have for the labor total field:
    form1.total.LABORTotal::calculate - (JavaScript, client)
    var nAmount = xfa.resolveNodes("detail[*].Table1.Row1.AMOUNT");
    var nItem = xfa.resolveNodes("detail[*].Table1.Row1.ITEM");
    var nSum = 0;
    for (var i=0; i<nAmount.length; i++)
        if (nItem.item[i].rawValue == "LABOR")
        nSum = nSum + nAmount.item(i).rawValue;
    This.rawValue = nSum;
    I am not familiar with loop scripting or var scripting so I know I am getting it wrong somewhere. 
    I would greatly appreciate any help!
    Thanks

    Okay,
    Here is your form back to you: https://acrobat.com/#d=IA67zcTBrWlnpcYS234*XQ.
    The issue wasn't the script. If you select the dropdown and go to the Object > Binding palette, you will see you had ticked "Specify values" and these were set to 1, 2 and 3.
    This meant that if the user selected LABOR, the value of the dropdown was "1" and NOT "LABOR". This was throwing the if statement.
    I deselected the specify values and it worked as expected.
    Hope that helps,
    Niall

Maybe you are looking for