Flattening the xml data

Hi,
I have the following XML loaded in the xmltype column.
<g1>
     <f1>A</f1>
     <g2>
          <f2>a</f2>
          <g3>
               <f3>1</f3>
               <f3>2</f3>
               <f3>3</f3>
          </g3>
     </g2>
     <g2>
          <f2>b</f2>
          <g3>
               <f3>5</f3>
               <f3>6</f3>
               <f3>7</f3>
          </g3>
     </g2>
</g1>
From the above xml, how to get the following result,
f1 f2 f3
===========================
A     a 1
A     a 2
A     a 3
A     b 5
A     b 6
A     b 7
Thanks.

SQL> var test varchar2(256)
SQL> --
SQL> begin
2 :test := '<g1>
3 <f1>A</f1>
4 <g2>
5 <f2>a</f2>
6 <g3>
7 <f3>1</f3>
8 <f3>2</f3>
9 <f3>3</f3>
10 </g3>
11 </g2>
12 <g2>
13 <f2>b</f2>
14 <g3>
15 <f3>5</f3>
16 <f3>6</f3>
17 <f3>7</f3>
18 </g3>
19 </g2>
20 </g1>';
21 end;
22 /
PL/SQL procedure successfully completed.
SQL> select xmltype(:test).extract('/*')
2 from dual
3 /
XMLTYPE(:TEST).EXTRACT('/*')
<g1>
<f1>A</f1>
<g2>
<f2>a</f2>
<g3>
<f3>1</f3>
<f3>2</f3>
<f3>3</f3>
</g3>
</g2>
<g2>
<f2>b</f2>
<g3>
<f3>5</f3>
<f3>6</f3>
<f3>7</f3>
</g3>
</g2>
</g1>
SQL> column F1 format A4
SQL> column F2 format A4
SQL> column F3 format A4
SQL> --
SQL> select extractvalue(xml,'/g1/f1') F1,
2 extractvalue(value(g2),'/g2/f2') F2,
3 extractValue(value(f3),'/f3') F3
4 from (select xmltype(:test) as xml from dual),
5 table (xmlsequence(extract(xml,'/g1/g2'))) g2,
6 table (xmlsequence(extract(value(g2),'/g2/g3/f3'))) f3
7 /
F1 F2 F3
A a 1
A a 2
A a 3
A b 5
A b 6
A b 7
6 rows selected.

Similar Messages

  • Using informations about the XML Data Set in *.js

    Dear Users,
    I hope I am able to explane my problem correctly:
    I wonna create a fade effect with various pictures. They don't should blend to 0 - I found a js script that lets the pictures fade from one to the other like this: www.sv-guenther.de
    What this script needs is the number of pictures. I put the picture links into an XML file. Everything works as long as write the number or length of the picture children manually.
    I tried to read out the length by using the ds_RowCount option. This works fine as long as I use this in HTML context like this:
    <div spry:region="ds1" ><script type="text/javascript">  alert({ds_RowCount});</script>{ds_RowCount}</div>
    Both works: The alert shows the number 21 AND you can read the "21" and not {ds_RowCount}.
    okay, but how do I use the "21" integer in a script block in the head area? like this:
    <head>
    <script type="text/javascript">
    var x = {ds_RowCount};
    </script>
    </head>
    I tried it in different ways: var x = '{ds_RowCount}'; or spry:....
    As you can see: I am afraid my scripting knowledge is not the best - like my English is...
    Sorry and thank you very much for your help! - any kind of help
    best regards from Bonn, Germany
    Thorsten

    Dear Ben,
    if you would see me, you wouldn't laugh anymore, you would cry -) - but you are in DownUnder - this would look like I am laughing for you - wouldn't it?
    Thank yoou so much for remembering me. I have been reading your post about this topic (blend a picture). Once somebody asked the same (or almost the same) like I did yesterday. But the difference is, that if you blend a text to 0 it is big diference blending a picture - in my mind. I would love to reduce the opacity from one picture when the next picture is already behind it. So it looks like a smooth fade in fade out, without displaying the background.
    I found a quite good code example for this:HERE
    To make it as easy as possible for me I tried to include the number of the pictures straight into the js code. in the meantime I found the correct code option for this: What I was looking for was: getData() and if I combine it with an observer to wait for the "onPostLoad" everything works fine. I am ashamed that I asked first and then lokked into the SPRY API - Sorry!
    Everything works fine? No not yet - unfourtunally. So I am pleased to get the chance to ask a second time:
    Let's say I have more than one picture and more than one topic. So my XML looks like this:
    <leistungen>
    <inhalte name="Bauvorhaben">
         <inhalt name="Bautechnische Beratung">
         <texte>
              <text>Beurteilung der Baubeschreibung, Beratung zur Ausführungsplanung</text>
         </texte>
         <bilder>
              <bild></bild>
         </bilder>
         </inhalt>
         <inhalt name="Baubegleitende Qualitätsüberwachung">
         <texte>
              <text>Stichprobenhafte Kontrollen der Bauausführung zur Gewährleistung der Einhaltung anerkannter Regeln der Bautechnik und vertraglicher Vereinbarungen</text>
         </texte>
         <bilder>
              <bild>3867</bild>
         </bilder>
         </inhalt>
         <inhalt name="Baumängel">
         <texte>
              <text>Feststellung und Beurteilung von Baumängeln, Ursachenermittlung,Sanierungsempfehlung, Schätzung der Instandsetzungskosten</text>
         </texte>
         <bilder>
              <bild>2857</bild>
              <bild>3612</bild>
         </bilder>
         </inhalt>
         <inhalt name="Beweissicherung">
         <texte>
              <text>Dokumentation von  Schäden an  Bestandsgebäuden im Einflußbereich von Bauvorhaben, Beurteilung von Schadensansprüchen</text>
              <text>Bauzustandsdokumentation, Leistungsfeststellung</text>
         </texte>
         <bilder>
              <bild>1176</bild>
              <bild>154</bild>
         </bilder>
         </inhalt>
         <inhalt name="Abnahme von Bauleistungen / Abnahmebegleitung">
         <texte>
              <text>Einfamilienhäuser</text>
              <text>Mehrfamilienhäuser</text>
              <text>Wohnanlagen</text>
              <text>Bürogebäude</text>
         </texte>
         <bilder>
              <bild>2485</bild>
              <bild>3485</bild>
              <bild>3481</bild>
              <bild>3460</bild>
         </bilder>
         </inhalt>
         <inhalt name="Schiedsgutachten">
         <texte>
              <text>Rechtsverbindliche Beurteilung von Bauprozessen und Gewerken zur Konfliktvermeidung und -lösung</text>
         </texte>
         <bilder>
              <bild>7080</bild>
         </bilder>
         </inhalt>
    </inhalte>
    <inhalte name="Bestandsgebäude">
         <inhalt name="Beweissicherung">
         <texte>
              <text>Dokumentation von  Schäden an  Bestandsgebäuden im Einflußbereich von Neubauten, Beurteilung von Schadensansprüchen</text>          
         </texte>
         <bilder>
              <bild>1176</bild>          
         </bilder>
         </inhalt>
         <inhalt name="Gebäudeschäden">
         <texte>
              <text>Feststellung und Beurteilung von Gebäudeschäden, Ursachenermittlung, Sanierungsempfehlung, Kostenschätzung</text>
              <text>Bautechnische Beratung beim Kauf einer Bestandsimmobilie</text>
         </texte>
         <bilder>
              <bild>2108</bild>
              <bild>4004</bild>
              <bild>1387</bild>
              <bild>3488</bild>
         </bilder>
         </inhalt>
    </inhalte>
    </leistungen>
    First I create an new object
    var ds1 = new Spry.Data.XMLDataSet("xml/leistungen.xml", "leistungen/inhalte/inhalt/texte");
    So the  dsR =  ds1.getData() gives me a dsR.length = 8 - correct - because this XML has got 8 <texte> nodes. But some of these <texte> nodes have more than one <text> node. If I asked for the contet of the fifth node dsR[4]["text"] it gives me back "Bürogebäude" = the last sub node content. I wished I could catch the first, second, third as well. Just like a spry:repeat - do you understand?
    I figured out that it doesn't help to extend the string like
    dsR[4][0]["text"] or dsR[4][0][0].
    As far as I understood the Spry framework flattens the XML like a table. So I thought that there might be just in this raw, in the actual column just another object (not a string)  to be found.This object  I could touch or open with square brackets. Like
    dsR[0]["texte"][0]
    - but: I can't!
    But this would mean, that straight in js I could always only catch the first node value??? I must be wrong!!!  But I don't know were!
    Dear Ben, Dear Guys out there - is this to difficult what I am looking for or am I blind?
    thank you so much for helping me out here - again!

  • Error while passing date parameter to the XML data definition

    Hi All,
    I have developed a BI publisher report using XML data definition & RTF template.
    This data definition contains a SQL query in it's CDATA section and runs as a concurrent program(without RDF) . We are looking to pass a date parameter to the SQL query and its not accepting the date parameter. However, when we hardcode SYSDATE in the SQL query in place of the parameter, the report runs fine. In the log file it shows that the parameter is being treated in American date style and we are using DD-MON-RRRR format. I have tried to convert the date format however still the error exists.
    What we did ?
    Created a XML data definition which contains the SQL query in its CDATA section & p_rundate (DATE) parameter.
    Registerd the XML data definition as concurrent program with EXECUTABLE= XDODTEXE and Output format as XML with p_date as a date parameter.
    Looking for any available solution for the same.
    Thanks.

    Hi All,
    I have developed a BI publisher report using XML data definition & RTF template.
    This data definition contains a SQL query in it's CDATA section and runs as a concurrent program(without RDF) . We are looking to pass a date parameter to the SQL query and its not accepting the date parameter. However, when we hardcode SYSDATE in the SQL query in place of the parameter, the report runs fine. In the log file it shows that the parameter is being treated in American date style and we are using DD-MON-RRRR format. I have tried to convert the date format however still the error exists.
    What we did ?
    Created a XML data definition which contains the SQL query in its CDATA section & p_rundate (DATE) parameter.
    Registerd the XML data definition as concurrent program with EXECUTABLE= XDODTEXE and Output format as XML with p_date as a date parameter.
    Looking for any available solution for the same.
    Thanks.

  • Unable to Load the XML data file in to RTF template

    Hi Team,
    We are working on the XML publisher reports,where the xml data is containing the Japanese Characters.
    I am facing an error while loading my xml data which has the japanese characters values in between the XML tags into the RTF Template.Though i have installed Japan fonts in my system,still unable to load the data.
    Could any one please help me out in this regard.
    Thanks in Advance.

    Hi;
    Hi please clearfy below question for can make you fast help
    1. What is your OS?
    2. What is your EBS verison?
    3. What is your DB version and Db character set?
    Also check:
    About Oracle XML Publisher Release 5.6.3 [ID 422508.1]
    Regard
    Helios

  • What is the best way to get rid of duplicates in the XML data?

    Hi all,
    Please help me with the best way to get rid of the duplicates in the XML data. Will a transform with some stylesheet do the trick? I need to read on the stylesheet first, but please tell me if that is possible. I have to deal with XML data that has tons of duplicate data. Please see one section of an XML file. You can see that for each charge, the same defendant information (address, ID numbers, etc) is included. Having 10 charges is not uncommon, so I would have the same data repeated 10 times. I first thought that I would use some temp tables to do that, but I wonder if there were a better way. Thanks a lot. Please see the data below.
    Ben
    <ChargeDispositionNotification>
         <TriggeredDateTime>2006-06-20T08:21:31-05:00</TriggeredDateTime>
              <NotificationEvent>DispositionAdded</NotificationEvent>
                   <ChargeDisposition chargeKey="622212">
                        <Charge chargeKey="622212" chargeVersionKey="2320743">
                             <ChargeSequenceID>1</ChargeSequenceID>
                             <ChargeFiledDate>2006-06-20</ChargeFiledDate>
                             <ChargeStatuteOrdinanceRule statuteKey="719">
                                  <StatuteOrdinanceRuleCite>609.222.1</StatuteOrdinanceRuleCite>
                                  <SeverityLevel>Felony</SeverityLevel>
                                  <ChargeLegalDescriptionText>Assault-2nd Degree-Dangerous Weapon</ChargeLegalDescriptionText>
                                  <MinnesotaOffenseCode>M1000</MinnesotaOffenseCode>
                                  <ChargeDescriptionText>Assault-2nd Degree-Dangerous Weapon</ChargeDescriptionText>
                             </ChargeStatuteOrdinanceRule>
                             <ChargeSubjectReference partyKey="558357"/>
                             <ChargePlea>
                                  <PleaDate>2006-06-20</PleaDate>
                                  <PleaJudge judgeKey="00553C">
                                       <JudgeName>
                                            <PersonGivenName>Thomas</PersonGivenName>
                                            <PersonMiddleName>William</PersonMiddleName>
                                            <PersonSurName>Bibus</PersonSurName>
                                            <PersonFullName>Bibus, Thomas William</PersonFullName>
                                       </JudgeName>
                                       <JudicialAgencyIdentifier>MN025015J</JudicialAgencyIdentifier>
                                  </PleaJudge>
                                  <PleaDescriptionText>Not guilty</PleaDescriptionText>
                             </ChargePlea>
                        </Charge>
                   <DispositionEvent>
                        <ChargeDispositionDate>2006-06-20</ChargeDispositionDate>
                        <ChargeDispositionJudge judgeKey="00553C">
                             <JudgeName>
                                  <PersonGivenName>Thomas</PersonGivenName>
                                  <PersonMiddleName>William</PersonMiddleName>
                                  <PersonSurName>Bibus</PersonSurName>
                                  <PersonFullName>Bibus, Thomas William</PersonFullName>
                             </JudgeName>
                             <JudicialAgencyIdentifier>MN025015J</JudicialAgencyIdentifier>
                        </ChargeDispositionJudge>
                        <ChargeDispositionText>Convicted</ChargeDispositionText>
                        <ChargeDispositionSeverityLevel>Felony</ChargeDispositionSeverityLevel>
                        <ChargeDispositionComment>This is the disposition comment</ChargeDispositionComment>
                   </DispositionEvent>
                        <CourtCaseNumber>
                             <MNCISCaseNumber>
                                  <CountyNumber>10</CountyNumber>
                                  <CaseType>CR</CaseType>
                                  <YearFiled>06</YearFiled>
                                  <SequenceNumber>367</SequenceNumber>
                             </MNCISCaseNumber>
                             <CaseNumberIdentifier caseNumberKey="10CR06367">10-CR-06-367</CaseNumberIdentifier>
                        </CourtCaseNumber>
                        <CaseDefendant partyKey="558357">
                             <PersonID>325193</PersonID>
                             <PartyName partyKey="558357" currentNameIndicator="true">
                                  <StandardName>
                                       <PersonGivenName>James</PersonGivenName>
                                       <PersonMiddleName>John</PersonMiddleName>
                                       <PersonSurName>Jetson</PersonSurName>
                                       <PersonFullName>Jetson, James John</PersonFullName>
                                  </StandardName>
                             </PartyName>
                             <PartyAddress partyCorrespondenceIndicator="true" partyKey="558357" currentKnownAddress="true" undeliverableIndicator="false">
                                  <AddressUSStandard>
                                       <AddressStreetNumber>abc</AddressStreetNumber>
                                       <AddressPreDirectional>Northeast</AddressPreDirectional>
                                       <AddressStreet>1st</AddressStreet>
                                       <AddressStreetType>Boulevard</AddressStreetType>
                                       <AddressPostDirectional>Southeast</AddressPostDirectional>
                                       <AddressUnit>
                                            <AddressUnitType>Building</AddressUnitType>
                                            <AddressUnitNumber>3333333333</AddressUnitNumber>
                                       </AddressUnit>
                                       <AddressCity>St. Paul</AddressCity>
                                       <AddressState>MN</AddressState>
                                       <AddressZipCode>555551234</AddressZipCode>
                                  </AddressUSStandard>
                             </PartyAddress>
                             <PartyBirthData currentBirthdate="true">
                                  <PersonBirthDate>1991-12-11</PersonBirthDate>
                             </PartyBirthData>
                             <InterpreterNeededIndicator>false</InterpreterNeededIndicator>
                             <PersonAssignedIDDetails>
                                  <PersonSSNID>
                                       <ID>111-00-1101</ID>
                                  </PersonSSNID>
                                  <PersonDriverLicenseID currentDriverLicenseIndicator="true">
                                       <ID>J-111-000-111-001</ID>
                                       <IDJurisdictionText>Minnesota</IDJurisdictionText>
                                  </PersonDriverLicenseID>
                                  <PersonFBIID>
                                       <ID>FBIMNJ001</ID>
                                  </PersonFBIID>
                                  <PersonStateID>
                                       <ID>MNJ0001</ID>
                                  </PersonStateID>
                             </PersonAssignedIDDetails>
                             <PersonPhysicalDetails>
                                  <PersonSexText>Male</PersonSexText>
                             </PersonPhysicalDetails>
                             <RepresentedBy>
                                  <ProSeIndicator>true</ProSeIndicator>
                             </RepresentedBy>
                        </CaseDefendant>
                   </ChargeDisposition>
    </ChargeDispositionNotification>
    <ChargeDispositionNotification>
         <TriggeredDateTime>2006-06-20T08:21:31-05:00</TriggeredDateTime>
              <NotificationEvent>DispositionAdded</NotificationEvent>
                   <ChargeDisposition chargeKey="622213">
                        <Charge chargeKey="622213" chargeVersionKey="2320744">
                             <ChargeSequenceID>2</ChargeSequenceID>
                             <ChargeFiledDate>2006-06-20</ChargeFiledDate>
                             <ChargeStatuteOrdinanceRule statuteKey="717">
                                  <StatuteOrdinanceRuleCite>609.221.1</StatuteOrdinanceRuleCite>
                                  <SeverityLevel>Felony</SeverityLevel>
                                  <ChargeLegalDescriptionText>Assault-1st Degree-Great Bodily Harm</ChargeLegalDescriptionText>
                                  <MinnesotaOffenseCode>B1000</MinnesotaOffenseCode>
                                  <ChargeDescriptionText>Assault-1st Degree-Great Bodily Harm</ChargeDescriptionText>
                             </ChargeStatuteOrdinanceRule>
                             <ChargeSubjectReference partyKey="558357"/>
                             <ChargePlea>
                                  <PleaDate>2006-06-20</PleaDate>
                                  <PleaJudge judgeKey="00553C">
                                       <JudgeName>
                                            <PersonGivenName>Thomas</PersonGivenName>
                                            <PersonMiddleName>William</PersonMiddleName>
                                            <PersonSurName>Bibus</PersonSurName>
                                            <PersonFullName>Bibus, Thomas William</PersonFullName>
                                       </JudgeName>
                                       <JudicialAgencyIdentifier>MN025015J</JudicialAgencyIdentifier>
                                  </PleaJudge>
                                  <PleaDescriptionText>Not guilty</PleaDescriptionText>
                             </ChargePlea>
                        </Charge>
                        <DispositionEvent>
                             <ChargeDispositionDate>2006-06-20</ChargeDispositionDate>
                             <ChargeDispositionJudge judgeKey="00553C">
                                  <JudgeName>
                                       <PersonGivenName>Thomas</PersonGivenName>
                                       <PersonMiddleName>William</PersonMiddleName>
                                       <PersonSurName>Bibus</PersonSurName>
                                       <PersonFullName>Bibus, Thomas William</PersonFullName>
                                  </JudgeName>
                                  <JudicialAgencyIdentifier>MN025015J</JudicialAgencyIdentifier>
                             </ChargeDispositionJudge>
                             <ChargeDispositionText>Convicted</ChargeDispositionText>
                             <ChargeDispositionSeverityLevel>Felony</ChargeDispositionSeverityLevel>
                             <ChargeDispositionComment>This is the disposition comment</ChargeDispositionComment>
                        </DispositionEvent>
                        <CourtCaseNumber>
                             <MNCISCaseNumber>
                                  <CountyNumber>10</CountyNumber>
                                  <CaseType>CR</CaseType>
                                  <YearFiled>06</YearFiled>
                                  <SequenceNumber>367</SequenceNumber>
                             </MNCISCaseNumber>
                             <CaseNumberIdentifier caseNumberKey="10CR06367">10-CR-06-367</CaseNumberIdentifier>
                        </CourtCaseNumber>
                        <CaseDefendant partyKey="558357">
                             <PersonID>325193</PersonID>
                             <PartyName partyKey="558357" currentNameIndicator="true">
                                  <StandardName>
                                       <PersonGivenName>James</PersonGivenName>
                                       <PersonMiddleName>John</PersonMiddleName>
                                       <PersonSurName>Jetson</PersonSurName>
                                       <PersonFullName>Jetson, James John</PersonFullName>
                                  </StandardName>
                             </PartyName>
                             <PartyAddress partyCorrespondenceIndicator="true" partyKey="558357" currentKnownAddress="true" undeliverableIndicator="false">
                                  <AddressUSStandard>
                                       <AddressStreetNumber>abc</AddressStreetNumber>
                                       <AddressPreDirectional>Northeast</AddressPreDirectional>
                                       <AddressStreet>1st</AddressStreet>
                                       <AddressStreetType>Boulevard</AddressStreetType>
                                       <AddressPostDirectional>Southeast</AddressPostDirectional>
                                       <AddressUnit>
                                            <AddressUnitType>Building</AddressUnitType>
                                            <AddressUnitNumber>3333333333</AddressUnitNumber>
                                       </AddressUnit>
                                       <AddressCity>St. Paul</AddressCity>
                                       <AddressState>MN</AddressState>
                                       <AddressZipCode>555551234</AddressZipCode>
                                  </AddressUSStandard>
                             </PartyAddress>
                             <PartyBirthData currentBirthdate="true">
                                  <PersonBirthDate>1991-12-11</PersonBirthDate>
                             </PartyBirthData>
                             <InterpreterNeededIndicator>false</InterpreterNeededIndicator>
                             <PersonAssignedIDDetails>
                                  <PersonSSNID>
                                       <ID>111-00-1101</ID>
                                  </PersonSSNID>
                                  <PersonDriverLicenseID currentDriverLicenseIndicator="true">
                                       <ID>J-111-000-111-001</ID>
                                       <IDJurisdictionText>Minnesota</IDJurisdictionText>
                                  </PersonDriverLicenseID>
                                  <PersonFBIID>
                                       <ID>FBIMNJ001</ID>
                                  </PersonFBIID>
                                  <PersonStateID>
                                       <ID>MNJ0001</ID>
                                  </PersonStateID>
                             </PersonAssignedIDDetails>
                             <PersonPhysicalDetails>
                                  <PersonSexText>Male</PersonSexText>
                             </PersonPhysicalDetails>
                             <RepresentedBy>
                                  <ProSeIndicator>true</ProSeIndicator>
                             </RepresentedBy>
                        </CaseDefendant>
                   </ChargeDisposition>
    </ChargeDispositionNotification>

    ds store wrote:
    ClamXav is only a scanner, it can't remove the MacDefender malware.
    Yes, it can. ClamXav scans and quarantines it. It was updated.
    http://www.reedcorner.net/news.php/?p=98
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G HD + OCZ Vertex 3 SSD Boot HD 

  • How to use XmlModify to sort the XML Data?

    Hello,
    I saw some examples explain how to use XmlModify in BDB XML package. I want to sort the XML data by several elements but my Java program could not work correctly.
    <CustomerData>
    <Transaction>
    <DLSFIELDS>
    <ADR_PST_CD>12345</ADR_PST_CD>
    <CLT_IRD_NBR>002</CLT_IRD_NBR>
    </DLSFIELDS>
    </Transaction>
    <Transaction>
    <DLSFIELDS>
    <ADR_PST_CD>12345</ADR_PST_CD>
    <CLT_IRD_NBR>102</CLT_IRD_NBR>
    </DLSFIELDS>
    </Transaction>
    // many nodes like transaction ...
    </CustomerData>
    My XQuery script was executed successfully in the shell. The script looks as follows:
    "for $i in collection('sample.dbxml')/CustomerData/Transaction order by xs:decimal($i//ADR_PST_CD), xs:decimal($i//CLT_IRD_NBR) return $i".
    The Java code :
    // create XmlManager
    XmlManager manager = // ...;
    // open XmlContainer
    XmlContainer container = // ...;
    XmlQueryContext context = manager.createQueryContext(XmlQueryContext.LiveValues, XmlQueryContext.Eager);
    XmlQueryExpression expression = manager.prepare("for $i in collection('sample.dbxml')/CustomerData/Transaction order by xs:decimal($i//ADR_PST_CD),xs:decimal($i//CLT_IRD_NBR) return $i", context);
    XmlModify modify = manager.createModify();
    XmlUpdateContext uc = manager.createUpdateContext();
    XmlDocument xmldoc = container.getDocument("sample.xml");
    XmlValue value = new XmlValue(xmldoc);
    long numMod = modify.execute(value, context, uc);
    System.out.println("Peformed " + numMod     + " modification operations");
    Could you point out the errors above or offer some suggestion?
    Thanks.

    I have other question of the sorting issue. Here are a large XML need to sort so I have to split it to multiple small XML files. After importing these files, I will use the XmlModify and XQuery to sort them. I'm not clear on the multiple XML files processing.
    1. Can the BDB XML ensure that all these XML files were sorted or how to update all documents with same logic.
    2. If I want export all these sorted documents, how can I ensure these files processed in sequence? Which document needs process first?
    The export method:
    public void export(String outputfile)throws Exception{
    final int BLOCK_SIZE = 5 * 1024 * 1024; // 5Mb
    try{
    File theFile = new File(outputfile);
    FileOutputStream fos = new FileOutputStream(theFile);
    byte[] buff= new byte[BLOCK_SIZE];                         
    XmlResults rs = container.getAllDocuments(new XmlDocumentConfig());               
    while(rs.hasNext()){
         XmlDocument xmlDoc = rs.next().asDocument();
         XmlInputStream inputStream = xmlDoc.getContentAsXmlInputStream();                    
         long read=0;
         while(true){
         read = inputStream.readBytes(buff, BLOCK_SIZE);
    fos.write(buff,0,(int)read);                    
         if(read < BLOCK_SIZE) break;
    inputStream.delete();
    xmlDoc.delete();
    rs.delete();
    //MUST CLOSE!
    fos.close();               
    catch(Exception e){
    System.err.println("Error exporting file from container " + container);
    System.err.println(" Message: " + e.getMessage());
    Thanks.

  • Want attach the XML data file with layout template in Oracle 10g

    Hi All,
    I need a help from you genius guys.
    I am genrating reports in BI with xml the procedure which I am following is as below.
    1. generating XML from the RDF
    2. creating a template in .rtf format
    3.after that loading the xml to the template then getting the required report.
    This all is doing through the given buttons
    But now my requirement is to create the gui from user can select the report and get the desire output file so how we would be able to attach the XML data file with layout template in Oracle 10g.
    If you require more detail please let me knnow.
    Thanks,
    Harry

    I am not using Oracle apps.
    I am using oracle 10g reports and I get something in it like one patch I downloded and one java code is having which creates the batch file ...still I am working on it ..
    If you will get some please share so that it will be helpful.
    Thanks,
    Harry

  • How to store the XML data? file or database?

    i'm frustrate at it.
    If store XML data into files, then when i query any data,how can i search data using relationship as SQL?
    But if store XML data into database.How can i transform the xml data to the data table?
    Can any one give me an clear example.

    XML is perfect for data interchange and readability. However, to make it searchable you should resolve it properly into tables, in accordance of your own choice of model.
    1. Investigate the XML files and resolve the model
    <Person sex="male">John
    <Pet animal="dog">Doggy</Pet>
    <Pet animal="cat">Catty</Pet>
    </Person>
    2. Create the tables in your database, let one or several tables keep the raw xml for retrieval of original xml data.
    --- XMLDocument ---
    id XML_data
    --- Person ---
    id XML_Document_id sex name
    (foreign key)
    --- Pet ---
    id Person_id animal name
    (foreign key)
    3. Resolve data from the xml files and insert it into the database. Do this through your ContentHandler, or from your DOM model.
    --- XMLDocument ---
    id XML_data
    0 <Person>...</Person>
    --- Person ---
    id XML_Document_id sex name
    0 0 male John
    --- Pet ---
    id Person_id animal name
    0 0 dog Doggy
    1 0 cat Catty
    Gil

  • How to fetch the xml data in webdynpro java

    Hi all,
    i have an xml data which contains the fields as 1.user type, 2. client, 3.vendor number
    in webdynpro java how i validate or fetch the details of  the user type, when ever user login's in portal i can show some data to user 'A' and invisible to user 'B', based on the xml data.
    help me in doing step by step'
    Thanks&Regards
    charan

    Hi
    Follow the steps .
    This is the XML file .
    <?xml version="1.0"?>
    <company>
         <employee>
              <firstname>Tom</firstname>
              <lastname>Cruise</lastname>
         </employee>
         <employee>
              <firstname>Paul</firstname>
              <lastname>Enderson</lastname>
         </employee>
         <employee>
              <firstname>George</firstname>
              <lastname>Bush</lastname>
         </employee>
    </company>
    Java Code of this to fetch the details.
    public class XMLReader {
    public static void main(String argv[]) {
      try {
      File file = new File("c:\\MyXMLFile.xml");
      DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
      DocumentBuilder db = dbf.newDocumentBuilder();
      Document doc = db.parse(file);
      doc.getDocumentElement().normalize();
      System.out.println("Root element " + doc.getDocumentElement().getNodeName());
      NodeList nodeLst = doc.getElementsByTagName("employee");
      System.out.println("Information of all employees");
      for (int s = 0; s < nodeLst.getLength(); s++) {
        Node fstNode = nodeLst.item(s);
        if (fstNode.getNodeType() == Node.ELEMENT_NODE) {
               Element fstElmnt = (Element) fstNode;
          NodeList fstNmElmntLst = fstElmnt.getElementsByTagName("firstname");
          Element fstNmElmnt = (Element) fstNmElmntLst.item(0);
          NodeList fstNm = fstNmElmnt.getChildNodes();
          System.out.println("First Name : "  + ((Node) fstNm.item(0)).getNodeValue());
          NodeList lstNmElmntLst = fstElmnt.getElementsByTagName("lastname");
          Element lstNmElmnt = (Element) lstNmElmntLst.item(0);
          NodeList lstNm = lstNmElmnt.getChildNodes();
          System.out.println("Last Name : " + ((Node) lstNm.item(0)).getNodeValue());
      } catch (Exception e) {
        e.printStackTrace();
    BR
    Satish Kumar

  • Oracle BI Administration Tool 11g - Fields have the XML data type

    I'm using Oracle BI Administration Tool 11.1.1.3.0 and I need to import Metadata an Oracle table where same fields have the XML data type.
    Please, there is someone can tell me what I must do to define these fields in Administration Tool?
    Regards.

    Hi,
    in u r RPD -->Try to select import Connection Type as : XMLA then give it the URL of u r analysis services 2000 then u can able to import it.
    refer:
    http://www.biblogs.com/2008/02/01/obiee-hybrid-olap-reporting-using-ms-analysis-services-oracle/
    http://www.rittmanmead.com/2007/11/essbase-integration-with-obiee-101331/
    Thanks
    Deva

  • Reg :  vo.writeXML() how to filter the data before generating the xml data

    Hi team,
    I have table region with multi selection option.
    My requirement is to fetch the data and generate the xml data for the selected rows.
    By using : writeXML() --> it is fetching all the data.
    What are the methods i need to use,so i can fetch only the selected data ?
    Any pointers ?
    -Sridhar

    Hi Peddi,
    i tried the way u mentioned :
    But the new VO2 (Target) VO is having an extra row, iam not understanding how that is getting stored in VO2.
    Can you please review the below query and let me know if any issue.
    public void copyVO()
    int rowCount=0 ;
    OAFXMLVOImpl vo1 = getOAFXMLVO1(); //source
    OAFXMLVOImpl vo2 = getOAFXMLVO2(); //destination
    OAFXMLVORowImpl row2= null ;
    OAFXMLVORowImpl row1 =null;
    if(vo2!=null && vo2.hasNext())
    { vo2.first();
    do
    vo2.getCurrentRow().remove();
    vo2.next();
    while (vo2.hasNext());
    oracle.jbo.Row[] rows = (oracle.jbo.Row[]) vo1.getFilteredRows("check", "Y");
    rowCount = rows.length;
    if(rowCount>0)
    vo2.setMaxFetchSize(0);
    for(int i=0;i<rowCount;i++)
    row1 = (OAFXMLVORowImpl)rows;
    System.out.println("User ID-->"+ row1.getUserId());
    System.out.println("Checked -->"+ row1.getcheck() );
    row2 = (OAFXMLVORowImpl) vo2.createRow();
    row2.setUserId(row1.getUserId());
    row2.setcheck(row1.getcheck());
    vo2.insertRow(row2);
    row2.setNewRowState(row2.STATUS_INITIALIZED);
    } //end of if
    -Sridhar

  • Reflecting the XML Data Changes in the online swf

    Hi pals,
    I am accessing an xml file which is in the server
    continuously with in the distinct time intervals from my swf in an
    online page.
    If I make any change in the xml data it’s not
    reflecting my online page because it’s accessing the xml file
    from offline content.
    How to avoid this? I want my page to be reflected immediately
    when I make any change in my xml file.
    Is there any wawy to clear the offline contents in
    ActionScript or ASP?
    *I had given the full server path to load the xml file in my
    ActionScript.
    Thx in advance... - ****

    Hi,
    just add a changing variable to the URL of the xml file:
    xml.load("data.xml?foo="+getTimer());
    That way, the URL is never the same, so the xml gets loaded
    again every time. You can't test this movie locally anymore, as it
    throws file not found errors, but with a server it's working fine.
    cheers,
    blemmo

  • Regrouping the XML data source in BI Publisher

    Hello,
    We have a requirement in BI Publisher to develop a template accessing the data from different sources (data sets) and need to regroup the whole data by a field which exists in all the data sets.
    Below is the sample example of the source file
    <DATA><Total_Depletion>
    <TOTAL_DEPLETION_ROW>
    <BRAND_GROUP>BEEFEATER</BRAND_GROUP>
    <BRAND>BEEFEATER</BRAND>
    <OPP_RISK>-50.000001</OPP_RISK>
    <STATE>AL</STATE>
    </TOTAL_DEPLETION_ROW>
    <TOTAL_DEPLETION_ROW>
    <BRAND_GROUP>BEEFEATER</BRAND_GROUP>
    <BRAND>BEEFEATER</BRAND>
    <OPP_RISK>53.1</OPP_RISK>
    <STATE>AR</STATE>
    </TOTAL_DEPLETION_ROW>
    </Total_Depletion>
    <Accounts_sold><ACCOUNTS_SOLD_ROW>
    <BRAND_GROUP>BEEFEATER</BRAND_GROUP>
    <BRAND>BEEFEATER REGULAR</BRAND>
    <STATE>MC</STATE>
    <ACTUAL_ONPREMISE>2</ACTUAL_ONPREMISE>
    </ACCOUNTS_SOLD_ROW>
    <ACCOUNTS_SOLD_ROW>
    <BRAND_GROUP>BEEFEATER</BRAND_GROUP>
    <BRAND>BEEFEATER WET</BRAND>
    <STATE>CA</STATE>
    <ACTUAL_ONPREMISE>916</ACTUAL_ONPREMISE>
    </ACCOUNTS_SOLD_ROW>
    </Accounts_sold></DATA>
    Now our requirement is to regroup the whole data by Brand and then state, and need to display in two different tables.
    Can any one help us in fixing this issue out.
    Thanks a lot,

    Hi Stefanos,
    Check beow blog for reference...
    /people/community.user/blog/2007/08/13/sap-netweaver-70-bi-how-to-send-xml-data-to-bi--enhancement
    Regards,
    KK.

  • How to integrate the XML data received via email in to MySQL

    Hi,
    This is JK, my compnay is planning to adopt Adobe Livecycle Barcoded forms technology, We are planning to automate the Weekly report submission of the HR dept of my company, where the various employees from various branches will be submiting their weekly reports thru Barcoded forms via email and the data has to be fed in to a MySQL database for Analysis purpose.
    The problem is, i have designed the form and tested it, when i fill out the form and submit it via email, i get a XML to the mentioneid email id, but is it possible to import the bulk amount of XML data received thru email to the MySQL database without using 3rd party XML Parser.
    Does Adobe Livecycle supports any functionality where these data's after decoding or received thru email can directly be integrated in to MySQL.
    Any Suggestions?
    Regards,
    JK

    One thing that should be clear is that you do not need to purchase Reader Extensions to use Barcode Forms technology. Take a look at the 2 articles at the bottom of http://www.adobe.com/products/server/barcodedpaperforms/ they talk specifically about this issue.
    However, if you do not get RE with your Barcoded Forms license your end users will not be able to save the form off-line or submit electronically (other than data-only by email). They will be able to fill-in and print the forms only.
    By your post it sounds like you are getting Adobe LiveCycle Barcoded Forms and you have also licensed the decoder.
    The decoder itself works with a watched folder mechanism. So what you can do is create a small Java program that simply waits for decoded output from the output directory of the decoder and then populates your MySQL database. The code should be around a day to implement.
    Here is the link to the deployment article that talks about the RE requirement: http://www.adobe.com/products/server/barcodedpaperforms/pdfs/deploying_2d_barcodedpdfform s.pdf
    Your Java will basically do something like this (very incomplete sample)
    public class theThred extends Thread {
    public void start() {
    public void run() {
    while (true) {
    checkTheDirectoryCodeHere();
    gotSomethingWriteItHere();
    sleep(foreSomeNumberOfMilliseconds);
    public void checkTheDirectoryCodeHere() {
    Directory dir = new Directory("thePath");

  • BI Publisher: not able to see the xml data after creating a data model

    I am learning BI publisher and trying to create a report data model
    I created a new data model from the report tab, use query builder, able to see the results. Then i save it and try to launch XML view from clicking View .
    I am getting unexpected exception, not able to see the XML view .
    in the server console i got servlet exception, here is one of the line
    com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303
    Edited by: joysaha123 on Mar 17, 2010 6:07 PM

    Hi karthik
    Thanks for your response
    Actually iam a beginner in java coding hence struggling to come up with the things
    I tried putting your code and onserver side i see it is returning 09:12:17,234 INFO [STDOUT] [root: null]
    actually the same program i wrote in java
    and the same method i was calling from the main
    and it is working fine and the xml document is getting displayed one important thing to be noted here is that the factory.newDocumentBuilder().parse(new File(filename));is returing XmlDocument
    and the printing takes place
    but the in same method public static Document parseXMLFile(String filename, boolean b) in servlet
    the line factory.newDocumentBuilder().parse(new File(filename)); is returning DeferredDocumentImpl
    and this creating problem , had it returned XmlDocument
    i would have printed the elements one one
    but as it is returning deferredimpl
    iam unable to print the elements
    could you please tell me why factory.newDocumentBuilder().parse(new File(filename)); is returning DeferredDocumentImpl
    in servlets but in plain java pogram it is returing XmlDocument
    Thanks
    Bhanu

Maybe you are looking for

  • ADF convertColor problem

    Hi, I am trying to use adf color and I am facing some problem. Basically, I am just trying to display color code string as color and below is my code. <af:inputColor label="#color" id="ic2" compact="true" simple="true" readOnly="true"  value="#{row.D

  • Data tranfer using bapi(lsmw)

    please explain the steps that are used to upload legacy data into sap using lsmw (bapi method) Message was edited by:         neela renganathan

  • Restarted and nearly everything is gone

    After force closing a non-responsive program, I restarted my macbook pro and it prompted a user login, then opened as though this was the first time I had booted up this machine. It started the setup video and then asked to register it. At this time,

  • Error creating servlet context

    Hello, there!           I am trying to run a web app on WebLogic. The application contains some           EJBs, several JSP's and a controller servlet. I have the EJB's           deployed, and both webApp and servlet (and its initArgs) registered in

  • Why apple do not sell replacement battery for iphone? Not original battery is dangerous

    Recently many problem about iphone specially about battery problem or charger. I can not buy original battery but i only can buy from another seller not authorized seller from apple and it could be dangerous for me Because i'm not sure  the battery i