Make the XML nodes
I'm trying to get my XML document-specific information... Here is the info:
< test >
< UI > < /iu > 2000
< amt > 125 < / amt >
< dump > 0.2 < / dump >
< > 3.2 hData < / hData >
< hData > 16 < / hData >
< > 8 hData < / hData >
< UI > < /iu > 2000
< amt > 125 < / amt >
< dump > 0.3 < / dump >
< > 4.8 hData < / hData >
< hData > 16 < / hData >
< > 8 hData < / hData >
< / test >
Here's the code in Flash:
var myURLLoader:URLLoader = new URLLoader();
var myURLRequest:URLRequest = new URLRequest ("dump.xml");
myURLLoader.load (myURLRequest);
myURLLoader.addEventListener (Event.COMPLETE, dataOK);
function dataOK(myevent:Event):void {}
var myXML:XML = new XML (myURLLoader.data);
TF1. Text = myXML.hData [1];
}
He steps back a value of 16, that is correct. But I want to be able to refer to a specific location, such as the second dump data and the 3rd entry here. So I tried:
TF1. Text = myXML.dump [1] .hData [2];
He comes back with:
TypeError: Error #1010: a term is undefined and has no properties.
I gues I just need to know how to read the nodes that are above hData.
Thank you.
Dave
hData nodes are not children of dump nodes. use:
myXML.hData [5]
Tags: Adobe Animate
Similar Questions
-
Hello
I have a created a structure tree
-one
-aa
-aaa
-aaa
b
-bb
-bbb
-cc
-ccc
I followed the steps given in the message
make the tree nodes that are engaged in "BOLD"
(a)
Now if I expand the root node, then all of the child nodes automatically become "BOLD", that is if I select 'a '.
all nodes below becomes "BOLD".
-a
-aa *.
-aaa
-aaa
b
-bb
-bbb
-cc
-ccc
How can I avoid this problem what I want is the selection if 'a' only 'a' should be bold not her children
now when I select 'aa' or 'bb' only her parents must be "BOLD" not his children.
(b)
My second problem is that while the page loads for the first time his having the whole tree is in bold how prevent this from happening.If the node selected for that tree is P100_SELECTED_NODE_ITEM
Add the following code to the onload code ("run when the page loads" article on page or dynamic action shot page load)
selected_node= $('#'+$v('P100_SELECTED_NODE_ITEM')).children('a:first'); selected_node.parents('li').each( function(){ $(this).children('a:first').css('font-weight','bold'); });
-
No idea how to loop and add the value to the attribute of the xml node?
I work on a lot of flattening of project using a watched folder.
I have a process parent to locate the directory and call a sub-process to flatten PDF files.
I want to write the directory failed to XML.
If there are several directory failed locations and if I want to add it to the node, he doesn't let me do.
If I set the Xpath location like/process_data/outputXML/flattenDirectoryRequestMessage/failureFileLocation[x]/@path it gives me invalid character exception. I use 'x' for looping and incrementing.
If I do not use the [x]. The directory is overwritten.
No idea how loop and add all the directories failed to attribute of the xml node?
I understand that you can not browse the xml code to assign the value at each node. Rather you can assign only one time to the node.
I realized that it is not possible to do it this way. Then concatenate it as strings, and then attach to the xml once.
-
How to set the value of the xml node.
Hello
I have the PDF application can be entered by the user using the key. When sending
I use following code to set the value of the xml node.
XFA. Data.assignnode ("Employee.ID", "123", 0):
If its generators of xml as below.
< employee >.
< id > 123 / < ID >.
< / name >
< / employee >
Now, I need to generate xml as below.
< employee id = '123' >
< / name >
< / employee >
So, how together create the id of node as above?
Thanks in advance.
Kind regards
Dhiyane
Hi Dhiyane,
You must set contains the property if the node id to "metadata", i.e.;
xfa.data.assignNode ("employee.id", "123", 0);
XFA. Data.Employee.ID.Contains = 'metadata ';Very awkward, if you have a number of them, in which case you might want to look at using E4X.
Good luck
Bruce
-
Dear adobe experts,
I have a requirement to remove a node in the XML interface of a form of adobe (not only by removing a subform in the form). It must be a deletion, an empty node does not work (I read this in another post).
The XML structure looks like this:
< ITEM >
< DATA >
< ROW_IID > 0 < / ROW_IID >
< PARENT > 0 < / PARENT >
< CHILD > 0 < / CHILD >
< / DATA >
< DATA >
< ROW_IID > 1 < / ROW_IID >
< PARENT > 0 < / PARENT >
< CHILD > 0 < / CHILD >
< / DATA >
< / ITEM >
I want to, for example, to remove the second node of data including the underlying elements: row_iid, parent & child. Already tried: xfa.record.nodes.remove (oRemoveNode); I got it from http://partners.adobe.com/public/developer/en/xml/Adobe_XML_Form_Object_Model_Reference.pd f and several messages in this forum, but I get the following message appears in the error console: remove failed. I know that the somexpression is correct.
Here's the code I used to try to remove the node.
var node_loc;
var del_node;
[node_loc = ' xfa.record.ELEMENT.DATA [1 '];
del_node = xfa.resolveNode (node_loc);
xfa.record.Nodes.Remove (del_node);
Anyone know what I am doing wrong?
Kind regards
Niels
Hi Steve,.
I fixed it myself. I adjusted my code a little, so the node, including the elements is successfully deleted.
Here is the way that I fixed it:
var node_loc;
var del_node;
[node_loc = ' xfa.record.ELEMENT.DATA [1 '];
del_node = xfa.resolveNode (node_loc);
xfa.record.ELEMENT.nodes.remove (del_node);
Thanks for the help!
Kind regards
Niels
-
Problem with to access the XML nodes whose namespace
Hello
I have a XML file with the following format;
"" "" "< graphml version ="1.3"xmlns =" http://graphml.graphdrawing.org/xmlns/graphml ' xmlns:y = ' http://www.yworks.com/xml/graphml ' xmlns: xsi = " http://www.w3.org/2001/XMLSchema-instance" > "
< graph id = 'G' edgedefault 'ordered' = >
< key data 'd11' = >
< y: SharedData >
< name there: Brush = "SolidBrush" color = "Black" id = "1" / >
< / y: SharedData >
< / data >
< node id = "G:n0" >
< y: Labels >
< y: Text > <! [CDATA [start]] > < / Text: y >
< / y: Labels >
< / node >
< node id = "G:n1" >
< y: Labels >
< y: Text > <! [CDATA [end]] > < / Text: y >
< / y: Labels >
< / node >
< / chart >
< / graphml >
I access this file as < mx:XML id = "layoutXml" source = "tmp.xml" / > "
I have no application debugging and found that the layoutXml object contains the xml file as it is. Now when I try to access any child node of layoutXml, every time I found null. Same instruction layoutXml.graph.toXMLString () or layoutXml.graph.toString () returns null.
I have tryied the following approach as well, but did not work,
var nameSpace:Namespace = new Namespace (" http://www.yworks.com/xml/graphml");
var str:String = layoutXml.graph.node. (@id == ' G:n0").nameSpace::Labels.nameSpace::Text.toXMLString();")
also, this property returns null.
If anyone has the solution, please answer.
Thank you.
Namespace var sets default namespace:
lack of namespace xml = nameSpace;You should then be able to reference nodes normally.
Tracy
-
I'm going after Yahoo Weather and try to get the value of an XML node
So after I take the node
item_buildNode.ToString () = < lastBuildDate > Tuesday, December 26, 2006 12:51 pm CST < / lastBuildDate >
So I know that I have the appropriate node
But I want just the value without the tags
If I try to item_buildNode... nodeValue, which returns a null value
Can I just the value? If so, how?
Thank you
MathiasWell, too bad. I have search the Forum better.
It's item_buildNode.firstChild.nodeValue
-
Retrieve the value of the XML node in XMLTable
Hello, hope that it is something simple and I went beside her, but consider this example:
How the child node of the 'name' Type?with et as( SELECT xmlType('<Invoice> <InvoiceInformation> <Number>123456</Number> </InvoiceInformation> <InvoiceLines> <InvoiceLine> <Detail> <Amount>100</Amount> <Line>1</Line> </Detail> <Type> <CheesyPotato> <Instructions> <CookTime>120</CookTime> <CookTimeUnits>Minutes</CookTimeUnits> <CookTemperature>450</CookTemperature> </Instructions> </CheesyPotato> </Type> </InvoiceLine> <InvoiceLine> <Detail> <Amount>10000</Amount> <Line>2</Line> </Detail> <Type> <DeathStar> <Instructions> <CookTime>4</CookTime> <CookTimeUnits>5 "parsecs"</CookTimeUnits> <CookTemperature>1000000</CookTemperature> </Instructions> </DeathStar> </Type> </InvoiceLine> <InvoiceLine> <Detail> <Amount>250</Amount> <Line>3</Line> </Detail> <Type> <Quiche> <Instructions> <CookTime>75</CookTime> <CookTimeUnits>Minutes</CookTimeUnits> <CookTemperature>350</CookTemperature> </Instructions> </Quiche> </Type> </InvoiceLine> </InvoiceLines> </Invoice> ') xt from dual ) SELECT ext.* FROM et, XMLTABLE( 'for $Invoice in $INV/Invoice for $InvoiceItem in $Invoice/InvoiceLines/InvoiceLine return <row> { $Invoice ,$InvoiceItem } </row>' PASSING et.xt as INV COLUMNS INVOICENUMBER VARCHAR2 (6) PATH 'Invoice/InvoiceInformation/Number' ,InvoiceLineNumber VARCHAR2 (5) PATH 'InvoiceLine/Detail/Line' ,Amount VARCHAR2 (5) PATH 'InvoiceLine/Detail/Amount' ,CookTime VARCHAR2 (5) PATH 'InvoiceLine/Type//Instructions/CookTime' ,CookTimeUnits VARCHAR2 (15) PATH 'InvoiceLine/Type//Instructions/CookTimeUnits' ,CookTemperature VARCHAR2 (10) PATH 'InvoiceLine/Type//Instructions/CookTemperature' ) ext / INVOICENUMBER INVOICELINENUMBER AMOUNT COOKTIME COOKTIMEUNITS COOKTEMPERATURE ------------- ----------------- ------ -------- --------------- --------------- 123456 1 100 120 Minutes 450 123456 2 10000 4 5 "parsecs" 1000000 123456 3 250 75 Minutes 350
I have tried different methods; along the lines of ', $InvoiceItem, Type, child, name ' does not, any help would be appreciated, thanksTypeChild INVOICENUMBER INVOICELINENUMBER AMOUNT COOKTIME COOKTIMEUNITS COOKTEMPERATURE ------------------- ------------- ----------------- ------ -------- --------------- --------------- CheesyPotato 123456 1 100 120 Minutes 450 DeathStar 123456 2 10000 4 5 "parsecs" 1000000 Quiche 123456 3 250 75 Minutes 350
Hello
You can use the name() function in the COLUMNS clause:
SQL> WITH et AS( 2 SELECT XMLType('
3 ') xt 54 FROM dual 55 ) 56 SELECT ext.* 57 FROM et 58 , XMLTable( 59 'for $Invoice in $INV/Invoice 60 for $InvoiceItem in $Invoice/InvoiceLines/InvoiceLine 61 return4 6123456 57 538 229 12100 101 1113 2114 2015 19120 16Minutes 17450 1823 3724 2710000 252 2628 3629 3530 344 315 "parsecs" 321000000 3338 5239 42250 403 4143 5144 5045 4975 46Minutes 47350 4862 { 63 $Invoice/InvoiceInformation 64 , $InvoiceItem 65 } 66
' 67 PASSING et.xt as INV 68 COLUMNS 69 typechild VARCHAR2(30) PATH 'name(InvoiceLine/Type/*)' 70 , INVOICENUMBER VARCHAR2(6) PATH 'InvoiceInformation/Number' 71 , InvoiceLineNumber VARCHAR2(5) PATH 'InvoiceLine/Detail/Line' 72 , Amount VARCHAR2(5) PATH 'InvoiceLine/Detail/Amount' 73 , CookTime VARCHAR2(5) PATH 'InvoiceLine/Type/*/Instructions/CookTime' 74 , CookTimeUnits VARCHAR2(15) PATH 'InvoiceLine/Type/*/Instructions/CookTimeUnits' 75 , CookTemperature VARCHAR2(10) PATH 'InvoiceLine/Type/*/Instructions/CookTemperature' 76 ) ext 77 ; TYPECHILD INVOICENUMBER INVOICELINENUMBER AMOUNT COOKTIME COOKTIMEUNITS COOKTEMPERATURE ------------------------------ ------------- ----------------- ------ -------- --------------- --------------- CheesyPotato 123456 1 100 120 Minutes 450 DeathStar 123456 2 10000 4 5 "parsecs" 1000000 Quiche 123456 3 250 75 Minutes 350If this does not work for your version (pre 11g), you will need to push the expression in the main XQuery expression:
... , XMLTable( 'for $Invoice in $INV/Invoice for $InvoiceItem in $Invoice/InvoiceLines/InvoiceLine return
{ element TypeChild {name($InvoiceItem/Type/*)} , $Invoice/InvoiceInformation , $InvoiceItem }
' PASSING et.xt as INV COLUMNS typechild VARCHAR2(30) PATH 'TypeChild' , INVOICENUMBER VARCHAR2(6) PATH 'InvoiceInformation/Number' ... -
make the tree nodes that are engaged in "BOLD"
Hi friends,
I'm putting a few settings of 'style' as the bold or italics
for tree nodes that are clicked. For example in the sub tree if you click node a31 , this node is parent node ( a3 ) and the parent node ( a ) A3 will be displayed in bold
Any input will be appreciated.*a*..|-a1 |- a2 |- *a3*...|- *a31* |- a4 |-a32 |- a5 |-a33 |- a6 |- a7
Kind regards
Jyothi
Published by: Jyothi on January 9, 2011 03:43Jyothi,
You have not used the ID of node item in the code. The element that stores the tree node in your case is P19_EXMPLE and if you need to change the code that is provided in an appropriate way.You must change the * $v ('
') * to * $v(P19_EXMPLE') * If you use my code
or * $v ('P19_EXAMPLE') * to * $v(P19_EXMPLE') * If you use Andy. -
AS2 change the XML node button
Hello
I'm a training designer ACE. I would be grateful if someone can help me solve this code. I need my flash application in order to move nodes for certain text fields and a movieclip that load images, when I click on one of the 6 simple buttons. Everything works except the part. How to change nodes? Can not find anywhere in websearch buttons change nodes, maybe it's called something else and not "switching nodes? Here is a part of the code that I can't solve, he begins to / / part of the PROBLEM. Thank you!
//-----------AS2
function loadXML(loaded) { if (loaded) { _root.locationX = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue; _root.nameX = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue; _root.emailX = this.firstChild.childNodes[0].childNodes[2].firstChild.nodeValue; _root.image = this.firstChild.childNodes[0].childNodes[3].firstChild.nodeValue; //loads text location_txt.text = _root.locationX; name_txt.text = _root.nameX; email_txt.text = _root.emailX; //loads image var url:String = _root.image; var movieClip:MovieClip = createEmptyMovieClip("movieClip", 0); movieClip.loadMovie(url); // PROBLEM: this BUTTON has to switch values to next node menu1.onPress = function() { xmlData = new XML(); xmlData.ignoreWhite = true; xmlData.onLoad = loadXML; _root.locationX = loadXML.firstChild.childNodes[1].childNodes[0].firstChild.nodeValue; _root.nameX = loadXML.firstChild.childNodes[1].childNodes[1].firstChild.nodeValue; _root.emailX = loadXML.firstChild.childNodes[1].childNodes[2].firstChild.nodeValue; _root.image = loadXML.firstChild.childNodes[1].childNodes[3].firstChild.nodeValue; } menu2.onPress = function() { xmlData = new XML(); xmlData.ignoreWhite = true; xmlData.onLoad = loadXML; _root.locationX = loadXML.firstChild.childNodes[2].childNodes[0].firstChild.nodeValue; _root.nameX = loadXML.firstChild.childNodes[2].childNodes[1].firstChild.nodeValue; _root.emailX = loadXML.firstChild.childNodes[2].childNodes[2].firstChild.nodeValue; _root.image = loadXML.firstChild.childNodes[2].childNodes[3].firstChild.nodeValue; } /// ...etc. --- 6 simple buttons, so far it is not working } else { content = "file not loaded!"; } }
+++ XML file: CDA to CDA, PLM button for button PLM, etc..
<?xml version="1.0" encoding="utf-8" ?> <dots> <DATA> <location>Empty location</location> <name>Empty Name</name> <email>Empty email address</email> <image>Contacts/img/empty.jpg</image> </DATA> <CDA> <location>Annemasse - CDA M&T Team</location> <name>John Doe CDA</name> <email>[email protected]</email> <image>Contacts/img/img1.jpg</image> </CDA> <PLM> <location>Annemasse - PLM key user</location> <name>John Doe PLM</name> <email>[email protected]</email> <img>Contacts/img/img2.jpg</img> </PLM> <CAD> <location>Annemasse - CAD key user</location> <name>John Doe CAD</name> <email>[email protected]</email> <img>Contacts/img/img3.jpg</img> </CAD> <CAE> <location>Annemasse - CAE key user</location> <name>John Doe CAE</name> <email>[email protected]</email> <img>Contacts/img/aimg4.jpg</img> </CAE> <PMT> <location>Annemasse - PMT key user</location> <name>John Doe PMT</name> <email>[email protected]</email> <img>Contacts/img/img5.jpg</img> </PMT> <engineering> <location>Annemasse - ENGINEERING IS CONTACTS</location> <name>John Doe ENG</name> <email>[email protected]</email> <img>Contacts/img/img6.jpg</img> </engineering> </dots>
Use the movieclip buttons and load your xml only once file:
var movieClip:MovieClip = createEmptyMovieClip("movieClip", 0);
var xmlData:XML;
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;xmlData.load (whatever.xml);
function loadXML() {
xmlData=this;}
for(var i:Number=0;i<6;i++){ // assuming you have menu0,menu1,...,menu5
this["menu"+i].ivar=i;
this["menu"+i].onRelease=changeF;
}
function changeF(){
_root.locationX = xmlData.firstChild.childNodes[this.ivar].childNodes[0].firstChild.nodeValue;
_root.nameX = this.firstChild.childNodes[this.ivar].childNodes[1].firstChild.nodeValue;
_root.emailX = this.firstChild.childNodes[this.ivar].childNodes[2].firstChild.nodeValue;
_root.image = this.firstChild.childNodes[this.ivar].childNodes[3].firstChild.nodeValue;//loads text
location_txt.text = _root.locationX;
name_txt.text = _root.nameX;
email_txt.text = _root.emailX;
//loads image
var url:String = _root.image;
movieClip.loadMovie(url);
}
-
My event.result may or may not return a node in the xml file. How can I avoid that TypeError: Error #1009: cannot access a property or method of a null object reference.
I have a very simple question. I want to take the value of
Event.Result.Item.nodeindex1.nodeindex2.Row.MyValue;
and assign it to a text field
mytextTi.text = event.result.item.nodeindex1.nodeindex2.row.myvalue;
But if a part of the tree is missing, which is also valid, so I get TypeError: Error #1009: cannot access a property or method of a null object reference.
I tried various solutions such as the following. Is there any simple way to do this?
If (event.result.item.nodeindex1.nodeindex2.row.myvalue! = undefined)-does not work
Unfortunately, one must test all levels to ensure that it is not null before the reference to it. You can take advantage of the short-circuit evaluation in tying together, for example
if (event.result.item && event.result.item.nodeindex1 && event.result.item.nodeindex1.nodeindex2 && event.result.item.nodeindex1.nodeindex2.row && event.result.item.nodeindex1.nodeindex2.row.myvalue) { // access the variable } else { // one of the XML nodes in the path is null }
Or you could stay away from her a little hacky and wrap the reference in a try/catch block.
-Tom
Flex SDK engineer
-
Access to the XML schemas from the connection manager?
The connection manager for a connection opened in version 4 is no longer an 'XML Schémas' icon (Java and XML patterns seem to have been deleted between versions 3 and 4). Is there a definition that can return the XML schemas?
Using lists yet... »
XML schemas
XML schemas are definitions of schema, written in XML, that describe the structure and various other semantics of XML instance documents. For conceptual and information on the use of XML schemas, see the Guide of Oracle XML DB Developer in the Oracle database documentation library.
You can change an XML schema by right clicking in the connections Navigator XML schema name and selecting open from the menu. You can delete a selected schema by selecting the Drop Schema menu. » ...
The XML node drawings missing in the connections Navigator is a known issue for the 4.0.1. The 4.0.2 patch is a fix.
Regarding the Java node, it seems to me in all versions 4.0.x. Maybe your Preferences... > Database > Navigation filter turned it off?
Kind regards
GarySQL development team
-
I work with XML in AS3. I'm loading in an xml with dates in a format such as:
2011-1-12-10-00-a
I am to convert those to the actual Date of Flash in order to compare them and use the methods of the class Date, etc. I prefer convert once and then store them in the XML node, they came.
Is it possible to store complex values such as date or what you have in an XML?
Yes, or more directly using:
var ms:int=date.getTime();
var newDate:Date = new Date (ms);
-
I have a script that calls a page xml via cfhttp. When I output a link from the xml, the link seems ok. When I try to go out as a viable link like this:
< cfoutput > < a href = "#myxmldoc.response.legislators.legislator.link #" > link < /a > < / cfoutput >
the output looks like this:
No idea where I am going wrong?
You try maybe output the xml node that confuses the browser. Try xmlText at the end of your node to tell him that you want the text of the node.
Link -
best way to see the xml objects attribute existence
"I have the xml node < type mynode ='sometype" >...
I do: 'item.@type' and I need to check and if the attribute type is not lifting error, but it seems that "item.@type" will never return null, if there is no attribute "type" not specified, it returns a kind of empty xml or something, is there a particular reason, why it is done that way? and especially, what is the best way to check whether the xml node attribute 'type' defined?
Thanks in advance
! point. (hasOwnProperty ("@type")) | «StringUtil.trim (item.@type) == «»
Maybe you are looking for
-
Satellite A500-1GH - SD slot is compatible with SDHC and SDXC?
I have a Satellite A500-1GH with Windows 7 64 bit. I'm about to buy an SD card, and I was wondering if the SD card on the front of the laptop is compatible with SDHC cards and latest SDXC cards. If so, do I need to download some software or drivers f
-
FlipOut covers in the bike store
If you are looking for a new color to the back of your flipout, the motorcycle shop now has: http://www.store.Motorola.com/battery-door-FlipOut-brilliant-blue/DP/B003ZVQE9W?ie=UTF8&ID=battery%2...
-
I want to make a CD with the picture of my brother in the order of his life.
My brother just died. I want to make a cd of photos of him in the order when he was a baby, and through his life. I have created a folder for this and entered the order the photos I wish, but as I put the pictures in, file fix them out of use. How to
-
Windows Vista not able to support the WPA2 wireless security problem
Recently, I upgraded my router wireless to a Linksys 400N series N wireless router. I use WPA Personal / RTK to authenticate and on all my XP and Vista machines, I was able to enter the security credentials and connect to the network. However, on a
-
Realtek PCIe GBE Family Controller
Why can't I find the Realtek drivers without someone wanting to buy me this wizard or the program of this kind? It's crazy, that I just want to keep my drivers up to date. You shouldn't go out and buy these rediculas priced at programs to keep the co