Read XML using DB Link
Gurus,
Is it possible to read/write XML using DB Link?
If yes please let me know how to achieve this.
Thanks in Advance.
Venu
You need to use quoted names. SQL Server data dictionary stores names in same case they were entered while Oracle in upper case. So when you issue
Select test.status from testtable@DBLINK test Oracle parser will look for column STATUS while on SQL Server side it could be stored, for examle, as Status or status. Check column names on SQL Server side and use quoted names. Assuming column name is Status:
Select test."Status" from testtable@DBLINK test SY.
Similar Messages
-
Getting error in Mozilla, reading xml using JavaScript
Hi All,
I am working with javascript with xml, getting error in Mozilla
1. see html and xml file and check xml file path before test ---
2. please, go through the html and xml file.
read_xml.html
=================
<html>
<head>
<title>xml file using javascript</title>
<script type="text/javascript">
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
//loading xml file
function doLoadXML(xmlFile)
xmlDoc.async="false";
xmlDoc.onreadystatechange=doStateVerify;
xmlDoc.load(xmlFile);
rootData=xmlDoc.documentElement;
function doStateVerify()
if (xmlDoc.readyState != 4)
return false;
// reading xml file
function doReadXML()
alert("calling function");
doLoadXML("C:/Documents and Settings/webdeveloper06/Desktop/for_test/comp-info.xml");
alert("loading file...........");
var dataArr=new Array();
dataArr=xmlDoc.getElementsByTagName("comp-info");
for(var m=0; m <= dataArr.length-1; m++)
alert("entering inside looping here");
document.write("<Table border='1px'><tr><td>");
document.write(dataArr[m].getElementsByTagName("name")[0].firstChild.nodeValue);
document.write(dataArr[m].getElementsByTagName("description")[0].firstChild.nodeValue);
document.write(dataArr[m].getElementsByTagName("web-addr")[0].firstChild.nodeValue);
document.write(dataArr[m].getElementsByTagName("address")[0].firstChild.nodeValue);
document.write(dataArr[m].getElementsByTagName("city")[0].firstChild.nodeValue);
document.write(dataArr[m].getElementsByTagName("postal-code")[0].firstChild.nodeValue);
document.write(dataArr[m].getElementsByTagName("country")[0].firstChild.nodeValue);
document.write("</input></td></tr></table>");
</script>
</head>
<body>
<input type="button" value="Display XML Data" onClick="doReadXML()" />
</body>
</html>
com-info.xml
=========
<?xml version="1.0" encoding="iso-8859-1"?>
<itcopany>
<comp-info>
<name>xxx</name>
<description>IT Reaserch Company</description>
<web-addr>http://xxx.com</web-addr>
<address>mehdipatnam</address>
<city>Hyderabad</city>
<postal-code>777888888</postal-code>
<country>IN</country>
</comp-info>
<comp-info>
<name>yyyyy </name>
<description>Non IT Company</description>
<web-addr>http://yyyy.com</web-addr>
<address>xyxxyxyx</address>
<city>Banglore</city>
<postal-code>78878787878</postal-code>
<country>IN</country>
</comp-info>
<comp-info>
<name>zzzzzzz</name>
<description>IT Company</description>
<web-addr>http://zzzzzzz.com</web-addr>
<address>secondrabad</address>
<city>Hyderabad</city>
<postal-code>9999999999999</postal-code>
<country>IN</country>
</comp-info>
</itcopany>
output status
============
1. getting output in IE
2. not getting output in Mozilla
Can anyone Helpout, To get data in Mozilla
regards,
AbuTry to check this document Browser Support for SAP and use PAM (Product Availability Matrix) to check for the compatibility of your SAP system with the browser.
If you are only the user of the Web Dynpro you would have probably no other choice than change the browser. -
I want to read all <temp >nodes map them to some variable and create one more XML.
I am stuck up in the first place itself where i need to read the data :( . I am getting null pointer exception, please find the code also.
<?xml version="1.0" encoding="UTF-8"?>
<ftpl id="47" name="XXXXXXXX xxx xxxxxxxx">
<abc-cab name="Systems" id="43434">
<abc-dr name="zzzzz" id="4545454">
<temp key="Type">null</param>
<temp key="Folder">/ZVZ/XXXXX - xyz</param>
<temp key="Author">XYZ,ABC</param>
<temp key="Comments">null</param>
<temp key="Mailed_By">XYZ,ABC</param>
<temp key="Subject">null</param>
<temp key="Key_Words">null</param>
<abc-page name="1" id="3524012">
<file text="/asas/asasa/asa/asas/Oxxxxxx2276744.txt" count="1"/>
</abc-page>
</abc-dr>
</abc-cab>
</ftpl>
try {
File file = new File("source-file");
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(file);
doc.getDocumentElement().normalize();
System.out.println("Root element " + doc.getDocumentElement().getNodeName());
NodeList nodeLst = doc.getElementsByTagName("abc-dr");
for (int s = 0; s < nodeLst.getLength(); s++) {
Node fstNode = nodeLst.item(s);
if (fstNode.getNodeType() == Node.ELEMENT_NODE) {
Element fstElmnt = (Element) fstNode;
NodeList fstNmElmntLst = fstElmnt.getElementsByTagName("abc-dr");
Element fstNmElmnt = (Element) fstNmElmntLst.item(1);
NodeList fstNm = fstNmElmnt.getChildNodes();
System.out.println("First Node : " + ((Node) fstNm.item(1)).getNodeValue());
NodeList lstNmElmntLst = fstElmnt.getElementsByTagName("Folder");
Element lstNmElmnt = (Element) lstNmElmntLst.item(0);
NodeList lstNm = lstNmElmnt.getChildNodes();
} catch (Exception e) {
e.printStackTrace();
Please help.. let me know the code which read XML I have tried with all SAX/DOM i am getting same NUllPointerExcetion
Message was edited by:
JavaNewUserHi
Thanks patricknz
pls find the XMl and the java code
I have again modified the code .. but got the same result as below
[temp: null]----------------------param =
[temp: null]----------------------param =
[temp: null]----------------------param =
[temp: null]----------------------param =
[temp: null]----------------------param =
[temp: null]----------------------param =
[temp: null]----------------------param =
[abc-page: null]----------------------abc-page=
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Element;
import java.lang.*;
public class SampleDOM
public static void main(String s[]){
try{
DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document document = docBuilder.parse("C:\\demo.xml");
NodeList nodeList = document.getElementsByTagName("abc-dr");
for (int i = 0, length1 = nodeList.getLength(); i < length1; i++) {
final Element rDoc = (Element)nodeList.item(i);
final NodeList rDocC = rDoc.getChildNodes();
for (int j = 0, length2 = rDocC.getLength(); j < length2; j++) {
final Node child = rDocC.item(j);
if (child.getNodeType() == Node.ELEMENT_NODE) {
Element element = (Element)child;
System.out.println(element.getChildNodes() + "----------------------" +
new StringBuffer(element.getNodeName()).append(" = "));
}catch(Exception e){
e.printStackTrace();
}XML FIle:-
<?xml version="1.0" encoding="UTF-8"?>
<ftpl id="47" name="XXXXXXXX xxx xxxxxxxx">
<abc-cab name="Systems" id="43434">
<abc-dr name="zzzzz" id="4545454">
<temp key="Type">null</param>
<temp key="Folder">/ZVZ/XXXXX - xyz</param>
<temp key="Author">XYZ,ABC</param>
<temp key="Comments">null</param>
<temp key="Mailed_By">XYZ,ABC</param>
<temp key="Subject">null</param>
<temp key="Key_Words">null</param>
<abc-page name="1" id="3524012">
<file text="/asas/asasa/asa/asas/Oxxxxxx2276744.txt" count="1"/>
</abc-page>
</abc-dr>
</abc-cab>
</ftpl>Message was edited by:
JavaNewUser
Message was edited by:
JavaNewUser -
Need help with reading XML using File Adapter
I have created a simple BPEL process that uses a file adapter to read files containing XML messages of a simple xsd schema. But when reading the xml, I get the following error message:
[2010/03/01 23:43:13] Invalid data: The value for variable "Receive_1_Read_InputVariable", part "revision-report" does not match the schema definition for this part.The invalid xml document is shown below: More...
[2010/03/01 23:43:13] "{http://schemas.oracle.com/bpel/extension}invalidVariables" has been thrown. less
-<invalidVariables xmlns="http://schemas.oracle.com/bpel/extension">
-<part name="code">
<code>
9710
</code>
</part>
-<part name="summary">
<summary>
Invalid xml document.
According to the xml schemas, the xml document is invalid. The reason is: Error::cvc-complex-type.4: Attribute 'doc' must appear on element 'revision-report'.
Error::cvc-complex-type.4: Attribute 'model' must appear on element 'revision-report'.
Error::cvc-complex-type.4: Attribute 'pubdate' must appear on element 'revision-report'.
Error::cvc-complex-type.2.4.b: The content of element 'revision-report' is not complete. One of '{"http://xmlns.oracle.com/xmlfile":alternategroup}' is expected.
Please make sure that the xml document is valid against your schemas.
</summary>
</part>
</invalidVariables>
It seems that there is some issue with the namespace, but even after trying out various combinations, I am not able to resolve this.
Here the message schema (xsd):
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema elementFormDefault="qualified"
targetNamespace="http://xmlns.oracle.com/xmlfile"
xmlns:tns="http://xmlns.oracle.com/xmlfile"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="revision-report">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element name="alternategroup">
<xs:complexType>
<xs:attribute name="name" use="required" type="xs:string"/>
<xs:attribute name="Desc" use="required" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="doc" use="required" type="xs:string"/>
<xs:attribute name="model" use="required" type="xs:string"/>
<xs:attribute name="pubdate" use="required" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:schema>
And here is the xml file to be read by the file adapter:
<?xml version="1.0" encoding="UTF-8" ?>
<revision-report doc="doc2" model="model4" pubdate="pubdate5">
<alternategroup Name="ABC" Desc="ABC-Desc">
</alternategroup>
<alternategroup Name="DEF" Desc="DEF-Desc">
</alternategroup>
<alternategroup Name="GHI" Desc="GHI-Desc">
</alternategroup>
</revision-report>
Appreciate any help.
Thanks in advance for your attention.
JayThanks for your response.
I am not sure if there is any easier way, but I tried out the following tool available on the net to check an xml against a xsd:
http://tools.decisionsoft.com/schemaValidate/
There were a few issues, that I corrected and finally had a xsd and xml that were matching and valid. I tried this out in my file reading BPEL process, but the error still remained the same!
Here is my updated/simplified xsd and xml:
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema targetNamespace="http://xmlns.oracle.com/xmlfile"
xmlns:tns="http://xmlns.oracle.com/xmlfile"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://xmlns.oracle.com/xmlfile">
<xs:element name="revision-report">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="alternategroup"/>
</xs:sequence>
<xs:attribute name="doc" use="required" type="xs:string"/>
<xs:attribute name="model" use="required" type="xs:string"/>
<xs:attribute name="pubdate" use="required" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="alternategroup">
<xs:complexType>
<xs:attribute name="Name" use="required" type="xs:string"/>
<xs:attribute name="Desc" use="required" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:schema>
<?xml version="1.0" encoding="UTF-8" ?>
<revision-report doc="doc2" model="model4" pubdate="pubdate5" xmlns="http://xmlns.oracle.com/xmlfile">
<alternategroup Name="ABC" Desc="ABC-Desc"/>
<alternategroup Name="DEF" Desc="DEF-Desc"/>
<alternategroup Name="GHI" Desc="GHI-Desc"/>
</revision-report>
I even tried the option that is available in JDeveloper to generate a sample xml from a xsd (when in the context of a Transformation activity). The xml generated by this also seems exactly like the one above.
So, I am not able to figure out why my BPEL process errors out with the message Invalid xml document. -
How to read XML using vbscript
hi friends I have A big XML having following format :
<ECSC>
<ATTRIBUTES>
<ETTOOLNAME>ECATT</ETTOOLNAME>
<ETOBJ_GNDT>
<VERSION>00000001</VERSION>
<TWB_TITLE>TF_FI_FP_FI_0569_MS07_CO_Search_Help_Internal_Orders_vTD0_1_EN.x</TWB_TITLE>
<TWB_STATUS>X</TWB_STATUS>
<TWB_RELE>N</TWB_RELE>
<FUSER>ECATT</FUSER>
<FDATE>2014-05-22</FDATE>
<LUSER>ECATT</LUSER>
<LDATE>2014-05-22</LDATE>
<LTIME>13:59:50</LTIME>
</ETOBJ_GNDT>
<ETOBJNOVER>
<NAME>ZX_FI_FP_0569_MS07_COAS_FB01</NAME>
<TYPE>ECSC</TYPE>
<TWB_RESP>ECATT</TWB_RESP>
<TWB_DISTL>B</TWB_DISTL>
<DEVCLASS>Z_SOL_ONEERP</DEVCLASS>
<MASTERLANG>E</MASTERLANG>
<TADIR_RESP>ECATT</TADIR_RESP>
<FRANGE>BC</FRANGE>
</ETOBJNOVER>
<ETOBJ_DOC>
<SEARCH_1>FI_FP_FI_0569_MS07</SEARCH_1>
<SEARCH_2>COAS</SEARCH_2>
<SEARCH_3>KO03</SEARCH_3>
</ETOBJ_DOC>
<ETOBJ_CNST>
<TWB_WKREQ>0.000</TWB_WKREQ>
<TWB_PRIO>3</TWB_PRIO>
</ETOBJ_CNST>
<ETSC_TSYS>
<SYSTEMDATA>Z_SD_1ERP_Z</SYSTEMDATA>
<TESTSYSTEM>FI_TRUSTED_EN</TESTSYSTEM>
</ETSC_TSYS>
<ETSYS_COMP_TABTYPE/>
<ETSYS_REL_TABTYPE/>
</ATTRIBUTES>
<SCRIPT>
<ETXML_LINE_TABTYPE>
<item>***********************************************************************.</item>
<item>* Information.</item>
<item>**********************************************************************.</item>
<item>* Script for test case 'TF_FI_FP_FI_0569_MS07_CO_Search_Help_Internal_Orders_vTD0_1_EN.x'</item>
<item>*</item>
<item>* For Sub script:</item>
<item>* 'Test case 3: Choose an Internal Order in One.Fi using external order number while transaction posting (positive case)'.</item>
<item>*</item>
<item>* Script is to Display Internal Order using external order number while Transaction Posting 'FB01'</item>
<item>* GETTAB command is being used to fetch the data from table 'COAS'.</item>
<item>*</item>
<item>*</item>
<item>* Test data related Information</item>
<item>* -----------------------------</item>
<item>* Default test data present in parameter list has been used while Scripting ( script recording & Performing Checks ).</item>
<item>*</item>
<item>* Final execution of result log: 0000037077.</item>
<item>*</item>
<item>***********************************************************************.</item>
<item>* Preparation.</item>
<item>***********************************************************************.</item>
<item/>
<item/>
<item>***********************************************************************.</item>
<item>* End Preparation.</item>
<item>************************************************************************.</item>
<item/>
<item/>
<item>***********************************************************************.</item>
<item>* Execution.</item>
<item>***********************************************************************.</item>
<item>* To get the 'Table Entries' from table 'COAS'.</item>
<item> GETTAB ( COAS , COAS_1 ).</item>
<item>* To display the value for the field 'External Order No'.</item>
<item> LOG ( V_EXTERNAL_ORDER_NO_FRM_TABL ).</item>
<item/>
<item>*----------------------Posting(FB01)-------------------------------------------*.</item>
<item/>
<item>* This part of Script is to Display Internal Order using external order number while Transaction Posting 'FB01'.</item>
<item>MESSAGE ( MSG_1 ).</item>
<item>* To get the name of the Title Screen.</item>
<item> GETGUI ( FB01_100_STEP_1 ).</item>
<item>* Enter the Required details and Press Enter.</item>
<item> SAPGUI ( FB01_100_STEP_2 ).</item>
<item>* Enter Amount and Tax Code.</item>
<item>* and, Press F4 help in the Order Field.</item>
<item> SAPGUI ( FB01_300_STEP_1 ).</item>
<item>* In F4 screen, enter the 'External Order Number'</item>
<item>* pop-up screen is displayed with entries like Order, Description and External Order Number and select 1st order row, press Enter.</item>
<item> SAPGUI ( FB01_200_STEP_1 ).</item>
<item>* To get the values for the field 'Order, Description and External Order No' from F4 help.</item>
<item> GETGUI ( FB01_120_STEP_1 ).</item>
<item> SAPGUI ( FB01_120_STEP_3 ).</item>
<item>* To get the value for the field 'Order' from Main screen.</item>
<item> GETGUI ( FB01_300_STEP_2 ).</item>
<item>* click on 'F3' back button.</item>
<item> SAPGUI ( FB01_300_STEP_3 ).</item>
<item>* click on 'F3' back button.</item>
<item> SAPGUI ( FB01_700_STEP_1 ).</item>
<item>* click 'Yes' button.</item>
<item> SAPGUI ( FB01_200_STEP_2 ).</item>
<item>* click on 'F3' back button.</item>
<item> SAPGUI ( FB01_100_STEP_3 ).</item>
<item>ENDMESSAGE ( E_MSG_1 ).</item>
<item/>
<item>* To display the Title Screen.</item>
<item> LOG ( V_TITLE_SCREEN ).</item>
<item>* To display the 'Order' Number from F4 help.</item>
<item> LOG ( V_ORDER_NO_FROM_F4 ).</item>
<item>* To display the 'Description' from F4 help.</item>
<item> LOG ( V_DESCRIPTION_FROM_F4).</item>
<item>* To display the 'External Order no' value from F4 help.</item>
<item> LOG ( V_EXTERNAL_ORDER_NO_FROM_F4 ).</item>
<item>* To display the 'Order' Number from main screen.</item>
<item> LOG ( V_ORDER_NO_FRM_MAIN_SCREEN ).</item>
<item>************************************************************************.</item>
<item>* End Execution.</item>
<item>***********************************************************************.</item>
<item/>
<item>***********************************************************************.</item>
<item>* Check.</item>
<item>***********************************************************************.</item>
<item>* To check name of Title screen for transaction FB01.</item>
<item> CHEVAR ( V_TITLE_SCREEN = I_TITLE_SCREEN ).</item>
<item>* To check the value for the field 'External Order No' from F4 help, which should be equal to 'External Order No' from table.</item>
<item> CHEVAR ( V_EXTERNAL_ORDER_NO_FRM_TABL = V_EXTERNAL_ORDER_NO_FROM_F4 ).</item>
<item>* To check the values for the field 'Order' number from Table, which should be equal to 'Order' no from F4 screen and Main screen.</item>
<item> CHEVAR ( ( I_ORDER_NUMBER_FROM_TABLE = V_ORDER_NO_FROM_F4 ) AND ( I_ORDER_NUMBER_FROM_TABLE = V_ORDER_NO_FRM_MAIN_SCREEN )).</item>
<item>************************************************************************.</item>
<item>* End Check.</item>
<item>************************************************************************.</item>
</ETXML_LINE_TABTYPE>
</SCRIPT>
<PARAMETERS>
<ETPAR_GUIX>
<item>
<PNAME>COAS_1</PNAME>
<PTYP>X</PTYP>
<PDESC>Generated Table for View</PDESC>
<PINDEX>0001</PINDEX>
<PGROUP>GETTAB</PGROUP>
<XMLREF_TYP>T</XMLREF_TYP>
<PSTRUC_TYP>T</PSTRUC_TYP>
<PREF_TYPE>VIEW</PREF_TYPE>
<PREF_NAME>COAS</PREF_NAME>
<PDATLEN>0000</PDATLEN>
<PINTLEN>000000</PINTLEN>
<PDECIMALS>000000</PDECIMALS>
<SORT_LNR>0001</SORT_LNR>
<PREF_NAME2>COAS</PREF_NAME2>
<VALUE><VALUE></VALUE>
<VAL_TYPE>T</VAL_TYPE>
<TAB_INDEX>0</TAB_INDEX>
</item>
<item>
<PNAME>IOAS_1</PNAME>
<PTYP>I</PTYP>
<PDESC>Generated Table for View</PDESC>
<PINDEX>0001</PINDEX>
<PGROUP>IETTAB</PGROUP>
<XMLREF_TYP>T</XMLREF_TYP>
<PSTRUC_TYP>T</PSTRUC_TYP>
<PREF_TYPE>VIEW</PREF_TYPE>
<PREF_NAME>COAS</PREF_NAME>
<PDATLEN>0000</PDATLEN>
<PINTLEN>000000</PINTLEN>
<PDECIMALS>000000</PDECIMALS>
<SORT_LNR>0001</SORT_LNR>
<PREF_NAME2>COAS</PREF_NAME2>
<VALUE><VALUE></VALUE>
<VAL_TYPE>T</VAL_TYPE>
<TAB_INDEX>0</TAB_INDEX>
</item>
</ETPAR_GUIX>
</PARAMETERS>
</ECSC>
I want to write vbscript for above XML file. Vbscript should display following result :
1) It should validate <SCRIPT> node The line staring with * symbol is called comment and the line staring without * symbol is call code in above XML file.
2) Vb Script should display such line numbers those code don't have any comment line specified.
for example : In above XML the code line : <item> SAPGUI ( FB01_120_STEP_3 ).</item> it doesn't have any comment line means this code don't have any comment. So vbscript should find such line numbers and code text and show error message.
3) Each code had its own comment just above line of code.
4) In <PARAMETER> node we have to check <PNAME> is staring with letter "I" or not.. If its staring with letter "I" then its <PTYPE> and <PGROUP> staring letter should be "I". We have to check this condition
for every child node of <PARAMETER> node using vbscript.
Please help me and Thank You so much in advance.
My Vb Script is as follows :
filename = "D:\Automation\o.txt"
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(filename)
fl=0
Do Until f.AtEndOfStream
strLine = f.ReadLine
if (strLine ="MESSAGE ( MSG_1 ).") then
Document.write("<br>Inside MESSAGE ")
Do until f.AtEndOfStream
strLine = f.ReadLine
if((Left(strLine,1)="*"))
Then
if((Right(strLine,1)="."))
then
Document.write("<br>ERROR Found at Line No :" & f.line-1&" "& strLine)
end if
fl=1
else
if((Right(strLine,1)=".")
and (fl=1))Then
fl=0
else
Document.write("<br>ERROR Found at Line No :" & f.line-1&" "& strLine)
end if
end if
Loop
end if
And the following code for <PARAMETER> tag :
Const XMLDataFile = "D:\Automation\imp\p.xml"
Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.Async = False
xmlDoc.Load(XMLDataFile)
xmlDoc.validateOnParse = True
If xmlDoc.Load(XMLDataFile) Then
Document.write "SUCCESS loading XML File"
Else
Document.write "ERROR loading XML File"
End If
counter=0
Set root = xmlDoc.documentElement
Set items = root.childNodes
for each item in items
myPNAME = xmlDoc.getElementsByTagName("PNAME").item(counter).text
myPTYP = xmlDoc.getElementsByTagName("PTYP").item(counter).text
myPGROUP = xmlDoc.getElementsByTagName("PGROUP").item(counter).text
If (Left(myPNAME, 1) = "I") Then
'Document.write("myPNAME Starts with I")
IsValid = True
'Innocent until proven guilty
If (Left(myPTYP, 1) <> "I") Then
IsValid = False
End If
If (Left(myPGROUP, 1) <> "I" )Then
IsValid = False
End If
If IsValid = False Then
Document.write(myPNAME & " is not valid.")
End If
IsValid = True
End If
If (Left(myPNAME, 1) = "V") Then
'Document.write("myPNAME Starts with I")
IsValid = True
'Innocent until proven guilty
If (Left(myPTYP, 1) <> "V") Then
IsValid = False
End If
If (Left(myPGROUP, 1) <> "V" )Then
IsValid = False
End If
If IsValid = False Then
Document.write(myPNAME & " is not valid.")
End If
IsValid = True
End If
If (Left(myPNAME, 1) = "E") Then
'Document.write("myPNAME Starts with I")
IsValid = True
'Innocent until proven guilty
If (Left(myPTYP, 1) <> "E") Then
IsValid = False
End If
If (Left(myPGROUP, 1) <> "E" )Then
IsValid = False
End If
If IsValid = False Then
Document.write(myPNAME & " is not valid.")
End If
IsValid = True
End If
counter=counter+1
next
Here is a better example of how to pull all of the text.
strXmlFile = "D:\Automation\imp\p.xml"
Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.Async = False
If xmlDoc.Load(strXmlFile) Then
WScript.Echo "SUCCESS loading XML File"
Else
WScript.Echo "ERROR loading XML File"
End If
Set items = xmlDoc.SelectNodes("//SCRIPT/ETXML_LINE_TABTYPE/item")
For Each item In items
WScript.Echo item.Text
Next
¯\_(ツ)_/¯ -
Hi,
My company just bought a software, which this s/w will generate a HTML file with the XML tags and data inside it.
I will need to read the XML tags and data inside the HTML file using JSP.
Does anyone know how to do this?
Please help mi!!Thanks!http://java.sun.com/webservices/docs/1.1/tutorial/doc/index.html
-
Hi ALL,
I have a xml as follows:
<AAA>
<BBB>
<CCC>xyz</CCC>
<DDD>abc</DDD>
</BBB>
</AAA>
Now using any of the java class, i just need read the value of "CCC" as follows:
(i.e using xpath i need to read the value)
String val = x.somemethod("/AAA/BBB/CCC");
Thanks!In case you're curious - here's the dom4j equivalent of dvohra09's sample code.
SAXReader saxReader = new SAXReader("org.apache.xerces.parsers.SAXParser");
Document doc = saxReader.read(source); //Where source is your file, input source, input stream, reader, or url
String value = doc.valueOf("//AAA/BBB/CCC"); //Result given the xml from OP = 'xyz'OK - not much difference with this simple example but if you haven't settled on an API, dom4j is worth looking at (IMHO).
∞ brewman ∞ -
Hi,
Please could someone help me how to query an XML data (stored in oracle) using SQL.
My Table Name is ACCOUNT_SNAPSHOT
Column Name in which XML is stored: ACCOUNT_INFO
Here is the XML stored in ACCOUNT_INFO:
<PROPERTIES>
<PROPERTY name="AccountNumber" type="java.lang.String" value="222222222" />
<PROPERTY name="UserId" type="java.lang.String" value="Test001" />
<PROPERTY name="SecQuesId" type="java.lang.Integer" value="91" />
<PROPERTY name="CreatedDate" type="java.util.Date" value="1195851922000" />
<PROPERTY name="CreatedBy" type="java.lang.String" value="Admin" />
<PROPERTY name="AccountType" type="java.lang.String" value="Savings" />
</PROPERTIES>
I would like to retrieve all the records from table where AccountType in the XML is 'Savings' and CreatedDate is between two dates. How do i do this?
ThanksLook at the XML Extract function...
Examples can be found in the documentation as well as on the forum...
http://forums.oracle.com/forums/search.jspa?threadID=&q=XML+Extract&objID=f75&dateRange=all&userID=&numResults=30
Also consider asking in the XML DB FAQ -
Error while try to read XML using JDOM
hi' i don't know what's wrong with this. i try to read my XML document, but i already got exception when i try to initialize it.
public class readXML
public readXML()
try
SAXBuilder builder = new SAXBuilder();
Document doc = builder.build("XMLTutorial/data.xml");
catch(Exception e)
e.printStackTrace();
public static void main(String[] args)
new readXML();
}This is my XML Document :
<f:table>
<f:name>African Coffee Table</f:name>
<f:width>80</f:width>
<f:length>120</f:length>
</f:table>when i try to run it, i got this exception :
Caused by: org.xml.sax.SAXParseException: The prefix "f" for element "f:table" is not bound.what's wrong?
Thanks a lot.Namespace prefixes must always be bound to a namespace.
http://www.w3.org/TR/xml-names11/#sec-namespaces
For example:<f:table xmlns:f="some namespace">
<f:name>African Coffee Table</f:name>
<f:width>80</f:width>
<f:length>120</f:length>
</f:table> -
Faster way to read XML files using power shell !!
At the moment i have about 1000 XML files (ranging from size 15kb to 120kb), I have a powershell script which extracts information and writes all extracts to the same LOG file!!
It works well but am only concerned with the time it takes!! it took about 1.5 hrs to finish the script! Is this normal?
How can i speed it up, your inputs and thoughts helps!!
Reading XML using the following syntax!
$Inputfile=[xml](Get-Content $XFILE)
Script has only foreach loop! and no other conditions.
cheers!For a small file it is about twice as fast. It gets faster as the file size gets bigger.
PS C:\scripts> Measure-Command {$xml=[xml](cat FooProx.xml -raw)}
Days : 0
Hours : 0
Minutes : 0
Seconds : 0
Milliseconds : 275
Ticks : 2758195
TotalDays : 3.19235532407407E-06
TotalHours : 7.66165277777778E-05
TotalMinutes : 0.00459699166666667
TotalSeconds : 0.2758195
TotalMilliseconds : 275.8195
PS C:\scripts> Measure-Command {$xml.Load("$pwd\FooProx.xml")}
Days : 0
Hours : 0
Minutes : 0
Seconds : 0
Milliseconds : 108
Ticks : 1081647
TotalDays : 1.25190625E-06
TotalHours : 3.004575E-05
TotalMinutes : 0.001802745
TotalSeconds : 0.1081647
TotalMilliseconds : 108.1647
¯\_(ツ)_/¯ -
I'm getting xml from customFieldsFeed.getEnumerationValues() it is comming from a web services looks like this
<xml-fragment xmlns:b=""http://schemas.microsoft.com/2003/10/Serialization/Arrays""
xmlns:i=""http://www.w3.org/2001/XMLSchema-instance""
xmlns:a=""http://schemas.xxxxxxxx""
xmlns:u=""http://docs.oasis-open.org/wss/xxxxxxx-utility-1.0.xsd""
xmlns:s=""http://schemas.xmlsoap.org/soap/envelope/"">
<b:anyType i:type=""a:Enumeration"">
<a:EnumerationID>AAAAA</a:EnumerationID>
<a:Name>A3 MFD</a:Name>
</b:anyType>
<b:anyType i:type=""a:Enumeration"">
<a:EnumerationID>BBBBB</a:EnumerationID>
<a:Name>A3 Printer</a:Name>
</b:anyType>
<b:anyType i:type=""a:Enumeration"">
<a:EnumerationID>CCCCC</a:EnumerationID>
<a:Name>A4 MFP</a:Name>
</b:anyType>
</xml-fragment>"
I need to read EnumerationID ex if AAAAA need to retrive Name value " A3 MFD"
java 1.6
Thanks,
HJThis could be a starting point:
http://stackoverflow.com/questions/2811001/how-to-read-xml-using-xpath-in-java
bye
TPD -
Error in reading XML message and inserting data into another DB using DB link
Hi Experts,
I am getting error parsed XML message data while inserting into another DB table using DB link.
ORA-22804: remote operations not permitted on object tables or user-defined type columns.
Please help me.
Thanks.ORA-22804: remote operations not permitted on object tables or user-defined type columns.
Looking at the error message assuming you might be doing the alter table statement on remote table unit_labels which is throwing the ORA-22804 error which is not permitted on remote tables. -
Issue using data link in XML Publisher
Dear All,
I am new to XML Publisher, for the first time trying data link concept in XML Publisher tool. The issue is very simple, I have two queries Q1(say it fetches sales_order_number, application_name ) and Q2 (say it fetches sales_order_number , error_number, error_description). And sales_order_number is passed as input using data link to Query Q2 from query Q1 and Q2 will retrive more than one row for a given sales_order_number.
Say for a given dept_name 1001 the output will be something similiar like
Q1:
SO# | Appl.Name
1001 | 'Invoice '
Q2:
SO# | Error.# | Error Desc
1001 | 1512 | No Data Found
1001 | 1513 | Invalid Entry
1001 | 2674 | Error while inserting the record
and the query which I have used in XML template goes like this
<dataQuery>
<sqlStatement name="Q1">
<![CDATA[select sales_order_number, application_name
from T1
where sales_order_number = :in_sales_order_num]]>
</sqlStatement>
<sqlStatement name="LINES">
<![CDATA[
select sales_order_number , error_number, error_description
from T2]]>
</sqlStatement>
<link name="Dummy_LINK" parentQuery="Q1" parentColumn="sales_order_number" childQuery="Q2" childColumn="sales_order_number" condition="="/>
</dataQuery>
<daraStructure/>
And the grouping is as follows
<group name="G_Q1" source="Q1">
<element name="sales_order_number" value="sales_order_number"/>
<element name="application_name" value="application_name"/>
<group name="G_Q2" source="Q2">
<element name="sales_order_number" value="sales_order_number"/>
<element name="error_number" value="error_number"/>
<element name="error_description" value="error_description"/>
</group>
</group>
And in the RTF template I have properly used <?for-each:G_Q1?> <?for-each:G_Q2?>- --
<?end for-each?><?end for-each?>
Ideally the header (Q1) should have one row and the lines (Q2) should have 3 rows. But the issue here is even Q1 produces 3 rows.
If in case Q2 has 4 records, then Q1 also plots 4 records in the report output. Hope I am explaining the issue correctly. Any help to resolve the issue would be a great. Thanks in advance.
Regards,
Antony.try like this
<?if: (TYPE='A') or (TYPE= 'B')?><TABLE STRUCTURE><?end if?>
or
<?if:contains('A~B', TYPE )?><TABLE STRUCTURE> <?end if?> -
Ps query results to xml using xml link function registry
In People tools version 8.46 we need something like where the ps query result output is in the form of XML so that it can be used for external system. The catch I cannot use webservices. It is something like opening peoplesoft queires form excel using hyperlink but in this case we need xml. I looked at David Vandiver's Excel XML libraries which open the data in excel but is there something where the hyperlink output is xml using xml link function registry. I have capatured the data in rowset and now need to create mime type of xml to write the data
thanks in advance
vinnIf I understand correctly, you want to use something like Microsoft Excel's web queries to get data from a PeopleSoft query in XML format. I have never done this before, but if I were to implement this, here is what I would do in PT 8.46:
1. Create an unstructured message in app designer.
2. Create a user that only has access to the queries you want to expose to Excel
3. Write synchronous message handler PeopleCode to call SwitchUser to switch to a specific query user rather than the generic integration broker user and execute a query, returning the results in XML (see [Query.RunToRowsest|http://download.oracle.com/docs/cd/E13292_01/pt849pbr0/eng/psbooks/tpcr/htm/tpcr31.htm#d0e113933] for an example).
4. Call the message through IB using the HTTP GET URL format as defined in PeopleBooks: [http://download.oracle.com/docs/cd/E13292_01/pt849pbr0/eng/psbooks/tibr/book.htm?File=tibr/htm/tibr33.htm#H4026|http://download.oracle.com/docs/cd/E13292_01/pt849pbr0/eng/psbooks/tibr/book.htm?File=tibr/htm/tibr33.htm#H4026]. -
Read XML attributes from RSS internet link
I am very new to LabVIEW, and I am trying to determine the best way to read information an RSS link. Specfically, I would like to read data from a Yahoo! Weather RSS like http://weather.yahooapis.com/forecastrss?w=2502265. I would like to extract the temperature from <yweather: condition temp="[##]>, the wind speed from <yweather:wind speed="[##]">, and the text description from <yweather:condition text="[text]".
I have looked into some XML parsing solutions like EasyXML, but I wonder if they are too much for what may be a simple task. I would appreciate any input on my current problem. Thanks.Howdy,
It looks like EasyXML would make you life a little easier. You can search the LabVIEW Example Finder (Help menu->Find Examples) for XML examples. Other than that you would have to navigate to the website and parse the website source and use the LabVIW String Functions.
Joshua B.
National Instruments
NI Services
NI Support Resources
NI Training Resources
Maybe you are looking for
-
First I have to admit I'm not technical in any way so I'm easily confused so please forgive me if my question sounds unprofessional. The computer is a Mac desk top tower with Lion OS x 2x2.66 GHz Dual-Core Intel Xeon with an internal hard drive plus
-
Hi All, I want create Value of Back Order per Vendor report, Any body help me, What are the tables I have to use. My selection options are : Vendor and Delivery Date. Thanks,
-
Same photo in 2 Aperture projects
I have a photo in project "a". I want the same photo also in project "b". I can make a copy of it in "a" but if I try and drag it to "b", both the original and the copy move. Any solutions?
-
IMac Intel 2GHZ express problem...
I have called apple tech support 5 times, since I have apple care, they always help me out, but basically my problem is that at least once a week, I have to do a hard, factory reset of my airport express station in order for my computer iMac Intel 2g
-
My itunes account says disabled!! how do i re-activate it??
my itunes account says disabled!! how do i re-activate it??