Duplicate content XML child nodes
Hi all
I received below XML Developer example data and they need to load the data in table in the Oracle (10g) database.
< table >
< lines >
< row >
< CellCount > 3 < / CellCount >
cells <>
Tom John < cell > < / cell >
< cell > [email protected] < / cell >
< cell > 2013 - 08 - 30 12:20:37.0 < / cell >
< / cells >
< / row >
< row >
< CellCount > 3 < / CellCount >
cells <>
< cell > Micky Mouse < / cell >
< cell > [email protected] < / cell >
< cell > 2013 - 08 - 30 12:20:37.0 < / cell >
< / cells >
< / row >
< / rows >
< /table >
But I had the problem because child node which is duplicated name and developer use a tool to generate only and cannot change the tag before sending to me.
How can I do for this case?
Thanks in advance.
Hiko
SELECT name, email, sign_date FROM XMLTable('/Table/Rows/Row/Cells' -- hard-coded XML as unsure where your data comes from PASSING XMLTYPE('
That should help you get started. XMLTable was part of 10.2.0.1. Are there opportunities to spend at least 10.2.0.5 just to pick up corrections of bugs/new features?
Tags: Oracle Development
Similar Questions
-
the analysis for the XML child nodes
Hello
I have the following XML
' < AllocSimulation >
elements <>
< > 76 ItemNo < / ItemNo >
< DisplayCodes >
< DisplayCode > 1 < / DisplayCode >
< DisplayCode > 2 < / DisplayCode >
< / DisplayCodes >
< / object >
elements <>
< > 767 ItemNo < / ItemNo >
< DisplayCodes >
< DisplayCode > 3 < / DisplayCode >
< DisplayCode > 5 < / DisplayCode >
< / DisplayCodes >
< / object >
< / AllocSimulation > '
How can I extract elements such as
No display item code
76 1.2
767 3.5
I ran the following query
resultSelect * From xmltable('AllocSimulation/items' passing xmltype('<AllocSimulation> <items> <ItemNo>76</ItemNo> <DisplayCodes> <DisplayCode> 1 </DisplayCode> <DisplayCode>2 </DisplayCode> </DisplayCodes> </items> <items> <ItemNo>767</ItemNo> <DisplayCodes> <DisplayCode> 3 </DisplayCode> <DisplayCode>5 </DisplayCode> </DisplayCodes> </items> </AllocSimulation>') columns Item Varchar2(10) Path 'ItemNo', display xmltype path '//DisplayCode');
76 < DisplayCode > 1 < / DisplayCode > < DisplayCode > 2 < / DisplayCode >
767 < DisplayCode > 3 < / DisplayCode > < DisplayCode > 5 < / DisplayCode >Manjusha Muraleedas wrote:
It is one of the solutions... any solution straight forwatd for this?That's the one that I would have suggested too.
Another possibility would be to expand the collection in a subquery using the MULTISET operator, but I prefer the first approach.
To summarize (assuming that the document is stored in the TMP_XML table):
SELECT x.itemno , cast( multiset( select code, min, max from XMLTable('DisplayCodes/DisplayCode' passing x.display columns code varchar2(100) path 'code' , Min number(10) path 'Min' , Max number(10) path 'Max' ) ) as displaycodes_vtt ) as display_collection FROM tmp_xml t , XMLTable('/purchase/items' passing t.object_value columns ItemNo varchar2(30) path 'ItemNo' , display xmltype path 'DisplayCodes' ) x ;
or,
SELECT d.itemno , cast(collect(displaycode(p.code, p.Min, p.Max)) as displaycodes_vtt) as display_collection FROM tmp_xml t , XMLTable('/purchase/items' passing t.object_value columns ItemNo varchar2(30) path 'ItemNo' , display xmltype path 'DisplayCodes' ) d , XMLTable('DisplayCodes/DisplayCode' passing d.display columns code varchar2(100) path 'code' , Min number(10) path 'Min' , Max number(10) path 'Max' ) p GROUP BY d.itemno ;
-
Just starting to learn more about XML.
I have a simple XML I created which is
Ambient panel1 panel2 panel3 Using the XML property - child results node table of nodes in a table of 9 elements:
#text Probe #text Probe #text Probe #text Probe #text
My question is what are all the #text that are there? Should the child nodes be not just the probes?
It seems to me you may be heading down a dark path. Instead of using the "table of nodes child" and fighting through the unnecessary complications and text nodes, let me suggest you look at XPath and using "get all matched Nodes.vi ' or 'Get first match Node.vi' to get the items. XPath allows parsing XML child's play.
For example:
Of course, I hope that you use XP does not mean you use LV8.6 or earlier since the XPath screws are new to LV9.
If you use LV8.6 or earlier, I suggest looking in the .NET functions to implement XPath. Once you get the hang of it, it still beats the attempt to parse XML the old-fashioned way.
As for the editor, I generate very few XML files by hand, for the most part I bring other programs and analyse them in LV again, XPath adjusts the rough edges.
-
How to select only the last child nodes in a piece of XML via XMLTABLE?
Hello
I use Oracle 10.2.0.4.
I have the following XML:
and I want to choose the last child nodes where the FruitType is Apple or pear.with sd as (select xmltype('<Fruits> <Fruit> <FruitType>Apple</FruitType> <FruitSubtype>Granny Smith</FruitSubtype> </Fruit> <Fruit> <FruitType>Pear</FruitType> <FruitSubtype>Anjou</FruitSubtype> </Fruit> <Fruit> <FruitType>Pear</FruitType> <FruitSubtype>Comice</FruitSubtype> </Fruit> <Fruit> <FruitType>Plum</FruitType> <FruitSubtype>Victoria</FruitSubtype> </Fruit> <Fruit> <FruitType>Apple</FruitType> <FruitSubtype>Bramley</FruitSubtype> </Fruit> </Fruits>') fruit_xml from dual) select * from sd;
So far, I've got:
but I just want to finish with the last child node by FruitType, for example:with sd as (select xmltype('<Fruits> <Fruit> <FruitType>Apple</FruitType> <FruitSubtype>Granny Smith</FruitSubtype> </Fruit> <Fruit> <FruitType>Pear</FruitType> <FruitSubtype>Anjou</FruitSubtype> </Fruit> <Fruit> <FruitType>Pear</FruitType> <FruitSubtype>Comice</FruitSubtype> </Fruit> <Fruit> <FruitType>Plum</FruitType> <FruitSubtype>Victoria</FruitSubtype> </Fruit> <Fruit> <FruitType>Apple</FruitType> <FruitSubtype>Bramley</FruitSubtype> </Fruit> </Fruits>') fruit_xml from dual) select x.* from sd, xmltable('//Fruits/Fruit[FruitType=''Apple'' or FruitType=''Pear'']' passing sd.fruit_xml columns fruit_type VARCHAR2(25) path '//FruitType', fruit_subtype VARCHAR2(25) path '//FruitSubtype') x; FRUIT_TYPE FRUIT_SUBTYPE ------------------------- ------------------------- Apple Granny Smith Pear Anjou Pear Comice Apple Bramley
Is it possible to do through XMLTABLE, or I have to number each of the lines that results from (what I know how to do) and then create a group to prove XMLTABLE? The latter seems awkward to me, so I'd avoid it if possible, but if this is the way to go, I can do it.FRUIT_TYPE FRUIT_SUBTYPE ------------------------- ------------------------- Pear Comice Apple Bramley
Thank you.Is it possible to do through XMLTABLE, or I have to number each of the lines that results from (what I know how to do) and then create a group to prove XMLTABLE?
Indeed, it is a possible way:
select x.fruit_type, min(fruit_subtype) keep(dense_rank last order by rn) as fruit_subtype from sd, xmltable('/Fruits/Fruit' passing sd.fruit_xml columns fruit_type VARCHAR2(25) path 'FruitType', fruit_subtype VARCHAR2(25) path 'FruitSubtype', rn for ordinality) x where fruit_type in ('Apple','Pear') group by fruit_type ;
Other options, should push the logic of consolidation in the XQuery:
select x.* from sd, xmltable('/Fruits/Fruit[FruitType="Apple"][last()] | /Fruits/Fruit[FruitType="Pear"][last()]' passing sd.fruit_xml columns fruit_type VARCHAR2(25) path 'FruitType', fruit_subtype VARCHAR2(25) path 'FruitSubtype' ) x ;
or,
select x.* from sd, xmltable('for $i in distinct-values(/Fruits/Fruit/FruitType) return /Fruits/Fruit[FruitType=$i][last()]' passing sd.fruit_xml columns fruit_type VARCHAR2(25) path 'FruitType', fruit_subtype VARCHAR2(25) path 'FruitSubtype' ) x where x.fruit_type in ('Apple','Pear') ;
or,
select x.* from sd, xmltable('/Fruits/Fruit[not(following-sibling::Fruit/FruitType=./FruitType)]' passing sd.fruit_xml columns fruit_type VARCHAR2(25) path 'FruitType', fruit_subtype VARCHAR2(25) path 'FruitSubtype' ) x where x.fruit_type in ('Apple','Pear') ;
Edited by: odie_63 APR 17. 2012 17:56 - added latest example
-
XML E4X nodes select based on the attribute of the child node.
Hey,.
I'm making a selection on the following XML code.
I want to retrieve the list of the variable node when its child nodes metadata attribute 'name' is not equal to "transitional". I have read the documentation, but have not been able to solve this problem, and it should be pretty simple. So far, I tried with something like.
variable var: XMLList = classInfo.variable. (the metadata. (@name! = "transitoire")) ;
variable var: XMLList = classInfo.variable. (metadata.@name! = "transitional");
But he returns all the nodes variable.
"< name =" type com.sca.dataModel::PresentationDataEntity"base =" com.sca.dataModel::BaseEntity "isDynamic ="false"isFinal ="false"isStatic ="false">
< extendsClass type="com.sca.dataModel::BaseEntity"/ >
< extendsClass type = 'Object' / >
< variable name = "subtitle" type = "string" >
< name of metadata = "__go_to_definition_help" >
< arg key = 'file' value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/PresentationDataEntity.as"/ >
< arg key = "pos" value = "128" / >
< / metadata >
< / variable >
< variable name = "id" type = "Number" >
< name of metadata = "__go_to_definition_help" >
< arg key = 'file' value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/BaseEntity.as"/ >
< arg key = "pos" value = "153" / >
< / metadata >
< / variable >
< variable name = "tableName" type = "String" >
< name of metadata = "transitional" / >
< name of metadata = "__go_to_definition_help" >
< arg key = 'file' value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/BaseEntity.as"/ >
< arg key = 'pos' value = '118' / >
< / metadata >
< / variable >
< variable name = "db_SortAsc" type = "Boolean" >
< name of metadata = "transitional" / >
< name of metadata = "__go_to_definition_help" >
< arg key = 'file' value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/BaseEntity.as"/ >
< arg key = "pos" value = "281" / >
< / metadata >
< / variable >
< variable name = "title" type = "String" >
< name of metadata = "__go_to_definition_help" >
< arg key = 'file' value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/PresentationDataEntity.as"/ >
< arg key = "pos" value = "100" / >
< / metadata >
< / variable >
< method name = "setData" declaredBy = "com.sca.dataModel::BaseEntity" returnType ="*" > "
< parameter index = '1' type = 'Object' optional = "false" / >
< name of metadata = "__go_to_definition_help" >
< arg key = 'file' value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/BaseEntity.as"/ >
< arg key = "pos" value = "330" / >
< / metadata >
< / method >
< name of metadata = "__go_to_ctor_definition_help" >
< arg key = 'file' value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/PresentationDataEntity.as"/ >
< arg key = "pos" value = "167" / >
< / metadata >
< name of metadata = "__go_to_definition_help" >
< arg key = 'file' value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/PresentationDataEntity.as"/ >
< arg key = "pos" value = "42" / >
< / metadata >
< / type >Try classInfo.variable. ([email protected] (.indexOf("transient')) is
(- 1).
-
[CS4] [JS] Exchange xml content in duplicate content results
Hello
Does anyone have a solution for this problem?
I would exchange 2 content of xml text. The result is a duplicate content, what I don't want.
The text is in element 0 = 'ABC '. The text of the element 1 = '123 '.
The result is twice the same text.
var myFirstElm = myCurrentElement.xmlElements [0] .silence;
var mySecElm = myCurrentElement.xmlElements [1] .silence;
myCurrentElement.xmlElements [1] .silence = myFirstElm;
myCurrentElement.xmlElements [0] .silence = mySecElm;
I think that the myFirstElm and mySecElm values are just pointers to the location of the memory of the original. That would explain the result.
In some other programming languages known as 'Out '.
Is it possible to share content? How to solve this problem?
Thanks for all your comments
John
just a wild guess, but have you tried a. toString()?
var myFirstElm = myCurrentElement.xmlElements [0].contents.toString ();
var mySecElm = myCurrentElement.xmlElements [1].contents.toString ();
myCurrentElement.xmlElements [1] .silence = myFirstElm;
myCurrentElement.xmlElements [0] .silence = mySecElm;
-
Dear Indesign scripting,
This script is made of all the tags XML ParagraphStyles.
But he refuses to take the child to the elements. What do I have to use the XPath expression? And how?
function main() { var xes, n, doc, ps, xe; if ( !app.documents.length ) return; doc = app.activeDocument; xes = doc.xmlElements[0].xmlElements; n = xes.length; while ( n-- ) { xe = xes[n]; st = doc.paragraphStyles.itemByName (xe.markupTag.name ); !st.isValid && doc.paragraphStyles.add({name:xe.markupTag.name}); } } main();
The XML code
<Workbook> <Element_A_01> <Element_A_01></Element_A_01> </Element_A_01> <Element_B_02> <Element_B_02></Element_B_02> </Element_B_02> </Workbook>
Greetings from Holland
The code creates two paragraph styles namely Element_A_01 and Element_B_02. These two are created for the immediate child nodes of the workbook node. Now, it seems you are trying to create pstyles for all nodes in the XML document, which in your case would be even these two as Element_A_01 has a child node that is also named Element_A_01 and what is the case for Element_B_02.
If I get your straight stitch then you need to create 4 pstyles if all nodes have different names, but who doesn't. For that you recursively through each node that you receive from the fixed code [n].
The code to be something like this
- main() {} function
- fixed var n, doc, ps, xe;
- If (! app.documents.length) return;
- doc = app.activeDocument;
- fixed = doc.xmlElements [0] .xmlElements; This gives the immediate children nodes of the workbook node, where the length in the next statement 2
- n = xes.length;
- While (n)-{}
- XE = set [n]; Here you need to recursively through the xe node
- The number of child elements of the xe can be obtained as xe.xmlElements.length
- First element can be obtained by xe.xmlElements [0]
- }
- }
- main();
Hope this fixes the problem
-
Hi all
I am very new to the designer of the ADEP. Please help me with this problem.
Let's say that the Subform.datanode.saveXML () returns a XML as below.
< test >
< Paper1 > English < / Document1 >
Science < paper2 > < / paper2 >
History of < paper3 > < / papier3 >
< test >
In the script:
var XMLDoc = subform.datanode.saveXML ("pretty");
for (nodeCount = 0; nodeCount < XMLDoc.nodes.length; nodeCount ++)
Returns an error "error: null is not an object. But I was able to access the values by specifying directly "XMLDoc.paper1 [0] m:System.NET.SocketAddress.ToString ();"
Can someone please suggest a way to know the number of child nodes in this context?
Hello
You can count the knots by:
subform.datanode.nodes.item(0).nodes.length;
-
Check the value of the attribute of a child node to xmltype data type.
Hello
I have a xml stored in the column with the data type as "XMLTYPE.
I don't want to loop in each child node. But want to know if the value of the A5 parameter is Y or N? Is there a way I can find it without making the child node extract "Setting" and then a loop of each node to find the value?<?xml version="1.0" encoding="ISO-8859-1"?> <Settings> <Setting Name="A1" Value="N"/> <Setting Name="A2" Value="N"/> <Setting Name="A3" Value="SOMEVALUE"/> <Setting Name="A4" Value="N"/> <Setting Name="A5" Value="Y"/> <Setting Name="A6" Value="N"/> </Settings>
Kind regardsYou specify your Oracle version then here are two options. If 10.2 or higher, use XMLTable, otherwise use the option of ExtractValue.
-- The WITH simply simulates your existing table that I do not have. WITH fake_tab AS (SELECT XMLTYPE('
-
How can I get the content of a node TreeField?
I need to keep the contents of a TreeField.
I believe that the only way to do that is to keep the content of the tree instead of the tree itself.
However, I can't drive how to get the content of a node.
I found the method to get the node ID, but nothing to get the string value that contains the node.
Any suggestions?
Thank you.
the objects contained in a treefield are known cookies.
You can use http://www.blackberry.com/developers/docs/6.0.0api/net/rim/device/api/ui/component/TreeField.html#ge...
to retrieve one for the node id. -
I use experience in tools and frameworks 3.1.2 handler.
By browsing the content tree set up in my experience Manager application, I clicked on a content item to review the configuration. Although not explicitly made changes to this content, I clicked on another element of content to review its configuration, I received a pop-up message indicating the content item that I had been posted has been changed and you are prompted for me to ignore or cancel this action. Well instead of selecting an action, I closed the browser instead. Now, when I go back in the experienced Manager and try clicking on this same piece of content, I get a spinning hourglass for 10 seconds approximately and an error message appears stating...
Could not load the content item information of http://www.mysite.com/IFCR/sites/MyEndecaAppName/content/Web/categories/pages/content.XML
It seems that close the browser on a pending action to ignore or cancel the change may have corrupted this piece of content in some way, so that I can it display is no longer in the experienced Manager.
Is it possible to 'Status' maintained by frameworks and tools 3.1.2 could have been damaged because of this simple action, and if so how can I do to fix this?
Thank you!
PROBLEM SOLVED
This has proved to be a problem with the local browser caching! In Google Chrome, I just erased ALL my data in the browser history, and voila - I could access the item of previously inaccessible content without problem in the experience Manager.
-
I use JDev 12 c on Windows 7 Pro
I do a CreateInsert in ADF button on af:table. The model is set up so that T1 is one to many with t2, t2 is one to many with t3.
I have recordings in t1 and t2, and trying to insert a record into t3.
After I click the button, two of the three PK columns have values of t2. The third column is served by LOV. I open the LOV and select a value, and I get this exception:
oracle.jbo.InvalidOperException: Houston-34014: no child node not found for line with key:oracle.jbo.Key [79449 Xnnnn-nn-X-nnnn null] under parent node: root
at oracle.jbo.uicli.binding.JUCtrlHierBinding.bringNodeToRangeKeyPath(JUCtrlHierBinding.java:875)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding.bringNodeToRangeKeyPath(FacesCtrlHierBinding.java:121)
at oracle.adfinternal.view.faces.model.binding.RowDataManager.setRowKey(RowDataManager.java:131)
to oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$ FacesModel.setRowKey (FacesCtrlHierBinding.java:951)
at org.apache.myfaces.trinidad.component.UIXCollection.setRowKey(UIXCollection.java:553)
at org.apache.myfaces.trinidad.component.UIXTable.setRowKey(UIXTable.java:768)
at org.apache.myfaces.trinidad.component.UIXCollection.broadcast(UIXCollection.java:188)
more of the stack trace was stopped for brevity.
I've seen other posts related to this exception but no solid answers. I tried a few suggestions but nothing worked.
If I remove the 3rd key I can insert a line, but on the second row, I get an error indicating that the primary key violation. It's like the page checks the constraints of the entity before the validation.
Insert in this table works fine in the tester model.
Thank you
Dave
And by LOV you mean: af:inputListOfValues?
It usually works within the af: table if you VO with composite key.
Maybe you can set ChangeEventPolicy = none on your iterator, but it will probably not help.
Dario
-
Table tree - Select All child nodes at the same time when the Parent node is selected.
Hi all
I am relatively new to ADF and JDeveloper, and so I hit a problem I can't deny.
I have a tree table that looks like the following...
1 status | Name | Employee ID
-> Status 2. Name | Employee ID | etc. | etc.
-> 3 status. Name | Employee ID | etc. | etc. | etc.
I want to do is when I select the node from top of the line/parent (line 1) page I would like child nodes (lines 2 and 3) to choose from in the same mouse clicks.
In the end I will be citing a listener of the property on a button, once the selection was made, to change the value of the 'Status' column in all three levels that have been selected.
NB. each level in the tree above is derived from 3 views distinct, who are joined on the employee ID.
Thanks in advance for your help and your advice.
Kind regards
Jamie.
Jamie, tell us your version of jdev, please!
This http://andrejusb.blogspot.de/2012/11/check-box-support-in-adf-tree-table.html Blog shows how to implement this.
Timo
-
Hide the "open child node" hierarchy Viewer
How to hide the button ' Show/hide' If node has no child nodes,
similar to the example:Hierarchy - Structure of custom node and node comparison demo Viewer
Thank you
You do not check it to a bean. The hierarchy is eradicated, so check this is a method of bean would not help that the check is at the end.
Checkbox in the node itself. The hierarchy works on a model which is to build nodes. Each node must know itself and if there are children. Depending on your model, you implement a method in the node class, which returns true if there are children, and false otherwise. The method is named hasChildren() in the example from my previous post.
Timo
-
Click the step of node in the child node has no
Hello
I customized a series of nodes personalized like "chassisRackVSphere-ui.
In the picture1 below, "10.240.198.192", "Shopping cart", "Châssis" all three are custom node. When I double click on the column in the table, it must enter the purpose of the grid and remain in the child node as photo 2.
But it will show the Note2 for a second, then jump to the pic1. This jump is abnormal. An idea for this problem?
Set a breakpoint in your data adapter to see what happens when you select the custom in the 1st case object. The error of the user interface must be the result of bad data.
Maybe you are looking for
-
Minimize, maximize and Quit buttons appear in black
Windows 7, open Firefox by using the icon on desktop/toolbar the minimize, maximize and Quit buttons are not displayed correctly. However, when you open a link to a mail electronics (client Thunderbird) buttons to minimize, maximizes and Quit appear
-
Duplicate Remover Photo for iPad Pro
Somehow, I've created several pictures in double in pictures and now I want to remove them for ease of use on my iPad Pro. What is the best app (s) for this purpose? Thanks for your suggestions.
-
Satellite A200-1J0 and XP: the slow screen refresh
Dear friends, can you please check whether you have such a problem. I installed XP.Games and stuff like works fine and fast, but... When I do my usual work, I see that something is strange. Some windows are refreshing with a bit of delay. Example 1:
-
cannot install adobe reader error 2350.FDI code
Subject says it all. I've always been able to install and use Adobe Reader but now I can't. "error 2350.FDI server error" appears each time around 71% to 96% installed. I use Windows XP Home w/Windows Explorer 8 Help! joec76
-
SR - 1 for Office Premium is not installed
Caused by a virus, I had to do a clean install on my Dell 8250 running Windows XP Pro. I reinstalled Office 2000 Premium, but when I went to install CD of Service Pack 2 I received a message that I had to first install SR - 1. The update downloaded f