Getting the nodes of an xsd
I have a schema, which has both complex type and simple type elements. I want to parse the schema and get the root element, complex type and simple type element names.
Though i have seen some similar queries in the forum but none of them provide a complete solution.
I have tried using XMLSchema and getXMLSchemaNodeTable() but this gives only the root nodes.
My schema looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.abc.com/schema/teamDesc"
attributeFormDefault="unqualified">
<element name="team">
<complexType>
<sequence>
<element name="teamLongDesc" maxOccurs="unbounded">
<complexType>
<sequence>
<element name="TeamId" type="integer" default="0" />
<element name="TeamCode" type="string" />
<element name="TeamDesc" type="string" />
</sequence>
<attribute name="isMaster" use="required" />
<attribute name="primaryKey" use="required" />
</complexType>
</element>
</sequence>
</complexType>
</element>
</schema>
Thanks for the reply..when i use schema.getXMLSchemaNodeTable(), the Hashtable contains only the following items, this is as per the schema i have given above
(java.util.Hashtable<K,V>) {http://www.ifs.com/schema/teamDesc=oracle.xml.parser.schema.XMLSchemaNode@124e935, http://www.w3.org/2001/XMLSchema=oracle.xml.parser.schema.XMLSchemaNode@4ac866}
Similar Messages
-
How to get the Node Value from XmlValue result?
Hi ,
I am not able to get the Node Value from the result. In my XQuery im selecting till a Node, if i change my query as
collection('PhoneBook')/phone_book/contact_person/address/string()", qc);
im getting the node value, but here the problem is its not a Node so i cannot get the Node name.
So how can i get the Node Name and Node value together?
any help please ????
XML :
<?xml version="1.0" encoding="UTF-8"?>
<phone_book>
<contact_person>
<name>
<first_name>Michael</first_name>
<second_name>Harrison</second_name>
</name>
<address city="yyyyy" pincode="600017" state="xxxxx">
176 Ganesan street, Janakinagar, alwarthirunagar
</address>
</contact_person>
<phone_number type="mobile">9881952233</phone_number>
<phone_number type="home">044-24861311</phone_number>
<phone_number type="office">080-12651174</phone_number>
</phone_book>
Code:
XmlQueryContext qc = manager.createQueryContext();
XmlResults rs = manager.query
("collection('PhoneBook')/phone_book/contact_person/address", qc);
while(rs.hasNext()){
XmlValue val = rs.next();
System.out.println(val.getNodeName() + " = [ " + val.getNodeValue() + " ] ");
Output
address = [ ]You are right, this seemed un-intuitive to me too, but I finally understood how it's done.
The "value" of a node is actually the total amount of text that is not contained in any of the node's child nodes (if any). So a node with child nodes can still have text value.
To get the 'value' of an element node, you must therefore concatenate the values of all children of type "XmlValue::TEXT_NODE", of that node. Try it.
In your example, the <address> node has no child elements, my guess is that BDB XML stores the address string "176 Ganesan street, Janakinagar, alwarthirunagar" inside a child node of <address> node (of type XmlValue::TEXT_NODE) because you wrote the string on a separate line. -
How to get the node id of the content shown from campaign
Hi
Can any one please tell how to get the node id of the content shown by the campaign
in jsp
ThanksOne option is to define a custom ad renderer, which is registered with the proper mime-type.
The campaign would run your renderer if the campaign retrieved a node with a binary of the proper registered mime-type.
This allows you to insert yourself into the call chain for the node rendering. You can access the nodeID at that point (and do the typical rendering-- providing a URL for the ShowPropertyServlet)
-Steve -
How to get the node value of payload
Hi
The null is returned when I use the following code to get the User_ID element in the payload, but there are values in the User_ID element of the payload
Task task_test = wfSvcClient.getTaskQueryService().getTaskDetailsById(wfCtx, taskId);
System.out.println("the payload value is " + task_test.getPayloadAsElement().getElementsByTagName("User_ID").item(0).getNodeValue());
How to get the node value of payload ? any suggestion?
Thanks
JaysonHi Jayson,
Try:
System.out.println("the payload value is " + task_test.getPayloadAsElement().getElementsByTagName("User_ID").item(0).getFirstChild().getNodeValue());
So add the getFirstChild() call in between.
If this works, maybe consider using JAXB to marshall the payload details to POJO's. This will make reading the payload details much easier.
Regards, Ronald -
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.
-
Just comparing one string how to get the node?
hi group,
I get the string value like this:
String listselvalue = getJList1().getSelectedValue().toString();
Just i am comparing this with particular node.(which is in tree) like this:
TreePath path = getmy_tree().getPathForRow(1);
DefaultMutableTreeNode selnode = (DefaultMutableTreeNode)path.getLastPathComponent();
Enumeration enum = selnode.children();
while(enum.hasMoreElements())
if(enum.nextElement().toString().equalsIgnoreCase(listselvalue))
//here what trick I have to use to get that node.(if it matches)
thank u...
Shalinipriya.You need your node for both your test and your manipulation if the test is succesfull, so just keep a ref to your node before the test, and use that ref for both test and manipulation. Within your code, it should look like this:
Enumeration elts = selnode.children();
while ( elts.hasMoreElements() ) {
// keep a ref to the current node,
// so you can bith test its name
// and manipulate it if it match you critiria
Object currentNode = elts.nextElement();
if ( currentNode.toString().equalsIgnoreCase( listValue ) ) {
// here you have your currentNode object
// that is a DefaultMutableTreeNode
doNodeJob( currentNode );
} -
How to get the node name?
Hi Guys,
I have a path that look like this root/1stLevel/dynamicLevel
how can i get the dynamic level node name when it come with different node name so that i can catch it into one of the variable?
it may change according to the requester
root/1stLevel/dynamicLevel1
root/1stLevel/dynamicLevel2
root/1stLevel/dynamicLevel3
root/1stLevel/dynamicLevel4What software? In OSB try Assign with this expression:
fn:name($body/root/firstLevel/*[1])By the way, you can't use element named "1stLevel" because it starts with number. -
Impossible to get the Sun NS and XSD to validate my web.xml
Hello,
I'm having a problem getting the namespace and schema to validate my web.xml file. Three days ago, everythings were working fine, but since friday I can't get the XSD.
The top of my web.xml looks like this :
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
>When I try to validate my web.xml, I got error like this :
s4s-elt-character: Non-whitespace characters are allowed ...I've recently seen other topics like this, but I'm not sure it's the same issue.
Is it a known issue? What can I do to validate my web.xml? Are there mirrors for this XSD?
Best Regards.
Message was edited by:
ArloPlease help, I still have the problem and it seems it's a known issue :
http://dev.eclipse.org/newslists/news.eclipse.webtools/msg03484.html -
How to get the node's coordinates when Node is in a managed container
I worked thru the documentation of "BoundsInParent and BoundsInLocal" but these values do not seem to be resonable when the Node is within a managed container
e.g. when the node is placed in a HBox or BorderPane.
How can I estimate the y-coordinate of this node (relative to the scene) ?Have you tried Node's "localToScene" method?
-
Where we get the OutboundMessageService.WSDL OutboundMessageService.XSD files?
Hi Gurus,
Where we can download the follwing file for the webservice integration. Is it availble in OER?
OutboundMessageService.WSDL
OutboundMessageService.XSD
Thanks in Advance,
MohanHi,
No, the WSDL and XSD for this are not in OER currently since it catalogs only the webservices Fusion Applications contains, but it seems useful addition so I'll see if we can get them added.
If you have an on-premises instance you can find it in Enterprise Manager, going to the crmCommon weblogic server, from the menu selecting Webservices, and finding the OutboundMessageServiceSoapHttpPort from the list under J2EE Intrastructure Webservices. Also you can use the Test Webservice feature in EM to shows and parse the WSDL at http://[myinstance]/crmCommonSalesParties/OutboundMessageService?wsdl
This is the same format for the SOAP message triggered by the Object Workflow and sent to the remote system endpoint.
Hope this helps
Richard
FA Developer Relations - blogs.oracle.com/fadevrel -
Function Module to get the node name in particular level name in Hierarchy
Hi All,
We have 0Material hierarchy which consists of 14 levels and materials are in the 14th level.
We have a requirement to update the 4th level node name to all materials.
So we have created the attribute to this 0Material and thought of updating in the transformation.
Could you please suggest us to which function module i can in this scenario.
Thanks in advance,..
PrasannaCan you explain in more detail what exactly you want to do?
do you want to limit hierarchy to level4?
Regards
Sudeep -
Get the node key while using button on toolbar
HI All
I'm using alv tree (class - CL_GUI_ALV_TREE ) and I want to add a button
to the toolbar (class - CL_GUI_TOOLBAR ) that User can delete
a row from the tree .
assume the user put the cursor on row
how can i know on which node_key is it ?
I am using the event function selected for the button ...
Regards
AlexAlex,
check this sample program BCALV_TREE_04
call method g_alv_tree->get_selected_nodes
changing
ct_selected_nodes = lt_selected_nodes.
Thanks
Bala Duvvuri -
HOW TO GET THE VALUE OF A NODE IN XMLDOC?
i have an xml doc like this:
<FUSIONHUB>
<INFO>
<COMPANY_ID>A001</COMPANY_ID>
</INFO>
</FUSIONHUB>
HOW TO RETRIEVE THE VALUE A001?
I HAVE USED NODE.getNodevalue() method but it returned null instead of A001.
can anybody please answer ?
waitng for replies immediately.
nullHi,
You need to get the child node of the company_id node and then get the node value.
The value A001 is stored in a textnode under the node company_id.
Thanks,
Oracle XML Team -
How to get the name and value of an attribute on a node/element that is not a child
Hello,
Can someone shed some wisdom on how I can compare 2 xml nodes for differences.
My main challenge is I need to use the attributes/values of 'ProductDescription' and 'Features' as 'key' to identify the same node in
another doc with the same layout, but different content.
I am having trouble getting the name of the attribute on the node, 'ProductDescription' and 'Features'. I can only seem to get the node names, but not the attributes on the node. I need the name, because it can be different from doc to doc, so
I can't hardcode this.
Can someone please help with how to retrieve an attribute name/value on a node that is not a child. Here's an example of what
my xml looks like:
DECLARE
@myDoc1 xml
,@mydoc2 xml
DECLARE
@ProdID int
SET @myDoc1 ='<ProductDescription ProductID="1" ProductName="Road Bike">
<Features featureID = "1" featureName = "body">
<Warranty>1 year parts and labor</Warranty>
<Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
</Features>
<features featureID = "2" featureName = "seat">
<Warranty>1 year parts and labor</Warranty>
<Maintenance>2 year parts and labor extended maintenance is available</Maintenance>
</Features>
</ProductDescription>
SET @myDoc2 ='<ProductDescription ProductID="1" ProductName="Road Bike">
<Features featureID = "1" featureName = "body">
<Warranty>2 year parts and labor</Warranty>
<Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
</Features>
<features featureID = "2" featureName = "wheel">
<Warranty>1 year parts and labor</Warranty>
<Maintenance>2 year parts and labor extended maintenance is available</Maintenance>
</Features>
</ProductDescription>
I need to compare the attributes of 'ProductDescription' and 'Features' from @mydoc1 against @mydoc2 to see if they are the same based on those 2 nodes first. If they are, then i want to show the difference in the child elements.
This will eventually be an outer join to give me the differences betw the 2 docs based on those key values (node attributes).
I used node('//*') for the path, and value('local-name(../.)', 'varchar(50)') as element
,value('.[not(@xsi:nil = "true")]','VARCHAR(255)') AS new_value
...etc...
but that only gives me the node names, and the child elements. It does not give me back the attribute names and values from the node itself.
Thanks in advance for your help.
ceeAre you looking for something like this:
DECLARE @myDoc1 xml
SET @myDoc1 ='<ProductDescription ProductID="1" ProductName="Road Bike">
<Features featureID = "1" featureName = "body">
<Warranty>1 year parts and labor</Warranty>
<Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
</Features>
<Features featureID = "2" featureName = "seat">
<Warranty>1 year parts and labor</Warranty>
<Maintenance>2 year parts and labor extended maintenance is available</Maintenance>
</Features>
</ProductDescription>'
SELECT T.c.value('local-name(.)', 'nvarchar(50)') AS name,
T.c.value('.', 'nvarchar(50)') AS value
FROM @myDoc1.nodes('ProductDescription/@*') AS T(c)
Erland Sommarskog, SQL Server MVP, [email protected] -
How to get the folder name of selected subitem in tree structure?
Hi All,
I created a tree structure like below.
->Folder1-- 1
2
3
->Folder2-----1
2
3
i.e i have two folders & each folder having the values like above.Now i want to perform some action by clicking on the any of the values.Suppose if i click value 2,i want to do some action.the actions need to perform is varies from floder to to folder.
So How can i get the folder name of clicked Value?
Regards,
RaviHi Kumar ,
the below code should help you.
Register the below action for the leaf node for which u need the subfolder's name above it.
Worked fine in my system ...hope it does in ur scenario too
method ONACTIONGET_PATH .
data : lr_element TYPE REF TO if_wd_context_element,
lr_node TYPE REF TO if_wd_context_node,
ls_path type string,
ls_path_node TYPE string,
lt_string type TABLE OF string,
l_lines type i,
l_lines_1 TYPE i.
lr_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).
**-> getting the path of the node/leaf
*which u had clicked and from that getting the node above it
ls_path = lr_element->get_path( ).
SPLIT ls_path at '.' into table lt_string.
-> remove the first 2 entries as they will contain the view name
DELETE lt_string FROM 1 to 2.
l_lines = LINES( lt_String ).
l_lines_1 = l_lines - 1.
-> remove the last 2 entries as they will contain the element in the path
DELETE lt_string from l_lines_1 to l_lines.
LOOP AT lt_string into ls_path.
CONCATENATE LINES OF LT_STRING into ls_path_node SEPARATED BY '.'.
ENDLOOP.
**-> getting access to the node above the leaf element
LR_NODE = WD_CONTEXT->PATH_GET_NODE( path = ls_path_node ).
lr_element = lr_node->get_element( ).
**-> Getting the name of the folder...
*here path is the attribute in my context which stores the name of the folder
lr_element->get_attribute( EXPORTING name = 'PATH' IMPORTING value = ls_path ).
endmethod.
Maybe you are looking for
-
How can I move IR receiver & iSight from one USB to port to another
I have the latest 15" MBP, with two HS USB 2.0 ports. I need to have an open (nothing else on it) HS USB 2.0 port for a special application. How can I get my MBP to allow changing USB devices (IR Receiver & iSight) locations?
-
Need to reinstall photoshop creative suite 4 master collection disc does not show photoshop app
photoshop has crashed on Mac OS X 10.5.8 went to reinstall from Creative Suite 4 master collection disc photoshop application is not listed on disc what can I do?
-
Where can I download oracle terminal?
Hi, Where can I download oracle terminal? Please help Amy
-
Recording live music with Soundblaster X-Fi Xtr
Hi, My new Dell shipped with a Soundblaster X-Fi Xtreme. I told the sales rep I wanted to record li've music into it, and wanted a card with a MIDI port - he said this was the card I needed but now it's arri'ved it hasn't got a MIDI port at all, just
-
XYZ Domain rejected your message
Hello All, I am running MS Exchange 2010 with DAG environment, since couple of weeks my Users are receiving below errors while sending emails to few different domains xyz.com gave this error: Please turn on SMTP Authentication in your mail client. :