Unable to read tabfile containing char u00E9 (spanish)from appln server in 4.7
Hello,
I am facing a problem during read of a tab delimited file from application servers. My file contains spanish and japanese text(eg. éêèóñôçëíáÉÓÍÚÁ), when i upload the file onto application server and perform read using the following code, all the spanish characters are read as '#'(# being a standard replacement character).
OPEN DATASET p_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
If there is an error in opening the file an error is thrown
IF sy-subrc <> 0.
p_error = 10. " Error -
File could not be opened
EXIT.
ELSE.
p_error = 0.
ENDIF.
Reads the contents of the file into an internal table
DO.
READ DATASET p_file INTO t_data_tab.
At end of file exit, else append contents to
the internal table
IF sy-subrc <> 0.
EXIT.
ELSE.
APPEND t_data_tab.
ENDIF.
ENDDO.
Close the dataset
CLOSE DATASET p_file.
Upload of same file as CSV works fine. Can some please tell why the Tab file upload fails and provide a solution for this problem.
Thanks in advance!!
Regards,
Bindu
File content:
2000.00 EUR 20060213 Philippé Fortes Test 7.11 Item Line 1
Hello Bindu
This sounds quite like a Unicode problem.
Maybe the class CL_ABAP_FILE_UTILITIES could be of help:
(1) Check with the static method CL_ABAP_FILE_UTILITIES=>CHECK_UTF8 whether the file on the application server is encoded using UTF-8
(2) If so, try to read the file
OPEN DATASET... ENCODING UTF-8.
Regards
Uwe
Similar Messages
-
I am unable to read signatures on PDF files sent from my Los Angeles office - they use windows, any solution?
Hey guys,
So this is follow up from my debarkle with the EDD. I found out my problem with copying files from Mac to EDD and vice versa was a result of a not so good EDD ( i had an apollo hard drive from imation) that was not very compatible with macs. So i did my research and found out that the best hard drives were Western Digital and Seagate. I bought the newest western digital EDD 1TB and formated it to FAT32 and guess what...no problems so far. The only problem is that FAT32 format doesn't copy files larger than about 4 gigs so i couldnt copy a movie from my brothers computer onto my EDD that was 1080p. You could probably resolve that by partitioning a small part of your hard drive in ExFAT? but yeah, hopefully that helped guys.
Aaisha -
Unable to read TLD "META-INF/jsf_core.tld" from JAR file "file:
Hallo everybody :-)<br /><br />i've installed Workflow-Server + ARES + FormManager. When i call localhost:8080/adminui i can log in and the browser loads the next site --> it fails and says:<br /><br />org.apache.jasper.JasperException: Unable to read TLD "META-INF/jsf_core.tld" from JAR file "file:/C:/Adobe/LiveCycle/jboss/server/all/tmp/deploy/tmp56414LiveCycle.ear-contents/admi nui.war/WEB-INF/lib/jsf-impl.jar": org.apache.jasper.JasperException: Failed to load or instantiate TagExtraInfo class: com.sun.faces.taglib.FacesTagExtraInfo<br /> org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:5 0)<br /> org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)<br /> org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:183)<br /> org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:181)< br /> org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418)<br /> org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)<br /> org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)<br /> org.apache.jasper.compiler.Parser.parse(Parser.java:126)<br /> org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220)<br /> org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)<br /> org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)<br /> org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)<br /> org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)<br /> org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)<br /> org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)<br /> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)<br /> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)<br /> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)<br /> javax.servlet.http.HttpServlet.service(HttpServlet.java:810)<br /> com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)<b r /> com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)<br /> com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)<b r /> com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)<br /> com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)<br /> javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)<br /> com.adobe.framework.SecurityFilter.doFilter(SecurityFilter.java:177)<br /> com.adobe.idp.um.auth.filter.PortalSSOFilter.doFilter(PortalSSOFilter.java:106)<br /> com.adobe.framework.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter .java:161)<br /><br />Any idea what' wrong?<br /><br />Thanks,<br />Valerio
Hi Howard,
thank you for your post.
I actually new about the problems with the jvm version. Still i wanted to ask, cause there are different reports on this `java problems` and even though the 1.4.2_08 seems to be the best version (by the way this version is not to be downloaded any longer *sig*), there are people getting all installed with other versions. I couldn't find any regularity in the misbehavior of the servers while installing.
I finally achieved and got everything working ... but very slow. Loading the adminui or BAM features takes very long time (over one minute). Have you already had this delay. Any hint?
Thanks again,
Valerio -
Unable to read view Id of Declarative Component from "var" of af:iterator
Hi,
I am facing a weird issue where when i assign "var" of af:iterator to the view Id of declarative component, it is saying "<DynamicIncludeTag> <getViewId> Encountered null from the viewId expression: #{row}"
And Page is showing blank.
My JSPX code is as follows :
<af:iterator value="#{pageFlowScope.stageBean.pathList}" var="row">
<af:outputText value="#{row}" id="ot1"/>
<af:declarativeComponent viewId="#{row}"/>
</af:iterator>
And code snippet for getter in Java bean is as follows:
public List<String> getPathList()
List<String> pathList = new ArrayList<String>();
pathList.add("/Test.jspx");
return pathList;
The weird thing here is output text is printing the path /Test.jspx but declarative component is not recognizing it. Its showing blank page and in logs, error says "Encountered null from the viewId expression: #{row}"
If i remove #{row} from viewId and manually give like viewId = "/Test.jspx" , its displaying the page correctly.
Can anyone please help me solve this issue?
Regards,
Rakesh.http://stackoverflow.com/questions/12183735/adf-unable-to-read-view-id-of-declarative-component-from-var-of-afiterator
-
Unable to edit the "Default Domain Controllers Policy" from a Server 2012 machine
I am unable to edit the "Default Domain Controllers Policy" from a Server 2012 machine. The error message i recieve is:
"Failed to open the group policy object. You might not have the appropriate rights. Details: The volume for a file has been externally altered so that the open file is no longer valid."
The domain controllers are running Windows 2012 R2 upgraded from Windows 2008 R2, the domain functional level is Server 2012.
I am able to edit the policy from both a Windows 7 and Server 2008 R2 machine.
The following post is identical however the fix for them does not work for me:
http://social.technet.microsoft.com/Forums/windowsserver/en-US/2d968a05-2cff-4dd0-9c5d-dd810d1fa66f/cant-edit-default-domain-controllers-policy-on-windows-8-or-server-2012
Any ideas?MuhammadUmar
Yes, the Unique ID is available on 2012 server
Lany Zhang
This only affects the default domain controllers policy object
Another user added to amins and tested has no effect
It is the same on another server
DCDiag passes all tests
Thanks for all your help so far -
Unable to read data in Excel 2010/2013 from encrypted Access 2010/2013 database
A customer has an Access database (.accdb), which was encrypted/given a database password in Access 2013. It should be possible to read that data from Excel 2010/2013, but when clicking on Data-->From Access
and the correct path is put in and the correct database password has been entered, Excel just keeps prompting for the database password. This happens with both Excel 2010 and 2013.
The database password supplied is correct as evidenced by opening the database in Access 2013 using the same database password.
A colleague in a separate company has found that a separate .accdb file he has recently encrypted also has the same problem as above, yet a .accdb file encrypted ages ago
is readable from Excel.
How do I get Excel 2010/2013 to read the data from the encrypted .accdb file, please?Since Access 2010 the encryption algorithm has changed:
Source
Follow the next steps to apply an encryption method that will allow you to (programmatically) connect to the database:
1. Decrypt the database
2. Change the encryption method:
- In Access Options select 'Client Settings'
- Scroll down to section 'Advanced'
- 'Encryption Method': select option 'Use legacy encryption (..'
- Click 'OK'
3. Encrypt the database
Hope this helps.
Emiel Nijhuis -
Unable to read or restore the backup contact from ...
Team,
My Nokia C5-00 was suddenly switch off, i gave it to nearest nokia care, i tried to restore backup the contacts(which i took from my phone option) from my memory card to system and tried to open the contacts in notepad, but all the contacts are in unreadeable format. Please see the attached contact which i got from my mobile after taking the backup and let me know a solution to open all the contacts. Since i lost all my contacts from my phone i need it badly.
Note:
I am having 356 contacts totally, all ar opening like same in some encoded format.
Attachments:
Opened Contact screenhot.png 50 KBHi Prasath_M,
Thank you for your post and welcome to Nokia Support Discussions!
Please see this link for a list of different applications that can help you open and view VCF files. The easiest way to access the data may be to open it in Outlook.
Note that you can also restore your contact data using Nokia PC Suite, all you need to do is to copy the VCF file back to Nokia Communication Centre in Contacts window. This way you do not need to open the file and copy the information by hand.
Hope this helps!
Puigchild
If you find this post helpful, a click upon the white star at bottom would always be appreciated.
If it also solves your problem, clicking ACCEPT AS SOLUTION below it will benefit other users! -
UNABLE TO READ DATE FORMAT(DD/MM/YY) FROM EXCEL
HI...
i have written a code to read excel sheet.my problem is my program is working fine but in the first column i am having dates in dd/mm/yy format....This column is not getting value when the vi is running.Rest all the columns show the correct data except the date column...i have also changed the seperator and used '-' ,'.' but no use....
sometimes it gives some random number there in 1st colum of array where i am storing the data after reading...i am not understanding why this is happening...
pls can any1help me out.........I'm going to take a guess and say the day/month thing is a typo.
In Excel when a cell is formatted to date in windows (By Default) it starts from Jan 1 1900 as day 1. Mac uses Jan 1 1904 as Does LabVIEW.
Formatting to date in Excel calculates number of days since 1900, 12/08/2009 is equal 40155 days. LabVIEW calculates seconds since 1904.
If the formatting in the spreadsheet cannot be changed because the data is already there then you will need to convert the number in LabVIEW by pulling out the value, subtract 4 years of days, then multiply by seconds in a day. This will give you a time LabVIEW can use. get the date and then insert the data back into the array.
See .png
Robert Fogg
Certified LabVIEW Architect
Attachments:
Convert Excel Date.PNG 7 KB -
TO READ FILES IN A PARTICULAR DIRECTORY FROM APPLICATION SERVER
Hi all,
Is there any function module which gives the list of files in a specific directory ??
for eg ;i want to fetch all files in a particular directory say */interf/sy-mandt/reports....*
I need a function module which will give all filenames in an internal table ,if i give the directory name as input.
Thanks in advance,
Aakash.
Edited by: Aakash Neelaperumal on Apr 25, 2008 11:06 PMHi,
You can use WS_FILENAME_GET but understand it is obsolete. Search for a FM in function group SFES. I saw quite a few and one of them should meet your requirement.
Cheers ! -
Read and Write Files to user from Forms Server
We are developing an application that requires us to rread and write files to the user system. We are deploying using the developer/forms server and this is not happenning. The text_io package and the d2wkutil operate on the application server system, not the user system. So is there a method to read the file contents into the app and write files out to the user system across the web. Thanks.
developer6 can interact with javabeans. the javabean runs as an applet on the client machine. all you have to do is setup a javabean that read and write to your client machine.
when you test your application, work with java console open so you'll be able to debug your appliacion, if you'll receive java security execption you may need to sign this javabean. look at sun site for info regarding the usage of javakey for signing java classes and jars. -
Unable to read file from application server
Hi guys,
I am reading file(could be any extension) from application server,but some time i am successfuly able to read file and sometime unable to read,why its happening .
my code is here
OPEN DATASET E_FILE FOR INPUT IN BINARY MODE . "
IF SY-SUBRC = 0.
DO .
READ DATASET E_FILE INTO GS_PDF_TAB.
IF SY-SUBRC = 0.
APPEND GS_PDF_TAB TO GT_PDF_TAB.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET E_FILE.
ENDIF.
Thanks
Ankur SharmaHi,
What actually happens? Do you get a short dump? Do you get a return code ne 0? Does it run fine but you get no data in your table?
We aren't mind-readers and can't help much without more information.
Try using transaction AL11 to see if you access the files you are trying to open.
Gareth. -
Unable to read TLD "META-INF/jsf_core.tld
Hi guys,
I have Tomcat 5.5.7 and jdk1.5.0_02 on Windows XP Pro ! I am using jsf-1_1_01. One of my page is as below:
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<f:loadBundle basename="com.stufftolet.view.bundle.selectcountry" var="msg"/>
<f:view locale="#{catalogBean.currentLocale}">
and I got the following error:
org.apache.jasper.JasperException: Unable to read TLD "META-INF/jsf_core.tld" from JAR file "file:/C:/Tomcat5/webapps/stufftolet/WEB-INF/lib/jsf-impl.jar": org.apache.jasper.JasperException: Failed to load or instantiate TagLibraryValidator class: com.sun.faces.taglib.jsf_core.CoreValidator
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:179)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:181)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:146)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
com.stufftolet.view.util.SecurityFilter.doFilter(SecurityFilter.java:70)
de.mindmatters.faces.spring.RequestHandledFilter.doFilter(RequestHandledFilter.java:117)
Appreciate if someone could give some help here, Thanks !
regards,
kmthienHi
I am also facing the same problem. But I am using tomcat 5.0.xx and i havnt included extra jsp-api in the lib. But getting the error
JSP Parsing Error:Failed to load or instantiate TagLibraryValidator class: com.sun.faces.taglib.jsf_core.CoreValidator
tried all the options...but yet not got where is the problem.
Please help. -
Unable to read TLD "META-INF/c-1_0.tld"
Hi guys,
I'm using Tomcat 5.5.7 and jdk1.5.0_02 installed under Winds XP PRO SP2. I'm also using Standard-1.1: JSTL 1.1 (2.0). But when trying to view the 1st page, I got the following error msg:
org.apache.jasper.JasperException: Unable to read TLD "META-INF/c-1_0.tld" from JAR file "file:/C:/Tomcat5/webapps/stufftolet/WEB-INF/lib/standard.jar": org.apache.jasper.JasperException: Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLV
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:179)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:181)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:146)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
pls help....I really need help desperately ! Thanks !
regards,
kmthienHi evnafets,
My index.jsp looks like below:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="-1"/>
<meta name="Security" content="public"/>
<meta name="Robots" content="index,follow"/>
<meta name="Description" content="Stufftolet Index Page."/>
</head>
<body>
<jsp:forward page="selectcountry.jsf"/>
</body>
</html>
and I still got the following error:
org.apache.jasper.JasperException: Unable to read TLD "META-INF/c.tld" from JAR file "file:/C:/Tomcat5/webapps/stufftolet/WEB-INF/lib/standard.jar": org.apache.jasper.JasperException: Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLV
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:179)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:181)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:146)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Appreciate if u could give somemore assistance here, Thanks ! -
SPRING App through JBOSS - error:Unable to read TLD
Hello,
First post for me, not 100% certain I am in the right forum, but here I go.
I am using Eclipse 3.1, JRE j2sdk1.4.2, spring-framework-1.2, and JBOSS 3.2.7 to follow this tutorial
http://www.springframework.org/docs/MVC-step-by-step/Spring-MVC-step-by-step-Part-2.html
on building a simple Spring MVC application.
I am using jstl.jar,standard.jar (among others) from the spring-framework-1.2 release. I noticed JBOSS starting to go nuts after adding these 2 jars specifically.
My project .war is deployed to JBOSS containg a WEB-INF/lib storing the .jars (standard.jar, jstl.jar ...) I do not have these .jars configured in JBOSS' classpath.
When I run my app and hit my my servlet followed by jsp page, JBOSS reports a runtime exception.
jsp...
<%@ include file="/WEB-INF/jsp/include.jsp"%>
<html>
<head>
<title>Hello :: Spring Application</title>
</head>
<body>
<h1>Hello - Spring Application</h1>
<p>Greetings, it is now <c:out value="${now}" /></p>
</body>
</html>
exception...
: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /index.jsp(1,1) Unable to read TLD "META-INF/c.tld" from JAR file "file:/C:/java/jboss-3.2.7/server/default/tmp/deploy/tmp3725spring_app.war/WEB-INF/lib/standard.jar": org.apache.jasper.JasperException: Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLV
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
I confirmed that this standard.jar is deployed/accessible, and the tld is present.
any ideas?
Thanks,
ChrisHi
I am also facing the same problem. But I am using tomcat 5.0.xx and i havnt included extra jsp-api in the lib. But getting the error
JSP Parsing Error:Failed to load or instantiate TagLibraryValidator class: com.sun.faces.taglib.jsf_core.CoreValidator
tried all the options...but yet not got where is the problem.
Please help. -
Read XML file from different server on JSP
Dear All,
I am a newbie to JSP with XML, now i want to read the "test.xml" from JSP.
I read successfully this "test.xml" file from my system and I got output, but I need to read the xml file from
different server like "http://www.domain.com/test.xml". I couldn't read such a type of file from different server.
Is it possible to read a xml file from different server?
If anybody have idea please let me know.
Thanks in Advance,
Prasath.
<%@ page import="java.sql.*,java.io.*,java.util.*,javax.xml.parsers.*,org.w3c.dom.*,org.xml.sax.*" %>
<%
try {
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
Document doc = docBuilder.parse (new File("http://www.domain.com/test.xml"));
// normalize text representation
doc.getDocumentElement ().normalize ();
out.println ("Root element of the doc is " +
doc.getDocumentElement().getNodeName()+"<br>");
NodeList listOfPersons = doc.getElementsByTagName("person");
int totalPersons = listOfPersons.getLength();
out.println("Total no of people : " + totalPersons+"<br>");
for(int s=0; s<listOfPersons.getLength() ; s++){
Node firstPersonNode = listOfPersons.item(s);
if(firstPersonNode.getNodeType() == Node.ELEMENT_NODE){
Element firstPersonElement = (Element)firstPersonNode;
NodeList firstNameList = firstPersonElement.getElementsByTagName("first");
Element firstNameElement = (Element)firstNameList.item(0);
NodeList textFNList = firstNameElement.getChildNodes();
out.println("First Name : " +
((Node)textFNList.item(0)).getNodeValue().trim()+"<br>");
NodeList lastNameList = firstPersonElement.getElementsByTagName("last");
Element lastNameElement = (Element)lastNameList.item(0);
NodeList textLNList = lastNameElement.getChildNodes();
out.println("Last Name : " +
((Node)textLNList.item(0)).getNodeValue().trim()+"<br>");
NodeList ageList = firstPersonElement.getElementsByTagName("age");
Element ageElement = (Element)ageList.item(0);
NodeList textAgeList = ageElement.getChildNodes();
out.println("Age : " +
((Node)textAgeList.item(0)).getNodeValue().trim()+"<br>");
}//end of if clause
}//end of for loop with s var
}catch (SAXParseException err) {
out.println ("** Parsing error" + ", line "
+ err.getLineNumber () + ", uri " + err.getSystemId ());
out.println(" " + err.getMessage ());
}catch (SAXException e) {
Exception x = e.getException ();
((x == null) ? e : x).printStackTrace ();
}catch (Throwable t) {
t.printStackTrace ();
%>You might try:
Document doc = docBuilder.parse ("http://www.domain.com/test.xml");Alternatively use the java.net package to obtain an Input Stream to the xml document
InputStream in = methodThatYouWriteYourselfCalledgetInputStreamForURI("http://www.domain.com/test.xml");
Document doc = docBuilder.parse (in);cheers,
evnafets
Maybe you are looking for
-
Can't upgrad FF 4 Beta 9 to Beta 10
Every time I open my Firefox (4 Beta 9) a window pops up and tells me that upgrading to Beta 10 couldn't be done. And that I should check if I have other Firefoxes running which need to be closed. I DON'T have any other Firefoxes on (or any other Moz
-
Is there a way to have an AppleID for an end-user without credit card info attached to it?
I am in charge of managing the Macs in our department. We have purchased a volume license for Mountain Lion (can't jump to Mavericks yet until we upgrade other software). I have a code to redeem, but the end-user is supposed to have an AppleID. I wen
-
How to change the name of a BADI Implementation?
Hello experts, Does anyone knows how to change the name of the BADI Implementation? I just create a new Implementation but we need to rename it. Thanks in advance, AK
-
Question slide not advancing on click to continue
I have only one question slide out of 6 and it is a true/false question. When answered the user clicks submit and the correct success caption appears and it indicates click anywhere to continue. The slide doesn't continue when you click on the slide.
-
Sales Info System - Evaluation creation Problem (MCSA)
Hi I have a problem when creating an Evaluation. Basically I wish to copy an Evaluation and then change the sort criteria of the characteristics But I keep getting the error message, Set xyzabcsefrefe' ___ exists How can I resolve this issue I wish t