How to fetch the child Nodes using XNode
Hi All,
How to fetch child nodes of XNode object ?
I am moving my code to .net 3.5 so i was replacing XMLNode to XNode , but i could find any ChildNodes() method.
Thanks,
Pallavi
As such this is not a SharePoint related question, even though there are many way to parse the XNode object.
One way is,
XNode an all other are derived from XElement, so you can use Linq to get all children by casting it with XElement, below is a snippet
XDocument doc = XDocument.Load(""); //Path
XElement ele = doc.Nodes().First() as XElement;//Just taking the first element as XNode
foreach (var item in ele.Elements())
var v = item;
You can use Full Linq queries to find any node, just for example, below is a snipped to find a node based on a attribute value
ele.Elements().Where(x => x.Attribute("text").Value == "text");
get2pallav
Please click "Propose As Answer" if this post solves your problem or "Vote As Helpful" if this post has been useful to you.
Similar Messages
-
How to store multiple child nodes using dbms_xmlstore
Hi,
I'm using oracle 10g environment. In DBMS_XMLSTORE package I cannot able to insert the multiple child node value into db table.
Here I have given the xml value
<DATAPACKET REQUEST-ID="10001094">
<HEADER>
<SEARCH-RESULT-LIST>
<SEARCH-RESULT-ITEM NAME="Ra-Al-Gul" CONFIDENCE-SCORE="750" BUREAU-ID="893991307899440">
<IDENTIFIERS>
<IDENTIFIER IDSOURCE="0001" MATCHED="TRUE"/>
</IDENTIFIERS>
<SURROGATES>
<SURROGATE ID="CH0001" MATCHED="TRUE"/>
<SURROGATE ID="CH0002" MATCHED="TRUE"/>
<SURROGATE ID="CH0003" MATCHED="TRUE"/>
</SURROGATES>
</SEARCH-RESULT-ITEM>
</SEARCH-RESULT-LIST>
</HEADER>
</DATAPACKET>for this xml data I have created the below table structure
-- Table create script
CREATE TABLE xml_insert (datapacket t_response );
/* Type creation code */
CREATE OR REPLACE TYPE t_response AS OBJECT
"@REQUEST-ID" VARCHAR2(100),
header t_resp_header
CREATE OR REPLACE TYPE t_resp_header AS OBJECT
"SEARCH-RESULT-LIST" t_search_item
CREATE OR REPLACE TYPE t_search_item AS OBJECT
("SEARCH-RESULT-ITEM" t_search_list);
CREATE OR REPLACE TYPE t_search_list AS OBJECT
("@NAME" VARCHAR2(300),
"@CONFIDENCE-SCORE" VARCHAR2(300),
"@BUREAU-ID" VARCHAR2(300),
IDENTIFIERS t_search_identifiers,
SURROGATES t_search_surrogates
CREATE OR REPLACE TYPE t_search_identifiers AS OBJECT
(IDENTIFIER t_search_IDENTIFIER);
CREATE OR REPLACE TYPE t_search_identifier AS OBJECT
"@IDSOURCE" VARCHAR2(20),
"@MATCHED" VARCHAR2(20)
CREATE OR REPLACE TYPE t_search_surrogates AS OBJECT
(SURROGATE t_search_SURROGATE);
CREATE OR REPLACE TYPE t_search_surrogate AS OBJECT
"@ID" VARCHAR2(20),
"@MATCHED" VARCHAR2(20)
CREATE OR REPLACE TYPE tb_search_surrogate AS TABLE of t_search_SURROGATE;
/and run this block
DECLARE
insCtx DBMS_XMLStore.ctxType;
rows NUMBER;
xmldoc CLOB :=
<ROWSET>
<ROW>
<DATAPACKET REQUEST-ID="Q10001094">
<HEADER>
<SEARCH-RESULT-LIST>
<SEARCH-RESULT-ITEM NAME="Anis kulam" CONFIDENCE-SCORE="750" BUREAU-ID="893991307899440">
<IDENTIFIERS>
<IDENTIFIER IDSOURCE="0001" MATCHED="TRUE"/>
</IDENTIFIERS>
<SURROGATES>
<SURROGATE ID="CH0001" MATCHED="TRUE"/>
<SURROGATE ID="CH0002" MATCHED="TRUE"/>
<SURROGATE ID="CH0003" MATCHED="TRUE"/>
</SURROGATES>
</SEARCH-RESULT-ITEM>
</SEARCH-RESULT-LIST>
</HEADER>
</DATAPACKET>
</ROW>
</ROWSET>';
BEGIN
insCtx := DBMS_XMLStore.newContext('xml_check');
rows := DBMS_XMLStore.insertXML(insCtx, xmlDoc);
DBMS_XMLStore.closeContext(insCtx);
END;I got the following error
Error Messgae :
ORA-19031: XML element or attribute SURROGATE does not match any in type DOHADEV.T_CRB_SEARCH_SURROGATES
ORA-06512: at "SYS.DBMS_XMLSTORE", line 78
ORA-06512: at line 28Hi,
A couple of comments to begin with :
- Your setup script, test case and error message are not consistent with each other.
- You've not chosen the easiest road with DBMS_XMLSTORE and nested objects. As pointed out in a previous thread of yours, the whole thing would be far more simple with XMLTable.
Do you really need to store the data in an object-relational structure at the end, or do you intend to further break it down into relational rows and columns?
Do you have an XML schema? -
How to fetch the BCC address using java mail
Hi,
I want to extract the mail address given in the Bcc address field of an email which I fetch it from the IMAP store !!
I will be very much thankful if this problem is solved !!
Thanks!!You can read the Bcc addresses just like the To and Cc addresses. But.... Note that Bcc addresses
won't be present in any message you receive; if you could see the Bcc addresses it wouldn't be a
blind carbon copy. If you create a message with Bcc addresses and save that message in your
"Sent Items" folder, you'll be able to read the Bcc addresses in that message. -
Hi, i want create new row, all work fine, i can fill the header node and it´s record in the backend... but, how can fill the child node?
My code for create a row is:
// add a new item
// first an empty synbo is created and than the values are set
public void addRowInDB(String syBName, String[] newValues) throws SmartSyncException, PersistenceException {
String syncBoName = syBName;
SyncBoDescriptor sbd = descriptorFacade.getSyncBoDescriptor(syncBoName);
SmartSyncTransactionManager transactionManager;
RowDescriptor sbdRowDesc = sbd.getTopRowDescriptor();
// Create new syncbo
SyncBo newsyncBo = dataFacade.createEmptySyncBo(sbd);
Row worker = newsyncBo.getTopRow();
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("BSTNK"),newValues[0]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("PKUNAG"),newValues[1]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("PKUNWE"),newValues[2]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("PKUNRG"),newValues[3]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("PKUNZV"),newValues[4]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("AUART"),newValues[5]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("BSARK"),newValues[6]); Date d = new Date(2008, 10, 10);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("ERDAT"),d);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("ERNAM"),newValues[8]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("VKORG"),newValues[9]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("VTWEG"),newValues[10]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("SURTIDO_COMPLETO"),newValues[11]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("TEMPORADA"),newValues[12]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("COLECCION"),newValues[13]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("TEMA"),newValues[14]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("SPART"),newValues[15]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("AUGRU"),newValues[16]); worker.setFieldValue(sbdRowDesc.getFieldDescriptor("NOTAS"),newValues[17]);
dataFacade.insertSyncBo(newsyncBo);
With this code only can fill the header, how can fill the child?
Thanks,Hello, lot of thanks...
Finally i can insert the root and the child in my DB SQL Studio... and i can see the data... But, when sync, no send the data, and not appear errors, and not appear block queue... What happend?
My code is:
SyncBoDescriptor sbd = descriptorFacade.getSyncBoDescriptor(syncBoName);
SmartSyncTransactionManager transactionManager;
RowDescriptor sbdRowDesc = sbd.getTopRowDescriptor();
// Create new syncbo
SyncBo newsyncBo = dataFacade.createEmptySyncBo(sbd);
Row worker = newsyncBo.getTopRow();
transactionManager = dataFacade.getSmartSyncTransactionManager();
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("BSTNK"),newValues[0]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("PKUNAG"),newValues[1]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("PKUNWE"),newValues[2]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("PKUNRG"),newValues[3]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("PKUNZV"),newValues[4]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("AUART"),newValues[5]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("BSARK"),newValues[6]); Date d = new Date(2008, 10, 10);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("ERDAT"),d);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("ERNAM"),newValues[8]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("VKORG"),newValues[9]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("VTWEG"),newValues[10]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("SURTIDO_COMPLETO"),newValues[11]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("TEMPORADA"),newValues[12]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("COLECCION"),newValues[13]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("TEMA"),newValues[14]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("SPART"),newValues[15]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("AUGRU"),newValues[16]);
worker.setFieldValue(sbdRowDesc.getFieldDescriptor("NOTAS"),newValues[17]);
dataFacade.insertSyncBo(newsyncBo);
Row row = newsyncBo.createEmptyRow(sbd.getRowDescriptor("010"));
SyncBo so = row.getSyncBo();
RowDescriptor s = sbd.getRowDescriptor("010");
row.setFieldValue(s.getFieldDescriptor("MATNR"),newValues[18]);
row.setFieldValue(s.getFieldDescriptor("J_3ASIZE"),newValues[19]);
Date da = new Date(2008, 10, 10); row.setFieldValue(s.getFieldDescriptor("DT_ENTREGA"),da);
row.setFieldValue(s.getFieldDescriptor("SEMANA"),newValues[21]);
row.setFieldValue(s.getFieldDescriptor("MES"),newValues[22]);
row.setFieldValue(s.getFieldDescriptor("NO_CANTBRUTA"),newValues[23]);
so.insertRow(row);
If i create without the child.. when sync, send the data...
Regards, -
In oracle rac, If user query a select query and in processing data is fetched but in the duration of fetching the particular node is evicted then how failover to another node internally?
The query is re-issued as a flashback query and the client process can continue to fetch from the cursor. This is described in the Net Services Administrators Guide, the section on Transparent Application Failover.
-
How can i get the value of childnodes in java using sax?
Just wait a while. The child nodes will be passed to you after the parent nodes. Of course, you will have to keep track of which child nodes of which parent elements you want, but you probably know this already. If you want to process the entire file first and then decide which child nodes are of interest, read up on one of the DOM-ish approaches.
Dave Patterson -
How to fetch the data & display the data if fields got the same name in alv
hi frnds, i need ur help.
how to fetch the data & display the data if fields got the same name in alv grid format.
thanks in advance,
Regards,
mahesh
9321043028Refer the url :
http://abapexpert.blogspot.com/2007/07/sap-list-viewer-alv.html
Go thru the guide for OOPs based ALV.
Use SET_TABLE_FOR_FIRST_DISPLAY to display the table:
CALL METHOD grid->set_table_for_first_display
EXPORTING
I_STRUCTURE_NAME = 'SFLIGHT' Structure data
CHANGING
IT_OUTTAB = gt_sflight. Output table
You can also implement
Full Screen ALV, its quite easy. Just pass the output table to FM REUSE_ALV_GRID_DISPLAY.
For controlling and implementing the FS-ALV we have to concentrate on few of the components as follows :
1. Selection of data.
2. Prepare Layout of display list.
3. Event handling.
4. Export all the prepared data to REUSE_ALV_GRID_DISPLAY.
Regd,
Vishal -
How to get the current node element by its value?
e.g,:
wdContext.current<b>Deal</b>Element().setAttributeValue("<i>deal_id</i>","<i>aaaaaaa</i>");
above code can get the result i wanna.
but now i wanna in terms of its node'name to set attribute vaue of itself. in other words,i have no idea about how to get the current node element by its name"<b>Deal</b>".Hi Wing,
The answer is there in your question itself.
wdContext.currentDealElement()
will give you the current node element by its name"Deal" or you could use
wdContext.nodeDeal().getCurrentElement()
or you could use
wdContext.nodeDeal().getElementAt(wdContext.nodeDeal().getLeadSelection())
Regards,
Sudeep -
How to fetch the payment details in to report
Hi,
I have the MIRo number, How to find the payment document number and check number so and so.
What are the transactions like: F053,FB03.
Let me know the process of payment after MIRO.
What are the documents we need to raise, how to find those documents, what is the link.
How to find the accounting document for payment and check details (from which tables).
What are the table names and field names. What we can get from PAYR table.
I want to create a report for MIRO with payment details.
How to fetch the business area field value in to report.
What is the table name. I verified it is storing in structure. Which is the right table for fetching that value with reference to MIRO.
With regards
Lakki
With regards
LakkiHi,
For Creating MIRO Document,
We have to create PO Me21n,
then Do GR - MIGO using PO Reference,
then we have to do MIRO Using then same PO. so the link is basically the PO. Then the Payment for the MIRO document is done in F-53/F-58 refering the MIRO document. the check number will be generated once we do the Check Print in
FBZ5.
You can assign the check number to the F-53 document either in Assignment Field or the Reference field Using FCHU.
Once you do this you can view all the Vendor Bill using Doc Type RE, KR & Vendor Payments Doc Type KZ.
You can use the Std Report FBL1N / FK110N
Hope its useful. Assign points if found use ful
Regards,
R.Ramakrishnaraj -
How can provide parent-child nodes relation ships?
how can provide parent-child nodes relation ships?
I was under the impression that scenegraph is like a JTree. But in JavaFX only leaf node rendering in scenegraph. This situation was confusing my mind. In JavaFX CustomNode must be extending and return a group for custom leaf. If we want to a create parent-child node hierarchy we are create CustomNode that return a group and this group contain an another group,etc. So there is maybe only a way. If you learning to JavaFX first time.This way don't look familiar.
-
How to achieve parent-child relationship using self join?
my table structure is as follows
parent child name
-1 1 A1
1 2 A2
1 3 A3
how to achieve the hierarchy model using self join. this can be easily achieved using "connect by prior". but how to achieve the same using self join?Hi,
Yes, that's definitely possible. If you only need to display two levels from the hierarchy, a self-join is a good option. Make it an outer join if you need to show everyone on one level, regardless of whether they have a match on the other level or not; for example, if you want the output:
child_name child_id parent_name parent_id
A1 1
A2 2 A1 1
A3 3 A1 1It's good that you posted some sample data. Now post the results you want from that data, and your query (what you think is the best attempt you've made so far). If you haven't tried anything so far, then look at some other simple self-join to get ideas. -
How can I remove child node from JTree???
Hi,
I would like to remove all the child node of my jtree. For instance I would like to remove the c, d, and e nodes. It's possible to remove all the child node or to remove by her name ("c", "d", and "e"). If yes what is the method that it permit to do.
A-----
|
b-------c
|
|--------d
|
---------e
I use the model : DefaultMutableTreeNode
ThanksThere are a couple of ways it can be done. If your tree uses DefaultTreeModel as its TreeModel, you can use removeNodeFromParent(). This will remove the node from its parent and effectively remove its children, too. All nodes removed will be garbage-collected if there are no other references to them.
If your tree model is not the default tree model, but still uses MutableTreeNode, you can use either remove() or removeFromParent() on the node itself, depending on whether you want to remove the node itself or one of its children.
On the other hand, your tree may use a model that simply "mirrors" another data structure, in which case you would have to remove the node from the other data structure and have it reflected in the model. -
How to fetch external handling unit# using delivery#
Hi Gurus,
Please tell me relationship how to fetch the VBEP-EXIDV(external handling unit) Using LIKP-VBELN(Outbound Delivery no) .
Any suggestions welcome.
Thanks in advance,Table vekp has a field SPE_DELDEC.
Also if field STATUS = 60, its deleted. -
How to write the given query using 'ANY ' operator
Hi,
How to write the given query using 'ANY ' operator , I dont need to fetch to grade_master table twice in database, just need to fetch within the result set.
SELECT dsg_code,dsg_name,dsg_grade FROM designation_master WHERE dsg_orgn='&&Orgn' and dsg_ctry='&&ctry'
And dsg_loc ='&&loc' And dsg_oru = '&&oru' and dsg_grade in decode('&&radio_group',
1, SELECT grd_code FROM grade_master WHERE grd_osm_code in (Select grd_osm_code FROM grade_master WHERE grd_orgn='&&Orgn' and grd_ctry='&&ctry' And grd_loc ='&&loc' And grd_oru = '&&oru' and grd_code ='&&emp_grade'),
2, SELECT grd_code FROM grade_master WHERE grd_osm_code > (Select grd_osm_code FROM grade_master WHERE grd_orgn='&&orgn' and grd_ctry='&&ctry' and grd_loc ='&&loc' And grd_oru = '&&oru' and grd_code),
3, SELECT grd_code FROM grade_master WHERE grd_osm_code < (Select grd_osm_code FROM grade_master WHERE grd_orgn='&&orgn' and grd_ctry='&&ctry' And grd_loc ='&&loc' And grd_oru = '&&oru' and grd_code ='&&emp_grade'))
thanks
rincyHi,
One thing I understood my your issue is you want to perform, execution of query once or fetch the results sets my minimizing the number of times executions of queries. It would be hard for us to check in this way, atleast provide some temporary data and some business rules. Only I can IN, >, < (queries logical conditons on inner query)
- Pavan Kumar N
- ORACLE OCP - 9i/10g
https://www.oracleinternals.blogspot.com -
How to find the NodeManager Status using WLST
Hi All,
can anyone please let me know how to find the nodemanager status using wlst, the nodemanager status whether it is 'Reachable' or not.
Thank you.Hi Bob,
As James pointed, we faced the same. We could not find any mbean to find the Node Manager Stat that we can monitor from Weblogic console.
The best I can suggest, use the below WLST command after connecting to 'Node Manager:
nm()
Currently connected to Node Manager to monitor the domain xxxdomain.Grep for 'connected to Node Manager to monitor the domain <Your WLS domain name>' and if successfull, your node manager is UP & Connected other wise not 'Reachable'.
Regards,
qumar
Maybe you are looking for
-
Notes on JDev 10.1.3
I watched the on-line presentation on Faces yesterday, and decided to dive in and try to build the same application myself. I noted the following problems, which no doubt have already been reported, but just in case... 1. The range validator presents
-
Photo events do not show correctly in my iPhone
Photo events do not show correctly in my iPhone. I have 21 events in my iPhoto but they appear in many different groups in my iPhone.
-
LOV with inputListOfValues not working
Hi, using JDeveloper 11.1.1.5.0 and Fusion Web Application (ADF). I simply cannot make LOV work in any scenario. I have a view with a transient attribute on which I define LOV. When I test application module everything works as expected I get a LOV p
-
Oracle Client to connect to oracle database 7.x
Hi, I want to connect to oracle database 7.x from a win2K using ODBC. I know I need sql*net to make a connection . Can you tell me where can I find it on the site to download/purchase? If it is not available,can you suggest me the other options avail
-
We are trying to implement server side includes for our servlets, but are having difficulty retrieving parameters passed using the param tag. Our shtml code is as follows: <HTML> <BODY> <SERVLET NAME=