Issue with extracting node values of an XMLElement with multiple namespaces
I have created a Table with XMLType Column
CREATE TABLE xmlNode
( ID numeric(10) primary key,
DATA XMLType);
Then inserted one row
INSERT INTO xmlNode(ID, DATA) VALUES(1, '<lineItemElement orderLineItemID="12323" transactionType="New" xmlns="http://rcss.bell.ca/schema/lineitemmessages">
<rcss:catalogeID xmlns:rcss="http://rcss.bell.ca/schema/PartnerBatch">3234</rcss:catalogeID>
<rcss:venueID xmlns:rcss="http://rcss.bell.ca/schema/PartnerBatch">345345</rcss:venueID>
<rcss:startDate xmlns:rcss="http://rcss.bell.ca/schema/PartnerBatch">2007-09-10T00:00:00Z</rcss:startDate>
<rcss:endDate xmlns:rcss="http://rcss.bell.ca/schema/PartnerBatch">2007-09-10T00:00:00Z</rcss:endDate>
<rcss:contact contactID="234234" xmlns:rcss="http://rcss.bell.ca/schema/PartnerBatch">
<rcss:address>
<rcss:streetAddress1>?asdsd</rcss:streetAddress1>
<rcss:streetAddress2>?sdss</rcss:streetAddress2>
<rcss:city>?ddf</rcss:city>
<rcss:province>?sdcfsdcf</rcss:province>
<rcss:country>sds</rcss:country>
<rcss:postalCode>1121332</rcss:postalCode>
</rcss:address>
</rcss:contact>
</lineItemElement>')
Then i ran:
SELECT
extractValue(data,'/lineItemElement/rcss:catalogeID','xmlns=http://rcss.bell.ca/schema/lineitemmessages, xmlns:rcss=http://rcss.bell.ca/schema/PartnerBatch')
from xml where id=1
There is nothing returned.
Please advise how could I get the node value when there is namespace?
I know how to extract values if there is one namespace but i'm not able to extract values if there are two namespaces.
Any help is appreciable!!
Thanks in Advance.
I fixed that problem too. What I thought was a singleton was actually a repeating element. I needed to be able to "multiply" the repeating node for the main node, but I couldn't find a concise way of doing this in SQL. So instead I did it in with two loops.
FOR rec IN (
SELECT
extractvalue(value(e), 'surchargeEntry/company',p_namespace) company
,extractvalue(value(e), 'surchargeEntry/surchargeType',p_namespace) surcharge_type
,extractvalue(value(e), 'surchargeEntry/shortDescription',p_namespace) short_description
,extractvalue(value(e), 'surchargeEntry/longDescription',p_namespace) long_description
,e.column_value surcharge_entry_xml
FROM TABLE(xmlsequence(extract(p_xml, 'surchargeInquiryResponse' ||
'/surchargeAttributes/surchargeEntry'
,p_namespace))) e
) LOOP
FOR rec_country IN (
SELECT
extractvalue(value(c), 'country/originationCountry',p_namespace) origination_country
,extractvalue(value(c), 'country/destinationCountry',p_namespace) destination_country
FROM TABLE(xmlsequence(extract(rec.surcharge_entry_xml, 'surchargeEntry/country',p_namespace))) c
LOOP
nafta_fee_obj.append_surcharge_entry_data(
v_arr
,r_surcharge_entry(
rec.company
,rec.surcharge_type
,rec.short_description
,rec.long_description
,rec_country.origination_country
,rec_country.destination_country
END LOOP;
END LOOP;
I populate a collection, which is easy to pass around between routines. I can easily convert the collection to a ref cursor, and index-by array, comma-delimited string, etc.
Apparently, the namespace is required in SQL, but not in staright PL/SQL.
I've also noticed that the docs say xmltype() has all these member functions, but when I try to use some of them, I get an error that it's undefined. Like getNumVal(). There are some functions I can use in SQL, or PL/SQL, but not vice-versa.
- Dan Clamage
Similar Messages
-
Store XML node value into an array with node element name
Hi,
I have the following code that displays the node element with the
corresponding node value. I want to store the values in an array in
reference to the node name.
i.e.
XML (my xml is much bigger than this, 300 elements):
<stock>
<symbol>SUNW</symbol>
<price>17.1</price>
</stock>-----
would store the following:
*data[symbol] = SUNW;*
*data[price] = 17.1;*
Thanks in advance,
Tony
test.jsp
Here's my source code:
<html>
<head>
<title>dom parser</title>
<%@ page import="javax.xml.parsers.*" %>
<%@ page import="org.w3c.dom.*" %>
<%@ page import="dombean.*" %>
</head>
<body bgcolor="#ffffcc">
<center>
<h3>Pathways Info</h3>
<table border="2" width="50%">
<jsp:useBean id="domparser" class="dombean.MyDomParserBean" />
<%
Document doc = domparser.getDocument("c:/stocks/stocks.xml");
traverseTree(doc, out);
%>
<%! private void traverseTree(Node node,JspWriter out) throws Exception {
if(node == null) {
return;
int type = node.getNodeType();
switch (type) {
// handle document nodes
case Node.DOCUMENT_NODE: {
out.println("<tr>");
traverseTree
(((Document)node).getDocumentElement(),
out);
break;
// handle element nodes
case Node.ELEMENT_NODE: {
String elementName = node.getNodeName();
//if(elementName.equals("MOTHER-OCC-YRS-PREVIOUS")) {
//out.println("</tr>");
out.println("<tr><td>"+elementName+"</td>");
NodeList childNodes =
node.getChildNodes();
if(childNodes != null) {
int length = childNodes.getLength();
for (int loopIndex = 0; loopIndex <
length ; loopIndex++)
traverseTree
(childNodes.item(loopIndex),out);
break;
// handle text nodes
case Node.TEXT_NODE: {
String data = node.getNodeValue().trim();
//if((data.indexOf("\n") <0) && (data.length() > 0)) {
out.println("<td>"+data+"</td></tr>");
%>
</table>
</body>
</html>
{code}
*MyDomParserBean.java*
Code: package dombean;
{code:java}
import javax.xml.parsers.*;
import org.w3c.dom.*;
import java.io.*;
public class MyDomParserBean
implements java.io.Serializable {
public MyDomParserBean() {
public static Document
getDocument(String file) throws Exception {
// Step 1: create a DocumentBuilderFactory
DocumentBuilderFactory dbf =
DocumentBuilderFactory.newInstance();
// Step 2: create a DocumentBuilder
DocumentBuilder db = dbf.newDocumentBuilder();
// Step 3: parse the input file to get a Document object
Document doc = db.parse(new File(file));
return doc;
{code}
Edited by: ynotlim333 on Sep 24, 2007 8:41 PM
Edited by: ynotlim333 on Sep 24, 2007 8:44 PM
Edited by: ynotlim333 on Sep 24, 2007 8:45 PMI still need to store it in an array because its 300 elements in the XML stocks.
I've done the following but its not working, i'm getting error codes. I think its an easy fix. I'd also like to pass a String instead of a .xml document b/c my xml is stored inside a DB. Any suggestions on that?
<html>
<head>
<title>dom parser</title>
<%@ page import="javax.xml.parsers.*" %>
<%@ page import="org.w3c.dom.*" %>
<%@ page import="org.*" %>
</head>
<body bgcolor="#ffffcc">
<center>
<h3>Pathways Info</h3>
<table border="2" width="50%">
<jsp:useBean id="domparser" class="org.MyDomParserBean" />
<%
Document doc = domparser.getDocument("c:/stocks/stocks.xml");
traverseTree(doc, out);
%>
<%!
public String element_store = null;
public String[] stock_data = new String[400];
private void traverseTree(Node node,JspWriter out) throws Exception {
if(node == null) {
return;
int type = node.getNodeType();
switch (type) {
// handle document nodes
case Node.DOCUMENT_NODE: {
out.println("<tr>");
traverseTree
(((Document)node).getDocumentElement(),
out);
break;
// handle element nodes
case Node.ELEMENT_NODE: {
String elementName = node.getNodeName();
element_store = elementName;
//if(elementName.equals("MOTHER-OCC-YRS-PREVIOUS")) {
//out.println("</tr>");
NodeList childNodes =
node.getChildNodes();
if(childNodes != null) {
int length = childNodes.getLength();
for (int loopIndex = 0; loopIndex <
length ; loopIndex++)
traverseTree
(childNodes.item(loopIndex),out);
break;
// handle text nodes
case Node.TEXT_NODE: {
String data = node.getNodeValue().trim();
if((data.indexOf("\n") <0) && (data.length() > 0)) {
out.println("<tr><td>"+element_store+"</td>");
out.println("<td>"+data+"</td></tr>");
stock_data[element_store]=data;
%>
</table>
</body>
</html> -
How to extract node value by using xpath in orchestration shape
i want extract the node value by using xpath in expression shape in orch, then assign to variable.
then decide shape in if branch im using check condition based nodevalue .
str = xpath(Message_3, ("string(/*[local-name()='Root' and namespace-uri()='http://BizTalk_Server_ProjectRNd2.Schema3']/*[local-name()='no' and namespace-uri()=''])"));
but i got below error:
xlang/s engine event log entry: Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'BizTalk_Server_ProjectRNd2.BizTalk_Orchestration1(f3c581d3-049f-8a8a-9316-fc1235b03f99)'.
The service instance will remain suspended until administratively resumed or terminated.
If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
InstanceId: 020779be-713d-408c-9ff4-fd1462c2e52c
Shape name: Expression_1
ShapeId: b865a3e1-7ebe-410d-9f60-8ad2139ad234
Exception thrown from: segment 1, progress 10
Inner exception: There is an error in the XML document.
Exception type: InvalidOperationException
Source: System.Xml
Target Site: System.Object Deserialize(System.Xml.XmlReader, System.String, System.Xml.Serialization.XmlDeserializationEvents)
The following is a stack trace that identifies the location where the exception occured
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
at Microsoft.XLANGs.Core.Part.XPathLoad(Part sourcePart, String xpath, Type dstType)
at BizTalk_Server_ProjectRNd2.BizTalk_Orchestration1.segment1(StopConditions stopOn)
at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)
Additional error information:
<no xmlns=''> was not expected.
Exception type: InvalidOperationException
Source: System.Xml
Target Site: System.Object Read_string()
The following is a stack trace that identifies the location where the exception occured
at System.Xml.Serialization.XmlSerializationPrimitiveReader.Read_string()
at System.Xml.Serialization.XmlSerializer.DeserializePrimitive(XmlReader xmlReader, XmlDeserializationEvents events)
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)Hi,
as per your code i got below error
Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'BizTalk_Server_ProjectRNd2.BizTalk_Orchestration1(f3c581d3-049f-8a8a-9316-fc1235b03f99)'.
The service instance will remain suspended until administratively resumed or terminated.
If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
InstanceId: f5fffb05-e6d6-4765-83da-4e6c9696dd8a
Shape name: Expression_1
ShapeId: b865a3e1-7ebe-410d-9f60-8ad2139ad234
Exception thrown from: segment 1, progress 10
Inner exception: There is an error in the XML document.
Exception type: InvalidOperationException
Source: System.Xml
Target Site: System.Object Deserialize(System.Xml.XmlReader, System.String, System.Xml.Serialization.XmlDeserializationEvents)
The following is a stack trace that identifies the location where the exception occured
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializat
this is my schema:
<?xml version="1.0" encoding="utf-16"
?>
<xs:schema xmlns="http://BizTalk_Server_ProjectRNd2.Schema3" xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
xmlns:ns0="https://BizTalk_Server_ProjectRNd2.PropertySchema" targetNamespace="http://BizTalk_Server_ProjectRNd2.Schema3" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:appinfo>
<b:imports>
<b:namespace
prefix="ns0" uri="https://BizTalk_Server_ProjectRNd2.PropertySchema" location=".\PropertySchema.xsd"
/>
</b:imports>
</xs:appinfo>
</xs:annotation>
<xs:element name="Root">
<xs:annotation>
<xs:appinfo>
<b:properties>
<b:property
name="ns0:no" xpath="/*[local-name()='Root' and namespace-uri()='http://BizTalk_Server_ProjectRNd2.Schema3']/*[local-name()='no' and namespace-uri()='']"
/>
</b:properties>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element
name="no" type="xs:string" />
<xs:element
name="name" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema> -
Extract Node Values using XPATH
This may be a repeat question.
No offence meant
I am using XPATH to extract values from the nodes.
I need to extract the value of i:RequestedBy Node using XPATH
<?xml version="1.0" encoding="UTF-8"?>
<i:Interest>
<i:Status>0</i:Status>
<i:Generation>2</i:Generation>
<i:Details xsi:type="i:vanilla.details.stock">
<i:RequestedBy>AA.MM</i:RequestedBy>
The above XML is of type Document
Document msgDoc;
XPath xpath = XPathFactory.newInstance().newXPath();
XPathExpression expr;
Object result=null;
try {
expr = xpath.compile("i:Interest/i:Details/i:RequestedBy/text()");
result = expr.evaluate(msgDoc, XPathConstants.NODESET);
NodeList nodes = (NodeList) result;
for (int i = 0; i < nodes.getLength(); i++) {
System.out.println(nodes.item(i).getNodeValue());
} catch (XPathExpressionException e1) {
e1.printStackTrace();
I am getting null/
Is my XPATH correct?I don't know if your XPath is correct or not. Your XML is not well-formed because the namespace declarations are missing. And I don't see where you set the namespace context for your XPath object; that is quite likely why it doesn't do what you want.
-
Extracting node value from XPath Expression in OSB Conditional Branch
HI All
While using conditional branch in OSB,i only get an XPath Expression editor to set a variable used to test a condition.
Now let's say my request is
<Body>
<exam:PersonSearchReq xmlns:exam="http://www.example.org">
<exam:RequestorSSO>James</exam:RequestorSSO>
</exam:PersonSearchReq>
</Body>
I write my XPath expression as :
./exam:PersonSearchReq/exam:RequestorSSO/text()
Now if I test this using the tester application , insted of getting node value 'James' ,i get the entire node element ,i.e
<exam:RequestorSSO xmlns:exam="http://www.example.org">James</exam:RequestorSSO>
Please suggest how can i extract the text value.
Regards,
ChinmayHi Guys
Actually it turns out that you need to populate In-Variable to function is correctly.As soon as i entere 'body' in it,it worked fine.
Thanks
Chinmay -
Read a XML node value/attribute value from a CLOB
Hello,
I can write SQL/ - PL/SQL "straightforward" but now I have a problem what is to big for me. I hop that someone can help.
We create by code a xml structure and write these into the oracle database CLOB field. I'm sorry to say that a xml text structure is written into a clob in stead of a xmltype field. (it's a design failure?) It's a large xml structure. I believe I can't attach a file so I put at the end of this discussion a light example of the xml structure.
It's a xml with quartervalue's, so there are 35040 detail rows (24h * 4 * 365days). I want to accumulate the the attribute Amount value 9. The amount value is in the Detail node a attribute but at the end you can see that for the DST are also 4 value's, but these are not attribute value's but node value's. (In this case it are four value's in some cases there is one DST amount value.
Can somebody help me how to accumulate all the detail attribute value Amount with the node value Amount of the DST tag?
XML structure:
<?xml version="1.0"?>
<Message xmlns:ns1="http://automaticdealcapture/">
<BusinessDocument messageDateTime="2013-10-25T13:59:31+02:00" ediReference="LO-461967" messageName="New" businessSector="Z" documentFunction="Original">
<DocumentData>
<ns1:Adcs>
<ns1:Package>
<ns1:Deal>
<ns1:ProductCode>PWCODE</ns1:ProductCode>
<ns1:Action>NEW</ns1:Action>
<ns1:Memo1>MemoField</ns1:Memo1>
<ns1:Details>
<ns1:Detail Dates="2014-01-01" Datee="2014-01-01" Times="00:00:00" Timee="01:00:00" Amount="0.0153" Price="11.111"/>
<ns1:Detail Dates="2014-01-01" Datee="2014-01-01" Times="01:00:00" Timee="02:00:00" Amount="0.015" Price="22.222"/>
etc. 350040 detail rows.
</ns1:Details>
<ns1:DSTS>
<ns1:Year Val="2014">
<ns1:DST Period="1">
<ns1:Amount>0.0146</ns1:Amount>
<ns1:Price>33.333</ns1:Price>
</ns1:DST>
<ns1:DST Period="2">
<ns1:Amount>0.0222</ns1:Amount>
<ns1:Price>33.333</ns1:Price>
</ns1:DST>
<ns1:DST Period="3">
<ns1:Amount>0.0444</ns1:Amount>
<ns1:Price>33.333</ns1:Price>
</ns1:DST>
<ns1:DST Period="4">
<ns1:Amount>0.0146</ns1:Amount>
<ns1:Price>33.333</ns1:Price>
</ns1:DST>
</ns1:Year>
</ns1:DSTS>
</ns1:Deal>
</ns1:Package>
</ns1:Adcs>
</DocumentData>
</BusinessDocument>
</Message>From what I know, extracting the "Amount" values in the Details section and the "Amount" values in the DSTS section would be two different SELECT statements.
Both of these will use XMLTable() to extract the values.
BTW - If you need more information on this, post up in the XML/XML DB forum section for more complex help. (eg getting YEAR with the DSTS Amount values)
as far as XML size goes, I've seen oracle handle a 100MB XML document without problems.
(just understand, it will be 'slow')
This one will give you the Amount values from the DSTS section:
with xml_data as ( SELECT
XMLType('<?xml version="1.0"?>
<Message xmlns:ns1="http://automaticdealcapture/">
<BusinessDocument messageDateTime="2013-10-25T13:59:31+02:00" ediReference="LO-461967" messageName="New" businessSector="Z" documentFunction="Original">
<DocumentData>
<ns1:Adcs>
<ns1:Package>
<ns1:Deal>
<ns1:ProductCode>PWCODE</ns1:ProductCode>
<ns1:Action>NEW</ns1:Action>
<ns1:Memo1>MemoField</ns1:Memo1>
<ns1:Details>
<ns1:Detail Dates="2014-01-01" Datee="2014-01-01" Times="00:00:00" Timee="01:00:00" Amount="0.0153" Price="11.111"/>
<ns1:Detail Dates="2014-01-01" Datee="2014-01-01" Times="01:00:00" Timee="02:00:00" Amount="0.015" Price="22.222"/>
</ns1:Details>
<ns1:DSTS>
<ns1:Year Val="2014">
<ns1:DST Period="1">
<ns1:Amount>0.0146</ns1:Amount>
<ns1:Price>33.333</ns1:Price>
</ns1:DST>
<ns1:DST Period="2">
<ns1:Amount>0.0222</ns1:Amount>
<ns1:Price>33.333</ns1:Price>
</ns1:DST>
<ns1:DST Period="3">
<ns1:Amount>0.0444</ns1:Amount>
<ns1:Price>33.333</ns1:Price>
</ns1:DST>
<ns1:DST Period="4">
<ns1:Amount>0.0146</ns1:Amount>
<ns1:Price>33.333</ns1:Price>
</ns1:DST>
</ns1:Year>
</ns1:DSTS>
</ns1:Deal>
</ns1:Package>
</ns1:Adcs>
</DocumentData>
</BusinessDocument>
</Message>') as XMLDATA from dual
select Y.amount
from xml_data X,
XMLTable( XMLNAMESPACES( 'http://automaticdealcapture/' as "ns1"),
'/Message/BusinessDocument/DocumentData/ns1:Adcs/ns1:Package/ns1:Deal/ns1:DSTS/ns1:Year/ns1:DST'
passing X.XMLData
COLUMNS
amount Number PATH '/ns1:DST/ns1:Amount'
) Y;
Replace the XMLTable() with the one below to get the Amount from the Details section:
XMLTable( XMLNAMESPACES( 'http://automaticdealcapture/' as "ns1"),
'/Message/BusinessDocument/DocumentData/ns1:Adcs/ns1:Package/ns1:Deal/ns1:Details/ns1:Detail'
passing X.XMLData
COLUMNS
amount number PATH '/ns1:Detail/@Amount'
) Y; -
How extract a value from table?
how extract a value only from table with labview 5.0?
Hi T4l
I modified you VI to extract a selected row from the table. This is quite simple by done by using the index array function. Hope this helps
B Bakels
Labview CLD , Engineer/Manager
Promedes and DSM
using LV 7.1, 8.0, 8.2, 8.5 and 2009 SP1
http://www.promedes.nl
Attachments:
Untitled 2.vi 16 KB -
Cluster nodes receiving by logical, sending with physical IP
Hi. I'm a cluster beginner and using Cluster 2.2 with two nodes, I'm having problems with logical IP.
Both nodes have got their physical and logical IPs configured in the same subnet (e.g., x.y.z.1, .2, and .3).
Primary node is reached fine via logical IP, but when it sends frames back it uses its physical IP as IPsource.
Is there anything I'm doing wrong? Does it happen the same with cluster 3.0?
Thanks in advance.Your quite right this is a known problem, but it is actually a problem on all operating systems not just Solaris. We have been approached to solve it and we have, see following for the details:
http://www.DefaultRouter.com/
Although the WP describes an environment slightly different from how imagine your is you can see that the technology does solve the problem. -
Extract specific value of a Clob column with multiple nodes,similar name
Hi,
There is a clob column in the table USER_DETAILS which hold the values similar to the one given below, i would like to form a query which should fetch the entire record where the age<30, as all the child nodes are with similar name i couldn't fetch it out using xmltype.extract. Also the order of the node values may change for eg. age may follow salary or age can be the first node in the list. Please help me to fetch the desired details.
<Details>
<parameter>
<enter>
<value>name</value>
<value>jacob</value>
</enter>
<enter>
<value>Age</value>
<value>30</value>
</enter>
<enter>
<value>Salary</value>
<value>20000</value>
</enter>
<enter>
<value>DOB</value>
<value>12091980</value>
</enter>
Thanks, gilbertLet's start with the easy part.
Cells on a Numbers table can contain data entered directly, or can contain a formula. They can't contain both. That means you cannot 'type the conditions into a single cell' in column A ("the left header" cell) AND have a formula which sets that cell to TRUE if the typed in data contains an "A".
There's no problem doing this using column A as the key holder and columns B:Z to hold the TRUE/FALSE results, staring in both cases on row 2.
Here's an example
The column header cells (row 1) contain the letter corresponding to that column.
The row header cells (starting at row 2) contain the 'bunch of letters' you describe. Note (A4) that the letters do not have to be entered in any particular order, and that extraneous characters (eg. a space) are ignored.
The formula shown is entered B2, and filled down and right from there.
=IFERROR(FIND(B$1,$A2)>0,FALSE)
FIND returns the position of the first occurrence of the target string (in this case, the single letter at the top of the column) in the search string, then compares that with the value zero. For any letter that is included in the search string, the find value will be at least 1, so the comparison will return TRUE. If the target letter is not found, FIND returns an error. IFERROR traps this and returns FALSE.
Since the target depends on the letter at the top of the column, all that's needed to extend the range of possible letters to the full alphabet is to enter an A in cell B1, then run through the alphabet A to Z, with Z in cell AA1.
Depending what you want to do with the TRUE or FALSE values in these 26 columns, it may be possible to skip the auxiliary column step and use a formula similar to the one above as the condition argument of an IF(condition,do-if-true,do-if-false) statement.
Regards,
Barry -
Oracle SQL - Extracting clob value from XML with repeating nodes
Hi All,
I am attempting to run SQL on a table (called test_xml with a column xml_data [data type xmltype]). The column contains xml with repeating nodes (description). The following statement runs successfully when the node contains data of a non clob size:
SELECT
extractvalue (Value (wl), '*/description')
FROM test_xml
, TABLE (xmlsequence (extract (xml_data, '*/record'))) wl
but fails when description node contains a lot of data:
ORA-01706: user function result value was too large
I amended my query:
SELECT
extractvalue(Value (wl), '*/description').getClobVal()
FROM test_xml
, TABLE (xmlsequence (extract (xml_data, '*/record'))) wl
but this fails with:
ORA-22806: not an object or REF
Thanks in AdvanceHi Greg,
11.2.0.2.0 (Although I will need to do this on my work instance also which is 10.2.0.4)That's gonna be a problem...
Direct CLOB projection is supported starting with 11.2.0.2, using XMLTable or XMLCast/XQuery functions (extractvalue, extract, xmlsequence are deprecated now) :
SELECT x.*
FROM test_xml t
, XMLTable(
'/*/record'
passing t.xml_data
columns
description clob path 'description'
) x
;On prior versions, implicit conversions will occur to VARCHAR2 datatype, hence the limitation observed.
AFAIK you have two options on 10.2.0.4 :
1) Using Object-Relational storage, with the xdb:SQLType="CLOB" annotation.
2) Using the following trick :
SELECT dbms_xmlgen.convert(x.description.getClobVal(), 1) as description
FROM test_xml t
, XMLTable(
'/*/record'
passing t.xml_data
columns
description xmltype path 'description/text()'
) x
; -
Issue using extractval to get the node value when there is namespace
I created the db with a XMLType column:
CREATE TABLE mytable1 (key_column VARCHAR2(10) PRIMARY KEY, xml_column1 XMLType);
Then inserted one row:
INSERT INTO mytable1 (key_column,xml_column1) VALUES ('test', XMLType('<MY_TEST xmlns="http://xmlns.oracle.com/ku" version="1.0">
<SCHEMA>SYSTEM</SCHEMA>
<NAME>TABLE41</NAME>
<TEST_GROUP>TEST_GRP_RMP</TEST_GROUP>
<TEST_NAME>DEPARTTEST</TEST_NAME>
<FUNCTION_SCHEMA>SYSTEM</FUNCTION_SCHEMA>
<TEST_FUNCTION>EXCLUDE_TABLE</TEST_FUNCTION>
<STATEMENT_TYPE_LIST>
<STATEMENT_TYPE_LIST_ENTRY>
<NAME>SELECT</NAME>
</STATEMENT_TYPE_LIST_ENTRY>
</STATEMENT_TYPE_LIST>
<UPDATE_CHECK>Y</UPDATE_CHECK>
<ENABLE>Y</ENABLE>
<STATIC_POLICY>N</STATIC_POLICY>
<TEST_TYPE>DBMS_RLS.DYNAMIC</TEST_TYPE>
<LONG_PREDICATE>N</LONG_PREDICATE>
</MY_TEST>'));
Then I ran:
select extractValue(xml_column1,'MY_TEST/TEST_NAME') policy from mytable1;
There is nothing returned.
If i do not have "xmlns="http://xmlns.oracle.com/ku" " in MY_TEST node, then the correct value returned.
Please advise how could I get the node value when there is namespace? Thanks.This is a known issue. In the third parameter of extractvalue, set the namesapce. Then it works.
-
OBIEE 11g (11.1.1.5.0) - Issue with starting Node Manager
Hi,
Have anyone faced an issue with starting Node Manager in OBIEE 11g (11.1.1.5.0)? OS is 64 bit Linux, WebLogic is 10.3.5. I used the software-install method and followed by running config.sh. Everything completed successfully. I updated the catalog and rpd location in the FMW control screen.
To get it activated I bounced services and when I try to start Node Manager it gives below error --
<Aug 30, 2011 2:02:42 PM CDT> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG to FIPS186PRNG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true>
<Aug 30, 2011 2:02:42 PM> <SEVERE> <Fatal error in node manager server>
java.io.IOException: Unsupported cypher suite: TLS_RSA_EXPORT_WITH_RC4_40_MD5
at weblogic.nodemanager.server.SSLListener.init(SSLListener.java:82)
at weblogic.nodemanager.server.NMServer.start(NMServer.java:206)
at weblogic.nodemanager.server.NMServer.main(NMServer.java:377)
at weblogic.NodeManager.main(NodeManager.java:31)
Aug 30, 2011 2:02:42 PM weblogic.nodemanager.server.NMServer main
SEVERE: Fatal error in node manager server
java.io.IOException: Unsupported cypher suite: TLS_RSA_EXPORT_WITH_RC4_40_MD5
at weblogic.nodemanager.server.SSLListener.init(SSLListener.java:82)
at weblogic.nodemanager.server.NMServer.start(NMServer.java:206)
at weblogic.nodemanager.server.NMServer.main(NMServer.java:377)
at weblogic.NodeManager.main(NodeManager.java:31)
+ set +x
I see the same issue reported in ML OBIEE 11g - Node manager fails to start upon upgrade [ID 1329442.1] and WebLogic Server: Node Manager Startup is Failing with java.io.IOException: Unsupported cypher suite [ID 1329260.1] I tried to modify commEnv.sh. But it didnt help me.
Please let me know if anyone have faced similar issue and what exactly did you do to resolve it.
Cherrish Vaidiyan
Edited by: Cherrish on Aug 30, 2011 3:14 PMHi,
There are Two types of Cipher suites --- Certicom Cipher Suite and SunJSSE Equivalent Cipher Suite. And with Weblogic 10.3.5, you are using Sun JSSE Cipher Suite, and by default Node Manager uses the Certicom Cipher Suite.
In the nodemanager.properties, Add CipherSuite=SSL_RSA_EXPORT_WITH_RC4_40_MD5, save and restart Node Manager.
Reference Metalink Note: WebLogic Server 10.3.x: Getting "Unsupported Cipher" Exceptions When Starting Node Manager [ID 1307325.1]
Cherrish Vaidiyan -
Extract the node value of the input schema in a mapping
I want to extract the value of request_id in the xslt of the mapping where the input schema format is in the below image.
I tried the following, but I am not able to pull out the value. Could anyone help with it.
<xsl:template match="/s1:TranslationsRequest">
<ns1:Value>
<xsl:value-of select="SelectRecord/s0:REQUEST_ID/text()" />
</ns1:Value>SelectRecord Record has a blank namespace. Instance Xpath for request_id has a different namespace(s0). TranslationsRequest has a different namespace(s1). So I used as above.
la Cour Vertica: I tried, "s1:SelectRecord/s0:REQUEST_ID/text()", but it's not working. May be because of blank namespace for SelectRecord
boatseller: I tried the following, but it failed. May be because TranslationRequest has a namespace, REQUEST_ID has a namespace and no namespace for SelectRecord
<xsl:template match="/s1:TranslationsRequest">
<ns1:Value>
<xsl:value-of select="//*[local-name()='SelectRecord']/*[local-name()='REQUEST_ID']/text()"
/>
</ns1:Value> -
Hi All,
We have an issue with the R&R demon when creating a new extract. The queue AC_Extract holds with a DDIC_WRITE error. After deleting it and releasing the queue, the extract will eventually end succesfully. We have the same problem with all MSA sites. What does the error mean and what can we do to prevent it?
Thanks!Hi,
isn't it SPE_DDIC_WRITE which causes the problem?!
Then in case you are running 5.0 please check note 765953.
Regards,
Wolfhard -
XMLSearch / case in-sensitive search in a text node value with XPATH
Hi everyone,
I was aggregating some XML files and queries for a search
engine. It is pretty easy with coldfusion XML functions BUT ....
I was looking around XMLSearch to do a simple text search
into nodes and I am stuck with it.
with something like that :
selectedElements = XmlSearch(myxmldoc,
'(/directory/user[contains(.,"#form.firstName#")])');
Without loop all the XML elements, I cannot put firstName
text nodes to lower-case, do a simple search into the directory and
get user entries.
Is it possible to do with XPATH something like that :
selectedElements = XmlSearch(myxmldoc,
'(/directory/user[contains(lower-case(.),lower-case("#form.firstName#"))])');
Thanks for your help.When Do you think coldfusion will implement Xpath functions
as
http://www.w3schools.com/xpath/xpath_functions.asp
????
Maybe you are looking for
-
I participated in getting the free download of Mountain Lion for new Mac owners. It took me three days to finally get a code to do it and when I tried downloading it, the estimated time was 74 days 17 hours. Now an error occurred. What do I do? I am
-
Type of object in if statement
Hello i have a function that needs to know if the object is either a block01 or a block02. if i trace the object in particular i get [object block01] and [object block02] just as i want. but if i try to use the same thing in an if statement it isn't
-
How can I change the browser for Preview in Browser?
I can't find the preferences for changing the default browser than opens when previewing an animation.
-
Are HP Chromebook to HP Officejet Compatible
I have an HP Officejet 4630 Printer and I was wondering if it would be compatible with an HP Chromebook? I am thinking of buying one and I wanted to know the jist. Also did you guys know that you can't add spaces in this text box? LOL you have to typ
-
can we call an form (.fmx) or a report (.rep) from a database trigger. that is when there is some insertion in the table i want to call a report which will take the parameters from the table changed. regards vishal