Document, getting an Element by its Name, not Id
Is it possible to get an Element from a Document object by its Name and not its Id. I know there's a getElementById() but there is no getElementsByName(), although there is a getElementsByTagName(), too bad that doesn't help me.
You can't because it's ambiguous. An element can only have one property with a given name, but (depending upon its spec) it can contain any number of elements with a given name.
Which is why there's only a method to return a list.
Why isn't that sufficient?
Similar Messages
-
While importing Deski document getting message box as universe is not found
While importing Deski document getting message box as universe is not found. How to suppress the messagebox and import the document. using BO .net sdk.
So is the Universe there?
Sincerely,
Ted Ueda -
i have purchase iphone4 from gray market,it is not factory unlock,how can i get it factory unlock,
its safari not working and it is not showing drive in my computer.iPhones are sold in carrier-locked and unlocked versions. If the phone has a carrier lock on it, you must contact the carrier to have it removed (you probably need to bring the phone to the carrier for the process). If you don't know the carrier, you won't be able to get it unlocked. US carriers will not remove the carrier lock and it cannot be removed.
How is Safari behaving that makes you say that Safari is not working? The lock status of the phone won't affect Safari, except that if the phone is locked and you aren't using the carrier (and SIM provided by the carrier) to which it is locked, then you can't use the phone or 3G service, only Wi-Fi.
The iPhone should not appear as a drive on your computer, so there's no error there. -
How to access an element using its name or id if it is not a class variable?
I am trying to retrieve the element I added to my UI in a different function. I am using actionscript 3. I know I can put the variable into a class variable, so it can be access anywhere in the class, but I have too many elements. Is there anyway I could access them without putting them into class variable?
Thanks.
public class Test extends SkinnableContainer{
// private var image:Image; <-- I try not to do this, too messy
private function func1() {
var image:Image = new Image();
addElement(image);
private function func2() {
var image:Image = /* how to get the element from my UI without putting into class variable */Here is what works for me:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
creationComplete="init()"
minWidth="955" minHeight="600">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import spark.components.Image;
private var image:Image;
private function init():void
image = new Image();
addElement(image);
trace(this["image"]);
]]>
</fx:Script>
</s:Application> -
Get ItemGroupCode by looking its name via SDK not SQL
Hi,
Is it possible to get an ItemGroupCode by searching the GroupName ?
with an ItemGroups I just have GetByKey(GroupCode)
Ofr course if I'm forced to use a RecordSet I will but if there's a way to iterate through the GroupName I would prefer it
Thank youHi Marc Roussel,
Items Group object have Browser function that will return you DataBrowser object which can be used for iteration.
HTH
B Ravi Shankar -
Why do I get this error? Nano (name) not found import pod cast yet on desk?
Check out the error yet look at arrows, clearly the ipod is on the desk - it synchs everything except this pod cast that I haven't finished (is there also a setting to save podcasts not finished?)..
Thanks.
http://img372.imageshack.us/my.php?image=ipoderrorzh2.jpgAnyone Bueheller, anyone...
-
How to get xml Element , data and its Childs
hi,
I am trying to get entire Element and its childs depending on condition.
suppose
if(doc.element.name== "despatch"){
// here i want entire despatch element with data and childs and copy into one string like
// eg: String dsp = <despatch><name>body1</name> <value>value1<value>
</despatch>
<?xml version="1.0">
<handler>
<name>header1</name>
<value>value1</value>
</handler>
<despatch>
<name>body1</name>
<value>value1<value>
</despatch>
<gov>
<name>env</name>
<value>value1</value>
</gov>I managed to get number of elements depending on the Element name but i need to get the entire block.
nodeList = document.getElementsByTagName("despatch").item(0).getChildNodes();
for(int i=0;i<nodeList.getLength();i++){
System.out.println("i :"+document.getElementsByTagName("m:Security").item(i));
}any kind of help is appreciated.
Han.
Edited by: HANRAM on Apr 24, 2008 2:48 AMHi Kartik,
This one is similar to my question to print and email invoice at same time. I pass itcpo-tdgetotf = 'X' in order to get otfdata and send email with the attachment of otfdata.
Now I have data in otfdata, but when I call print_otf function, I clear out itcpo-tdgetotf, and passed
itcpo-tddest = device_type but I still get error message said 'Handler not valid for open spool request'.
Can you give me a working example that you have otfdata table and print data from that table. I also post my question on other thread
submit report and export to memory
thanks -
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 -
Error 32812 (Specified Tag Name not Defined) from FP Read
I built an application using LabVIEW 7.1 and FieldPoint 4.1. It
performed well until about a week ago. Suddenly, I started getting
error 32812 (Specified Tag Name Not Defined) when doing an FP Read to
read all the channels on an FP-RLY-420. This is installed at a
client's site, but my client assures me that nothing changed in the
computer configuration. There is a dual serial card installed (SIIG
Cyberserial DualPCI dual 16550
RS232 Serial I/O Card), which does seem to cause problems (mouse jumps
erratically), and I wonder if this card could be contributing to the
problem, but I'm not sure why I would get the specific error message
I'm getting.
In looking for info on the problem, I did find an article on
registering the MIS files, but I have tried selecting "Find Devices"
through MAX while logged on as an admin, and the error still occurs.
If anyone has any ideas as to what could be causing the problem, it would be greatly appreciated.
Thank you,
JasonHello Jason,
I think that the error you are seeing could be caused by either 1) a
mismatch between the tag names saved on your computer and the actual
channel names on the module, or 2) a problem with how the serial port
is communicating with the module (only applies if you are using a
serial communication module, as opposed to an Ethernet module).
For the first issue, you have already tried to reconcile any
differences in tag names by reregistering the MIS files. Since
that didn't work, I would recommend trying to recreate your entire
FieldPoint system in Measurement & Automation Explorer (MAX),
including the IAK file. I know it is kind of extreme, but I would
recommend just deleting your FieldPoint configuration in MAX, deleting
the IAK file, and resetting the address and recreating your
configuration.
I think that troubleshooting a serial communication problem could be a
little more difficult. I would recommend browsing through the
following documents for some possible troubleshooting ideas.
FieldPoint Serial Network Module Common Problems
Let us know if this solves the problem or if you have any further question.
Regards,
Travis Gorkin
Applications Engineering
National Instruments
www.ni.com/support -
How to get child elements of element in xml?
public class Test {
public static void main(String[] args) {
Document doc = null;
System.out.println("!!!");
try {
// TODO if path is 'c:' then make it 'c:/'
doc=DocumentBuilderFactory.newInstance().newDocumentBuilder().parse("test.xml");
} catch (Exception e) {
System.out.println("exception");
Element root = doc.getDocumentElement();
NodeList dsList = root.getElementsByTagName("GenericDataSource");
Element e = (Element)dsList.item(0);
NodeList nl = e.getChildNodes();
System.out.println(nl.getLength());
Node n = nl.item(0);
Element ee = (Element)n;
}i want to get child elements. but its throwing exception on typecasting. can u tell me why?thanks for the info.
i got 2 solutions
SOLUTION 1:
public class Test {
public static void main(String[] args) throws Exception {
Document doc = null;
System.out.println("!!!");
try {
// TODO if path is 'c:' then make it 'c:/'
doc=DocumentBuilderFactory.newInstance().newDocumentBuilder().parse("test.xml");
} catch (Exception e) {
System.out.println("exception");
Element root = doc.getDocumentElement();
NodeList dsList = root.getElementsByTagName("GenericDataSource");
Element e = (Element)dsList.item(0);
NodeList nl = e.getChildNodes();
int count = 0;
System.out.println(nl.getLength());
for(int i=0;i<nl.getLength();i++){
Node n = nl.item(i);
//System.out.println(n.getClass().getName());
//System.out.println((Element)n);
if(n instanceof Element){ // this checks for node type
count++;
System.out.println("Element "+(Element)n);
SOLUTION 2: :
XPath xpath = XPathFactory.newInstance().newXPath();
InputSource inputSource = new InputSource("test.xml");
NodeList nodes = (NodeList) xpath.evaluate("//GenericDataSource/*", inputSource, XPathConstants.NODESET);
System.out.println(nodes.getLength());
System.out.println((Element)nodes.item(9)); -
Data source name not found and no default driver specified.
Hi all,
I am using Microsoft Accessas as backn'd. when I am starting my Presentation Services I am getting this error> Data source name not found and no default driver specified.Your presentation services configuration file
$SADATADIR/web/config/instanceconfig.xml
contains an entry DSN which is the connection to the bi server
then inside your RPD(s) loaded by the bi server
you will have various connection pools in the physical layer
which connect to physical data sources such as MS Access
you can test a physical database connection
by right clicking a physical table
then "View Data" or "Update Row Count" -
Cannot sign in to trial account (user name not recognized)
Hi all,
I registered for a trial account of Windows Intune yesterday, but after submitting the registration request, the website told me something went wrong during account creation and threw an error (1004). I tried registering again but it tells me the account
is already registered.
Now, when I try to sign in to Windows Intune with my credentials, I get the following message:
User Name Not Recognized
This user account is not authorized to use Windows Intune. Contact your system administrator if you think you have received this message in error.
I am unsure what went wrong, but as I would really like to start trying out the platform, any help is very much appreciated!
Thank you and kind regards!Hi,
I would either create a new trial account as it seems that something went wrong with your registration of your first account or contact Microsoft Support and see if they can assist you with the account you have created.
regards,
Jörgen
-- My System Center blog ccmexec.com -- Twitter
@ccmexec -
My MacBook Pro keeps making copies of a document that I am trying to save. I don't want to duplicate the file. I only want to save it on both my hard drive and my external hard drive. I do not want to change its name for every save, which the computer seems insistent on doing. Help!!
11lizzyp wrote:
can't be saved because the file is read-only.
I did not create the file to be read-only. I created to be able to continue to add to it as I work on it.
More on versions here:
http://support.apple.com/kb/ht4753
local snapshots:
http://support.apple.com/kb/HT4878
Sounds like a permissions problem ie read only.
If running repair permissions from your DiskUtility.app does not sort it,
Someone should jump in here with erudite and concise fix. -
How to get selection screen elements and its table reference of a report ?
halo experts
How can I get selection screen elements and its table reference of a report ? . I tried rs_refresh_from_select_options. But I am unable to get the table and field it is referring to
For eg if my selection screen 1000 is
parameters: p_carrid type spfli-carrid,
select-options :s-_connid type sflight-connid.
is there any Fm or method which gives me what are the screen elements( p_carrid and s_connid ) and what table( splfi and sflight ) and field ( carrid and conid )it is referring to ?The following code is an example of how you might dynamically determine all your PARAMETERS and SELECT-OPTIONS variables at run time. The PARAMETERS and SELECT-OPTIONS only point to a dictionary element--not a specific table. Even though you may say "spfli-carrid" or "sflight-connid", the data type really references the dictionary type and not a specific table/structure.
REPORT ZTEST_PROG.
TABLES sflight.
DATA:
screen_tab TYPE STANDARD TABLE OF screen,
wa_screen TYPE screen,
scrn_nm TYPE string,
scrn_leftover TYPE string,
l_type TYPE REF TO cl_abap_typedescr,
typ_nm TYPE string,
typ_pre TYPE string.
FIELD-SYMBOLS <fs_data> TYPE ANY.
PARAMETERS p_carrid TYPE spfli-carrid.
SELECT-OPTIONS s_connid FOR sflight-connid.
INITIALIZATION.
LOOP AT SCREEN.
IF screen-group3 = 'PAR'
OR screen-group3 = 'LOW'.
APPEND screen TO screen_tab.
ENDIF.
ENDLOOP.
START-OF-SELECTION.
LOOP AT screen_tab INTO wa_screen.
ASSIGN (wa_screen-name) TO <fs_data>.
l_type = cl_abap_typedescr=>describe_by_data( <fs_data> ).
IF wa_screen-group3 = 'LOW'.
SPLIT wa_screen-name AT '-' INTO scrn_nm scrn_leftover.
TRANSLATE scrn_nm TO UPPER CASE.
ELSE.
scrn_nm = wa_screen-name.
ENDIF.
SPLIT l_type->absolute_name AT '=' INTO typ_pre typ_nm.
WRITE:
/ 'Screen Name: ', scrn_nm,
/ 'DDIC Type: ', typ_nm.
ENDLOOP.
When you get into defining internal tables you can determine those at run time with cl_abap_structdescr. The following is an example of how you might do that. You can loop through the "components_table" and evaluate each field of the structure in this way.
DATA: structure_reference TYPE REF TO cl_abap_structdescr,
components_table TYPE abap_compdescr_tab,
components_structure LIKE LINE OF components_table.
structure_reference ?= cl_abap_structdescr=>describe_by_data( any_structure ).
components_table = structure_reference->components.
I don't know if this answers any of your questions but I hope that some of it is useful. -
Use DOM to get the element value of XML document?
I can not to use the method getNodeValue to get the element value of XML document. How can I do for it?
For example, for element
<address>125 Smith Avenue</address>
how to get the value "125 Smith Avenue" by using DOM?
ThanksThanks for all of you.
The code indicates that I need to get the node by tag name. If I do not know the distribution of the elements and want to traverse all nodes. If the node contains value, I retrieve the value. How to implement the general case.
For example, my XML file represent a directory hierarchy and looks like
<root>
<usr>
<user>user1
<file>file1</file>
<file>file2</file>
</user>
<user>user2
<file>file1</file>
<file>file2</file>
<file>file3</file>
<file>file4</file>
</user>
</usr>
</root>
Maybe you are looking for
-
Something has changed - cannot use remote prointer with my new MacBook Pro
I replaced my 3 year old MacBookPro with a new one 3 weeks ago (late April 2010). I just discovered that my 4 month old remote laser pointer (RemotePoint RF VP4810R and RF wireless from SMK-Interlink - www.smklink.com) will not work with this new sys
-
I have a new lap top and can't access my Itunes account.
I have a new lap top and can't access my Itunes account, help
-
can you buy a refurbished apple tv from the apple retail store or just online???
-
How do I convert pdd files to jpeg?
I don't know if I'm posting this correctly, but here's my question... Years ago I scanned old family photos using Adobe Photoshop and saved them as pdd files. Now I don't have the software to open them. I've read online that I may have success if I
-
Calling c/c++ code from websphere
hi, I want my application that would be deployed in websphere application server to communicate with a c/c++ program that is residing on another computer. Would it we possible if it is please provide some help hoew to achieve it.