How to get First node in an XMLList as String.
Hello I have this XMLList:
<content>
<TextFlow color="#000000" columnCount="2">
<p>One</p>
</TextFlow>
</content>
I need to get <textFlow> as an XMLList and as String.
The Xml File is organized like so:
<items>
<item>
<content>
<TextFlow color="#000000" columnCount="2" >
<p>Text goes here</p>
</p>
</TextFlow>
</content>
</item>
<item>
<content>
<TextFlow color="#000000" columnCount="2" >
<p>Text goes here</p>
</p>
</TextFlow>
</content>
</item>
</items>
I was able to reduce it to:
<content>
<TextFlow color="#000000" columnCount="2" >
<p>Text goes here</p>
</p>
</TextFlow>
</content>
</content>
</item>
<item>
<content>
<TextFlow color="#000000" columnCount="2" >
<p>Text goes here</p>
</p>
</TextFlow>
</content>
That resides in an XMLList with:
flash_xml = XML(e.target.data);
var TextFlownode:XMLList = flash_xml.item[i].content;
I cant get further, and the array U mentioned results empty, maybe its Because of the name TextFlow that colides with the Class I dont know.
Similar Messages
-
Hello All,
I am facing Problem in SharePoint Designer Workflow. The Problem is that while replacing some subtstring with Space from a string which contains item like {Test, Test, Test, Test}, It replaces all items.
Below two line we are using in Workflow.
Can any body suggest some soultion for Finding first ouucrence of ", " so that we can replace only first value from string not all. When String values are different then getting proper values but if String values are same with comma
seperated then it replace all values.
Please some body help and your help will be heighly appriciable.
Thanks in Advance.
Thanks,
Vivek Kumar PandeyHave you tried to use Regular Expressions instead of Replace?
This post is my own opinion and does not necessarily reflect the opinion or view of Slalom. -
How to get each node in tree?
how to get each node in tree?
Message was edited by:
NikisinProblemhow to get each node in tree?
Since (as far as I know) treeNode is an interface, the real question to me is how are you implementing your treeNodes? Are you overriding the toString() method? -
How to get the node id of the content shown from campaign
Hi
Can any one please tell how to get the node id of the content shown by the campaign
in jsp
ThanksOne option is to define a custom ad renderer, which is registered with the proper mime-type.
The campaign would run your renderer if the campaign retrieved a node with a binary of the proper registered mime-type.
This allows you to insert yourself into the call chain for the node rendering. You can access the nodeID at that point (and do the typical rendering-- providing a URL for the ShowPropertyServlet)
-Steve -
How to get the node value of payload
Hi
The null is returned when I use the following code to get the User_ID element in the payload, but there are values in the User_ID element of the payload
Task task_test = wfSvcClient.getTaskQueryService().getTaskDetailsById(wfCtx, taskId);
System.out.println("the payload value is " + task_test.getPayloadAsElement().getElementsByTagName("User_ID").item(0).getNodeValue());
How to get the node value of payload ? any suggestion?
Thanks
JaysonHi Jayson,
Try:
System.out.println("the payload value is " + task_test.getPayloadAsElement().getElementsByTagName("User_ID").item(0).getFirstChild().getNodeValue());
So add the getFirstChild() call in between.
If this works, maybe consider using JAXB to marshall the payload details to POJO's. This will make reading the payload details much easier.
Regards, Ronald -
How to create a node-typed XmlValue from a String with Java?
Hi all,
It's already been a while since I'm trying to get how to construct a node-typed XmlValue from a String value but I keep getting different exceptions no matter what method I try.
I started with the first way that came to my mind:
XmlValue value = new XmlValue("<element/>"); //Even though the String represents a valid xml node, calling value.isString() returns true.
then I thought ok, so I should maybe use the typed constructor:
XmlValue value = new XmlValue(XmlValue.NODE, "<element/>"); //_It does not work either, calling value.isNull() returns true.
I also tried with the rest of types (XmlValue.DOCUMENT, XmlValue.DOCUMENT_NODE, XmlValue.ELEMENT_NODE.....) and it did not work either with any of these.
Fiinally I saw that you can construct a new XmlValue from a XmlDocument but I cannot get a XmlDocument unless I phisically create one, which obviously wont be a very good idea.
So I'm definitely stuck with these, I would really appreciate if someone could tell me how to do this...
Thanks in advance,
Pablo Pareja
PS: I'm using Berkeley dbxml 2.5.13Hi Pablo,
XmlDocument doc = manager.createDocument();
doc.setContent("<bla/>");
XmlValue val = new XmlValue(doc);
System.out.println(val.getType() == XmlValue.NODE);
System.out.println(val.asString());Try this. It doesn't create physically (that is in the container) a document. The output of this piece of program:
true
<bla/>Hope it helps
Vyacheslav -
How to get correct node in JTree with DISCONTIGUOUS_TREE_SELECTION mode?
The following code creats a JTree with DISCONTIGUOUS_TREE_SELECTION mode. When select a single node, the node's name is printed correctly as expected. However, in Window environment, after select one node, if holding the ctrl key and select a different node, the program still prints out the name of the first selected node although both nodes are highlighted. Can some one tell me how to get the name of the second (i.e. the last) selected node printed?
Thank you very much!
import javax.swing.*;
import javax.swing.tree.*;
import javax.swing.event.*;
import java.io.*;
public class TestTree extends JFrame {
JTree tree;
public TestTree() {
super();
setBounds(0,0,500,500);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
tree = new JTree();
getContentPane().add(tree);
TreeSelectionModel model = new DefaultTreeSelectionModel();
model.setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
tree.setSelectionModel(model);
tree.addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent e) {
Object obj = tree.getLastSelectedPathComponent();
System.out.println(obj.toString());
public static void main(String [] args) {
TestTree test = new TestTree();
test.show();Hi!
Try this, maybe it's what you want?
/Smedman
public void valueChanged(TreeSelectionEvent e)
TreePath[] paths = tree.getSelectionPaths();
for (int i = 0; i < paths.length; i++)
System.out.println(paths.getLastPathComponent()); -
How to get the Node Value from XmlValue result?
Hi ,
I am not able to get the Node Value from the result. In my XQuery im selecting till a Node, if i change my query as
collection('PhoneBook')/phone_book/contact_person/address/string()", qc);
im getting the node value, but here the problem is its not a Node so i cannot get the Node name.
So how can i get the Node Name and Node value together?
any help please ????
XML :
<?xml version="1.0" encoding="UTF-8"?>
<phone_book>
<contact_person>
<name>
<first_name>Michael</first_name>
<second_name>Harrison</second_name>
</name>
<address city="yyyyy" pincode="600017" state="xxxxx">
176 Ganesan street, Janakinagar, alwarthirunagar
</address>
</contact_person>
<phone_number type="mobile">9881952233</phone_number>
<phone_number type="home">044-24861311</phone_number>
<phone_number type="office">080-12651174</phone_number>
</phone_book>
Code:
XmlQueryContext qc = manager.createQueryContext();
XmlResults rs = manager.query
("collection('PhoneBook')/phone_book/contact_person/address", qc);
while(rs.hasNext()){
XmlValue val = rs.next();
System.out.println(val.getNodeName() + " = [ " + val.getNodeValue() + " ] ");
Output
address = [ ]You are right, this seemed un-intuitive to me too, but I finally understood how it's done.
The "value" of a node is actually the total amount of text that is not contained in any of the node's child nodes (if any). So a node with child nodes can still have text value.
To get the 'value' of an element node, you must therefore concatenate the values of all children of type "XmlValue::TEXT_NODE", of that node. Try it.
In your example, the <address> node has no child elements, my guess is that BDB XML stores the address string "176 Ganesan street, Janakinagar, alwarthirunagar" inside a child node of <address> node (of type XmlValue::TEXT_NODE) because you wrote the string on a separate line. -
How to get first 10 records from the database using JSP
i want ot get first 10 records from the database and then after clicking the next button in the page,it must show the next precceding 10 records from the database.i am getting the first 10 records .but how to post to the same page to get another preceeding 10 record.
Search the forums - this has been asked a lot. I usually recommend experimenting with tops and order bys until you're satisfied.
Kind regards,
Levi -
HOw to get parent node name value through its child node?
Hi,
Experts,
I am able to get child node name values but according to attribute name value i want to get its parent name value how to achieve that. For that i have used If_Ixml_element->Get_parent. Please pass some idea on it.
Thanks in advance,
Shabeer ahmed.Hello Shabeer
I think the coding should be straightforward:
DATA: lo_element TYPE REF TO if_ixml_element,
lo_child TYPE REF TO if_ixml_node,
lo_parent TYPE REF TO if_ixml_node.
" NOTE: LO_ELEMENT holds your child node
lo_child ?= lo_element.
lo_parent = lo_child->get_parent( ).
Regards
Uwe -
How to get first row in query output
HI,
query:
select a.LOGIN,s2diq(a.created_t)
from service_t a,account_t b
where a.ACCOUNT_OBJ_ID0=b.POID_ID0
and b.ACCOUNT_NO='80161001'
and b.status =10100
output of query:
80161001 6/25/2011 2:00:43 AM
80161001_1 10/16/2011 9:10:44 PM
80161001_2 10/16/2011 9:36:02 PM
80161001_3 10/16/2011 10:23:07 PM
80161001_4 10/17/2011 9:41:34 PM
80161001_5 10/17/2011 9:45:59 PM
80161001_6 10/17/2011 10:26:27 PM
how to get only first row only in quaery:
Thanks
Prakash
Edited by: prakashdba on Apr 7, 2009 3:09 AMThen how about this
select * from
(select a.LOGIN,s2diq(a.created_t) secondcolumn
from service_t a,account_t b
where a.ACCOUNT_OBJ_ID0=b.POID_ID0
and b.ACCOUNT_NO='80161001'
and b.status =10100
order by COLUMN_NAME) A
where rownum=1; -
How to get first row from View Object cache.
hi,
I am using Jdeveloper 11.1.1.6
can we get first row from View Object cache??
Thanks in Advance.
Best
ShashidharHi Frank,
Thanks for reply!!
My case is:
I have a Query based ViewObject.
One of the field is LOV and remaining fields are in ADF table. the LOV field is out side ADF table when i insert first record in ADF table and i choose LOV filed the value is selected.
when i create second row LOV value got refreshed because both are in same VO.
I need to get the LOV value of first row and set same value to second Row.
Shashidhar -
How to get a Node with Empty Text in a JTree
Hi,
I want to get the node which does not have any text and I want to get it when the tree expands NOT when the user selects a node( thats pretty easy)
Thankx in advance...What do you mean by "get"?Since I would like to remove such a node therefoe I would like ot kow if such a node is in my JTree
Thankx -
How to get first item of hashMap w/out knowing the key
Hi
can someone tell me if there is a way to get first item from a hashMap when you dont know what the key is. as the get method expects a defined 'key'
reason I am asking this:
I am using struts 2 UI <s:radio> tag. this tag takes a hashmap and creates radio maps. it has a 'value' attribute and if something is passed to this attribute then that radio button is checked by default. the list that contains radio buttons is created dynamically so i dont know what is actually in the hashMap key's. but i do know that key's are string.
so just wondering if there is a way to get first item from a hashmap without knowing the key...thanks for the quick reply.
posted in java forums because thought it was a java API/workaround question. gave a little history because i didnt want people to start questioning my use of HashMap for this purpose..
anywhose..i've found a workaround.
If someone has a similar problem:
as the hashmap is being populated dynamically....set a String member of class to contain the first key thats being put in the hashmap. then have struts tag pick up that value.
also, through your post and reading hashMap api...its usefull to know that hasMaps do not gurantee the order of elements in it. So now I am using a TreeMap.
Thanks -
How to get a node selection in a table using Arraylist
Hi All,
Can someone help me with the code to get the node selected value from a table and then set that values to input fields?
Early response would be much appreciated.
Thanks
UdayDear Uday,
Please user the isMultiSelected inside the for loop and iterate through all the rows selected to set in the arraylist.
Refer to this might help: delete records from table
if(wdContext.node<Node Name>().size()>0)
// Iterate through the context Node
for(int i=0;i<wdContext.node<Node Name>().size();i++)
if(wdContext.node<Node Name>().isMultiSelected(i)) {
// Set the ArrayList here for the Lead Selected elements of the Table multiple selected rows
}else {
// Set the ArrayList here for the Lead Selected elements of the Table single selected rows
Best Regards
Arun Jaiswal
Edited by: Arun Jaiswal on Dec 10, 2011 2:04 PM
Maybe you are looking for
-
Where can i get an apps to install photoshop 5.5 on windows 8
anyone know where to get this apps thanks
-
Strange stack trace from clicking on chart in javafx
Hi folks - I want to be able to have an action occur when I click on a lineChart node in javafx (2.2). Before even implementing such behavior, though, I notice that I am getting a pileup of errors when I click on the chart window in my application: j
-
Technical Systems Not appearing in Managed Sytem Configuration
Hi Experts, I am doing Solman_setup after upgrade.I am in Managed system configuration step.I have synchronized Abap and java systems through RZ70 and NWA respectively to Solamn Local SLD and hence they are also appearing in LMDB (technical system ta
-
Subtotal in trailer on conditional break (PDF Form)
A row put by conditional breaks as trailer ( with condition "Items[-1].VPROC ne Items.VPROC" for example). How to calculate subtotal on some field in this row? Any example?
-
Need help to find out where can I download PS cs5 extended?
I had ps cs5 on a computer that died and now I can't find it so I can download it to my new computer. Can someone help? Thanks