Get count of nodes
Hi all - I'm pretty new to manipulating XML.
I have the following test code:
declare -- Data
p_xpath varchar2(1000) := '/TEST/SUBNODE/COUNTME/EXTRASTUFF';
w_xmlbuffer varchar2(4000) :=
'<TEST>
<SUBNODE>
<COUNTME>
<EXTRASTUFF>value</EXTRASTUFF>
</COUNTME>
<COUNTME>
<EXTRASTUFF>value2</EXTRASTUFF>
</COUNTME>
</SUBNODE>
</TEST>';
-- XMLDom variables
w_doc xmldom.domdocument;
w_parser xmlParser.Parser;
w_root_nl xmldom.domnodelist;
w_reqd_elem_nl xmldom.domnodelist;
w_src_elem_nl xmldom.domnodelist;
w_src_val varchar2(100);
w_deriv_val varchar2(100);
w_elem xmldom.domelement;
w_text xmldom.domtext;
w_node xmldom.domnode;
w_node2 xmldom.domnode;
w_elem_text varchar2(100);
-- Function to check for null or zero-length nodelists
function CHECK_EMPTY_NODE_LIST(p_nl xmldom.domnodelist)
return boolean
is
w_ret boolean := true;
begin
if (not xmldom.isNull(p_nl)) then
if xmldom.getLength(p_nl) > 0 then
w_ret := false;
end if;
end if;
return w_ret;
end CHECK_EMPTY_NODE_LIST;
begin
-- Prepare the DOM document
w_parser := xmlParser.newParser;
xmlParser.parseBuffer(w_parser, w_xmlbuffer);
w_doc := xmlParser.getDocument(w_parser);
-- Get all instances of the root element
w_root_nl := xslprocessor.selectNodes(xmldom.makenode(w_doc), p_xpath);
if (not CHECK_EMPTY_NODE_LIST(w_root_nl)) then
for n in 0 .. xmldom.getlength(w_root_nl) -1
loop
w_node := xmldom.item(w_root_nl, n);
w_elem_text := to_char(n) || ':' || xmldom.getnodename(w_node) || ': ' || xmldom.getnodevalue(w_node);
w_node2 := xmldom.getfirstchild(w_node);
if not xmldom.isnull(w_node2) then
if xmldom.getnodetype(w_node2) = xmldom.text_node then
w_elem_text := w_elem_text || ' ' || xmldom.getnodevalue(w_node2);
end if;
end if;
dbms_output.put_line(w_elem_text);
end loop;
end if;
dbms_output.put_line('*** END ***');
end;this returns:
0:EXTRASTUFF: value
1:EXTRASTUFF: value2
*** END ***now I want to change the XPATH to return the count of the COUNTME nodes.
I have tried numerous combinations. this seems to parse:
p_xpath varchar2(1000) := '/TEST/SUBNODE[count(COUNTME)]'; but it displays nothing.
what do I need to do to get the count appearing? preferably I'd like to only change the xpath.
any thoughts?
Your xpath is: give me the Nth SUBNODE element where N = # of COUNTME elements.
If you want the count of COUNTME elements why not
p_xpath varchar2(1000) := '/TEST/SUBNODE/COUNTME';
-- Get all instances of the root element
w_root_nl := xslprocessor.selectNodes(xmldom.makenode(w_doc), p_xpath);
dbms_output.put_line(p_xpath || ' count: ' || xmldom.getlength(w_root_nl));
Similar Messages
-
How to get count of rows for a table?
Hi,
How to get count of rows for a table and secondly, how can i have access to a particular cell in a table?
Regards,
DevashishHi Devashish,
WdContext.node<Your_node_name>().size() will give you the no: of rows.
This should be the node that is bound to the table's datasource property.
WdContext.node<Your_node_name>().get<node_name>ElementAt(index_value); will select the row at that particular index.
You can access an attribute of a particular row as
WdContext.node<Your_node_name>().get<node_name>ElementAt(index_value).get<attribute_name>();
Hope this helps,
Best Regards,
Nibu.
Message was edited by: Nibu Wilson -
Problem getting Count Of ChildNodes (JAXP)
I am trying to process an XML Document like
<Report siteID="1234567">
<Transaction transactionDetail="VFVF56760482" referenceNumber="32293642" date="09-01-2003 09:30 AM">
<Item modelNo="" serialNo="" quantity="1" price="250.00" total="250.00" description="Rayban Sun Glasses 1" />
</Transaction>
</Report>
Once i get the Main Node ("Transaction") using
int nodeLen=0;
NodeList nList = doc.getElementsByTagName("Transaction");
nodeLen = nList.getLength();
for(int i=0; i<nodeLen ;i++){
Node n = nList.item(i);
NamedNodeMap nnm = n.getAttributes();
int attrItems = nnm.getLength();
//Below is where the problem is..
System.out.println("ChildNodes:"+ n.getChildNodes().getLength());
n.getChildNodes.getLength = 3 , there is only one ChildNode for Transaction1 Node.
Is this a bug in JAXP or am i missing something?
Appreciate any Help
Thanks
Joe Eugenen.getChildNodes() includes ignorableWhitespace text
nodes.
Refer to
http://java.sun.com/xml/jaxp/dist/1.1/docs/tutorial/dom
2b_display.htmlThanks for your reply...
Is there a way to get the correct count of ChildNodes?
Thanks,
Joe Eugene -
I have the following code:
Import-Module "sqlps" -DisableNameChecking
#####http://www.travisgan.com/2013/03/powershell-and-performance-monitor.html
function ExtractPerfmonData
param(
[string]$server,
[string]$instance
[Microsoft.PowerShell.Commands.GetCounter.PerformanceCounterSampleSet]$collections
$monitorServer = "MonitoringServerNameHere"
$monitorDB = "MonitoringDatabaseNameHere"
$counters = @(
"\$($instance):Memory Manager\Memory Grants Pending",
"\$($instance):Memory Manager\Target Server Memory (KB)",
"\$($instance):Memory Manager\Total Server Memory (KB)",
"\$($instance):Buffer Manager\Buffer Cache Hit Ratio",
"\$($instance):Buffer Manager\Checkpoint pages/sec",
"\$($instance):Buffer Manager\Page Life Expectancy",
"\$($instance):General Statistics\User Connections",
"\$($instance):General Statistics\Processes Blocked",
"\$($instance):Access Methods\Page Splits/sec",
"\$($instance):SQL Statistics\Batch Requests/sec",
"\$($instance):SQL Statistics\SQL Compilations/sec",
"\$($instance):SQL Statistics\SQL Re-Compilations/sec",
"\$($instance):Locks(_Total)\Lock Waits/sec"
$collections = Get-Counter -ComputerName $server -Counter $counters -SampleInterval 1 -MaxSamples 1
$sampling = $collections.CounterSamples | Select-Object -Property TimeStamp, Path, Cookedvalue
$xmlString = $sampling | ConvertTo-Xml -As String
$query = "dbo.usp_InsertPerfmonCounters_SQLServer '$xmlString';"
Invoke-Sqlcmd -ServerInstance $monitorServer -Database $monitorDB -Query $query
#####ExtractPerfmonData -server "YourRemoteServerName" -instance "MSSQL`$SQLTest"
ExtractPerfmonData -server "ServerName1Here" -instance "SQLSERVER"
ExtractPerfmonData -server "ServerName2Here" -instance "SQLSERVER"
ExtractPerfmonData -server "ServerName3Here" -instance "MSSQL`$InstanceNameHere"
ExtractPerfmonData -server "ServerName4Here" -instance "SQLSERVER"
(I have 93 instances listed; here I just gave a sample of 4.)
For only one instance I get the following error message:
Get-Counter : The
\\ServerNameHere2\\SQLSERVER:Locks(_Total)\Lock Waits/sec performance counter path is not valid.
All of the instances should have been set up the same, so I am confused as to why this error only occurs on this one instance. I do not know where to look. Has anyone ever seen this type of error before?
lcerniHere is the output of the first script:
CounterSetName
... (eliminating non sql server counters here)
SQLAgent:Alerts
SQLAgent:Jobs
SQLAgent:JobSteps
SQLAgent:Statistics
SQLServer:Access Methods
SQLServer:Availability Replica SQLServer:Backup Device
SQLServer:Batch Resp Statistics
SQLServer:Broker Activation
SQLServer:Broker Statistics
SQLServer:Broker TO Statistics
SQLServer:Broker/DBM Transport
SQLServer:Buffer Manager
SQLServer:Buffer Node
SQLServer:Catalog Metadata
SQLServer:CLR
SQLServer:Cursor Manager by Type
SQLServer:Cursor Manager Total
SQLServer:Database Mirroring
SQLServer:Database Replica
SQLServer:Databases
SQLServer:Deprecated Features
SQLServer:Exec Statistics
SQLServer:FileTable
SQLServer:General Statistics
SQLServer:Latches
SQLServer:Locks
SQLServer:Memory Broker Clerks
SQLServer:Memory Manager
SQLServer:Memory Node
SQLServer:Plan Cache
SQLServer:Query Execution
SQLServer:Replication Agents
SQLServer:Replication Dist.
SQLServer:Replication Logreader
SQLServer:Replication Merge
SQLServer:Replication Snapshot
SQLServer:Resource Pool Stats
SQLServer:SQL Errors
SQLServer:SQL Statistics
SQLServer:Transactions
SQLServer:User Settable
SQLServer:Wait Statistics
SQLServer:Workload Group Stats
... (eliminating non sql server counters here)
lcerni -
Field for counter and node in IA07 transaction
Hi,
In PLPO table when i give the task list type and group, I get multiple entries.How do we restrict the number of entries to the ones we need for our maintenance plan? Can it be done through counter and node? In that case where can we find them in IA07 transaction?
Thanks & Regards,
JegashreeHi experts,
Any suggestion on this?
Regards,
Jegashree -
How to get all tree node parents upon select
I have a tree, and when user clicks an item in the tree, I want to get all the parents of the selectedItem node.
So if I have this XML:
<products>
<item>
<sku>1001</sku>
<quantity value="100" />
</item>
<item>
<sku>2001</sku>
<quantity value="250" />
</item>
<item>
<sku>3001</sku>
<quantity value="300" />
</item>
</products>
If user clicks on the 1001 sku, I want to get something like this:
<products><item><sku>
Also if I have a custom component, perhaps based on tree or but maybe not, and if this custom component shows the actual XML and used can click on XML elements or XML attributes, how can I use the selected item to get the parent nodes, so if they click on the value="100", I want to get this:
<products><item><sku><quantity>
I need this because I have a set of fields, and users will drag their XML node elements or attributes to my fields, to define a mapping between their XML and my fields.
The selectedItem is just a snippet of XML cut off from its source XMLListCollection, and I might be able to search the XMLListCollection, but what if there were say <sku> elements at more than one level in the XML? I'm guessing a search might return multiple hits for a selected element, when I want the actual parent nodes for the actual selected node.
Thanks very much!var path:Array=[]
var parent:XML = xxxx.selectedItem.parent()
while(parent){
path.push(parent.localName())
parent = parent.parent()
Or, i didn't get your question and xxxx.selectedItem is "detached" XML snippet ? -
How to get Text for nodes in Tree Structure
Hi Friends,
How to get Text for nodes in Tree Structure
REPORT YFIIN_REP_TREE_STRUCTURE no standard page heading.
I N I T I A L I Z A T I O N
INITIALIZATION.
AUTHORITY-CHECK OBJECT 'ZPRCHK_NEW' :
ID 'YFIINICD' FIELD SY-TCODE.
IF SY-SUBRC NE 0.
MESSAGE I000(yFI02) with SY-TCODE .
LEAVE PROGRAM.
ENDIF.
class screen_init definition create private.
Public section
public section.
class-methods init_screen.
methods constructor.
Private section
private section.
data: container1 type ref to cl_gui_custom_container,
container2 type ref to cl_gui_custom_container,
tree type ref to cl_gui_simple_tree.
methods: fill_tree.
endclass.
Class for Handling Events
class screen_handler definition.
Public section
public section.
methods: constructor importing container
type ref to cl_gui_custom_container,
handle_node_double_click
for event node_double_click
of cl_gui_simple_tree
importing node_key .
Private section
private section.
endclass.
*& Classes implementation
class screen_init implementation.
*& Method INIT_SCREEN
method init_screen.
data screen type ref to screen_init.
create object screen.
endmethod.
*& Method CONSTRUCTOR
method constructor.
data: events type cntl_simple_events,
event like line of events,
event_handler type ref to screen_handler.
create object: container1 exporting container_name = 'CUSTOM_1',
tree exporting parent = container1
node_selection_mode =
cl_gui_simple_tree=>node_sel_mode_multiple.
create object: container2 exporting container_name = 'CUSTOM_2',
event_handler exporting container = container2.
event-eventid = cl_gui_simple_tree=>eventid_node_double_click.
event-appl_event = ' '. "system event, does not trigger PAI
append event to events.
call method tree->set_registered_events
exporting events = events.
set handler event_handler->handle_node_double_click for tree.
call method: me->fill_tree.
endmethod.
*& Method FILL_TREE
method fill_tree.
data: node_table type table of abdemonode,
node type abdemonode.
types: begin of tree_node,
folder(50) type c,
tcode(60) type c,
tcode1(60) type c,
tcode2(60) type c,
text(60) type c,
text1(60) type c,
text2(60) type c,
end of tree_node.
data: wa_tree_node type tree_node,
t_tree_node type table of tree_node.
wa_tree_node-folder = text-001.
wa_tree_node-tcode = text-002.
wa_tree_node-text = 'Creditors ageing'.
wa_tree_node-tcode1 = text-003.
wa_tree_node-text1 = 'GR/IR aging'.
wa_tree_node-tcode2 = text-004.
wa_tree_node-text2 = 'Bank Balance'.
append wa_tree_node to t_tree_node.
clear wa_tree_node .
wa_tree_node-folder = text-005.
wa_tree_node-tcode = text-006.
wa_tree_node-text = 'Creditors ageing'.
wa_tree_node-tcode1 = text-007.
wa_tree_node-text1 = 'Creditors ageing'.
wa_tree_node-tcode2 = text-008.
wa_tree_node-text2 = 'Creditors ageing'.
append wa_tree_node to t_tree_node.
clear wa_tree_node .
wa_tree_node-folder = text-009.
wa_tree_node-tcode = text-010.
wa_tree_node-text = 'Creditors ageing'.
wa_tree_node-tcode1 = text-011.
wa_tree_node-text1 = 'Creditors ageing'.
wa_tree_node-tcode2 = text-012.
wa_tree_node-text2 = 'Creditors ageing'.
append wa_tree_node to t_tree_node.
clear wa_tree_node .
node-hidden = ' '. " All nodes are visible,
node-disabled = ' '. " selectable,
node-isfolder = 'X'. " a folder,
node-expander = ' '. " have no '+' sign forexpansion.
loop at t_tree_node into wa_tree_node.
at new folder.
node-isfolder = 'X'. " a folder,
node-node_key = wa_tree_node-folder.
clear node-relatkey.
clear node-relatship.
node-text = wa_tree_node-folder.
node-n_image = ' '.
node-exp_image = ' '.
append node to node_table.
endat.
at new tcode .
node-isfolder = ' '. " a folder,
node-n_image = '@CS@'. "AV is the internal code
node-exp_image = '@CS@'. "for an airplane icon
node-node_key = wa_tree_node-tcode.
node-text = wa_tree_node-text .
node-relatkey = wa_tree_node-folder.
node-relatship = cl_gui_simple_tree=>relat_last_child.
endat.
append node to node_table.
at new tcode1 .
node-isfolder = ' '. " a folder,
node-n_image = '@CS@'. "AV is the internal code
node-exp_image = '@CS@'. "for an airplane icon
node-node_key = wa_tree_node-tcode1.
node-relatkey = wa_tree_node-folder.
node-relatship = cl_gui_simple_tree=>relat_last_child.
node-text = wa_tree_node-text1.
endat.
append node to node_table.
at new tcode2 .
node-isfolder = ' '. " a folder,
node-n_image = '@CS@'. "AV is the internal code
node-exp_image = '@CS@'. "for an airplane icon
node-node_key = wa_tree_node-tcode2.
node-relatkey = wa_tree_node-folder.
node-relatship = cl_gui_simple_tree=>relat_last_child.
node-text = wa_tree_node-text2.
endat.
append node to node_table.
endloop.
call method tree->add_nodes
exporting table_structure_name = 'ABDEMONODE'
node_table = node_table.
endmethod.
endclass.
*& Class implementation
class screen_handler implementation.
*& Method CONSTRUCTOR
method constructor.
create object: HTML_VIEWER exporting PARENT = CONTAINER,
LIST_VIEWER exporting I_PARENT = CONTAINER.
endmethod.
*& Method HANDLE_NODE_DOUBLE_CLICK
method handle_node_double_click.
case node_key(12).
when 'Creditors'.
submit YFIIN_REP_CREADITORS_AGING via selection-screen and return.
when 'Vendor'.
submit YFIIN_REP_VENDOR_OUTSTANDING via selection-screen and return.
when 'Customer'.
submit YFIIN_REP_CUSTOMER_OUTSTANDING via selection-screen and
return.
when 'GR/IR'.
submit YFIIN_REP_GRIR_AGING via selection-screen and return.
when 'Acc_Doc_List'.
submit YFIIN_REP_ACCOUNTINGDOCLIST via selection-screen and return.
when 'Bank Bal'.
submit YFIIN_REP_BANKBALANCE via selection-screen and return.
when 'Ven_Cus_Dtl'.
submit YFIIN_REP_VENDORCUST_DETAIL via selection-screen and return.
when 'G/L_Open_Bal'.
submit YFIIN_REP_OPENINGBALANCE via selection-screen and return.
when 'Usr_Authn'.
submit YFIIN_REP_USERAUTHRIZATION via selection-screen and return.
endcase.
endmethod.
endclass.
Program execution ************************************************
load-of-program.
call screen 9001.
at selection-screen.
Dialog Modules PBO
*& Module STATUS_9001 OUTPUT
text
module status_9001 output.
set pf-status 'SCREEN_9001'.
set titlebar 'TIT_9001'.
call method screen_init=>init_screen.
endmodule. " STATUS_9001 OUTPUT
Dialog Modules PAI
*& Module USER_COMMAND_9001 INPUT
text
module user_command_9001 input.
endmodule. " USER_COMMAND_9001 INPUT
*& Module exit_9001 INPUT
text
module exit_9001 input.
case sy-ucomm.
when 'EXIT'.
set screen 0.
endcase.
endmodule.
exit_9001 INPUTyou can read the table node_table with nody key value which imports when docubble click the the tree node (Double clifk event).
Regards,
Gopi .
Reward points if helpfull. -
How to get the selected node value of a tree which is build on java code
Hi Experts,
How can i get the selected node value if I build the tree programatically.
I am using the following code in selectionListener but it is throwing error.
RichTreeTable treeTable = (RichTreeTable)getQaReasontreeTable();
CollectionModel _tableModel =
(CollectionModel)treeTable.getValue();
RowKeySet _selectedRowData = treeTable.getSelectedRowKeys();
Iterator rksIterator = _selectedRowData.iterator();
String selectedQaCode ="";
while (rksIterator.hasNext()) {
List key = (List)rksIterator.next();
JUCtrlHierBinding treeTableBinding =
(JUCtrlHierBinding)((CollectionModel)treeTable.getValue()).getWrappedData();
JUCtrlHierNodeBinding nodeBinding =
treeTableBinding.findNodeByKeyPath(key);
String nodeStuctureDefname =
nodeBinding.getHierTypeBinding().getStructureDefName();
selectedQaCode = selectedQaCode + nodeBinding.getAttribute(0);
where I am using following link to create a tree with java code.
http://one-size-doesnt-fit-all.blogspot.com/2007/05/back-to-programming-programmatic-adf.html
Please help me in resolving this issue.
Regards
GayazHi,
you should also move
JUCtrlHierBinding treeTableBinding =
(JUCtrlHierBinding)((CollectionModel)treeTable.getValue()).getWrappedData();
out of the while loop as this is not necessary to be repeated for each key in the set
Frank -
How to get a Tree Node Value when a Tree is Expanded
My reqiurement is when i Expand a Tree i need the Expanded tree Node Value. For Example Consider Parent as a Root Node of a Tree, and Consider its two Children Child1 and Child2.
When + Parent Expanded
I will Get the Output as --Parent
- Child1
- Child2
so As when i expand the Tree i must Get the String Value Parent.duplicate
How to get a Tree Node Value when a Tree is Expanded -
Ordering of objects by more than one field and get counts
i have an object visit (personid, city, street, place, date)
A person could have visited a same place in the same strret in the same city several times on different dates.
I have a visits 'Set' for a person and I have to get a count of visits he has done to a place..
its basically select count(visits) group by city, street , place.
I know to use interface comparator for a single field.. how to compare multiple fields and get counts??
if you know abt where i can find information please let me know.
Thanks.For multiple fields, your comparator compares the most significant field first. If they're unequal, it returns +/- accordingly. If they're equal, then it moves on to the next field. And so on, until, finally, if all the relevant fields are equal, then the objects are equal.
Just like what you do when comparing, say, last names. If the first letters are unequal, you're done, else move onto the next letter, and so on..
For the count, you wouldn't use a comparator, as that's for sorting. Exactly how you do it depends on the details of what you're storing and how, which you haven't provided. -
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 get the Change node in Production Server!!!!!
Hi Guys,
Kindly let me know how to get the Change node in Production Server for the Transaction Code Pe03 for generating the Acknowledgement No for the year 2008 .
Plz provide me the steps how to get the Change Node for Acknowledgement No so tat i can get the configuration done.
Regards
Ansuman Mohanty.Hi Mr!
If you want to generate the e-file feature 40ACK, do it in our Customization client box (Golden box) & save the request & move to Quality & production.
Still if you need to workout only in Production, than with the help of Basis people you can get the Production change mode for 5 to 10 min time & can generate it. But mostly Basis people wont give us change mode for Production box ... with ur request they can do..try it.
Did u collected 4 quarter TAN no's for 2008 Quarter...if not collect it & generate it at a time.
All the best:-)
Kind Regards,
Saisree.S -
I can't get the correct node (a real beginner)
I have an XML file which looks like this:
[code<lawyer>
<Country>Singapore</Country>
<Company>Allen & Gledhill</Company>
</lawyer>
<lawyer>
<Country>Singapore</Country>
<Company>Allen & Gledhill</Company>
</lawyer>.
</Lawyers>
But I can't get the right node names and values.
Here is my code:
File file = new File("lawyers.xml");
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = builder.parse(file);
NodeList nlLawyers = doc.getElementsByTagName("lawyer");
for (int i = 0; i < nlLawyers.getLength(); i++) {
Element elLawyer = (Element) nlLawyers.item(i);
NodeList columns = elLawyer.getChildNodes();
for (int j=0; j<columns.getLength(); j++) {
Node col = columns.item(j);
String colName = col.getNodeName();
String colVal = col.getNodeValue();
System.out.println(colName + ": " + colVal);
}What I would like to print out would be something like this:
Country: Singapore
Company: Allen & GledhillBut I am getting extra nodes and cannot get the text values. Here is the output I am getting:
#text:
Country: null
#text:
Company: nullI don't understand this output at all. Please help me get the list of node names and values?
Thank you.
-JeffIt seems that the #text nodes represent the whitespace between the formal nodes. Also, the nodes that I want to extract have a NodeTypeValue of 1. Once I had determined that I had the correct node, I had to get its child node to get the text. Here is the final code:
File file = new File("lawyers.xml");
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = builder.parse(file);
NodeList nlLawyers = doc.getElementsByTagName("lawyer");
for (int i = 0; i < nlLawyers.getLength(); i++) {
lawyer = new Lawyer();
Element elLawyer = (Element) nlLawyers.item(i);
NodeList columns = elLawyer.getChildNodes();
for (int j=0; j<columns.getLength(); j++) {
Node col = columns.item(j);
if (col.getNodeType() == 1) {
String strColumn = col.getNodeName();
Node txt = col.getFirstChild();
String strValue = txt.getNodeValue();
System.out.println(strColumn + ":\t" + strValue); }
} // for each column
} // for each lawyer -
How could i get the selected node in the JTree
getLastSelectedPathComponent() �returns the parent node of currenr selected, so how could I get the selected node itself in the JTree
I will appretiate for any help!i think you can get by....
TreePath treePath = tree.getSelectionPath();
DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) treePath.getLastPathComponent(); -
How to get the parent node of the current node?
Hi all,
i want to get the parent node of the current node and the not the parent of the parent node.
thank you very muchHi,
the parent node of <subnode1-2>29.99</subnode1-2> is (node1), how can do to get <node1> throw <subnode1-2>29.99</subnode1-2> the sub node of <node1>.
As per my understanding the parent node of <subnode1-2>29.99</subnode1-2> is book not the node1.
If you want node 1 as a parent of subnode1-2 than your xml will look like this.
<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>
<book>
<fathernode>Harry Potter</fathernode>
<node1>
<subnode1>29.99</subnode1>
<subnode2>29.99</subnode2>
</node1>
<node2>
<subnode1>19.99</subnode1>
<subnode2>19.99</subnode2>
</node2>
</book>
</bookstore>
and also if you want tom retrive float data than refer following XPATH.
"//book[[price='1000']]/price/text()"
Regards,
Manoj Bilthare
Maybe you are looking for
-
I have one ID that I have used for years for my purchases of Apple's online content (iTunes, MacApp Store, etc). It is the ID associated with my iTunes authorizations on my Macbooks. I have a new ID for use with iCloud, because I wanted a more approp
-
I deleted/changed my old apple ID (from the apple webb site) and I have changed all my Apple products onto the new ID, but they all randomly ask for a password for the old ID (which now will not work and I can't change) the biggest problem is that my
-
Graphic corruption on Dashboard and Volume change
Can anyone help identify this problem? http://imgur.com/XcuZT http://imgur.com/HBV34 In addition to these, sometimes there's also a white block under the menu bar and weird graphic corruptions around shadows. I received a Wacom graphic tablet for Chr
-
How can i star using itunes store?I want to download music and games.How can i download them?Please help me in this regard.............
-
I can´t initialise photoshop because of this Could not load actions because an unexpected end-of-file was encontered. "Could not initialise Photoshop because the preferences file was invalid (it has been deleted)" how can i fix it?