How to search attribute values
How to find the attribute values ("0_0_0_1" ) in the following xml example.
Example:
var xml:XML=
<root>
<country id="0">
<states id="0_0">
<city id="0_0_0">
<village id="0_0_0_0"></village>
<village id="0_0_0_1"></village>
<village id="0_0_0_2"></village>
</city>
</states>
<states id="0_1">
</states>
</country>
<country id="1"></country>
</root>
Do you mean like a depth first search?
package
import flash.display.Sprite;
public class XmlAttributes extends Sprite
protected var xml:XML = <root>
<country id="0">
<states id="0_0">
<city id="0_0_0">
<village id="0_0_0_0"></village>
<village id="0_0_0_1"></village>
<village id="0_0_0_2"></village>
</city>
</states>
<states id="0_1">
</states>
</country>
<country id="1"></country>
</root>;
public function XmlAttributes()
super();
var result:XML = depthFirstSearch(xml);
trace(result.localName());
public function depthFirstSearch(node:XML):XML
for each (var child:XML in node.children())
if (("@id" in child) && (child.@id == "0_0_0_1"))
return child;
else
var result:XML = depthFirstSearch(child);
if(result)
return result;
return null;
The XML tags in the code example above are being stripped - not sure why they cannot be encoded / escaped. It is the XML from your example.
Similar Messages
-
How to get attribute value from standard page ?
Hi,
How to get attribute value from standard page ?
String str = (String)vo.getCurrentRow().getAttrbute("RunId");
But this value is returning a null value ....
Can anyone help me to get this attribute value which is actually having a actual value .getCurrentRow() would always return null if no setCurrentRow() is used.
Please check the page design and understand how many rows of VO are there. You can also use the following to get the row:
vo.reset();
vo.next();
Regards
Sumit -
How to search this value in oracle database to find out the table
Hi expert,
I know there is a value in oracle database, please show me how to search this value in oracle database to find out the table holding this value.
Many Thanks,918440 wrote:
Hi friends,
this question is really practical, I already know there is value from application saved in database, I want to search the whole database to figure out which table the value is contained.write SQL that writes SQL to query every table.
Handle: 918440
Status Level: Newbie
Registered: Mar 2, 2012
Total Posts: 20
Total Questions: 10 (10 unresolved)
why do you waste time here when you NEVER get any answer to any question you post? -
How to get attribute value from an object inside an object in Xpress
Does anyone know how to get an attribute value from an object in Xpress in a workflow? I have an object structured as follows:
<ResourceInfo accountId='mj628' tempId='3483372b787ce7dd:-5d99a0c5:130cb238483:-3600'>
<ObjectRef type='Resource' name='Google Apps'/>
</ResourceInfo>
I need if possible to get the name='Google Apps', which is inside the ObjectRef, so I guess its an attribute value of an object inside an object.If the ResourceInfo object is accessible in a variable, i.e. named "myResInfo", you just have to check the Java API and call the relevant method:
<invoke name='getResourceName'>
<ref>myResInfo</ref>
</invoke> -
How to get attribute values from one view to another
HI all,
Thx in Advance..
I have 2 view like v1,v2.In v1 i used one attribute values from "get single attribute" method.And i need the same values in v2 screen.For this i did in v1 outbound plugs , i mentioned the parameter name . How can i get the same values in v2.Hi chandru ,
you said you declare the parameters in the Outbound Plug of V1. now go to view V2 inbound plug Tab and creat one inbound plug
double click on the plug name .it will navigate you to the event handeler method . Now add the outbound parameter variables in the
parameters
For example : V1firing the navigation plug
a type string " defined in parameter
wd_this->fire_out_to_view2_plg(
a = 'ABCD' " string
you can retrive the value freely in v2 inbound event handeler
a type string " defined in parameter
* set single attribute
lo_el_context->set_attribute(
name = `TEXT`
value = a )." here you will get the 'ABCD'.
regards
Chinnaiya P
Edited by: chinnaiya pandiyan on Jun 23, 2010 7:12 PM -
How to get attribute value of a node
Hi experts
I have a mapped node in my view context from component controller context. This node consists of 2 value attributes inside
Example:
NODE1 -
> Cardinality 1..1, seleciton 1..1
-- x_date -
> type DATS
-- x_years -
> dec3
How do I get the attribute value attr1 and attr2 ??
Here is my code in my view method
DATA: lr_node_info TYPE REF TO if_wd_context_node_info,
l_date TYPE dats,
l_xyears TYPE i.
lr_node_info = wd_context->get_node_info( ).
lr_node_info = lr_node_info->get_child_node('NODE1').
l_date = lr_node_info->get_attribute( name = 'X_DATE' ).
l_xyears = lr_node_info->get_attribute( name = 'X_YEARS' ).
It does not seems to work since it says < the result type of the function method can not be converted into the result type L_DATE>
I try to understand why but not sucessful, please help and thank you for your kindnessHi Dean,
Regading uour problem of reading the attributes value of the context node, you have to use the code wizard. that ia avaliable on the top toolbar when you are inside the View Method
There is option to read context select that radio button option and then thru F4 help
if you can select the node then Code is automatically generated with variable declaration.!!
Like this :
DATA lo_nd_node1 TYPE REF TO if_wd_context_node.
DATA lo_el_node1 TYPE REF TO if_wd_context_element.
DATA ls_node1 TYPE wd_this->element_node1.
DATA lv_x_date LIKE ls_node1-x_date.
DATA lv_x_year LIKE ls_node1-x_year.
navigate from <CONTEXT> to <NODE1> via lead selection
lo_nd_node1 = wd_context->get_child_node( name = wd_this->wdctx_node1 ).
get element via lead selection
lo_el_node1 = lo_nd_node1->get_element( ).
get all declared attributes
lo_el_node1->get_static_attributes(
IMPORTING
static_attributes = ls_node1 ).
lv_x_date = ls_node1-x_date.
lv_x_date = ls_noe1-x_year.
if you can select the attribute then Code is automatically generated with variable declaration.!!
DATA lo_nd_node1 TYPE REF TO if_wd_context_node.
DATA lo_el_node1 TYPE REF TO if_wd_context_element.
DATA ls_node1 TYPE wd_this->element_node1.
DATA lv_x_date LIKE ls_node1-x_date.
navigate from <CONTEXT> to <NODE1> via lead selection
lo_nd_node1 = wd_context->get_child_node( name = wd_this->wdctx_node1 ).
get element via lead selection
lo_el_node1 = lo_nd_node1->get_element( ).
get single attribute
lo_el_node1->get_attribute(
EXPORTING
name = `X_DATE`
IMPORTING
value = lv_x_date ).
Hopes this will helps you.
Regard
Manoj Kumar -
How to search a value in a string
Greate oracle programmers
how are u all doing. i am facing a problem in query. actually i wanna search a value in string using query. just read the piece of code below
DECLARE
LC_VALUE VARCHAR2(100) := '51,52,53,54';
CHK NUMBER;
BEGIN
SELECT 1 INTO CHK
FROM DUAL
WHERE TO_CHAR(51) IN (LC_VALUE);
MESSAGE(CHK);PAUSE;
EXCEPTION WHEN OTHERS THEN
MESSAGE(SQLERRM);PAUSE;
END;
I am unable to find my value in string using query. i have tried the instr function also but the problem with this function is that suppose if i wanna search '1' in '51,52,53' then the value is found in string although there is not as such value as but 51. also i dont want to use the dynamic SQL for this pupose
i m waiting for repsonse please help me out.
Regards
Kamran Ahmed
[email protected]you can do something like
select * from emp
where
'1000,2000,3000,4000,5000,6000,7000,8000,9950' like to_char(sal,'FM999999999990')||',%' or
'1000,2000,3000,4000,5000,6000,7000,8000,9950' like '%,'||to_char(sal,'FM999999999990')||',%' or
'1000,2000,3000,4000,5000,6000,7000,8000,9950' like '%,'||to_char(sal,'FM999999999990') or
'1000,2000,3000,4000,5000,6000,7000,8000,9950' = to_char(sal,'FM999999999990');
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7788 SCOTT ANALYST 7566 19-APR-87 3000 20
7839 KING PRESIDENT 17-NOV-81 5000 10
7902 FORD ANALYST 7566 03-DEC-81 3000 20 -
How to pass attribute values through variables in JSP Custom TagLib
Hi,
Can anybody help me how to pass values through varuables in the jsp custom tag.
i am using JSP custom tag. I am unable to pass attribute values through variables.
<invitation:invdetails invid="<%=invid%>"/> The value is passing as <%=invid%> ,not value of the invid.
But i am getting throuh the fllowing
<invitation:invdetails invid='1' />
Please anybody suggest me how to pass value by using the variable.Hi,
It sounds like you need to set the <rtexprvalue> tag to true in the TLD for your tag. If you do this the tag will read in the value you are trying to pass to it.
dapanther... -
How to inherit attribute values in object tables?
I am trying to implement object inheritance with oracle 10g express. What i have done so far is created some types and subtypes. And some tables based on those types and sub types. So far i have understood that the subtypes inherit the attributes and methods from its super types.
But is there a way to inherit the attribute values from the object table of the super type to the object table of the sub type?
For example: The object O1 , explicitly labeled with (sIPO1 , wIPO1) , also inherits the intended purpose (sIPT 1 wIPT 1) from T1 . Similarly, the object O3 inherits the intended purposes from T3 , O1 and T1 . Note, however, that O2 , which is not labeled, inherits the intended purpose from T2 , but not from O1 nor T1 , as the intended purposes are not inherited through the reference-of relation.
_a visual of the above description [http://picasaweb.google.com/lh/photo/1YBAQbCMQMBmd8oyw9SyNw?feat=directlink]_
How can the types and objects be labeled as mentioned above? And how can these labels be made inheritable by the subtypes and objects based on those subtypes?
Possible Solution*
Only way which i could think of is using relational tables, like this: type_label(type_name, label1, label2) and a similar table table_label(table_name, label1, label2) for labeling the object tables. Then refer to these labels through some java programming. Will this be a right approach. I doubt that this will defeat the very intentions of the object database. And i hope there is a straight solution in Object Relational methods instead of java programming.
nested tables and vararrays... will using them help solving the above problem some how?From those examples i can see that although the nested tables will have the super type attributes and values with them, if i have to change those attribute values the values in the whole table gets changed.
is it possible to change the super type attribute values which is corresponding to the nested table values alone and not disturb the over all table? -
How to assign attribute values to a range of BPs ????
Hi All,
While assigning attribute values to business partners we can specify at the most one business partner at a time.
My requirement is to assign attribute values to a range of business partners at a time.
Is there any customization setting where I can do this OR
do I write a report for this ?
Regards,
AshishHi Ravi,
Thanks for replying !!!!
But, CRMD_MKT_TOOLS doesnt seem to solve my problem.
I have a range of BPs (e.g 8000101 to 8000199).
And I have a list of attribute sets with values as follows:-
Attribute Set Values
Age group 1 - 10, 11 - 20, ....
Reading habits Business, sports, news.....
Profession Doctor , Engineer .......
and so on..
Now in transaction CRMD_PROF_BP, I can choose a single BP (e.g. 8000101) and assign it an attribute set(e.g. Profession) and value (Doctor).
But, my requirement is to specify an entire range of BPs(8000101 to 8000150) and assign attribute set and values to that entire range.
Now how do I achieve this ???????
(target groups would be created only after attributes have been assigned)
Regards,
Ashish -
How to pack attribute values in a soap request?
Hello,
We are trying to make an external webservice call through GWWS.
The (soap) request contains an element which looks like:
+<Request Version="1.0" RequestID="11111111" TypeOfRequest="type1" Echo="false">+
+<Info>+
+<Account xmlns="http://something.com/Domain1/">ABCD1234</Account>+
+</Info>+
+</Request>+
We had created this soap request based on the WSDL provided to us by the webservice host.
We used a tool (like soapui) to generate the the above request.
To be able to make a service call to this webserive, we used the wsdlcvt to generate the fml32 field headers as:
wsdlcvt -i <provided wsdl> -o <baseoutput name>
However we could not find a way to pack in the the information related to the attributes.
In vain, we tried to use the option [-m] with wsdlcvt.
Since there are no field headers generated by the wsdlcvt for the attributes, we do not know how do we put values of "Version", "RequestID", "TypeofRequest", "Echo" attributes of the "Request" element in the webservice request.
Are we missing something here?
How can we populate/put information in the attributes of an element in a request?
Thank you.
Sincere Regards,
MrugendraHello Xu,
We have a simple test wsdl as follows
+<?xml version="1.0" encoding="UTF-8"?>+
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://new.webservice.namespace" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://new.webservice.namespace">+
+<wsdl:types>+
+<xsd:schema targetNamespace="http://new.webservice.namespace" xmlns="http://new.webservice.namespace" elementFormDefault="unqualified" attributeFormDefault="unqualified">+
+<xsd:complexType name="Service_Type">+
+<xsd:sequence>+
+<xsd:element name="DateTime" type="xs:dateTime" nillable="true">+
+</xsd:element>+
+<xsd:element name="UUID" type="xs:string" nillable="true">+
+</xsd:element>+
+<xsd:element name="Status" nillable="true" minOccurs="0" maxOccurs="unbounded">+
+<xsd:complexType>+
+<xs:sequence>+
+<xs:element name="StatusDesc" type="xs:string">+
+</xs:element>+
+</xs:sequence>+
+<xsd:attribute name="StatusTyp" type="xs:string" use="required">+
+</xsd:attribute>+
+</xsd:complexType>+
+</xsd:element>+
+</xsd:sequence>+
+<xsd:attribute name="Version" type="xs:string" use="required">+
+</xsd:attribute>+
+<xsd:attribute name="Name" type="xs:string" use="required">+
+</xsd:attribute>+
+</xsd:complexType>+
+</xsd:schema>+
+</wsdl:types>+
+<wsdl:message name="GetServiceReq">+
+<wsdl:part name="ServiceReq" type="tns:Service_Type"/>+
+</wsdl:message>+
+<wsdl:message name="GetServiceRes">+
+<wsdl:part name="ServiceRes" type="tns:Service_Type"/>+
+</wsdl:message>+
+<wsdl:portType name="ServicePortType">+
+<wsdl:operation name="getService">+
+<wsdl:input message="tns:GetServiceReq"/>+
+<wsdl:output message="tns:GetServiceRes"/>+
+</wsdl:operation>+
+</wsdl:portType>+
+<wsdl:binding name="ServiceBinding" type="tns:ServicePortType">+
+<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>+
+<wsdl:operation name="getService">+
+<soap:operation soapAction="getService"/>+
+<wsdl:input>+
+<soap:body use="literal"/>+
+</wsdl:input>+
+<wsdl:output>+
+<soap:body use="literal"/>+
+</wsdl:output>+
+</wsdl:operation>+
+</wsdl:binding>+
+<wsdl:service name="Service">+
+<wsdl:port name="getService" binding="tns:ServiceBinding">+
+<soap:address location="No Target Adress"/>+
+</wsdl:port>+
+</wsdl:service>+
+</wsdl:definitions>+
When we create a soap request (Using soapiu) from the above wsdl we get:
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">+
+<soapenv:Header/>+
+<soapenv:Body>+
+<ServiceReq Version="?" Name="?">+
+<DateTime>?</DateTime>+
+<UUID>?</UUID>+
+<!--Zero or more repetitions:-->+
+<Status StatusTyp="?">+
+<StatusDesc>?</StatusDesc>+
+</Status>+
+</ServiceReq>+
+</soapenv:Body>+
+</soapenv:Envelope>+
As you can see that ServiceReq has attributes Version and Name
However, wsdlcvt (with -m) creates the following fml32 headers
DateTime 1 string - fullname=DateTime, schema=xs:dateTime
ServiceReq 2 fml32 - fullname=ServiceReq, schema=tns:Service_Type
ServiceRes 3 fml32 - fullname=ServiceRes, schema=tns:Service_Type
Status 4 fml32 - fullname=Status, schema=tns:Status
StatusDesc 5 mbstring - fullname=StatusDesc, schema=xs:string
UUID 6 mbstring - fullname=UUID, schema=xs:string
The points that we did not understand:
1. You mentioned: "SALT will map the *whole* request to FLD_MBSTRING
It is not so in this case.
Did we miss something?
2. Going by your suggestion in your last reply how do we create the FML32 buffer (specifically for the "ServiceReq" element, with attributes) for the sample we have?
Thank you.
Sincere Regards,
Mrugendra -
How to retrieve attribute value from my JSP?
My servlet needs to redirect to a JSP. Before that, I set an attribute value.
getServletContext().setAttribute("filename",templateFile);
RequestDispatcher rd = getServletContext().getRequest...
rd.forward(request, response);
In my JSP, this is how I want to retrieve it:
<%
String filename = (String)request.getAttribute("filename");
if (filename != null)
%>
<%= filename %>
<%
else
%>
it is null
<%
%>
But the value is always null? Do I need any tag or declaration on the top of my JSP?Can i set attribute for list and get that list using request.getAttribute() in jsp?
ex.
in action
List plist;
plist = ...
request.setAttribute("plist", plist);
to get this value in jsp
<%
List plist = (List)request.getAttribute("plist");
%>
is this code is allowed? -
How to extract attribute value from an XML
I have column where all my diffrent structures of XML's are getting stored. I want extract a patticular attribute value from all the XML’s. Can any one help me with this?
Thanks,
swagathKindly refer to the EXTRACTVALUE function in your online documentation and refrain from further doc questions.
Sybrand Bakker
Senior Oracle DBA -
How to extract Attribute Value from a DBC file with LabWindows and NI-XNET library
Hi all,
For my application, i would like to feed my LabWindows CVI Test program with data extracted from *.dbc file (created by another team under Vector CANdb++).
These files contains all CAN frame definition
and also some extra information added to :
Message level,
Signal level,
Network Level
These extra information are set by using specific ATTRIBUTE DEFINITIONS - FUNCTIONALITY under Vector CANdb++
The opening of the DataBase works under NI-XNET DataBase Editor as in LabWindows using: nxdbOpenDatabase ( ... )
No attribute seems be displayable under the NI-XNET DataBase Editor (it's not a problem for me)
Now, how, using the NI-XNET API and CVI, be able to extract these specially created attributes ?
Thanks in advance.
PS : In attached picture, a new attribute called Test_NI, connected to a message
Attachments:
EX1.jpg 36 KBHi Damien,
To answer your question on whether the XNET API on LabWindows/CVI allows you to gain access to the custom attributes in a DBC file, this is not a supported feature. The DBC format is proprietary from Vector. Also, custom attributes are different for all customers and manufacturers. Those two put together make it really difficult for NI to access them with an API that will be standard and reliable.
We do support common customer attributes for cyclic frames. This is from page 4-278 in the XNET Hardware and Software Manual :
"If you are using a CANdb (.dbc) database, this property is an optional attribute in the file. If NI-XNET finds an attribute named GenMsgSendType, that attribute is the default value of this property. If the GenMsgSendType attribute begins with cyclic, this property's default value is Cyclic Data; otherwise, it is Event Data. If the CANdb file does not use the GenMsgSendType attribute, this property uses a default value of Event Data, which you can change in your application. "
Link to the manual : http://digital.ni.com/manuals.nsf/websearch/32FCF9A42CFD324E8625760E00625940
Could you explain us the goal of this attribute, and what you need it on your application.
Thanks,
Christophe S.
FSE East of France І Certified LabVIEW Associate Developer І National Instruments France -
How to search for value records for a specific period of time?
Hi,
I am building an application where I need to use BDB to store tons of call records.
In the call records, I have the following fields:
1. from-caller
2. to-caller
3. begin-time
4. end-time
5. account-code
6. user-code
I want to use end-time's microsecond representation to serve as the Key.
So, how can I do the following data lookup?
1. Search for all Value records between 2009-10-11 to now()
2. Search for all Value records between 2009-10-11 to now() with account-code = 100
3. Search for all Value records between 2009-10-11 to now() with account-code = 100 and user-code=10
Is there any similar examples out there that I can refer to?
Thanks,
JBHi,
Btw, my operation is mostly:
1. Append call records
2. Search call records
3. Remove ending records that are older than XX days
Please kindly advise on how I should best structure the data to meet this purpose.
Thanks,
JB
Maybe you are looking for
-
Here's what I have: Synology DS212J Airport Extreme Base Station Gen 4 running latest firmware Running Lion Here's what I have done: Changed NAS to use Manual Configuration. IP set to: 10.0.1.14 (after reading some forums here and there I have now ch
-
Creating New Sales Order with Total=$0.00
B1 is not allowing me to save a Sales Order with a DocTotal of zero. Is there a setting to allow this? Something I missed in admin, maybe?
-
Designer.xml Fatal Parsing Error
I ran into a little snag working with a new web page. When I fired up DreamWeaver CS4 it gave a fatal parsing error associated with the designer.xml file. DreamWeaver would sit and spin its wheels and would not load. After trying several things to fi
-
Thousands of grey thumbnails with duplicate ._IMG* filenames?
Hi I have iPhoto 9.5.1 for Mavericks and have 10's of thousands of grey thumbnails that I cannot view. When I check the info on these they all show with a ._ prefix. E.g. "._IMG_0041", when I search for IMG_0041 I can see the photo fine. I have gone
-
hi can any one help in making the field email as a mandatory in su01 t-code and kindly help with process where to go and what are the steps do i take to make the field mandatory