How to read xml-stylesheet Processing Instruction from XML using DOM Parser
Hi,
I am trying to read an xml that contains xsl stylesheet PI using DOMParser. The parse() method reads the entire contents of the XML except the PI instruction. Below is the XML I am using to read
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href="../../../lang/en-us/style0/usc_profile.xsl" type="text/xsl"?>
<Oblix oblang="en-us" xmlns="http://www.oblix.com/" xmlns:oblix="http://www.oblix.com/">
<ObProfile>
</ObProfile>
</Oblix>
Can anyone let me know if there are any propery settings to be done for the DOM parser before parsing?. If so, what is the property to be set?.
Thanks in Advance
Muthu
A COTS product builds the XML and inserts the respective xsl (xml:stylesheet) file name to be used for transforming the xml. I am trying to interrupt this xml and make some updations on an element and finally send the updated xml to the stream.
For the above process, I parse the input XML using DOMParser and update the elements (some internal elements). While I view the final XML that would be passed to the stream, I found the <?xml-stylesheet... PI is missing.
I somehow managed using a temp fix by doing the below. I manually pulled the PI using document.getFirstChild().getNodeValue() and reconstructed the PI and inserted it to the outgoing XML. This needs to be done every time. This might run into problems when more than one PI is used in the XML.
If the parsed XML could get the PI along with it the above problem could be resolved.
Is there any property that could be set on the parser (prior to parsing) to resolve the issue?.
Similar Messages
-
Parsing an XML using DOM parser in Java in Recursive fashion
I need to parse an XML using DOM parser in Java. New tags can be added to the XML in future. Code should be written in such a way that even with new tags added there should not be any code change. I felt that parsing the XML recursively can solve this problem. Can any one please share sample Java code that parses XML recursively. Thanks in Advance.
Actually, if you are planning to use DOM then you will be doing that task after you parse the data. But anyway, have you read any tutorials or books about how to process XML in Java? If not, my suggestion would be to start by doing that. You cannot learn that by fishing on forums. Try this one for example:
http://www.cafeconleche.org/books/xmljava/chapters/index.html -
Problem in parsing XML using DOM Parser.
Hi,
I am parsing an XML using DOM Parser.
When i try to get attributes of a node, i dont get in the order it is written. For Eg. This the node:
<Level0 label="News" link="/website/ing_news.nsf/ViewNewsForm?OpenForm&All" level="202" uid="COGN-4MNMT3" parentid="aaaa">
When i try to print the attribute values i should get in the order:
News, /website/ing_news.nsf/ViewNewsForm?OpenForm&All, 202, COGN-4MNMT3, aaaa
BUT I AM GETTING IN THE ORDER:
News, 202, /website/ing_news.nsf/ViewNewsForm?OpenForm&All, aaaa, COGN-4MNMT3
Is there any way to sort this problem out?
Thanks and Regards,
AshokHi Guys,
Thanks a lot for your replies.
But i want to keep all the values as attributes only.
the XML file is as shown below:
<Menu>
<Level0 label="News" link="/website/ing_news.nsf/ViewNewsForm?OpenForm&All" level="202" uid="COGN-4MNMT3" parentid="aaaa" children="3">
<Level1 label="ING News" link="" level="1" uid="COGN-4MNN89" parentid="COGN-4MNMT3" children="3" >
<Level2 label="All ING News" link="/website/ing_news.nsf/ViewNewsForm?OpenForm&All" level="2" uid="INGD-4MVTK2" parentid="COGN-4MNN89" children="0">
</Level2>
</Level1>
</Level0>
The code i was using to get attributes is:
String strElementName = new String(node.getNodeName());
// System.out.println("strElementName:"+node.getNodeName());
NamedNodeMap attrs = node.getAttributes();
if (attrs != null) {
int iLength = attrs.getLength();
for (int i = 0; i < iLength; i++) {
String strAttributes = (String) attrs.item(i).getNodeName();
String strValues = (String) attrs.item(i).getNodeValue();
Also is it not possible to Enforce the order using some Schema/DTD in this case?
TIA
Ashok -
Generating XMLs from CSVs using DOM parser......
Hi,
I am trying to generate XMLs from CSV files using DOM parser. XMLs are getting generated but the problem is that i am using Encoding "ISO-8859-1" but XMLs are getting generated in UTF-8 encoding.
Please refer to the code below and advice. (where are the code tags gone ????? )
Source domSource = new DOMSource(document);
ByteArrayOutputStream xmlStream = new ByteArrayOutputStream();
Result result = new StreamResult(xmlStream);
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.transform(domSource, result);
xmlStream.close();
generatedXml = new String(xmlStream.toByteArray(), "*ISO-8859-1*");Use transformer.setOutputProperty(OutputKeys.ENCODING, "ISO-8859-1") to specify the character set.
-
Parsing xml using DOM parser in java
hi there!!!
i don have much idea about parsing xml.. i have an xml file which consists of details regarding indentation and spacing standards of C lang.. i need to read the file using DOM parser in java n store each of the attributes n elements in some data structure in java..
need help as soon as possible!!!DOM is the easiest way to parse XML document, google for JDOM example it is very easy to implement.
you need to know what is attribute, what is text content and what is Value in XML then easily you can parse your document with dom (watch for space[text#] in your XML document when you parse it).
you get root node then nodelist of childs for root then go further inside, it is easy believe me. -
I am using Dom parser in java to parse xml.I am able to retrive data from xml.Can any one help me in updating an xml when data is modified in the user interface.I am created interface in html with three fields namely UserName , LastLogin, Modified fields.If Admin person wants to modify any of these three fields , those changes should reflect in xml also.
Thanks
divyaCode snippet
===========
OutputFormat outputFormat = new OutputFormat("XML","ISO-8859-1",true);
outputFormat.setDoctype(null,"emp.dtd")
It adds the DOCTYPE element but doesnt create the .DTD file.
<!DOCTYPE ROOT_EL SYSTEM "emp.dtd">
Any ideas?
Rgds,
Seetesh -
Need to retrieve all the node values of xml using DOM parser..pls help
I want to fetch each node value in this xml file:
<?xml version="1.0" encoding="UTF-8"?>
<Main>
<AAAAA>
<ES>ESValue</ES>
<EI>EIValue</EI>
</AAAAA>
<BBBBB>
<SIP>
<ST>STValue</ST>
<TB>TBValue</TB>
<PM>PMValue</PM>
<VIP>
<CARP>
<AN1>AN1Value</AN1>
<BN>BNValue</BN>
</CARP>
<DARP>
<SA>
<AN2>AN2Value</AN2>
<CN>CNValue</CN>
</SA>
</DARP>
</VIP>
</SIP>
</BBBBB>
</Main>
output should be the inner text values of diffrent nodes that contain some values..
i.e
output:
ESValue
EIValue
STValue
TBValue
PMValue
AN1Value
BNValue
AN2Value
CNValue
so that i can use thses node values and put it them in database...pls check the above xml file in proper redable order...I need to parse using DOM and fetch node values that are present...
<?xml version="1.0" encoding="UTF-8"?>
<Main>
<AAAAA>
<ES>ESValue</ES>
<EI>EIValue</EI>
</AAAAA>
<BBBBB>
<SIP>
<ST>STValue</ST>
<TB>TBValue</TB>
<PM>PMValue</PM>
<VIP>
<CARP>
<AN1>AN1Value</AN1>
<BN>BNValue</BN>
</CARP>
<DARP>
<SA>
<AN2>AN2Value</AN2>
<CN>CNValue</CN>
</SA>
</DARP>
</VIP>
</SIP>
</BBBBB>
</Main> -
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
¯\_(ツ)_/¯ -
Problem in parsing an xml using DOM parser.
Hi,
I have created an action block for client.
it takes a xml file present on D drive and generates a pdf by parsing the xml file.
My code was working perfectly fine till yesterday.
But now i getting , [INFO ]: Error-- Premature end of file. org.xml.sax.SAXParseException: Premature end of file.
But xml is perfectly fine. Also the code work from eclipse.
Need some inputs on this.
Regards,
Vishal Jadhav
Edited by: vishal jadhav on Jan 23, 2009 9:49 AMVishal,
what exactly did you change? How do you call the action block? What version/Support package/Build of MII do you use?
Have you see the following thread? There a user had the same message which was caused by missing credentials.
[https://forums.sdn.sap.com/click.jspa?searchID=21364701&messageID=6756453]
Michael
Edited by: Michael Otto on Jan 23, 2009 11:57 AM -
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 -
How to read .xml file from embedded .swf(flash output) in captivate
I have been trying to read .xml file from the .swf (Flash output) that is embedded within the captivate file but no luck yet . Please if anyone got any clue on how get this thing done using Action script 3.0 then let me know. I am using Adobe Captivate 5.5 at present and Flash CS 5.5.
I am well aware about how to read .xml file through action script 3.0 in flash but when insert the same flash in captivate and publish nothing comes in captivate output. I would higly appreciate if anyone could help me out with that.
Here is is graphical demonstration of my query :
Message was edited by: captainmkvHi Captainmkv,
Does the information in this post cover what you're trying to do: http://forums.adobe.com/message/5081928#5081928
Tristan, -
How to read XML SpreadSheet using OleDb Provider
Hi All,
I have generated an xml spreadsheet (*.xls) using XSL. I have another program that reads this spreasheet and processes it.
Dim sConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + filnavn + ";" + "Extended Properties=Excel 8.0;"
Dim objCon As OleDbConnection = New OleDbConnection(sConnectionString)
objCon.Open()
Dim objCmdSelect As OleDbCommand = New OleDbCommand("SELECT * FROM [General$]", objCon)
Dim objAdapater As OleDbDataAdapter = New OleDbDataAdapter()
objAdapater.SelectCommand = objCmdSelect
Dim _DSGen As DataSet = New DataSet()
objAdapater.Fill(_DSGen)
I m facing an issue while opening a connection to the generated spreadsheet. It says "{"External table is not in the expected format."}".
My Connection string is
"Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + filnavn + ";" + "Extended Properties=Excel 8.0;"
Do i need to change anything to this string ? I tried using a dataset and calling dataSet.ReadXml(excelFileName); But the dataset doesnt contain my table. Any inputs on how to read an xml spreadsheet ?
How to read XML SpreadSheet in OleDb? How to Convert XML SpreadSheet to Microsoft Office Excel Sheet?
Many ThanksHi,
You'lll most likely have better luck posting this in a Microsoft forum. This forum deals with issues specific to querying the Oracle database via the Oracle OLEDB provider.
Cheers,
Greg -
How to read xml file as shown below.
Hello,
I am using flash builder 4 and currently working on implementing AIR application.
I need to read xml file data.
Normal xml files are easy to read and i am much more aware of it.
But can any one have idea how to read XML file which is given below.
<node>
<key>ID</key>
<integer>1</integer>
<key>Name</key>
<string>Dhwani</string>
<key>Postno</key>
<integer>20</integer>
<key>deskname</key>
<string>flex</string>
<key>empid</key>
<integer>25</integer>
<key>projectname</key>
<string>abc</string>
</node>
Here i have xml file in form of key value pair. <key> node shows name of the key and after that <integer> or <string> node are the value for that specific key.
if i select node.key then it shows me all the keys. and from that i cant make out what is the value for key ID.
Is there any way to take first node and then second. i mean first i ll take value of key and store it into some arraycollection. and then value will be stored.
Any help is appreciated.. Looking for positive reply.
Thanks
DhwaniThere are different methods to access XML data which have pro's and cons. Let us know more about what you want to do and we can help you.
-
How to read XML file and write into another XML file
Hi all, I am new to JAVAXML.
My problem is I have to read one XML file and take some Nodes from that and write these nodes into another XML file...
I solved, how to read XML file
But I don't know how to Write nodes into another XML.
Can anyone help in this???
Thanks in advance..This was answered a bit ago. There was a thread called "XML Mergine" that started on Sept 14th. It has a lot of information about what it takes to copy nodes from one XML Document object into another.
Dave Patterson -
How to read XML payload in Adapter module
Hi all,
I have to read content of xml payload inside custom adapter module:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_REQ xmlns:ns0="namespace">
<record>
<EmployeeName>a</EmployeeName>
<EmployeeID>9999</EmployeeID>
</record>
<record>
<EmployeeName>b</EmployeeName>
<EmployeeID>9999</EmployeeID>
</record>
<record>
<EmployeeName>c</EmployeeName>
<EmployeeID>9999</EmployeeID>
</record>
</ns0:MT__REQ>
obj = inputModuleData.getPrincipalData();
msg = (Message) obj;
XMLPayload xpld = msg.getDocument();
String xmltxt = xpld.getText();
InputStream in = new ByteArrayInputStream(xmltxt.getBytes("UTF-8"));
& then using DOM parser i am trying to read the contents.
But i am not able to read anything. And no exception is raised.
How can i read contents of this xml file.
Thanks,
Mayankhi,
I am still getting same Blank payload.
My Code for Parsing is:
doc = db.parse((InputStream) xpld.getInputStream());
NodeList list_Set=doc.getElementsByTagName("record");
NodeList list_Set1=doc.getElementsByTagName("EmployeeName");
NodeList list_Set2=doc.getElementsByTagName("EmployeeID");
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "12");
String input = "";
for(int i = 0; i < list_Set.getLength(); i++){
Node f=list_Set1.item(i);
f=f.getFirstChild();
String str_f=f.getNodeValue();
Node f2=list_Set2.item(i);
f2=f2.getFirstChild();
String str_f2=f2.getNodeValue();
input = input + str_f + "," + str_f2 + "END" ;
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "Value added from incoming payload");
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, input);
And in RWB monitoring, i am able to see:
2009-10-01 14:20:51 Information 12
2009-10-01 14:20:51 Information UNDEFINED
2009-10-01 14:20:51 Information 14
So UNDEFINED is coming for input.
Edited by: Mayank Gupta on Oct 1, 2009 11:08 AM
Maybe you are looking for
-
Only CERTAIN videos will not import in BOTH versions of iMovie
Heya, I'm dying here, hoping someone can help: I've been filming video with my camera, but for some reason, one out of every 6 or 7 times a file will absolutely not import into iMovie. They play absolutely fine with audio and everything in Quicktime,
-
I am facing issues with my music on my iOS device. I have five devices connected to my apple id. And out of which a Windows Machine and iPhone is not able to sync the purchased songs on the the Windows machine and the iPhone. The iPhone4 shows the so
-
Nike Amp: stops connecting half way through workout
I've been using the Nike Amp with my ipod for the past two months. It's a great piece of kit, and I've come to depend on it to change music, pause a workout when I need to wait for traffic etc. Now it loses it's connection to the ipod mid workout whi
-
Software update taking too long!
Hi, I recently got myself a Macbook Pro 13" newer version (late 2011 model) running Mac OS X Lion. Today I got a system update notification for safari, and it asked me to restart the Macbook for system update. Its been 15 minutes since that update is
-
BlackBerry Media App isnt working- Phone needs to be restarted in order to view new media
I recently realized that my BB 8520 isn't showing any new media I add onto my phone (for example when I take a photo with the camera or download a video it doesn't show when I go into my Media on my phone) I have to perform a battery pull and restart