How to find in a xml node by its localName ?
i have an a xml with namespace
but i dont know this namespace and how many its in this xml
so i know tah will be a tag named hash
i want to get the actual value
and assign a new value
thanks
Hi,
With debug mode using breakpoints you should be able to stop the app at the time you data is coming back and see the structure of data result.
Johnny
Please rate answers
Similar Messages
-
How I can binding specified xml node to datagridview?
hello
please, i am new in c#;
I have xml file, i displayed the first node within form in c#, this node have attribute is called 'id', now i want to display all nodes that have attribute is called 'father' its value equal to id value of the displayed node.
xml file:
<?xml version="1.0" encoding="UTF-8"?>
<tree>
<grand name="aaa" id="1" sex="m" status="d" child="2" father=""></grand>
<grand name="ddd" id="12" sex="m" status="d" child="" father="1"></grand>
<grand name="bbb" id="11" sex="m" status="d" child="1" father="1"></grand>
<grand name="ccc" id="111" sex="m" status="d" child="1" father="11"></grand>
<grand name="ddd" id="1111" sex="m" status="d" child="3" father="111"></grand>
<grand name="eee" id="11111" sex="f" status="d" child="" father="1111"></grand>
<grand name="fff" id="11112" sex="m" status="d"child="" father="1111"></grand>
</tree>
c# code that display the first node is:
InitializeComponent();
XDocument xdoc = XDocument.Load(" http://domaim.net/tree/index.xml");
var name = xdoc.Descendants("grand").First().Attribute("name").Value;
var sex = xdoc.Descendants("grand").First().Attribute("sex").Value;
var alive = xdoc.Descendants("grand").First().Attribute("status").Value;
var child = xdoc.Descendants("grand").First().Attribute("child").Value;
var id = xdoc.Descendants("grand").First().Attribute("id").Value;
var father = xdoc.Descendants("grand").First().Attribute("father").Value;
textBox1.Text = name;
if (sex == "m") textBox2.Text = "male"; else textBox2.Text = "female";
if (child == "") textBox4.Text = "no child"; else textBox4.Text = child;
if (alive == "d") textBox3.Text = "dead"; else textBox3.Text = "alive";
here I displayed the node its id="1", now i want to display all nodes that its "father" attribute is equal 1. i want to display thier attributes of these nodes within datagridview,(bbb & ddd).
thank you for all.Try this. You have an error in the XML that you need to put a space before child in the last row.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
public partial class Form1 : Form
public Form1()
InitializeComponent();
DataSet ds = new DataSet();
ds.ReadXml(@"c:\temp\index.xml");
dataGridView1.DataSource = ds.Tables["grand"];
DataTable fatherRows = ds.Tables["grand"].AsEnumerable()
.Where(x => x.Field<string>("father") == "1").CopyToDataTable();
dataGridView2.DataSource = fatherRows; -
How to find the Adobe barcode name for its corresponding SAP Script barcode
Dear All,
We are doing conversions from SAPScript to Adobe forms.
The barcode used in two sapscript forms are 'BC_CD39' and 'ARTINR' respectively .
I would like to know the corresponding barcode name to be assigned to Adobe forms as the above barcode names are not present in the Object Library-> Barcode section of Adobe forms.
regards,
PP>
Muralidhar Medisetty wrote:
> Hi,
>
> I had an issue, in the transaction F110 Payment advice. They need to adjust the spacing on the cheque printing, which is overlapping the names on the cheque and hence I have forgotten how to find the form name and the driver program of the script. Can anybody suggest me how to find those. Your help will be appreciated.
>
> Thanks in advance.
hey
NACE is the transaction ..for this u must know the output type..
Script for Cheque Printing and Payment Advice can be known from Transaction FBZP...
FBZP -> paying Company Codes -> u will get Script used for Payment Advice
FBZP -> Pmnt methods in company code -> u will get Script used for Cheque Print
....Give points if useful.....
Edited by: Satyabrata sahoo on Oct 14, 2008 4:42 PM -
How to count number of xml nodes , with JSTL XML api?
I am trying to count the number of nodes in the parsed xml by doing this:
<x:out select="count($doc/Items/Item)"/>
There are about 50 item nodes in the source xml, but I get the output as 0
Is this syntax correct?
I searched every where but couldn't find the xpath syntax to be used inside jstl xml tags, I was assuming that it's the same as the syntax used in xsltThank you for your reply, sorry I wasnt very clear with my question.
I want to count the number of nodes inside the jsp file , not inside the xslt file.
My xml file is something like this for example:
<?xml version="1.0" encoding="UTF-8"?>
<DocumentRootNode>
<Products>
<Item>1</Item>
<Item>2</Item>
<Item>3</Item>
<Products>
</DocumentRootNode>
I want the count of number of Item nodes , in the JSP file.
I'm doing something like this in the JSP but it gives 0 instead of 3:
<c:import url="source.xml" var="xml" charEncoding="UTF-8"/>
<x:parse doc="${xml}" var="xml_doc"/>
<x:out select="count($xml_doc/Products/Item)"/>
null -
How to find the right XML files
Hi all
I need to customize OBIEE according to the custommers needs,Is there any tool to find the xml source files where I can make the changes.
Currently I'm using 'psoug' to edit the page source code , for example I want to modify those values:
<tbody>
<tr>
<td class="XUISectionHeadingTitle">Columns</td>
</tr>
<tr>
<td class="XUISectionHeadingText">
Click on column names in the selection pane to add them to the request. Once added, drag-and-drop columns to reorder them. Edit a column's format, formula and filters by clicking the buttons below its name.
and I don't find the xml file to update it.
Anyone knows how I can find it?*(BIInstallDir)\OracleBI\web\msgdb\l_en\messages*
Under this path you can find the list of XML files....
These XMLs are named to indicate what type of info it contain.. -
How to determine in an XML node exists in Coldfusion
If I have XML that looks something like this:
<manifest>
<state ID="20" name="State 2">
<person>john.black</person>
</state>
<state ID="30" name="State 2">
<person>bill.doe</person>
<group>Group2</group>
</state>
</manifest>
Where <group> may or may not exist under <state>, how do I determine if <group> exists when I'm parsing this XML?
This is the code I'm working with currently:
<cfset szXMLFile = "Manifest.xml">
<cfset XMLDoc = xmlParse(szXMLFile)>
<cfset StateNodes = xmlSearch(XMLDoc,'/manifest/state')>
<cfoutput>
<cfloop from="1" to="#ArrayLen(StateNodes)#" index="i">
<cfset StateXML = xmlparse(StateNodes[i])>
<cfloop index="p" from="1" to="#ArrayLen(StateXML.state.person)#">
<cfoutput>Person: #StateXML.state.person[p].xmltext#</cfoutput><br />
</cfloop>
<cfloop index="g" from="1" to="#ArrayLen(StateXML.state.group)#">
<cfoutput>Person: #StateXML.state.group[g].xmltext#</cfoutput><br />
</cfloop>
</cfloop>
</cfoutput>
I suppose I could just put <try><catch> blocks around where I'm referencing <group> and if it doesn't exist, I'll just handle it that way - but that seems like such a hack. Is there a 'real' way to determine if the node actually exists?
Thanks!<cfif structKeyExists(StateXML.state, "group")>
<cfloop index="g" from="1" to="#ArrayLen(StateXML.state.group)#">
<cfoutput>Person: #StateXML.state.group[g].xmltext#</cfoutput><br />
</cfloop>
</cfif> -
How do find Process name and Node name in a workflow ?
Hi,
For logging exceptions, how do I elegantly find the
process name and node name in a workflow.
Thanks
-AnilThe service location of the process is available on the interface returned
by
context.getService() in the process. That contains the full process path
(including process project name).
On the node, I don't know...
Robert
"Anil Varma" <[email protected]> wrote in message
news:31361182.1091122588490.JavaMail.root@jserv5...
Hi,
For logging exceptions, how do I elegantly find the
process name and node name in a workflow.
Thanks
-Anil -
How to find out if a NODE has any CHILD NODES in a hierarchical tree?
I want to find out programmatically if a node in a tree has CHILDREN.
My requirement is this: I want to only show nodes for which the user has permission to execute the program that node is associated with.
Problem is, my tree population query will not show the child nodes, BUT the sub-menu nodes are displayed and I need to get rid of these nodes.
There is a function to find out the PARENT of a tree node (FTree.Get_Tree_Node_Parent), but noting to find out if children exist for a node or not?
What I thought of was to display the tree and then traverse it from the ROOT onwards and then if a NODE is a submenu node (I can find this out by checking the PROGRAM value. If this is NULL it is a sub-menu node) and IF IT HAS NO CHILD NODES then I can delete the node.Please provide the examples with DATA
as far as i know we cannot get the Child Nodes but NODE's Parents we can get
parent_node := Ftree.Get_Tree_Node_Parent(htree, :SYSTEM.TRIGGER_NODE);I faced the similar problem but i solved it with query.
Provide the data and your Tree query then we can help -
How to select a specific XML node with XPath
Hi,
I'm trying to a select a specific node from my XML data using the XPath Builder. For example, say I have a process variable 'xmlData' with the
following contents:
User 1
101
User 2
102
I can successfully use the following expression to retrieve the name of
a specific user:
(/process_data/xmlData/users/user[userid='102'])/name
The problem is I need to use another process variable for the selection
key. For Example:
(/process_data/xmlData/users/user[userid=/process_data/@userId])/name
But this always returns null. I've tried surrounding /process_data/@userId
with single quotes, double quotes, and event {$..$}.
Any help would be greatly appreciated.
Thanks.Hi,
Thanks for the quick replies. I gave a bit of a bad example, as the
userid in my data is really a string, not a number.
A better example is:
User 1
user1
User 2
user2
I can get the following to work perfectly:
(/process_data/xmlData/users/user[userid='user2'])/name
but I can't get it to work with
/process_data/@userId = "user2"
(/process_data/xmlData/users/user[userid=/process_data/@userId])/name
Thanks. -
How to find changes in XML document?
I haven't seen this problem discussed, which surprises me because it must be pretty common.
I get the same (large amount of) XML data every night. I need to find out what has been added, changed and deleted since the last transfer and put the changes into an existing relational database.
I thought it could be a good idea to use the XML DB for the job of finding changes. Register the XSD and load the XML and use some queries to compare with last nights data to find out what has changed, and somehow transfer the changed data to the existing relational tables.
Do any of you have any experience in what is the best way to do this?Hi
Try it out in Tcode AUT10.
In this enter the from date and To date and enter the transaction MB22.
Then execute.
It will show the list of changes done in the paticular period.
Regards,
Raman -
How can i append new xml node to xmltype doc with updatexml and xpath?
ex. content of column:
<xmldoc>
<xmlnode attr="x" value="x1"/>
<xmlnode attr="y" value="y1"/>
</xmldoc>
needed to be:
<xmldoc>
<xmlnode attr="x" value="x1"/>
<xmlnode attr="y" value="y1"/>
<xmlnode attr="z" value="z1"/>
<xmldoc/>
how can i do this with updatexml without rewriting all xmlnode-elements?You have to specify the DTD in the transformation. If you are using XSLT then you do that on your <xsl:output>. Otherwise you need to give more details.
-
JS: how can find role in XML element attribute
Dear All,
We could gather "footnote" XML elements as an array. But we need to filter the elements which has "role=endnote" in the attributes from the group of common footnote tagged elements .
Eg. <footnote xml:id="en2" label="2" role="endnote"> from myGetXMLElements("//footnote")
Kindly assist to get footnote XML elements which has the role "endnote".
regards
MasthanHi Fred,
Yes, I got it. Thanks
regards
Masthan -
Hierarchical query: how to find out the root node
Hi to all.
I have a table with the following values:
user manager
Tom
John
Peter Tom
Steven Peter
Sean Peter
Jim John
Bill John
Ken Bill
So my hierachical query is as follow:
SELECT rpad(' ',(level-1)*3)||user as user_root, managerFROM My_Table
START WITH manager IS NULL
CONNECT BY manager = PRIOR user
ORDER SYBLINGS BY user
user_root manager
Tom
Peter Tom
Steven Peter
Sean Peter
John
Jim John
Bill John
Ken Bill
But I want also to know the top manager of each user. I want my output to be as follows:
user_root manager top_manager
Tom
Peter Tom Tom
Steven Peter Tom
Sean Peter Tom
John
Jim John John
Bill John John
Ken Bill Ken
Any hlp will be appreciated. Thanks a lot.
Regards, BeroetzIn 9i sys_connect_by_path can help:
SQL> select empno, ename, mgr
2 from emp
3 start with mgr is null
4 connect by prior empno = mgr
5 /
EMPNO ENAME MGR
7698 BLAKE
7499 ALLEN 7698
7521 WARD 7698
7654 MARTIN 7698
7844 TURNER 7698
7900 JAMES 7698
7839 KING
7566 JONES 7839
7788 SCOTT 7566
7876 ADAMS 7788
7902 FORD 7566
7369 SMITH 7902
7782 CLARK 7839
7934 MILLER 7782
14 rows selected.
SQL> select ename, mgr,
2 substr(sys_connect_by_path(ename,'/'),
3 2,instr(sys_connect_by_path(ename,'/'),'/',2)-2) top
4 from emp
5 start with mgr is null
6 connect by prior empno = mgr
7 /
ENAME MGR TOP
BLAKE
ALLEN 7698 BLAKE
WARD 7698 BLAKE
MARTIN 7698 BLAKE
TURNER 7698 BLAKE
JAMES 7698 BLAKE
KING
JONES 7839 KING
SCOTT 7566 KING
ADAMS 7788 KING
FORD 7566 KING
SMITH 7902 KING
CLARK 7839 KING
MILLER 7782 KING
14 rows selected.Rgds. -
How to find document/content type i.e. its extension ??
Hello,
I wanted to find the extension of a resource i.e. basically i wanted to find out programatically the document type whether its pdf or xml or word doc etc etc....which is stored in KM in portal.
Is there a way to do so using webdynpro Java ???
Thanks in advance,
SandeshHi,
you can take the resource type and you IMimeHandlerService for achieving that.
best regards,
--epexpert -
How to find the Oraganization name and the its classification
Hi All,
Can any one help me to find out the Query for Organization Name and its classification.
Please help..Considering you've used only one segment -
select name,date_from,date_to from per_jobs
where trunc(sysdate) between date_from and nvl(date_to,trunc(sysdate));
It is a good practise to close threads once you're done with and open new ones for new queries.
Cheers,
Vigneswar
Maybe you are looking for
-
I have a Sharp TV can I use my new Apple TV
My TV is an older annalog TV model number 32R-S60. What do I need to hook up my apple TV. I have three RCA jacks Input in the back and three RCA output jacks in the front. I have purchased an HDMI to RCA cable with no success. Does anyone know a fix
-
Problems with Photoshop CS5.1
Hello everyone, I'm having some problems with Photoshop, it simply doesn't work as it should. When trying to resize the brush, the cursor changes shape and if I click, it won't, for example, paint where the cursor is pointing at, but about two inches
-
[CS2, CS3] Drop shadow exceeds picture frame
Hi there, maybe this is a well known effect, if not for myself ... If you apply a drop shadow to a placed image that has a clipping mask active, you may end up with a shadow area that falls inside the images picture frame as well as outside of it. Th
-
Apple iTouch and Sony PSP will not connect to Home...
Please, please can someone help..... Just received my kit for the Home Hub 2.0, (although as my PC is close by this is connected via ethernet cable), other than this, this is the first time I have gone wireless, main reason is that I am getting a sli
-
HT4519 Unable to move deleted mail to trash on ipad
For the last month I have not been able to fully delete all messages and I get a warning message that I am unable to o Move message to trash Only on ipad