XML data with nested repeating nodes

First let me prelude with my skill set; "I am an XML,
JavaScript and Spry newbie". My xml data looks like this:
<report>
<header>
<column type="[string|real|int]>some
value</column>
<column type="[string|real|int]>some
value</column>
</header>
<details>
<row>
<cell type="[string|real|int]">some value</cell>
<cell type="[string|real|int]">some value</cell>
</row>
<row>
<cell type="[string|real|int]">some value</cell>
<cell type="[string|real|int]">some value</cell>
</row>
</details>
</report>
- report/header/column is completely dynamic and not known in
advance
- each report/header/column is the table column name value
- each report/details/row/cell is the table cell value
- type="[string|real|int]" is data type of the cell value
Using Spry 1.5 I have been able to successfully populate the
table column header row dynamically and repeat the appropriate
number of rows.
Spry is Cool!
I have not been able to figure out how to repeat
report/details/row/cell for each repeating row node. If I nest
spry:repeat it appears to go into an endless loop.
I will also need to equate data type to a Spry data type so
that I may sort the columns appropriately for their respective data
type.
Here is the code I have so far:
<script language="JavaScript" type="text/javascript"
src="includes/xpath.js"></script>
<script language="JavaScript" type="text/javascript"
src="includes/SpryData.js"></script>
<script language="JavaScript" type="text/javascript"
src="includes/SpryNestedXMLDataSet.js"></script>
<script type="text/javascript">
var dsReport = new
Spry.Data.XMLDataSet("data/cmbcov_raw.xml", "/iqreport");
var dsHeaders = new Spry.Data.NestedXMLDataSet(dsReport,
"header/column");
var dsRows = new Spry.Data.NestedXMLDataSet(dsReport,
"details/row");
var dsCells = new Spry.Data.NestedXMLDataSet(dsReport,
"details/row/cell");
Spry.Data.Region.debug = true;
</script>
<link href="/report/css/samples.css" rel="stylesheet"
type="text/css" media="all" />
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<title>Reports</title>
</head>
<body>
<h3
spry:region="dsReport">{dsReport::@title}</h3>
<div class="liveSample" spry:region="dsReport dsHeaders
dsRows dsCells">
<table class="dataTable">
<tr>
<th
spry:repeat="dsHeaders">{dsHeaders::column}</th>
</tr>
<tbody>
<tr spry:repeat="dsRows">
<td>{dsCells::cell}</td> <!--if I use
spry:repeat here browser hangs - endless loop?-->
</tr>
</tbody>
</table>
</div>
</body>
</html>
Your assistance will be greatly appreciated!
Thank you in advance,
nomadcanuck

Don,
Thanks for forcing me to read the nested data set sample
again, three times the charm as they say :). I made the following
addition to get it to work.
var dsDetails = new Spry.Data.NestedXMLDataSet(dsReport,
"details");
var dsRows = new Spry.Data.NestedXMLDataSet(dsDetails,
"row");
var dsCells = new Spry.Data.NestedXMLDataSet(dsRows, "cell");
<tbody spry:repeat="dsDetails">
<tr spry:repeat="dsRows">
<td spry:repeat="dsCells">{dsCells::cell}</td>
</tr>
</tbody>
I am still stumped with respect to sorting the dynamic
header/column. Any chance of being pointed in the right direction,
either document or hint is appreciated.
Thanks again,
nomadcanuck

Similar Messages

  • Store xml data with difference dtd in the same xmltype column?

    Hi, all!
    I want to know, whether i can store the xml data with difference DTD in the same xmltype column.
    thank you for your help
    rabbit

    As long as the column is not based on an XML Schema

  • Create xml file with nested internla table or with header & item tables

    Hi I have a requirement like, I need to create an xml file for header and item details. For 1 header there may be multiple line items.
    I did search in forums some where I came to know that we can use XSL:IF to achieve this. but I could not able to do this.
    I tried with using nested internal tables also but now luck.
    can anybody please suggest how can we create xml for header and item detials.
    <xsl:transform version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:sap="http://www.sap.com/sapxsl"
      xmlns:asx="http://www.sap.com/abapxml"
      exclude-result-prefixes="asx"
    >
    <xsl:template match="/">
      <OrbisomRequest>
        <xsl:attribute name="Version">
          <xsl:value-of select="11.1"/>
        </xsl:attribute>
        <xsl:attribute name="IssuerID">
          <xsl:value-of select="1"/>
        </xsl:attribute>
        <xsl:for-each select="asx:abap[1]/asx:values[1]/T_FINAL[1]/*">
    <CreateApprovedPurchaseRequest
           RerquestID="{VBLNR}"
           CommonName="User1"
           Amount="{WRBTR}"
           Comment="TestComment"
           CurrencyCode="978"
           PurchaseType="All"
           SupplierName="All"
           VCardAlias="PurchaseCard"
           ValidFrom="1M"
           CurrencyType="B">
                    <CDFs>
                      <Invoice> <xsl:value-of select="BELNR"/> </Invoice>
                      <Amount> <xsl:value-of select="WRBTR"/> </Amount>
                    </CDFs>
          </CreateApprovedPurchaseRequest>
        </xsl:for-each>
      </OrbisomRequest>
    </xsl:template>
    </xsl:transform>
    here belnr and wrbtr will be my item details. for each payment document I can have multiple invoices. in CDF I need to display the invoices for that particular payment document.
    what conditions can I put there before CDFs to make the item internal table to loop based on header internal table.
    Regards,
    Ranganadh.

    Looks like you have already created the transformation "Z_ID"
    Take a look at the following thread, it answers many of the questions you have asked:
    [ABAP data to XML conv with UTF-8 encoding and custom namespace|Re: ABAP data to XML conv with UTF-8 encoding and custom namespace;
    Che

  • Problem when decrypting an encrypted xml data with arabic data

    Hi all
    I have problem in decryption an encrypted Xml file. because my Xml file contains utf-8 characters, this problem occurs. after many proccess on Xml data the following code throws an Exception:
    try {
    // Works if the content is a single child element.
    byte [] a = decbit.getBytes("UTF-8");
    ByteArrayInputStream bais2 = new ByteArrayInputStream(a);
    Document decdoc = docBuilder.parse(bais2);
    Node decNode =
    encDoc.importNode(decdoc.getFirstChild(), true);
    edata.getParentNode().replaceChild(decNode,edata);
    }catch(org.xml.sax.SAXParseException spe) {
    //In case the content is plain text
    //or a group of child elements
    Text decText = encDoc.createTextNode(decbit);
    edata.getParentNode().replaceChild(decText,edata);
    decString = (getString((XmlDocument)encDoc));
    at the line with code "Document decdoc = docBuilder.parse(bais2); " an Exception occurs with message :
    org.xml.sax.SAXParseException: Illegal character at end of document, &#x3c;.
    whereas when I debug the project the filed "decbit", contains correct data. any way, in order to the exception, the control move to "catch" block and create a Text Node but the problem is the replaced data is like this:
    <id root="588588588" extension="" displayable="false" /><beneficiaryOf typeCode="BEN">
    <policyOrAccount classCode="COV" moodCode="EVN">
    <id xsi:type="II" root="855855855" extension="" displayable="false" />
    <author typeCode="AUT">
    <carrierRole classCode="UNDWRT">
    <id root="6548888888" extension="" displayable="false" />
    </carrierRole>
    </author>
    </policyOrAccount>
    </beneficiaryOf>
    as you can see, tha "<" characters are < and the ">" characters are >
    this really exhausted me, please help me out.
    thank you, any help will be appreciated
    regards
    Mohammad

    Hi Naveen,
    In sxmb_moni the content transmitted to the adapter(RFC)is as follows
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns:ZRFID_EQUIP xmlns:ns="urn:sap-com:document:sap:rfc:functions">
    - <RECORDS>
    - <item>
      <FLOC>f1-01-01</FLOC>
      <RFID_NO>I006</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-02</FLOC>
      <RFID_NO>I002</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-03</FLOC>
      <RFID_NO>I003</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-04</FLOC>
      <RFID_NO>I004</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-05</FLOC>
      <RFID_NO>I005</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-06</FLOC>
      <RFID_NO>I001</RFID_NO>
      </item>
      </RECORDS>
      </ns:ZRFID_EQUIP>
    At r/3 side the field floc and rfid_no gets mapped to floc which is of char30
    eg floc=f1-01-01I006
       rfid_no=

  • Problem inserting and querying XML data with a recursive XML schema

    Hello,
    I'm facing a problem with querying XML data that is valid against a recursive XML Schema. I have got a table category that stores data as binary XML using Oracle 11g Rel 2 on Windows XP. The XML Schema is the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="bold_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="keyword_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
                   <xs:element name="plain_text" type="xs:string"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="emph_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="text_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="parlist_type">
              <xs:sequence>
                   <xs:element name="listitem" minOccurs="0" maxOccurs="unbounded" type="listitem_type"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="listitem_type">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="parlist" type="parlist_type"/>
                   <xs:element name="text" type="text_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:element name="category">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="name"/>
                        <xs:element name="description">
                                  <xs:complexType>
                                            <xs:choice>
                                                           <xs:element name="text" type="text_type"/>
                                                           <xs:element name="parlist" type="parlist_type"/>
                                            </xs:choice>
                                  </xs:complexType>
                        </xs:element>
                                                                </xs:sequence>
                                                                <xs:attribute name="id"/>
                                            </xs:complexType>
                        </xs:element>
    </xs:schema>I registered this schema and created the category table. Then I inserted a new row using the code below:
    insert into category_a values
    (XMlElement("category",
          xmlattributes('categoryAAA' as "id"),
          xmlforest ('ma categ' as "name"),
          (xmlelement("description", (xmlelement("text", 'find doors blest now whiles favours carriage tailor spacious senses defect threat ope willow please exeunt truest assembly <keyword> staring travels <bold> balthasar parts attach </bold> enshelter two <emph> inconsiderate ways preventions </emph> preventions clasps better affections comes perish </keyword> lucretia permit street full meddle yond general nature whipp <emph> lowness </emph> grievous pedro')))    
    The row is successfully inserted as witnessed by the results of row counting. However, I cannot extract data from the table. First, I tried using SqlPlus* which hangs up and quits after a while. I then tried to use SQL Developer, but haven't got any result. Here follow some examples of queries and their results in SQL Developer:
    Query 1
    select * from category
    Result : the whole row is returned
    Query 2
    select xmlquery('$p/category/description' passing object_value as "p" returning content) from category
    Result: "SYS.XMLTYPE"
    now I tried to fully respect the nested structure of description element in order to extract the text portion of <bold> using this query
    Query 3
    select  xmlquery('$p/category/description/text/keyword/bold/text()' passing object_value as "p" returning content) from  category_a
    Result: null
    and also tried to extract the text portion of element <text> using this query
    Query 4
    select  xmlquery('$p/category/description/text/text()' passing object_value as "p" returning content) from  category_a
    Result: "SYS.XMLTYPE".
    On the other hand, I noticed, from the result of query 1, that the opening tags of elements keyword and bold are encoded as the less than operator "&lt;". This explains why query 3 returns NULL. However, query 4 should display the text content of <text>, which is not the case.
    My questions are about
    1. How to properly insert the XML data while preserving the tags (especially the opening tag).
    2. How to display the data (the text portion of the main Element or of the nested elements).
    The problem about question 1 is that it is quite unfeasible to write a unique insert statement because the structure of <description> is recursive. In other words, if the structure of <description> was not recursive, it would be possible to embed the elements using the xmlelement function during the insertion.
    In fact, I need to insert the content of <description> from a source table (called category_a) into a target table (+category_b+) automatically .
    I filled category_a using the Saxloader utility from an flat XML file that I have generated from a benchmark. The content of <description> is different from one row to another but it is always valid with regards to the XML Schema. The data is properly inserted as witnessed by the "select * from category_a" instruction (500 row inserted). Besides, the opening tags of the nested elements under <description> are preserved (no "&lt;"). Then I wrote a PL/SQL procedure in which a cursor extracts the category id and category name into varchar2 variables and description into an XMLtype variable from category_a. When I try to insert the values into a category_b, I get the follwing error:
    LSX-00213: only 0 occurrences of particle "text", minimum is 1which tells that the <text> element is absent (actually it is present in the source table).
    So, my third question is why are not the tags recognized during the insertion?
    Can anyone help please?

    Hello,
    indded, I was using an old version of Sqlplus* (8.0.60.0.0) because I had a previous installation (oracle 10g XE). Instead, I used the Sqlplus* shipped with the 11g2database (version 11.2.0.1.0). All the queries that I wrote work fine and display the data correctly.
    I also used the XMLSERIALIZE function and can now display the description content in SQL Developer.
    Thank you very much.
    To answer your question Marco, I registered the XML Schema using the following code
    declare
      doc varchar2(4000) := '<?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="bold_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="keyword_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
                   <xs:element name="plain_text" type="xs:string"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="emph_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="text_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="parlist_type">
              <xs:sequence>
                   <xs:element name="listitem" minOccurs="0" maxOccurs="unbounded" type="listitem_type"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="listitem_type">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="parlist" type="parlist_type"/>
                   <xs:element name="text" type="text_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:element name="category">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="name"/>
                        <xs:element name="description">
                                  <xs:complexType>
                                            <xs:choice>
                                                           <xs:element name="text" type="text_type"/>
                                                           <xs:element name="parlist" type="parlist_type"/>
                                            </xs:choice>
                                  </xs:complexType>
                        </xs:element>
                                                                </xs:sequence>
                                                                <xs:attribute name="id"/>
                                            </xs:complexType>
                        </xs:element>
    </xs:schema>';
    begin
      dbms_xmlschema.registerSchema('/xmldb/category_auction.xsd', doc,     LOCAL      => FALSE, 
            GENTYPES   => FALSE,  GENBEAN    => FALSE,   GENTABLES  => FALSE,
             FORCE      => FALSE,
             OPTIONS    => DBMS_XMLSCHEMA.REGISTER_BINARYXML,
             OWNER      => USER);
    end;then, I created the Category table as follows:
    CREATE TABLE category_a of XMLType XMLTYPE store AS BINARY XML
        XMLSCHEMA "xmldb/category_auction.xsd" ELEMENT "category";Now, there still remains a problem of how to insert the "description" content which I serialized as a CLOB data into another table as XML. To this purpose, I wrote a view over the Category_a table as follows:
    CREATE OR REPLACE FORCE VIEW "AUCTION_XWH"."CATEGORY_V" ("CATEGORY_ID", "CNAME", "DESCRIPTION") AS
      select category_v."CATEGORY_ID",category_v."CNAME",
      XMLSerialize(content ( xmlquery('$p/category/description/*' passing object_value as "p" returning content)) as clob) as "DESCRIPTION"
      from  auction.category_a p, 
    xmltable ('$a/category' passing p.Object_Value as "a"
    columns  category_id varchar2(15) path '@id',
              cname varchar2(20) path 'name') category_v;Then, I wrote a procedure to insert data into the Category_xwh table (the source and target tables are slightly different: the common elements are just copied wereas new elements are created in the target table). The code of the procedure is the following:
    create or replace PROCEDURE I_CATEGORY AS
    v_cname VARCHAR2(30);
    v_description clob ;
    v_category_id VARCHAR2(15);
    cursor mycursor is select category_id, cname, description from category_v;
    BEGIN
    open mycursor;
      loop
      /*retrieving the columns*/
      fetch mycursor into v_category_id, v_cname, v_description ;
      exit when mycursor%notfound;
      insert into category_xwh values
      (XMlElement("category",
          xmlattributes(v_category_id as "category_id"),
          xmlelement("Hierarchies", xmlelement("ObjHierarchy", xmlelement ("H_Cat"),
                                                               xmlelement ("Rollsup",
                                                                                  (xmlelement("all_categories",
                                                                                   xmlattributes('allcategories' as "all_category_id")))
        xmlforest (
                  v_cname as "cat_name",
                  v_description as "description")    
    end loop;
      commit;
      close mycursor;
    END I_CATEGORY;When I execute the procedure, I get the following error:
    LSX-00201: contents of "description" should be elements onlyso, I just wonder if this is because v_description is considered as plain text and not as XML text, even if its content is XML. Do I need to use a special function to cast the CLOB as XML?
    Thanks for your help.
    Doulkifli

  • C# load xml data with attributes to datagridview; update data and save back to the xml

    Hi guys,
    i currently have this XML as data
    <DEALS>
    <DEAL ID="22" ISBN="0-7888-1623-3" Screenplay="Mary Kaplan" Title ="Mr Gentleman" Director = "Jonathan Jones">
    <ALLOCATION DEMANDE="5000" CODE="72" PRICE="25.00">2500</ALLOCATION>
    <ALLOCATION DEMANDE="7000" CODE="75" PRICE="35.00">4000</ALLOCATION>
    </DEAL>
    <DEAL ID="23" ISBN="1-7988-1623-3" Screenplay="Joe Doe" Title ="Nothing Much" Director = "Listentome">
    <ALLOCATION DEMANDE="3300" CODE="72" PRICE="15.00">2500</ALLOCATION>
    </DEAL>
    </DEALS>
    I load the data with the code below:
    i use xDocument to load the DealData.xml and then put it in ToString.
    //outside of the form
    public static class XElementExtensions
    public static DataTable ToDataTable(this XElement element)
    DataSet ds = new DataSet();
    string rawXml = element.ToString();
    ds.ReadXml(new StringReader(rawXml));
    return ds.Tables[0];
    public static DataTable ToDataTable(this IEnumerable<XElement> elements)
    return ToDataTable(new XElement("Root", elements));
    //in the form
    private void button2_Click(object sender, EventArgs e)
    var xDocument = XDocument.Load("DealData.xml");
    string txtxml = xDocument.ToString();
    StringReader reader = new StringReader(txtxml);
    XDocument doc1 = XDocument.Load(reader);
    var res = doc1.Descendants("DEAL").ToList().Where(x => x.Attribute("ID").Value == "22").Descendants("ALLOCATION");
    dataGridView1.DataSource = res.ToDataTable();
    Now my question is:
    I would like to update the data from the DataGridview with the Attribute("ID").Value == "22" and save the data back to the XML.
    For example, after I load my data on the datagridview, we only pickup anything that is in the node
    <DEAL ID="22" ISBN="0-7888-1623-3" Screenplay="Mary Kaplan" Title ="Mr Gentleman" Director = "Jonathan Jones">
    <ALLOCATION DEMANDE="5000" CODE="72" PRICE="25.00">2500</ALLOCATION>
    <ALLOCATION DEMANDE="7000" CODE="75" PRICE="35.00">4000</ALLOCATION>
    </DEAL>
    I updated the datagridview below with DEMANDE = 9000 CODE = 66 PRICE = 24.77 AND ALLOCATION = 1200
    I want be able to extract the data back in the xml as a child of the DEAL ID = "22"
    So that the XML file looks like this 
    <DEALS>
    <DEAL ID="22" ISBN="0-7888-1623-3" Screenplay="Mary Kaplan" Title ="Mr Gentleman" Director = "Jonathan Jones">
    <ALLOCATION DEMANDE="5000" CODE="72" PRICE="25.00">2500</ALLOCATION>
    <ALLOCATION DEMANDE="7000" CODE="75" PRICE="35.00">4000</ALLOCATION>
    <ALLOCATION DEMANDE="9000" CODE="66" PRICE="24.77">1200</ALLOCATION> <-! this is the new line !->
    </DEAL>
    <DEAL ID="23" ISBN="1-7988-1623-3" Screenplay="Joe Doe" Title ="Nothing Much" Director = "Listentome">
    <ALLOCATION DEMANDE="3300" CODE="72" PRICE="15.00">2500</ALLOCATION>
    </DEAL>
    </DEALS>
    Is there a way to achieve that?
    I have been searching and reading in the books but i cannot find a solution for this.
    Thank you
    Please do not forget to click “Vote as Helpful” if the reply helps/directs you toward your solution and or "Mark as Answer" if it solves your question. This will help to contribute to the forum.

    I would think of something like the below, the id is passed as static you need to change this
    protected virtual void button1_Click(object sender, EventArgs e)
    //Get DataTable from DGV datasource
    DataTable dt = new DataTable();
    dt = (DataTable)dataGridView1.DataSource;
    string file1 = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><DEALS><DEAL ID=\"22\" ISBN=\"0-7888-1623-3\" Screenplay=\"Mary Kaplan\" Title =\"Mr Gentleman\" Director = \"Jonathan Jones\"><ALLOCATION DEMANDE=\"5000\" CODE=\"72\" PRICE=\"25.00\">2500</ALLOCATION><ALLOCATION DEMANDE=\"7000\" CODE=\"75\" PRICE=\"35.00\">4000</ALLOCATION></DEAL><DEAL ID=\"23\" ISBN=\"1-7988-1623-3\" Screenplay=\"Joe Doe\" Title =\"Nothing Much\" Director = \"Listentome\"><ALLOCATION DEMANDE=\"3300\" CODE=\"72\" PRICE=\"15.00\">2500</ALLOCATION></DEAL></DEALS>";
    StringReader reader = new StringReader(file1);
    XDocument doc1 = XDocument.Load(reader);
    //Remove all elements related to the id being populated into the Grid
    doc1.Descendants("DEAL").ToList().Where(x => x.Attribute("ID").Value == "22").Descendants("ALLOCATION").Remove();
    //loop through datatable and create new xelement to be added to the xdocument
    foreach (DataRow dr in dt.Rows)
    XElement xe = new XElement("ALLOCATION",
    new XAttribute("DEMANDE", dr[0].ToString()),
    new XAttribute("CODE", dr[1].ToString()),
    new XAttribute("PRICE", dr[2].ToString()));
    xe.Value = dr[3].ToString();
    doc1.Descendants("DEAL").ToList().Where(x => x.Attribute("ID").Value == "22").FirstOrDefault().Add(xe);
    Fouad Roumieh

  • Problem with Nested Repeatable Forms

    Hi All,
    I am having some problems when creating 3 repeatable forms inside another reapeatable form. My XML structure is similar to this:
    - <tasks>
           <id>3139--13</id>
           <startDate>2012-10-01T04:00:00Z</startDate>
           <name>Tax Preparation Fees</name>
    -      <weekTable>
                <weekNumber>49</weekNumber>
    -           <data>
                     <service>Accountant</service>
                     <servicePerformer>Alex</servicePerformer>
                     <hours>PT5H</hours>
                     <rate>45.000000</rate>
                </data>
    -           <data>
                     <service>Fund Officer</service>
                     <servicePerformer>Malinda</servicePerformer>
                     <hours>PT3H</hours>
                     <rate>0.000000</rate>
                     </data>
           </weekTable>
    -      <weekTable>
                <weekNumber>40</weekNumber>
    -           <data>
                     <service>Fund Officer</service>
                     <servicePerformer>R. Major</servicePerformer>
                     <hours>PT4H</hours>
                     <rate>0.000000</rate>
                </data>
    -           <data>
                     <service>Account Support</service>
                     <servicePerformer>Leslie</servicePerformer>
                     <hours>PT10H</hours>
                     <rate>0.000000</rate>
                </data>
           </weekTable>
       ** 2 more reapeatable structures similar to <weekTable>
      </tasks>
    I can make weekTable repeate based on the number of data items but I couldn't make the tasks repeate.
    Is it possible to be done ?
    Thanks a lot!
    Felipe.

    Hi Kyle,
    I didn't explain it righ, sorry. The task also repeats. So, there is tasks, which repeats, inside it there is weektable, which repeats, and inside it there is data which also repeats.
    Anyway, I tried to create a repeatable form inside another repeatable form with the bindings you mentioned but LCD doesn't let me.
    I can check "Repeat Subform for each data item" in the subData form binding settings but not int the subWeek.
    Felipe

  • Generate hierarchical xml data with xmlutilities ?

    hello
    I am just experimenting with the oracle xml utilities, because I
    want to set on http-services to access to our patient database.
    Is it possible to generate the following xml structure (ALL
    relevant diagnoses are hierarchically subordered to the ONE
    patient) when two tables (master table patient, dependent table
    diagnoses) are given ?
    <rowset>
    <row num=...>
    <name>smith</name>
    <diagnosis>
    <date> ...</date>
    <icd-code> ... </icd-code>
    <text> ... </text>
    </diagnosis>
    /*ev.further diagnosis*/
    </row>
    /*ev.further rows for further patients*/
    </rowset>
    By the moment, I have the impression that only list-similar xml
    data is possible.
    Thank You very much for comments.
    ali gerhard
    null

    Hi ali,
    Yes, you can use the CAST(MULTISET()) operator to create a
    nested table of subordered diagnostic record and display it.
    (You need the objects option installed if you are using 8.0.
    With 8i, the objects options is included free)
    e.g.
    /* Create a regular type */
    CREATE TYPE diagnostic_type AS OBJECt
    diag_date NUMBER,
    icd_code NUMBER,
    /* etc... all the necessary diagnostic details.. */
    /* create a nested table type */
    CREATE TYPE diagnostic_list_t AS TABLE OF diagnostic_type;
    /* Now u can use this in any query */
    SELECT p.name AS name,
    CAST(MULTISET( SELECT d.diag_date, d.icd_code,...
    FROM diagnosis_table d
    WHERE d.patient_name = p.name)
    AS diagnostic_list_t) AS diagnosis
    FROM patient_table p;
    This query as u can see gets the name of the patient and then
    creates a nested table of diagnostic records for the patient.
    This assumes that for every patient there are more than 1
    diagnosis records.
    If you have only one diagnostic record per patient then u can
    simply write this as,
    SELECT p.name AS name,
    diagnostic_t(d.diag_date,d.icd_code,...) AS diagnosis
    FROM patient_table p, diagnostic_table d
    WHERE p.name = d.patient_name;
    Here u are just constructing a structured diagnosis type from
    the given values.
    Hope this helps,
    Murali
    ali gerhard (guest) wrote:
    : hello
    : I am just experimenting with the oracle xml utilities, because
    I
    : want to set on http-services to access to our patient
    database.
    : Is it possible to generate the following xml structure (ALL
    : relevant diagnoses are hierarchically subordered to the ONE
    : patient) when two tables (master table patient, dependent
    table
    : diagnoses) are given ?
    : <rowset>
    : <row num=...>
    : <name>smith</name>
    : <diagnosis>
    : <date> ...</date>
    : <icd-code> ... </icd-code>
    : <text> ... </text>
    : </diagnosis>
    : /*ev.further diagnosis*/
    : </row>
    : /*ev.further rows for further patients*/
    : </rowset>
    : By the moment, I have the impression that only list-similar
    xml
    : data is possible.
    : Thank You very much for comments.
    : ali gerhard
    null

  • How to get & use xml data with jstl libraries? (URGENT PLZ)

    I am using jstl to get and use xml data
    I needs to perform operations on the parsed xml document with other libraries of jstl. How can i do that.
    I used Dom variable to parse my document as:
    <x:parse varDom="test"> <c:import url="project.xml"/> </x:parse>
    where my project.xml is:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <project>      <projectName>myProject</projectName> </project>
    I can dislay this value in html by
    <x:out select="$test/project/projectName"/>
    But I need a string value sotred in variable such as <c:set var="pname" value="???">
    HOW CAN I SET THIS VALUE IN CORE VARIABLE THAT IS, USING <c:set...> SO THAT IT CAN BE USED ANYWHERE IN JSP PAGE TO CONCATE RETURNED STRING IN OTHER STRING VARIABLES DEFINED BY CORE LIB?
    Jessy
    Message was edited by:
    jessy
    Message was edited by:
    jessy

    I believe that <c:set> should do that but i am facing problem in it. Look into this jsp scriptlet:
    1-<x:parse varDom="test"> <c:import url="project.xml"/> </x:parse>
    2-<x:set var="ds" select="$test/project/projectName"/>
    3-<x:out select="$ds"/> <br>
    4-<c:set var="tt" value="${ds}" />
    5-<c:out value="${tt}" />
    In line 3 variable ds returns: myProject
    In line 5 variable tt returns: [[projectName: null]]
    perhaps on line 4 ds is storing some array to tt and i am not calling correct array element. I tried many options but still could not find solution. Plz Plz do something urgent for me. Thanks
    Jessy
    Message was edited by:
    jessy

  • URGENTLY NEED HELP WITH NESTED REPEAT REGION

    Im using dreamweaver to deevelop a page that displays questions in ann assessment to the user. First of all the page shows the assessment name to the user and then it gets some information about the questions in the assessment from the table called Item. It gets the Question_ID and then there is a repeat region which uses the Question_ID to display the questions in the assessment. There is a nested repeat region inside this which displays the possible answers the user can respond to the question with It gets this information from a table called outcome. The page should display each question and then all the possible answers but i am having problems and im not sure wether i am doing this in the correct way. What is wrong with my code? PLEASE HELP! can someone tell me what is going wrong and how i can fix this problem thamks.
    here is my code.
    Driver DriverassessmentRecordset = (Driver)Class.forName(MM_connAssessment_DRIVER).newInstance();
    Connection ConnassessmentRecordset = DriverManager.getConnection(MM_connAssessment_STRING,MM_connAssessment_USERNAME,MM_connAssessment_PASSWORD);
    PreparedStatement StatementassessmentRecordset = ConnassessmentRecordset.prepareStatement("SELECT Assessment_ID, Assessment_Name, Time_Limit, Display_Random, Record_Answers FROM Assessment.assessment WHERE Assessment_ID = '" + session.getValue("AssessmentID") + "' ");
    ResultSet assessmentRecordset = StatementassessmentRecordset.executeQuery();
    boolean assessmentRecordset_isEmpty = !assessmentRecordset.next();
    boolean assessmentRecordset_hasData = !assessmentRecordset_isEmpty;
    Object assessmentRecordset_data;
    int assessmentRecordset_numRows = 0;
    %>
    <%
    Driver DriveritemRecordset = (Driver)Class.forName(MM_connAssessment_DRIVER).newInstance();
    Connection ConnitemRecordset = DriverManager.getConnection(MM_connAssessment_STRING,MM_connAssessment_USERNAME,MM_connAssessment_PASSWORD);
    PreparedStatement StatementitemRecordset = ConnitemRecordset.prepareStatement("SELECT Question_ID, Assessment_ID FROM Assessment.item WHERE Assessment_ID = '" + session.getValue("AssessmentID") + "' ");
    ResultSet itemRecordset = StatementitemRecordset.executeQuery();
    boolean itemRecordset_isEmpty = !itemRecordset.next();
    boolean itemRecordset_hasData = !itemRecordset_isEmpty;
    Object itemRecordset_data;
    int itemRecordset_numRows = 0;
    %>
    <%
    Driver DriverquestionRecordset = (Driver)Class.forName(MM_connAnswer_DRIVER).newInstance();
    Connection ConnquestionRecordset = DriverManager.getConnection(MM_connAnswer_STRING,MM_connAnswer_USERNAME,MM_connAnswer_PASSWORD);
    //PreparedStatement StatementquestionRecordset = ConnquestionRecordset.prepareStatement("SELECT Question_Type, Number_Outcomes, Question_Wording FROM Answer.question WHERE Question_ID = '" + (((itemRecordset_data = itemRecordset.getObject("Question_ID"))==null || itemRecordset.wasNull())?"":itemRecordset_data) +"' ");
    //ResultSet questionRecordset = StatementquestionRecordset.executeQuery();
    %>
    <%
    Driver DriveroutcomeRecordset = (Driver)Class.forName(MM_connAnswer_DRIVER).newInstance();
    Connection ConnoutcomeRecordset = DriverManager.getConnection(MM_connAnswer_STRING,MM_connAnswer_USERNAME,MM_connAnswer_PASSWORD);
    PreparedStatement StatementoutcomeRecordset = ConnoutcomeRecordset.prepareStatement("SELECT Outcome_Number, Outcome_Text, Score, Feedback FROM Answer.outcome WHERE Question_ID = '" +itemRecordset.getObject("Question_ID")+ "' ");
                     ResultSet outcomeRecordset = StatementoutcomeRecordset.executeQuery();
                     boolean outcomeRecordset_isEmpty = !outcomeRecordset.next();
                    boolean outcomeRecordset_hasData = !outcomeRecordset_isEmpty;Object outcomeRecordset_data;
                  int outcomeRecordset_numRows = 0;
    %>
    <%
    int Repeat1__numRows = -1;
    int Repeat1__index = 0;
    itemRecordset_numRows += Repeat1__numRows;
    %>
    <%
    int Repeat2__numRows = -1;
    int Repeat2__index = 0;
    assessmentRecordset_numRows += Repeat2__numRows;
    %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/assessment.dwt.jsp" codeOutsideHTMLIsLocked="false" -->
    <head>
    <!-- InstanceBeginEditable name="doctitle" -->
    <title>Assessment</title>
    <!-- InstanceEndEditable -->
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <!-- InstanceBeginEditable name="head" -->
    <!-- InstanceEndEditable -->
    <link href="../css/style.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <table width="1000" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td height="190"><img src="../img/assessment_login.png" alt="" name="navigation" width="1000" height="190" border="0" id="navigation" /></td>
      </tr>
      <tr>
        <td height="19"><!--DWLayoutEmptyCell--> </td>
      </tr>
      <tr>
        <td height="19"><!-- InstanceBeginEditable name="main" -->
        <table>
          <tr>
            <td width="990">Assessment Name:<%=(((assessmentRecordset_data = assessmentRecordset.getObject("Assessment_Name"))==null || assessmentRecordset.wasNull())?"":assessmentRecordset_data)%> </td>
            </tr>
          <tr>
            <td><% int count = 1; %> </td>
          </tr>
          <tr>
            <td valign="top"><table>
                <% while ((itemRecordset_hasData)&&(Repeat1__numRows-- != 0)) { %>
    <tr>
                  <td width="21"> 
                     </td>
                  <td width="86">Question:<%= count %></td>
                </tr>
                <tr>
                  <td></td>
                  <td>
                     <% 
                     PreparedStatement StatementquestionRecordset = ConnquestionRecordset.prepareStatement("SELECT Question_Type, Number_Outcomes, Question_Wording FROM Answer.question WHERE Question_ID = '" +itemRecordset.getObject("Question_ID")+"' ");
                     ResultSet questionRecordset = StatementquestionRecordset.executeQuery();
                  boolean questionRecordset_isEmpty = !questionRecordset.next();
                  boolean questionRecordset_hasData = !questionRecordset_isEmpty;
                  Object questionRecordset_data;
                  int questionRecordset_numRows = 0;
                     %> <%= questionRecordset.getObject("Question_Wording") %></td>
                </tr>
                <tr>
                  <td></td>
                  <td>
                     </td>
                </tr>
                <tr>
                  <td></td>
                  <td> 
                    <table>
                      <% while ((outcomeRecordset_hasData)&&(Repeat2__numRows-- != 0)) {%>
                      <tr>
                        <td><%=(((outcomeRecordset_data = outcomeRecordset.getObject("Outcome_Number"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data)%></td>
                        <td><%=(((outcomeRecordset_data = outcomeRecordset.getObject("Outcome_Text"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data)%></td>
                        <td><%=(((outcomeRecordset_data = outcomeRecordset.getObject("Score"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data)%></td>
                        <td><%=(((outcomeRecordset_data = outcomeRecordset.getObject("Feedback"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data)%></td>
                        <td><%=(((outcomeRecordset_data = outcomeRecordset.getObject("Question_ID"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data)%></td>
                      </tr>
                      <%
      Repeat2__index++;
      outcomeRecordset_hasData = outcomeRecordset.next();
    %>
                    </table>
                    <table>
                      <tr> </tr>
                      <tr> </tr>
                    </table></td>
                </tr>
                <%
      Repeat1__index++;
      itemRecordset_hasData = itemRecordset.next();
      count++;
    //questionRecordset.close();
    //StatementquestionRecordset.close();
    //ConnquestionRecordset.close();
    %>
    Here is the exception i am gettingorg.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 115 in the jsp file: /delivery/session.jsp
    Generated servlet error:
    C:\Servers\Tomcat 5.0\work\Catalina\localhost\assessment\org\apache\jsp\delivery\session_jsp.java:220: cannot find symbol
    symbol : variable outcomeRecordsetRecordset_data
    location: class org.apache.jsp.delivery.session_jsp
    out.print((((outcomeRecordset_data = outcomeRecordset.getObject("Outcome_Number"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data));
    ^
    An error occurred at line: 116 in the jsp file: /delivery/session.jsp
    Generated servlet error:
    C:\Servers\Tomcat 5.0\work\Catalina\localhost\assessment\org\apache\jsp\delivery\session_jsp.java:223: cannot find symbol
    symbol : variable outcomeRecordsetRecordset_data
    location: class org.apache.jsp.delivery.session_jsp
    out.print((((outcomeRecordset_data = outcomeRecordset.getObject("Outcome_Text"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data));
    ^
    An error occurred at line: 117 in the jsp file: /delivery/session.jsp
    Generated servlet error:
    C:\Servers\Tomcat 5.0\work\Catalina\localhost\assessment\org\apache\jsp\delivery\session_jsp.java:226: cannot find symbol
    symbol : variable outcomeRecordsetRecordset_data
    location: class org.apache.jsp.delivery.session_jsp
    out.print((((outcomeRecordset_data = outcomeRecordset.getObject("Score"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data));
    ^
    An error occurred at line: 118 in the jsp file: /delivery/session.jsp
    Generated servlet error:
    C:\Servers\Tomcat 5.0\work\Catalina\localhost\assessment\org\apache\jsp\delivery\session_jsp.java:229: cannot find symbol
    symbol : variable outcomeRecordsetRecordset_data
    location: class org.apache.jsp.delivery.session_jsp
    out.print((((outcomeRecordset_data = outcomeRecordset.getObject("Feedback"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data));
    ^
    An error occurred at line: 119 in the jsp file: /delivery/session.jsp
    Generated servlet error:
    C:\Servers\Tomcat 5.0\work\Catalina\localhost\assessment\org\apache\jsp\delivery\session_jsp.java:232: cannot find symbol
    symbol : variable outcomeRecordsetRecordset_data
    location: class org.apache.jsp.delivery.session_jsp
    out.print((((outcomeRecordset_data = outcomeRecordset.getObject("Question_ID"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data));
    ^
    An error occurred at line: 119 in the jsp file: /delivery/session.jsp
    Generated servlet error:
    Note: C:\Servers\Tomcat 5.0\work\Catalina\localhost\assessment\org\apache\jsp\delivery\session_jsp.java uses or overrides a deprecated API.
    An error occurred at line: 119 in the jsp file: /delivery/session.jsp
    Generated servlet error:
    Note: Recompile with -Xlint:deprecation for details.
    An error occurred at line: 119 in the jsp file: /delivery/session.jsp
    Generated servlet error:
    Note: C:\Servers\Tomcat 5.0\work\Catalina\localhost\assessment\org\apache\jsp\delivery\session_jsp.java uses unchecked or unsafe operations.
    An error occurred at line: 119 in the jsp file: /delivery/session.jsp
    Generated servlet error:
    Note: Recompile with -Xlint:unchecked for details.
    5 errors
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)     org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
    org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

    Hi,
    Dont have much time to go through your code, but apparently i can see the error is becoz of the following reason.
    In the following code, you have used "outcomeRecordset_data ", but its not declared. You need to declare the variable first before you can use it.
    <% while ((outcomeRecordset_hasData)&&(Repeat2__numRows-- != 0)) {%>
                      <tr>
                        <td><%=(((outcomeRecordset_data = outcomeRecordset.getObject("Outcome_Number"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data)%></td>
                        <td><%=(((outcomeRecordset_data = outcomeRecordset.getObject("Outcome_Text"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data)%></td>
                        <td><%=(((outcomeRecordset_data = outcomeRecordset.getObject("Score"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data)%></td>
                        <td><%=(((outcomeRecordset_data = outcomeRecordset.getObject("Feedback"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data)%></td>
                        <td><%=(((outcomeRecordset_data = outcomeRecordset.getObject("Question_ID"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data)%></td>
                      </tr>
                      <%
      Repeat2__index++;
      outcomeRecordset_hasData = outcomeRecordset.next();
    %>Try declaring the "outcomeRecordset_data " on top as an object
    Hope it helps

  • Transforming XML Data with XSLT in a servlet

    Trying to transform XML data using XSLT. The following code works fine outside of a servlet. But in a servlet it gives the following error :
    * Transformer Factory error
    javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: org.xml.sax.SAXException: Namespace not supported by SAXParser
    javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: org.xml.sax.SAXException: Namespace not supported by SAXParser
         at org.apache.xml.utils.DefaultErrorHandler.fatalError(DefaultErrorHandler.java:257)
         at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:813)
         at TransformationApp.XSLTTransformServlet.MyTransform(XSLTTransformServlet.java:79)
         at TransformationApp.XSLTTransformServlet.doGet(XSLTTransformServlet.java:39)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
         at org.apache.tomcat.core.Handler.service(Handler.java:287)
         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
         at java.lang.Thread.run(Thread.java:484)
    Several articles hinted at setting the factory namespace attribute to TRUE. I have tried that but same results. Here is the code :
    static Document document;
    DocumentBuilderFactory factory =
    DocumentBuilderFactory.newInstance();
    //factory.setNamespaceAware(true);
    //factory.setValidating(true);
    try {
    File stylesheet = new File(argv[0]);
    File datafile = new File(argv[1]);
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse(datafile);
    // Use a Transformer for output
    TransformerFactory tFactory =
    TransformerFactory.newInstance();
    StreamSource stylesource = new StreamSource(stylesheet);
    Transformer transformer = tFactory.newTransformer(stylesource);
    DOMSource source = new DOMSource(document);
    StreamResult result = new StreamResult(System.out);
    transformer.transform(source, result);
    } catch (TransformerConfigurationException tce) {
    // Error generated by the parser
    System.out.println ("\n** Transformer Factory error");
    System.out.println(" " + tce.getMessage() );
    // Use the contained exception, if any
    Throwable x = tce;
    if (tce.getException() != null)
    x = tce.getException();
    x.printStackTrace();
    } catch (TransformerException te) {
    // Error generated by the parser
    System.out.println ("\n** Transformation error");
    System.out.println(" " + te.getMessage() );
    // Use the contained exception, if any
    Throwable x = te;
    if (te.getException() != null)
    x = te.getException();
    x.printStackTrace();
    } catch (SAXException sxe) {
    // Error generated by this application
    // (or a parser-initialization error)
    Exception x = sxe;
    if (sxe.getException() != null)
    x = sxe.getException();
    x.printStackTrace();
    } catch (ParserConfigurationException pce) {
    // Parser with specified options can't be built
    pce.printStackTrace();
    } catch (IOException ioe) {
    // I/O error
    ioe.printStackTrace();
    Any help would be greatly appreciated.

    I don't know that this is true, but i think the problem is the classpath.
    The runtime has his own parser. This parser is befor your xalan.lib in the classpath and the
    parser from the runntime don't support namespace.
    Try Tomcat 4.
    Regard Dietmar

  • Fixed length outer table with nested repeating group inner table.

    I had to re-create a PDF using tables in an RTF template. It has a fixed 1 page width. However, one of the rows in the template has a nested table with a repeating group. I set the width of the outer table row width to 2". However when I have repeating groups it makes the outer row grow wider than the 2" inches. The option to un-select "automatically resize to fit contents" is grayed out.
    Is there a way to keep the outer table width fixed with an inner repeating group?
    Thanks.
    --Johnnie
    Edited by: Vortex13 on Jun 13, 2012 11:15 AM

    Hi Borris,
    Found the following in the Oracle Documentation under: Oracle8i Application Developer's Guide - Object-Relational Features Release 2 (8.1.6)
    2 Managing Oracle Objects / Using Collections / Collection Unnesting
    URL: http://www.znow.com/sales/oracle/appdev.816/a76976/adobjmng.htm#1002885
    Oracle8i also supports the following syntax to produce outer-join results:
    SELECT d.*, e.* FROM depts d, TABLE(d.emps)(+) e;
    The (+) indicates that the dependent join between DEPTS and D.EMPS should be NULL-augmented. That is, there > will be rows of DEPTS in the output for which D.EMPS is NULL or empty, with NULL values for columns
    corresponding to D.EMPS.

  • Problem in mapping xml data with header details from IPM 11g to BPEL

    Hi,
    I want to map xml data as a supporting content from IPM application to BPEL.
    My xml is
    <?xml version="1.0" encoding="utf-8"?>
    <DocumentFile xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/Document.xsd">
    <Document DocumentType="Invoice">
    <DocumentImage>
    <Filename>\\10.205.0.209\Img\10883212.TIF</Filename>
    </DocumentImage>
    </DocumentFile>
    If I remove header details from root element <DocumentFile> i.e. modified xml is
    <DocumentFile>
    <Document DocumentType="Invoice">
    <DocumentImage>
    <Filename>\\10.205.0.209\Img\10883212.TIF</Filename>
    </DocumentImage>
    </DocumentFile>
    it works fine but i need to pass header details as well.
    Please suggest.
    Thanks,
    Priya

    Hi Naveen,
    In sxmb_moni the content transmitted to the adapter(RFC)is as follows
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns:ZRFID_EQUIP xmlns:ns="urn:sap-com:document:sap:rfc:functions">
    - <RECORDS>
    - <item>
      <FLOC>f1-01-01</FLOC>
      <RFID_NO>I006</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-02</FLOC>
      <RFID_NO>I002</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-03</FLOC>
      <RFID_NO>I003</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-04</FLOC>
      <RFID_NO>I004</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-05</FLOC>
      <RFID_NO>I005</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-06</FLOC>
      <RFID_NO>I001</RFID_NO>
      </item>
      </RECORDS>
      </ns:ZRFID_EQUIP>
    At r/3 side the field floc and rfid_no gets mapped to floc which is of char30
    eg floc=f1-01-01I006
       rfid_no=

  • Singing XML Data with PKCS#7 with SHA1withRSA

    Dear All
    I am using the following code to sign xml message with PKCS#7 with SHA1withRSA. But I am facing bad signature error from the server, they are telling me that this is signed correctly.
    Please can anybody give some idea that i doing correctly as PKCS#7 with SHA1 algorithm.
    I am using bouncy castle libraries
      private byte[] sign(String input) {
            Security.addProvider(new BouncyCastleProvider());
            byte[] encoded = null;
            try {
                KeyStore keystore = loadKeyStore();
                Certificate[] certchain =
                    (Certificate[])keystore.getCertificateChain(MaadenPropertiesConstants.KEYSTORE_Alias);
                final List<Certificate> certlist = new ArrayList<Certificate>();
                for (int i = 0, length = certchain == null ? 0 : certchain.length;
                     i < length; i++) {
                    certlist.add(certchain[i]);
                PrivateKey key =
                    (PrivateKey)(keystore.getKey(MaadenPropertiesConstants.KEYSTORE_Alias, MaadenPropertiesConstants.KEYSTORE_PWD.toCharArray()));
                ContentSigner signer =
                    new JcaContentSignerBuilder("SHA1withRSA").setProvider("BC").build(key);
                CMSSignedDataGenerator generator = new CMSSignedDataGenerator();
                generator.addSignerInfoGenerator(new JcaSignerInfoGeneratorBuilder(new JcaDigestCalculatorProviderBuilder().setProvider("BC").build()).build(signer,
                                                                                                                                                             (X509Certificate)keystore.getCertificate(MaadenPropertiesConstants.KEYSTORE_Alias)));
                generator.addCertificates(new JcaCertStore(certlist));
    //            CMSSignedData signedData =
    //            generator.generate(new CMSProcessableFile(new File(this.inputFile)),
    //                                   true); //changed to false
                CMSTypedData msg;
                msg = new CMSProcessableByteArray(input.getBytes());
                CMSSignedData signedData = generator.generate(msg, true);
                encoded = signedData.getEncoded();
                System.out.println("Got encoded pkcs7 bytes " + encoded.length +
                                   " bytes");
            } catch (Exception e) {
                e.printStackTrace();
            return encoded;
        private static KeyStore loadKeyStore() throws Exception {
            KeyStore keystore =
                KeyStore.getInstance(MaadenPropertiesConstants.KEYSTORE_INSTANCE);
            InputStream is =
                new FileInputStream(MaadenPropertiesConstants.keystoreLocation);
            keystore.load(is,
                          MaadenPropertiesConstants.KEYSTORE_PWD.toCharArray());
            return keystore;

    Dear All
    I am using the following code to sign xml message with PKCS#7 with SHA1withRSA. But I am facing bad signature error from the server, they are telling me that this is signed correctly.
    Please can anybody give some idea that i doing correctly as PKCS#7 with SHA1 algorithm.
    I am using bouncy castle libraries
      private byte[] sign(String input) {
            Security.addProvider(new BouncyCastleProvider());
            byte[] encoded = null;
            try {
                KeyStore keystore = loadKeyStore();
                Certificate[] certchain =
                    (Certificate[])keystore.getCertificateChain(MaadenPropertiesConstants.KEYSTORE_Alias);
                final List<Certificate> certlist = new ArrayList<Certificate>();
                for (int i = 0, length = certchain == null ? 0 : certchain.length;
                     i < length; i++) {
                    certlist.add(certchain[i]);
                PrivateKey key =
                    (PrivateKey)(keystore.getKey(MaadenPropertiesConstants.KEYSTORE_Alias, MaadenPropertiesConstants.KEYSTORE_PWD.toCharArray()));
                ContentSigner signer =
                    new JcaContentSignerBuilder("SHA1withRSA").setProvider("BC").build(key);
                CMSSignedDataGenerator generator = new CMSSignedDataGenerator();
                generator.addSignerInfoGenerator(new JcaSignerInfoGeneratorBuilder(new JcaDigestCalculatorProviderBuilder().setProvider("BC").build()).build(signer,
                                                                                                                                                             (X509Certificate)keystore.getCertificate(MaadenPropertiesConstants.KEYSTORE_Alias)));
                generator.addCertificates(new JcaCertStore(certlist));
    //            CMSSignedData signedData =
    //            generator.generate(new CMSProcessableFile(new File(this.inputFile)),
    //                                   true); //changed to false
                CMSTypedData msg;
                msg = new CMSProcessableByteArray(input.getBytes());
                CMSSignedData signedData = generator.generate(msg, true);
                encoded = signedData.getEncoded();
                System.out.println("Got encoded pkcs7 bytes " + encoded.length +
                                   " bytes");
            } catch (Exception e) {
                e.printStackTrace();
            return encoded;
        private static KeyStore loadKeyStore() throws Exception {
            KeyStore keystore =
                KeyStore.getInstance(MaadenPropertiesConstants.KEYSTORE_INSTANCE);
            InputStream is =
                new FileInputStream(MaadenPropertiesConstants.keystoreLocation);
            keystore.load(is,
                          MaadenPropertiesConstants.KEYSTORE_PWD.toCharArray());
            return keystore;

  • Problem in mapping xml data with imported RFC parameters

    I am currently working on a senario in which a flat file is generated by an RFID server and placed in FTP server.
    The flat file is picked up from the FTP server using XI and the contents are mapped to the corresponding imported RFC parameters.
    The content of the file which is in text format is successfully converted in XML at the XI side.
    File contains records of 2 fields Functional location and RFID equipment number . In the R/3 side these fields
    are used as Functional location and equipment number of PM module .
    The structure of the FTP message is as follows
    <ns:RFID_MSG_TYPE xmlns:ns="urn://sisl:rfiddemo">
    <RecordSet>
      <Row>
       <FL1>"f1</FL1>
       <FL2>01</FL2>
       <FL3>01</FL3>
       <RFID_NUM>I001"</RFID_NUM>
      </Row>
    </RecordSet>
    </ns:RFID_MSG_TYPE>
    After the mapping program which maps the above structure to the imported RFC is executed the following payload document is generated
    <ns:ZRFID_EQUIP xmlns:ns="urn:sap-com:document:sap:rfc:functions">
    <RECORDS>
      <item>
       <FLOC>f1-01-01</FLOC>
       <RFID_NO>I001</RFID_NO>
      </item>
    </RECORDS>
    </ns:ZRFID_EQUIP>
    The size of FLOC is 30 of type string and RFID_NO is also a string with size 18.
    When the data is brought in R/3 both the fields FLOC and RFID_NO gets mapped in FLOC which is of type char30.

    Hi Naveen,
    In sxmb_moni the content transmitted to the adapter(RFC)is as follows
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns:ZRFID_EQUIP xmlns:ns="urn:sap-com:document:sap:rfc:functions">
    - <RECORDS>
    - <item>
      <FLOC>f1-01-01</FLOC>
      <RFID_NO>I006</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-02</FLOC>
      <RFID_NO>I002</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-03</FLOC>
      <RFID_NO>I003</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-04</FLOC>
      <RFID_NO>I004</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-05</FLOC>
      <RFID_NO>I005</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-06</FLOC>
      <RFID_NO>I001</RFID_NO>
      </item>
      </RECORDS>
      </ns:ZRFID_EQUIP>
    At r/3 side the field floc and rfid_no gets mapped to floc which is of char30
    eg floc=f1-01-01I006
       rfid_no=

Maybe you are looking for