Recovery of the values of the nodes
I am facing this problem when trying to get the values of xml file, it's received orders from third-party customer file, need to load in our data base and data updates according to this file.This is the example of the file
<? XML version = "1.0" encoding = "utf-8"? >
"< RegistrationFile xmlns: xsi ="http://www.w3.org/2001/XMLSchema-instance"xsi:noNamespaceSchemaLocation="file:///lrb.xsd ">
< header >
LRB_33h43k3j_281020080944.XML < Filename > < / name of the file >
< OrganisationRef > 33h43k3j < / OrganisationRef >
< LearnerRecordCount > 6 < / LearnerRecordCount >
< / header >
the learner < MISIdentifier > 5 > < < / MISIdentifier > < title > MISS < / Title > < GivenName > MARGARET < / GivenName > < PreferredGivenName > MARGARET < / PreferredGivenName > < FamilyName > O'BRIEN < / FamilyName > < FamilyNameAt16 > O & apos; BRIEN < / FamilyNameAt16 > < LastKnownAddressLine1 > 121 ST STEPHENS GREEN < / LastKnownAddressLine1 > < LastKnownAddressLine2 > DUBLIN 2 < / LastKnownAddressLine2 > < LastKnownAddressTown > CO DUBLIN < / LastKnownAddressTown > < LastKnownAddressCountyorCity > IRELAND < / LastKnownAddressCountyorCity > < DateOfAddressCapture > 2003-04-25T 11:47:18 < / DateOfAddressCapture > < DateOfBirth > 1980 - 01-01 T 00: 00:00 < / DateOfBirth > < EmailAddress > [email protected] < / EmailAddress > < sex > 2 < / kind > < / learning >
learner < MISIdentifier > 7 > < < / MISIdentifier > < title > Mr. < / title > < GivenName > TOBY < / GivenName > < James MiddleOtherName > < / MiddleOtherName > < FamilyName > LANHAM < / FamilyName > < DateOfBirth > 1979-05-23T 00: 00:00 < / DateOfBirth > < sex > 0 < / Type > < / learner >
learner < MISIdentifier > 80 > < < / MISIdentifier > < GivenName > HASSAN < / GivenName > < FamilyName > AHMED < / FamilyName > < sex > 9 < / Type > < / learning >
the learner <>< MISIdentifier > 86 < / MISIdentifier > < GivenName > BOAKYE < / GivenName > < FamilyName > AMPONSAH < / FamilyName > < sex > 9 < / Type > < / learner >
learner < MISIdentifier > 93 > < < / MISIdentifier > < title > MS < / title > < GivenName > LIZ < / GivenName > < FamilyName > ARKLESS < / FamilyName > < DateOfAddressCapture > 2008-08-17T 16: 51:55 < / DateOfAddressCapture > < sex > 9 < / Type > < / learner >
learner < MISIdentifier > 100 > < < / MISIdentifier > < GivenName > JOHN < / GivenName > < FamilyName > BRISCOE < / FamilyName > < sex > 9 < / Type > < / learning >
< / RegistrationFile >
After running this code:
declare
l_xml xmltype.
l_doc dbms_xmldom. DOMDocument;
doc_node dbms_xmldom. DOMNode;
l_elem DBMS_XMLDOM. DOMElement.
l_nodeList dbms_xmldom. DOMNodeList;
l_node dbms_xmldom. DOMNode;
l_childNode dbms_xmldom. DOMNode;
l_nodeValue varchar2 (100);
number of l_num;
Start
Select imported_xml from l_xml
of miap_export_header
Where object_id = 77891310;
l_doc: = dbms_xmldom.newDOMDocument (l_xml);
doc_node: = DBMS_XMLDOM.makeNode (l_doc);
l_elem: = DBMS_XMLDOM.getDocumentElement (l_doc);
l_nodeList: = dbms_xmldom.getElementsByTagName (l_elem, 'Head');
l_node: = dbms_xmldom.item (l_nodeList, 0);
l_childNode: = dbms_xmldom.getLastChild (l_node);
l_num: = dbms_xmldom.getNodeValue (l_childNode);
dbms_output.put_line (' number of learners: ' | l_num);
l_nodeList: = dbms_xmldom.getElementsByTagName (l_elem, 'Learner');
l_node: = dbms_xmldom.item (l_nodeList, 0);
loop
l_childNode: = dbms_xmldom.getFirstChild (l_node);
l_nodeValue: = dbms_xmldom.getNodeName (l_childNode);
l_num: = dbms_xmldom.getNodeValue (l_childNode);
dbms_output.put_line (' node name: ' | l_nodeValue |' value: ' | l_num);
l_node: = dbms_xmldom.getNextSibling (l_node);
When the output dbms_xmldom.isNull (l_node);
end loop;
DBMS_XMLDOM.freeDocument (l_doc);
end;
I have this output:
Number of students:
Name of the node: MISIdentifier value:
Name of the node: MISIdentifier value:
Name of the node: MISIdentifier value:
Name of the node: MISIdentifier value:
Name of the node: MISIdentifier value:
Name of the node: MISIdentifier value:
There's no value, only a white space in each line. Why? And how do I retrieve these values, perhaps I should take a different approach?
All responses are much appreciated, because I'm going out right now.
An A_Non mentions, DOMElement have no value. You must first get his DOMText child to get the data of the item.
Tags: Oracle Development
Similar Questions
-
new to labview :-) and I have a problem when I want to change the value of a string in bunches, and I want to implement this using the node value of property instead of writing directly to the stream or by using the variable, enclosed is the picture. No matter, I have change in cluster (control) or value of Popery out (indicator) cluster, the value (sensor 7) dataflow keeps unchanged even I gave the new value by value of property node. Thank you to give me some advice about this.
Hi GerdW
Thanks a lot for your answer. The reason I'm stubbornly tring to break the flow of DATA is: we have a test system that have about 100 screws, they have a few connected flow, some of them will be unbundling a cluster dataflow chain to check the value in order to make the different cases. Now I want to insert user event by changing the control and influential cases during run time.
As I initially uses a global variable (to control cases) instead of unbundle string data flow, it works well. But then, I found there are a lot of screws that are using the string unbundle. One of the 'lazy' means, I tried is to change the value via the property node (because that way, I did not need to find all the places where using the unbundle string and replace them with the global variable), then I noticed a problem with "dataflow", the value in the stream of cluster in fact will not be changed by changing the value of the property node.
I did a test with VI simple (like the picture in last post), and after reading your advice, I tell myself that I need to understand the concept of "DATAFLOW" in labview, it seems that my "lazy" way can not work in this scenario.
I have attached the criterion VI here, have you furthur suggestions on what I can do in this case?
Mant thanks!
Minyi
-
Dear...
I bouight last month a Sony vaio laptop. Model SVE151D11M
I did a recovery of the value.
Now, the computer no longer starts and demand for recovery disks.
But I do not have such a set.
How can I get a recovery set, so I start from my laptop again.
Please help me and thanks in advance,
Kind regards
Down Jonker
Hello, I need a cover for my Sony Vaoi SVE151D11M model
Thank you
Kind regards
Down Jonker
-
Read the nodes that have the same value as the subnodes - XML
It is more of a general JAVA / XML problem, but given that it is going into my BlackBerry app I thought I'd see if anyone knows.
Consider a simple XML document:
Whatever 1 Whatever 2 Whatever 3 Using the standard org.w3c.dom, I can get the nodes in X by the practice...
NodeList fullnodelist = doc.getElementsByTagName ("x");
But if I want to go to the next set of 'e', I try to use something like...
Element element = (Element) fullnodelist.item(0);NodeList nodes = pelement.getElementsByTagName("e");
EXPECTED back '3' nodes (because there are 3 series of 'e'), but it returns '9' - because it gets all entries including the 'e' apperently.
It would be nice in the above case, because I could probably go through and find what I'm looking for. The problem I have is that when the XML file looks like the following:
whatever Something Else whatever Something Else When I ask 'e' value, it returns 4, instead of (what I want) 2.
I am simply not understand how DOM parsing works? Generally, in the past I used my own XML documents so I name never articles like this, but unfortunately this isn't my XML file and I don't have the choice to work like this.
What I thought I would do, it is write a loop knots "drills down" so that I can combine each node...
public static NodeList getNodeList(Element pelement, String find) { String[] nodesfind = Utilities.Split(find, "/"); NodeList nodeList = null; for (int i = 0 ; i <= nodesfind.length - 1; i++ ) { nodeList = pelement.getElementsByTagName( nodesfind[i] ); pelement = (Element)nodeList.item(i); } // value of the nod we are looking for return nodeList; }
.. While if adopted you ' s/e' in the service, he would return the 2 nodes I'm looking (or elements, perhaps I'm using the wrong terminology?). on the contrary, it returns all the 'e' nodes in this node.
Anyway, if anyone is still with me and has a suggestion, it would be appreciated.
Well, there is no doubt that there is a learning curve robust for XML programming. You can take an hour or two and go through one of the tutorials that are circulating on the net. (Like that of w3schools.com.)
Basically, almost everything in XML is a node, the Document that returns the parser. The API for node tells you that you can test the node type you have by calling getNodeType, which returns one of the constants of type node (Node.ELEMENT_NODE, Node.TEXT_NODE, etc..) If necessary, you can then convert the variable to the corresponding interface (element, text, etc.).
Similarly, the API documentation say you for any node, calling getChildNodes (or for an element node or Document getElementsByTagName) will give you a NodeList (a little non-types of nodes in the XML API), while calling getFirstChild and getNextSibling to any node will give you another node (or null ).
Once you learn the API, writing logic of course is not all that hard. For example, if the only 'e' interest tags are those directly under the element root of the document (as shown in your example) you can simply go to them directly:
Vector getTopENodes(Document doc) { Vector vec = new Vector(); NodeList nodes = doc.getDocumentElement().getChildNodes(); int n = nodes.getLength(); for (int i = 0; i < n; ++i) { Node node = nodes.item(i); if (node.getNodeType() == Node.ELEMENT_NODE && "e".equals(node.getNodeName())) { vec.addElement(node); } } return vec;}
Note that this example does not assume that all children are nodes of element 'e '. the document could have comments, white space or something else that makes it into the DOM as comment, text or any other type of node.
On the other hand, if you want to capture every "e" tag which is directly under the ' tag, no matter the level, then you need to do something a little more complicated (it's on the top of my head - no guarantee):
static class NodeListImp implements NodeList { private Vector nodes = new Vector(); public int getLength() { return nodes.size(); } public Node item(int index) { return (Node) nodes.elementAt(index); } public add(Node node) { nodes.addElement(node); }} NodeList getTargetNodes(Document doc) { NodeListImp list = new NodeListImp(); getTargetnodes(list, doc.getDocumentElement(), false); return list;} void getTargetNodes(NodeListImp list, Node node, boolean parentIsS) { if (node.getNodeType() == Node.ELEMENT_NODE) { // node name is tag name for element nodes String name = node.getNodeName(); if (parentIsS && "e".equals(name)) { list.add(node); } parentIsS = "s".equals(name); for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) { getTargetNodes(list, child, parentIsS); } }}
I hope that it gets the idea across.
-
Extract the value of the node with multiple namespace xml
Hello
I have to extract values in xml that includes several namepspaces. a single namespace has value of xmlns. I managed to get the value of the node for tag event where as info tag returns null.
experrts need help.
<? XML version = "1.0" encoding = "utf-8"? >
< event xmlns = " " http://www.w3.org/2001/XMLSchema-instance ' >
< data xmlns = ">
< object >
< eventtype > 110 < / eventtype >
< result > < / result >
< / object > < / data >
< xmlns = info "> < jref > JREF < / jref >
< / info >
< / event >
SELECT
TMX.eventtype,
TMX.result,
TMX.jref
of EXAMPLE_MESSAGES1.
XMLTABLE (XMLNAMESPACES (DEFAULT 'http://www.w3.org/2001/XMLSchema-instance'), )
' for $i in/event/data/object
Returns the local item: r {$i / eventtype,}
$i / result.
{$i / jref}'
EXAMPLE_MESSAGES1 OF PASSAGE. XML_MESSAGE
COLUMNS
EVENTTYPE VARCHAR2 (30) PATH "eventtype"
RESULT VARCHAR2 (30) PATH 'result ',.
TMX JREF PATH VARCHAR2 (30) 'jref');
Version of the database is 11.2.0.3.0
Hello
I have to extract values in xml that includes several namepspaces.
There is only one workspace names in fact (the default value).
Normally, an empty xmlns UN-declare a default namespace declaration is inherited from the parent node.
So, in your example, only
node belongs to the default namespace. In this case, when you have to walk through the nodes belonging to some namespaces and others in any namespace, do not use the DEFAULT option in the WITH XMLNAMESPACES.
Instead, declare a prefix and use it as needed for qualify of nodes.
Another thing:
Returns the local item: r {$i / eventtype,}
What what do you want with "local:" here?
The following should give the expected results:
SELECT TMX.*
of EXAMPLE_MESSAGES1
XMLTABLE)
XMLNAMESPACES ("http://www.w3.org/2001/XMLSchema-instance" as "ns0")
, ' / ns0:event'
EXAMPLE_MESSAGES1 OF PASSAGE. XML_MESSAGE
COLUMNS
EVENTTYPE VARCHAR2 (30) PATH 'data, object, eventtype.
, RESULT VARCHAR2 (30) PATH ' object/data/result '.
, PATH of VARCHAR2 (30) JREF ' info/jref.
) TMX;
-
XML: How to get the value of the node when the node of pasing as a parameter name
Hello
I've got some xml:
var xmlData:XML = <1stNode> <buttonID>first child node value</buttonID> <imageID>second child node value</imageID> <labelID>third child node value</labelID> </1stNode>
So, I want to read the value of specific node based on a value passed to a function. .
var buttonID = new Button; var imageID = new Image; var labelID = new Label; getNodeValue(buttonID); //the value here is set dynamically private function getNodeValue (nodeName:String):void { trace (xmlData.nodeName) //doesn't work var str:String = "xmlData." + nodeName; var xml:XMLList = str as XMLList //doesn't work }
I don't know how to get the value when the name of the node is changed dynamically.
use:
getNodeValue(buttonID); //the value here is set dynamically private function getNodeValue (nodeName:String):void { trace (xmlData[nodeName]) }
-
Display the names and values of the parameters in the node parameter of forms
Hello
Is it possible to loopback programmatically via the node parameter forms get the name and value of each parameter. I don't know the name of the individual parameters in advance. I want to display the parameter names and values on a help screen generic as each of our reference forms.
I could do somewhat similar code to display all names of block in a first_block get_form_property property and nextblock property get_block_property is formed. I can't think in the same way as the parameter names and the values of the list if.
Any suggestions would be welcome.
Thank you
NeilNo, there is no standard built-in to browse Forms settings.
François
-
Extract the value of the node only using XQuery
Hello
I have a xml as XMLType stored in the table. XML is,
< ocaStatus xmlns = "http://xmlbeans.apache.org/ocastatus" >
< status >
< > 990 statusCode < / statusCode >
< statusDate > 2010 - 01 - 19 < / statusDate >
< user name > OcaNimsAcf < / userId >
< comment > DocumentnotinNIMS < / comment >
< / status >
< status >
< > 990 statusCode < / statusCode >
< statusDate > 2010 - 01 - 19 < / statusDate >
< user name > OcaNimsAcf < / userId >
< comment > DocumentnotinNIMS < / comment >
< / status >
< / ocaStatus >
I use a combination of normal SQL and XQuery queries to extract data from table.
I have a requirement where I have to shoot only value of XML node as only * 990 * without tags < statusCode >.
I wonder if it's possible ass I've tried with two or three combinations of function extract().
Thank you.Hello
Different ways to do it, assuming you want the results in a relational table.
XMLTable using:
WITH t as ( select xmltype('
990 2010-01-19 OcaNimsAcf DocumentnotinNIMS 990 2010-01-19 OcaNimsAcf DocumentnotinNIMS Using the 'old' (and obsolete) XMLSequence:
WITH t as ( SELECT xmltype('
990 2010-01-19 OcaNimsAcf DocumentnotinNIMS 990 2010-01-19 OcaNimsAcf DocumentnotinNIMS Otherwise, targeting a specific node:
WITH t as ( select xmltype('
990 2010-01-19 OcaNimsAcf DocumentnotinNIMS 990 2010-01-19 OcaNimsAcf DocumentnotinNIMS -
failure of the value of the node... very easy to 'replace' on an attribute
Hello
(Working on DBXML 2.5.13. on Windows Server 2003)
The next document in a container:
< xmlns = "carrapateira.info village" >
< quantity of images = "124" / >
< / village >
When you try to replace the value of the attribute 'quantity' with the dbxml shell, using the following commands:
dbXML > sending ' ' 'carrapateira.info '.
Link-> carrapateira.info
dbXML > cquery/village/photos
1 objects returned for eager expression "/ village/images".
dbXML > print
< xmlns = "images carrapateira.info" quantity = "124" / > "
dbXML > contextQ @quantity
1 objects returned for the expression '@quantity '.
dbXML > print
{amount = "124".
dbXML > contextQ 'replace the value of the node. with 222 "
stdin:7: contextQuery failed
I always get this last message, whatever I try.
What is fundamentally wrong in my approach? Or is it a problem of shell?
Thank you
KoenKoen,
It's your query - you must cite the '222'
Kind regards
George -
Problems of recovery on the Satellite C650-182
I'm trying to fix a friends computer, it has formatted and deleted all the partitions on the hard drive and tried to install Windows 7 but still get the message that the installation can be done?
The following is the error message when trying to install: "windows cannot be installed to this disk. This hardware of computers may not support booting to this disk. Make sure that the disk controller is enabled in the computer's BIOS menu.
Then, he said the following: windows cannot be installed to this disk. "The disk may not soon."
I know that the hard drive is fine!
The complete model number is: Toshiba Satellite C650-182 part no: PSC08E-02J001EN
Any help would be wonderful.
Are you using the original Toshiba recovery DVD for the installation of the OS?
Your friend has created this disk in the past?Before you begin installation of recovery BIOS default value.
-
Do not understand why "the node fpga Audio IN Terminal is 16-bit signed integer"?
Hello
I work with myRIO 1900 for my project of ANC.
Audio IN of the fpga node gives its type terminal data as integer signed 16-bit. So, finally the exit on the nodes of the fpga is fluctuating between two values - 1 and 1. But I want the actual values of the audio data, I did not understand how to address this problem.
Audio In on the side of RT gives type of terminal of data such as actual values, but I did not understand why the terminal of Audio In FPGAs is 16-bit integer. ??
Please help me solve this problem.
Thank you.
If your analog range of +/-2.5 V. 32768 then--would be the equivalent of-2.5 V. 32767 would be + 2, 5V.
If you get + /-1 V, then you should see somewhere between + / 13 107 on the analog input of the number I16.
Basically, take the n ° I16, divide by 32767, multiply by 2.5. You will have your analog input in volts.
I don't know why you thing it's just rounding up to the-1 to + 1. Something must be wrong with your code or configuration.
-
Problems of bit shift left in the node of the formula
Hello
Sorry, but my English is not good.
I am trying to run a bit left SHIFT in the node of the formula, but the left SHIFT does not work as I expected.
uInt32 parametro[5]; float32 valorAmostra; int16 indiceAmostra; uInt8 indiceResposta; int16 controle; int32 valor; int8 i; for(i=0; i<5; i++) parametro[i]=param[i]; valor = parametro[5]<<16 | parametro[4]<<8 | parametro[3]; controle = parametro[1]<<8 | parametro[0]; indiceAmostra = (controle & 0x3FF); indiceResposta = (controle >> 10); valorAmostra = valor & 0x7FFFFF; valorAmostra = valorAmostra*(2.4/8388607); if((valor & 0x800000) == 0x800000) valorAmostra = valorAmostra*(-1);
the input param array is uInt8 type, because I saw in other topics that does not move with uInt8,
I copy the values in the array param to parameter , which is of type uInt32, but still does not work.
Test the input parameter with the following values:
[] param = {10,14,10,0,16}
the returned valorAmostra is 0,00117188 then it should be 0,300003.
Can someone help me please?
Portuguese:
OLA,
Is um no bug no LabVIEW para esta operacao. Este bug devera ser corrigido em paid futuras. UMA Solução para esta down e use int32 ao investment of um ulnt32 um.
Any doubt please between let em.
Obrigado.
English:
I studied the problem you are having, and it turns out that this is a bug that has already been reported and documented. The work around is to use int32 instead of uInt32.
Thank you.
-
disable the node property problem
Hi all!
I want to do a VI that the user will not fool around with the button.
So I put in my case for the "change the value" event, a node property disable during 1 second (disable) and out of it, an enable.
The problem is that if I press the as button 3 times in 1 second, the button will still change the value 3 times, as he has memory.
I want to just the user to be able to make changes to the value only after 1 second and not save them. I hope I made myself understood
Are there any suggestions?
You may use a state machine with two loops. UI loop place the actionwith a timestamp and the loop of consumer can compare timestamps to decide if enough time has passed, or if the action should be discarded.
-
Error 1 has occurred to the node invoke in openvi.vi
Hi, openvi.vi, I use Invoke node to run showchannel2.vi, I encountered the problem about error 1. refer to the attachment file.
Absolutely, this problem have been described below.
Error 1 has occurred to the node invoke in openvi.vi
Possible reasons:
LabVIEW: An input parameter is not valid.
---
NOR-488: Command requires controller GPIB be in Charge.I don't know why? How can I overcome this issue?
Thank you very much
The data types of your controls do not match. In the Subvi you have a U8. In the VI parent cursor is data type of DBL. change the cursor to a U8. You must also make sure that you have a valid range on your cursor. In the Subvi you subtract the input value 8, so it seems you're wanting a control with a minimum value of 8.
-
Using intermittent problems "invoke the node->; default reset" command to delete a table
I use the 'default' reinitalization invoke the node to clear a table after sending the data to a file. The next time that the vi is called the table should appear all items, set the default values. However sometimes the picture is not deleted and data since the previous call of the vi are still in the arrary, or at least it appears that way, since the same data for the previous time called appear in the file when new values are added to the file. New data looks good, as the data points in the table that I don't update appear with the old values. And again, it is an intermittent problem. I can solve this problem for a while in any case stop labview and re-run it. Any ideas what's happening?
Thank you.
Chuck
Maybe you are looking for
-
Only has Skippidity (sp?) where and how did get there?
When I pulled the top of Firefox, this morning, I got a toolbar named Skipity (I think that's the spelling). I went to tools, found and removed, but this is not the point; I want to know where it comes from and who authorized its installation. She ap
-
Satellite A200 - boots motorcycle cycle Post - in touch with Toshiba tomorrow
HelloI have a Toshiba Satellite A200 when start does not get past the message, get you the commercial display of system "In Touch with tomorrow Toshiba" press F2 or F12 for the boot of friends menu. The blue bar get about 3/4 of the way through, then
-
Program: Consent UI for administrative applicationsLocation: C:\windows\system32\consent.exe
-
0xC004F055 - windows vista business service pack 2 Update error
automatic update for service Pack 2 came and installed. but after 3 pass. He turned back. After the system starts but cannot connect to users in vista. Code: 0xC004F055 I bought this dell laptop and I have the original sticker on the back of the lapt
-
Trigger the native code in WebView - Invocation?
Hello I have a WebView inside my application and trigger the native code on certain events in the Web view. In iOS or Android, I would like to make a call to a URI (myapp://dothisfunction) and I as regged of URI in the app. But is it possible in 10 B