Extractvalue gives "only one node" error
Here is an example I tried to create based on some information I found at:
http://www.orafaq.com/faq/how_does_one_store_and_extract_xml_data_from_oracle
I created the table with the following:
create table XMLTable (doc_id number, filename varchar2(100), xml_data XMLType);
For a particular record, the xml_data field looks like this:
<FAQ-LIST>
<QUESTION>
<QUERY>Question 1</QUERY>
<RESPONSE>Abraham Lincoln</RESPONSE>
</QUESTION>
<QUESTION>
<QUERY>Question 2</QUERY>
<RESPONSE>Thomas Jefferson</RESPONSE>
</QUESTION>
</FAQ-LIST>
I tried to model my select statement after the example:
select extractValue(xml_data, '/FAQ-LIST/QUESTION/RESPONSE')
from XMLTable
where doc_id = 1
and existsNode(xml_data, '/FAQ-LIST/QUESTION[QUERY="Question 1"]') = 1;
hoping for a result of "Abraham Lincoln", but instead get the error:
ORA-19025: EXTRACTVALUE returns value of only one node ...
How can I arrange the query so I get one RESPONSE for each QUERY value named?
Thanks,
--Dave
SQL> SELECT EXTRACTVALUE (COLUMN_VALUE, 'QUESTION/RESPONSE') response
FROM TABLE
(XMLSEQUENCE
(EXTRACT
(XMLTYPE
('<FAQ-LIST>
<QUESTION>
<QUERY>Question 1</QUERY>
<RESPONSE>Abraham Lincoln</RESPONSE>
</QUESTION>
<QUESTION>
<QUERY>Question 2</QUERY>
<RESPONSE>Thomas Jefferson</RESPONSE>
</QUESTION>
</FAQ-LIST>'
'/FAQ-LIST/QUESTION'
) t
WHERE EXTRACTVALUE (COLUMN_VALUE, 'QUESTION/QUERY') = 'Question 1'
RESPONSE
Abraham Lincoln
1 row selected.
Similar Messages
-
XML - ORA-19025: EXTRACTVALUE returns value of only one node
Hi,
I am new to XML DB. Can somebody help me with the below XML
I use the following XML ... (I have pasted only a part of it coz i require data only till this section )
XML
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Body>
<ns:PicklistWS_GetPicklistValues_Output xmlns:ns="urn:crmondemand/ws/picklist/">
<ListOfParentPicklistValue xmlns="urn:/crmondemand/xml/picklist">
<ParentPicklistValue>
<Language>ENU</Language>
<ParentFieldName>plProduct_Team</ParentFieldName>
<ParentDisplayValue>Marketing On Demand</ParentDisplayValue>
<ParentCode>Marketing On Demand</ParentCode>
<Disabled>N</Disabled>
<ListOfPicklistValue>
<PicklistValue>
<Code>OCP/SME Escalation</Code>
<DisplayValue>OCP/SME Escalation</DisplayValue>
<Disabled>N</Disabled>
</PicklistValue>
<PicklistValue>
<Code>Fusion Request</Code>
<DisplayValue>Fusion Request</DisplayValue>
<Disabled>N</Disabled>
</PicklistValue>
Code
SELECT distinct
EXTRACTVALUE(VALUE(SR), '/ParentPicklistValue/ListOfPicklistValue/PicklistValue/Code','xmlns="urn:/crmondemand/xml/picklist"') AS Display,
EXTRACTVALUE(VALUE(SR),'/ParentPicklistValue/ListOfPicklistValue/PicklistValue/DisplayValue','xmlns="urn:/crmondemand/xml/picklist"') AS Return,
EXTRACTVALUE(VALUE(SR),'/ParentPicklistValue/ParentDisplayValue','xmlns="urn:/crmondemand/xml/picklist"') AS parent_display,
EXTRACTVALUE(VALUE(SR),'/ParentPicklistValue/ParentCode','xmlns="urn:/crmondemand/xml/picklist"') AS parent_return
FROM TABLE(XMLSEQUENCE(EXTRACT(
WEB_SERVICE('<?xml version="1.0" encoding="UTF-8" standalone="no"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<PicklistWS_GetPicklistValues_Input xmlns="urn:crmondemand/ws/picklist/">
<FieldName>Type</FieldName>
<RecordType>Service Request</RecordType>
</PicklistWS_GetPicklistValues_Input>
</soap:Body>
</soap:Envelope>'
,'document/urn:crmondemand/ws/picklist/:GetPicklistValues', Sessionid),
'/soap:Envelope/soap:Body/*/*/*','xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/'))) SR
ERROR
ORA-19025: EXTRACTVALUE returns value of only one node
UNDERSTANDING
As my Xpath points only until the node - ParentPicklistValue and not the child nodes under it. Hence when i try to query the child nodes - /ParentPicklistValue/ListOfPicklistValue/PicklistValue/Code, I recieve the above mentioned error.
REQUIREMENT
Can somebody help me to recieve the Parent values and also its child values based on the above query and xml.Hi,
That's a classic ;)
You need a second XMLSequence that will shred the collection of PicklistValue into relational rows :
select extractvalue(value(sr2), '/PicklistValue/Code', 'xmlns="urn:/crmondemand/xml/picklist"') AS Display
, extractvalue(value(sr2), '/PicklistValue/DisplayValue', 'xmlns="urn:/crmondemand/xml/picklist"') AS Return
, extractvalue(value(sr1), '/ParentPicklistValue/ParentDisplayValue', 'xmlns="urn:/crmondemand/xml/picklist"') AS parent_display
, extractvalue(value(sr1), '/ParentPicklistValue/ParentCode', 'xmlns="urn:/crmondemand/xml/picklist"') AS parent_return
from table(
xmlsequence(
extract( WEB_SERVICE( ... )
, '/soap:Envelope/soap:Body/ns:PicklistWS_GetPicklistValues_Output/ListOfParentPicklistValue/ParentPicklistValue'
, 'xmlns="urn:/crmondemand/xml/picklist"
xmlns:ns="urn:crmondemand/ws/picklist/"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"' )
) sr1
, table(
xmlsequence(
extract( value(sr1)
, '/ParentPicklistValue/ListOfPicklistValue/PicklistValue'
, 'xmlns="urn:/crmondemand/xml/picklist"' )
) sr2
;What's your database version BTW?
On 10.2 and up, you may use XMLTable instead. -
"ORA-19025 EXTRACTVALUE returns value of only one node" - Suggestion
ORA-19025 EXTRACTVALUE returns value of only one node
When this error occurs, would you please provide some or all of the following information:
(1) row number
(2) row id
(3) the name of the offending column
(5) the XQuery expression
(6) the node name
(7) the text value being parsed, in which an excess node was found
and would you consider processing every good row, assuming it may be correct,
because, in 13 thousand lines generated by my view, there is unlikely to even one more row in error.
Thank you,
Mike Rainville
FYI,
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
ojdbc6.jar 11.1.0.7.0Thanks for the suggestion...
The problem is that in one row, information in a data dump about two different things was combined into one, due to a gap in the input file. The starting delimiter for the second thing and the ending delimiter for the first were missing. The result was that many entity tags that should have been unique were duplicated, ion that particular row.
I was able to guard the view against future such errors with occurrences using this
in the WHERE clause ...
AND NOT ( XMLCLOB LIKE '%<TAG1>%<TAG1>%'
OR XMLCLOB LIKE '%<TAG2>%<TAG2>%'
OR XMLCLOB LIKE '%<TAG3>%<TAG3>%'
/* ... Repeated once for each tag used with extractvalue */
OR XMLCLOB LIKE '%<TAGN>%<TAGN>%'
It filters out any row with two identical starting tags, where one is expected.
I am pleased to see that the suggestion got through. -
SCAN LISTENER runs from only one node at a time from /etc/hosts !
Dear all ,
Recently I have to configure RAC in oracle 11g(r2) in AIX 6.1 . Since in this moment it is not possible to configure DNS, so I dont use SCAN ip into the DNS/GNS, I just add the SCAN ip into the host file like :
cat /etc/hosts
SCAN 172.17.0.22
Got the info from : http://www.freeoraclehelp.com/2011/12/scan-setup-for-oracle-11g-release211gr2.html#ORACLE11GR2RACINS
After configuring all the steps of RAC , Every services are ok except SCAN_LISTENER . This listener is up only one node at a time . First time when I chek it from node1 , it shows :
srvctl status scan_listener
SCAN listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node dcdbsvr1
now when I relocate it from node 2 using
"srvctl relocate scan -i 1-n DCDBSVR2" , then the output shows :
srvctl status scan_listener
SCAN listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node dcdbsvr2
Baring these , we have to try to relocate it from the node2 by the following way, then it shows the error :
srvctl relocate scan -i 2 -n DCDBSVR2
resource ora.scan2.vip does not exists
Now my question , How can I run the SCAN and SCAN_LISTENER both of the NODES ?
Here is my listener file (which is in the GRID home location) configuration :
Listener File OF NODE1 AND NODE 2:
==================================
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON
LISTENER_SCAN1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC) (KEY = LISTENER_SCAN1)
ADR_BASE_LISTENER_SCAN1 = /U01/APP/ORACLE
2)
Another issue , when I give the command : " ifconfig -a " , then it shows the SCAN ip either node1 or node2 . suppose if the SCAN ip is in the node1 , and then if I run the "relocate" command from node2 , the ip goes to the Node 2 . is it a correct situation ? advice plz ... ...
thx in advance .. ...
Edited by: shipon_97 on Jan 10, 2012 7:22 AM
Edited by: shipon_97 on Jan 10, 2012 7:31 AMAfter configuring all the steps of RAC , Every services are ok except SCAN_LISTENER . This listener is up only one node at a time . First time when I chek it from node1 , it shows :If I am not wrong and after looking at the document you sent, you will be able to use only once scan in case you use /etc/host file and this will be up on only one node where you added this scan entry in /etc/hosts file.
Now my question , How can I run the SCAN and SCAN_LISTENER both of the NODES ?Probably you can't in your case, you might run only one i think and on one node only
srvctl status scan_listener
SCAN listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node dcdbsvr1
now when I relocate it from node 2 using
"srvctl relocate scan -i 1 -n DCDBSVR2" , then the output shows :
srvctl status scan_listener
SCAN listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node dcdbsvr2You moved scan listener from node 1 to node 2, OK
Baring these , we have to try to relocate it from the node2 by the following way, then it shows the error :
srvctl relocate scan -i 2 -n DCDBSVR2
resource ora.scan2.vip does not exists
--------------------------------------------------------------------------------Since you have only one scan, you can't relocate "2". So ise "1" instead here also
FYI
http://www.oracle.com/technetwork/database/clustering/overview/scan-129069.pdf
Salman -
Extract return only one node.
error is ORA-19025: EXTRACTVALUE returns value of only one node
CREATE OR REPLACE PROCEDURE a_insertZipcodes
IS
p_directory VARCHAR2(100);
p_filename VARCHAR2(100);
l_xml xmltype;
type tp is record (c1 varchar2(100), c2 varchar2(100));
type t is table of tp;
r t;
BEGIN
sp_co_set_globalvar(null,null,null,null,51,null,null,'EOD',null);
p_filename :='myxml.xml';
p_directory:=get_handoff_path_batch(PKG_CO_GLOBALVAR.ctrl1);
l_xml := xmltype(bfilename(p_directory, p_filename), nls_charset_id('AL32UTF8'));
select extractvalue(l_xml,'root/flexcube/contractStatus/system'),
extractvalue(l_xml,'root/flexcube/contractStatus/accessKey') bulk collect into r from dual;
for i in r.first..r.last loop
dbms_output.put_line(r(i).c1);
dbms_output.put_line(r(i).c2);
end loop;
END;
xml file is :
<root>
<flexcube>
<contractStatus>
<system>TRESTEL</system>
<accessKey>eDealer</accessKey>
<password>eDealer</password>
<uuid>eDealer</uuid>
<sequenceNumber>206981112980100</sequenceNumber>
<sourceAddress>M@112980000201@2011-10-25 02:10:03.016@Internal@1112980100@20698@FX@1</sourceAddress>
<signature>FEDCBA98765432100123456789ABCDEF</signature>
<ref_num>
<contractRef>1112980100</contractRef>
</ref_num>
<branch>018</branch>
</contractStatus>
<contractStatus>
<system>TRESTEL</system>
<accessKey>eDealer</accessKey>
<password>eDealer</password>
<uuid>eDealer</uuid>
<sequenceNumber>206981112980100</sequenceNumber>
<sourceAddress>M@112980000201@2011-10-25 02:10:03.016@Internal@1112980100@20698@FX@1</sourceAddress>
<signature>FEDCBA98765432100123456789ABCDEF</signature>
<ref_num>
<contractRef>1112980100</contractRef>
</ref_num>
<branch>018</branch>
</contractStatus>
<contractStatus>
<system>TRESTEL</system>
<accessKey>eDealer</accessKey>
<password>eDealer</password>
<uuid>eDealer</uuid>
<sequenceNumber>206981112980100</sequenceNumber>
<sourceAddress>M@112980000201@2011-10-25 02:10:03.016@Internal@1112980100@20698@FX@1</sourceAddress>
<signature>FEDCBA98765432100123456789ABCDEF</signature>
<ref_num>
<contractRef>1112980100</contractRef>
</ref_num>
<branch>018</branch>
</contractStatus>
</flexcube>
</root>
error is ORA-19025: EXTRACTVALUE returns value of only one nodeuse xmltable as in Re: XMl Inserting
-
How to give only one function module execution Auth for a User ?
Dear Experts
I have reviewed S_DEVELOP auth object. It is not ful filling my requirement
Any Ideas !!
RgdsRakesh...Firstly thanks for reply.
As i said i reviewed these and found it is not meeting my requirement.
As we aware We can control auth to Function modules thru object type
Filed OBJTYPE----
FUGR --> 1st control
and with Function Group Name
Field OBJNAME----
<Function Group Name> --> 2nd control
In my scenario - I have given the authroizations as below
++++++++++++++++++++++++++++++++++++++++++++++++++++
ACTVT Activity Display, Execute
DEVCLAS Package *
OBJNAME Object name ZECC_FG
OBJTYPE Object type FUGR
P_GROUP Authorization group ABAP/4 pro *
++++++++++++++++++++++++++++++++++++++++++++++++++++
The above authroization is giving all Function modules authrozation under ZECC_FG Function Group.
My Requirement
I shoudl be able to give only one Function Module of a Function group where multiple function modules exist under the same Function Group.
How can i acheiveit. Any Custom Control can be place to acheive this.
I am sure S_DEVELOP will not solve my requirement (I Beleive)
Regards -
I want to make only one node draggable in the tree. How?
I want to make only one node draggable in the tree. How?
when we have only
tree.setDragEnable(true)which makes draggable the entire nodes in the tree.
Thanks -Hi Andrea
Just to clarify things up: is this what you want?
package treeDnD;
* DragJustOneNode.java
import java.awt.*;
import java.awt.datatransfer.*;
import java.awt.dnd.*;
import java.io.*;
import javax.swing.*;
import javax.swing.tree.*;
public class DragJustOneNode extends JFrame {
private JTree tree;
private DefaultTreeModel model;
private DefaultMutableTreeNode root;
public DragJustOneNode() {
super("Only child 1 is draggable!");
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
setSize(400,300);
setLocationRelativeTo(null);
tree = new JTree();
tree.setDragEnabled(true);
getContentPane().add(new JScrollPane(tree), BorderLayout.CENTER);
tree.setTransferHandler(new TreeTransferHandler());
root = new DefaultMutableTreeNode(new NodeData(0, "root"));
root.add(new DefaultMutableTreeNode(new NodeData(1, "child 1")));
root.add(new DefaultMutableTreeNode(new NodeData(2, "child 2")));
root.add(new DefaultMutableTreeNode(new NodeData(3, "child 3")));
root.add(new DefaultMutableTreeNode(new NodeData(4, "child 4")));
model = new DefaultTreeModel(root);
tree.setModel(model);
public static void main(final String args[]) {new DragJustOneNode().setVisible(true);}
class NodeData{
private int id;
private String data;
public NodeData(final int id, final String data){
this.id = id;
this.data = data;
public int getId() {return id;}
public void setId(final int id) {this.id = id;}
public String getData() {return data;}
public void setData(final String data) {this.data = data;}
public String toString() {return data;}
class TreeTransferable implements Transferable{
private NodeData nodeData;
public TreeTransferable(NodeData nodeData){
this.nodeData = nodeData;
public DataFlavor[] getTransferDataFlavors() {
return new DataFlavor[]{DataFlavor.stringFlavor};
public boolean isDataFlavorSupported(DataFlavor flavor) {
return true;
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
return nodeData;
class TreeTransferHandler extends TransferHandler{
private DefaultMutableTreeNode sourceNode, targetNode;
public boolean canImport(final JComponent comp, final DataFlavor[] transferFlavors) {
NodeData nodeData = (NodeData) (sourceNode).getUserObject();
if(nodeData.getId() == 1) return true;
return false;
protected Transferable createTransferable(final JComponent c) {
JTree tree = ((JTree)c);
sourceNode = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
return new TreeTransferable((NodeData) sourceNode.getUserObject());
public int getSourceActions(final JComponent c) {return DnDConstants.ACTION_MOVE;}
public boolean importData(final JComponent comp, final Transferable t) {
JTree tree = ((JTree)comp);
DefaultTreeModel model = (DefaultTreeModel)tree.getModel();
targetNode = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
DefaultMutableTreeNode parent = (DefaultMutableTreeNode)targetNode.getParent();
if(parent == null) return false;
model.removeNodeFromParent(sourceNode);
model.insertNodeInto(sourceNode, parent, parent.getIndex(targetNode));
tree.setSelectionPath(new TreePath(model.getPathToRoot(sourceNode)));
return true;
} -
Hi
I am working on portal SP14.
I wan't that the DTN will show only one Open folder (node) at a time.
Meaning, when a user presses on a folder (node) in the DTN- This folder (node) will open and other opened Folder (node) will be closed automatically.
Thanks
NirHi, I have the same Problem. Has nobody a solution?
-
ORA-19025: EXTRACTVALUE returns value of only one nod- When creating index
Hi,
My table have 2 columns . Columns are
Key varchar2(50)
Attribute XMLType
Below is my sample XML which is stored in Attribute column.
<resource>
<lang>
<lc>FRE</lc>
<lc>ARA</lc>
</lang>
<site>
<sp>257204</sp>
<sp>3664</sp>
</site>
<page>
<pp>64272714</pp>
<pp>64031775</pp>
<pp>256635</pp>
</page>
<key>
<kt>1</kt>
</key>
</resource>
When i try to create a index on XML column and i am getting the above exception. kindly help me out becz i'm not familar with oracle.
Query is
create index XMLTest_ind on language_resource_wrapper
(extractValue(attribute, '/resource/site/sp') )
index on sp,pp elements in the above XML.Thanks for the suggestion...
The problem is that in one row, information in a data dump about two different things was combined into one, due to a gap in the input file. The starting delimiter for the second thing and the ending delimiter for the first were missing. The result was that many entity tags that should have been unique were duplicated, ion that particular row.
I was able to guard the view against future such errors with occurrences using this
in the WHERE clause ...
AND NOT ( XMLCLOB LIKE '%<TAG1>%<TAG1>%'
OR XMLCLOB LIKE '%<TAG2>%<TAG2>%'
OR XMLCLOB LIKE '%<TAG3>%<TAG3>%'
/* ... Repeated once for each tag used with extractvalue */
OR XMLCLOB LIKE '%<TAGN>%<TAGN>%'
It filters out any row with two identical starting tags, where one is expected.
I am pleased to see that the suggestion got through. -
Oracle 10g RAC - two nodes - change SAN storage - only one node up
Hi all,
We're using Oracle 10g with Linux Red Hat.
We want to migrate to another SAN storage.
The basic steps are:
node 1:
1. presents the volume disk and create partition
2. asmlib create disk newvolume
3. alter diskgroup oradata add disk newdisk
4. alter diskgroup oradata drop disk OLDDISKOTHERSAN
But THE NODE 2 DOWN.
we want start the NODE 2 only after ALL operations in node 1 finish.
What's you opinion? Any impact?
Can I execute the oracleasm scandisks on node 2 after?
thank you very much!!!!modify the commands just slightly...
1. presents the volume disk node1 AND node2
2. create partition node1 [if necessary?? ]
3. asmlib create disk newvolume [node1] ## I am not a fan of and have never had to use ASMlib - however, apparently you do...
4. asmlib scandisk... [node2]
[on one of the nodes]
alter diskgroup oradata add disk1 newdisk rebalance power 0
alter diskgroup oradata add disk2 newdisk rebalance power 0
alter diskgroup oradata add disk3 newdisk rebalance power 0
alter diskgroup oradata add disk{n} newdisk rebalance power 0
alter diskgroup oradata drop disk1 OLDDISKOTHERSAN rebalance power 0
alter diskgroup oradata drop disk2 OLDDISKOTHERSAN rebalance power 0
alter diskgroup oradata drop disk3 OLDDISKOTHERSAN rebalance power 0
alter diskgroup oradata drop disk{n} OLDDISKOTHERSAN rebalance power 0
alter diskgroup oradata rebalance power {n}
You can actually do this with BOTH nodes ONLINE. I was involved in moving 250TB from one storage vendor to another - all online - no downtime, no outage.
And before you actually do this and break something - TEST it first!!! -
Hello
We are planning to have 10g eventually with 2 nodes in the next 2 weeks. We would like to start preparation, can we install it on our first node and then complete the install when the second is in place.Hi,
You start your prepration on Node1 straight away and can only Implement RAC when Node2 in its place.
Regards
Sunny -
Hi,
I installed oracle cluster ware on oel5 with version oracle 11g r2 on two node.
After installation of cluster ware i am trying to install oracle database software. But while installing it is showing only the first node only node1 that to in grey. another node is not detecting.
what could be the problem. If you know please let me know.
thank youCan you post the output of below command.
export SRVM_TRACE=true
srvctl status nodeapps -n servername
Thanks,
Nayab -
Xml parse, only one node
Hello,
I need to parse a xm string (i've got a String variable with an xml in it) to extract some fields.
All the examples i've read tell you how to index a xml with different nodes on it, but isn't there some function to extract just the field you need?
For example, CPU.
Thanks.
<TEMPLATE><CONTEXT><FILES><![CDATA[/srv/cloud/images/cursos_images/-curso-iop-nodos/context/init.sh]]></FILES><HOSTNAME><![CDATA[ioparal_node1]]></HOSTNAME><IP><![CDATA[192.168.210.2]]></IP><TARGET><![CDATA[hdd]]></TARGET></CONTEXT><CPU><![CDATA[1]]></CPU><DISK><DISK_ID><![CDATA[0]]></DISK_ID><SOURCE><![CDATA[/srv/cloud/images/cursos_images/curso-iop-nodos/-curso-iop-nodo.img]]></SOURCE><TARGET><![CDATA[hda]]></TARGET></DISK><GRAPHICS><KEYMAP><![CDATA[es]]></KEYMAP><LISTEN><![CDATA[127.0.0.1]]></LISTEN><PORT><![CDATA[6680]]></PORT><TYPE><![CDATA[vnc]]></TYPE></GRAPHICS><MEMORY><![CDATA[2048]]></MEMORY><NAME><![CDATA[curso-ioparal_node1]]></NAME><NIC><BRIDGE><![CDATA[br1]]></BRIDGE><IP><![CDATA[192.168.210.2]]></IP><MAC><![CDATA[fe:c0:a8:d2:02]]></MAC><NETWORK><![CDATA[curso-iop-local]]></NETWORK><NETWORK_ID><![CDATA[145]]></NETWORK_ID></NIC><OS><ROOT><![CDATA[hda1]]></ROOT></OS><RANK><![CDATA[- RUNNING_VMS]]></RANK><REQUIREMENTS><![CDATA[HYPERVISOR = "kvm"]]></REQUIREMENTS><VCPU><![CDATA[1]]></VCPU><VMID><![CDATA[780]]></VMID></TEMPLATE>i tried it and i got 1 as a result value of CPU tag.
Here is the code.
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
public class XMLParse
public static void main(String[] args) throws Exception
String tmp = "<TEMPLATE><CONTEXT><FILES><![CDATA[/srv/cloud/images/cursos_images/-curso-iop-nodos/context/init.sh]]></FILES><HOSTNAME><![CDATA[ioparal_node1]]></HOSTNAME><IP><![CDATA[192.168.210.2]]></IP><TARGET><![CDATA[hdd]]></TARGET></CONTEXT><CPU><![CDATA[1]]></CPU><DISK><DISK_ID><![CDATA[0]]></DISK_ID><SOURCE><![CDATA[/srv/cloud/images/cursos_images/curso-iop-nodos/-curso-iop-nodo.img]]></SOURCE><TARGET><![CDATA[hda]]></TARGET></DISK><GRAPHICS><KEYMAP><![CDATA[es]]></KEYMAP><LISTEN><![CDATA[127.0.0.1]]></LISTEN><PORT><![CDATA[6680]]></PORT><TYPE><![CDATA[vnc]]></TYPE></GRAPHICS><MEMORY><![CDATA[2048]]></MEMORY><NAME><![CDATA[curso-ioparal_node1]]></NAME><NIC><BRIDGE><![CDATA[br1]]></BRIDGE><IP><![CDATA[192.168.210.2]]></IP><MAC><![CDATA[fe:c0:a8:d2:02]]></MAC><NETWORK><![CDATA[curso-iop-local]]></NETWORK><NETWORK_ID><![CDATA[145]]></NETWORK_ID></NIC><OS><ROOT><![CDATA[hda1]]></ROOT></OS><RANK><![CDATA[- RUNNING_VMS]]></RANK><REQUIREMENTS><![CDATA[HYPERVISOR = \"kvm\"]]></REQUIREMENTS><VCPU><![CDATA[1]]></VCPU><VMID><![CDATA[780]]></VMID></TEMPLATE>";
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
InputStream inp = new ByteArrayInputStream(tmp.getBytes());
Document doc = docBuilder.parse(inp);
System.out.println(XMLParse.getTagValue(doc,"TEMPLATE#CPU"));
public static String getTagValue(Document doc,String tagPattern)
String[] tags = tagPattern.split("#");
String resultValue = "";
Element el;
NodeList nodes = doc.getElementsByTagName(tags[0]);
if(nodes != null && nodes.getLength() > 0)
el = (Element)nodes.item(0);
for(int i=1; i < tags.length; i++)
nodes = el.getElementsByTagName(tags[ i]);
if(nodes != null && nodes.getLength() > 0)
el = (Element)nodes.item(0);
if(el != null && el.getFirstChild() != null)
resultValue = el.getFirstChild().getNodeValue();
return (resultValue == null)?"":resultValue;
----- -
CUCM with CUBE - ITSP gives only one audio codec
Hi,
CUCM 9.1, CUBE 8.7 based on ISR 2821 with free PVDM2, ITSP with SIP telephony.
Need to understand what variants do I have in terms of configuring CUCM & CUBE & Media Resource.
Call flow must be the following: CUCM (SIP Trunk) > CUBE (flow-through is preferable) > ITSP SIP.
ITSP has g711alaw as a single choice.
The media resource if needed I prefer to configure on the same ISR (colocated with CUBE).
Calling endpoints are Cisco IP Phones which supports both u-/a- law.
CUCM cluster is also configured for both u-/a- law support (based on service parameters).
1. Configure no media resource i.e.
- CUCM use no MTP and works using DO (delayed offer) mode
- Make CUBE's voice class codec and dialpeers are using only g711a
Will it work? If yes, is it optimal?
2. Configure transcoder and MTP
- XCODE will be registered on CUCM using SCCP and available to SIP trunk via MRG/MRGL
- MTP will be registered the same way as a separate media profile
- SIP trunk will use MTP and g711a as originating codec
Will it work? If yes, is it optimal?
Thank you.Really good explanation from you, thank you.
You mean DO-EO conversion on CUBE by its means? Will I loose the possibility to use flow-through then?
Configure conversion of a delayed offer to an early offer:
voice-class sip early-offer forced in dial-peer configuration mode
early-offer forced in global VoIP configuration mode
Example:In dial-peer configuration mode:
Device (config) dial-peer voice 10 voip
Device (config-dial-peer) voice-class sip early-offer forced
Device (config-dial-peer) end
Example:In global VoIP SIP mode:
Device(config)# voice service voip
Device (config-voi-serv) sip
Device (config-voi-sip) early-offer forced
Device (config-voi-sip) end
The Delayed-Offer to Early-Offer (DO-EO) feature allows CUBE to convert a delayed offer that it receives into an early offer. This feature is supported in the Media Flow-Around mode.
http://www.cisco.com/c/en/us/td/docs/ios-xml/ios/voice/cube_sip/configuration/xe-3s/cube-sip-xe-3s-book/do-to-eo.html#task_225982666015625011230880737304687 -
Upgrating to Mountain Lion gives only "no recovery" error message
When trying to install ML to MBPro ( 8 Gt, 8.55 Gt free in HD, 2.26 GHz, OSX 10.6.8 ) this message pops up and I have to cancel the upgrating. What to do?
Since you need at least 8GB of available space, I suspect you don't have enough. Dump 10-20 GB to an ext HD and remove it from your installation. That should free enough to do the install.
Maybe you are looking for
-
Lines in a Illustrator-created PDF
I am having issues when some people print a PDF I created from Illustrator. It looks like the border around the page is going through the page diagonally. It does not appear like this when viewed as a PDF. This is a multi-page printout tiled 5 pages
-
Setup of Lis. extractor
Hi ! Can I get a material of the process of setup and automatic uploading of Lis. extractor ( 2LIS_13_VDITM, 2LIS_03_BX - compress process etc. ) . Thanks Moshe
-
Automating work flow with Shared Reviews
Is there a way to manage the work flow with shared reviews? In other words, I have a pdf document I need to send out for review. I have several people on my review team, and I want them to look at in in sequence rather than all at the same time. Pers
-
CS4: Font not missing, but glyph doesn't show
I have a Word 2003 document that I am trying to import as a test file. It has 2 sets of symbols: greater than or equal to and less than or equal to, one set in Times New Roman and the other in Symbol (PostScript). I have InDesign CS2 and CS4 on my co
-
WIFI hardware wont allow me to connect to webpages
I am getting an error within my Chrome browser that says, "this webpage is not available". This error only occurs when I try to use the wifi mode. Everything is fine when I plug in the RJ45 cable/ethernet cable directly to my notebook. The wifi butto