How to display & inside xml
Hi experts,
Im folllowing this blog by felin on xl to xml..
im getting an error every time the cell has &...eveything else is fine
pls let em know
Hi Guys,
My module code has
xmldata ="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n"+ "<ns0:""MT_Test"" ""xmlns:ns0=\"""urn:test:excelfiles"+"\"> \n ";
int a = w.getSheet(0).getRows();
int b = w.getSheet(0).getColumns();
for(int j=1;j<a;j++)
for(int i=0;i<b;i++)
xmldata = xmldata "\n" "<"w.getSheet(0).getCell(i,0).getContents().toString()">"w.getSheet(0).getCell(i,j).getContents().toString()"</"w.getSheet(0).getCell(i,0).getContents().toString()">"+ "\n";
xmldata = xmldata" </ns0:""MT_Test"+">";
Now, If cell (2,2) has &... how do i adjust the code?
cos its a string right?
Similar Messages
-
How to display an XMl file in a webydynpro Application.
Hi All,
I am working with a webdynpro application where i have an xml file. when ever i run the webdynpro application it has to display that xml file in the browser instead of view. It would be appreciable if anyone give me some idea on how to start this application
Thanks in advance
Regards
raviHI Ravi,
Insert a portalIFRame or IFrame with width 100%.
Create a context variable (Say xmlFile) of type String and bind to Source property of PoratlIFrame .
Put the xmlfile inside Project\src\mimes\Components\Package\
Let the xml file name be Config1.xml.
Write the following code inside wdDoinit()
wdContext.currentContextElement().setPortalFrame(WDURLGenerator.getWebResourceURL(wdComponentAPI.getComponent().getDeployableObjectPart(),"Config1.xml"));
Regards
Fahad Hamsa -
How to display an XML file as it is in browser that XI sent to my J2EE appl
Hi all!
I have a scenario like File->XI->J2EE appl.
The file is getting picked up from my machine by XI.
Now XI should send that XML file to my J2EE appl.
My servlet receives that XML and displays as it is in browser. But am getting some error like:
XML page cannot be displayed.
XML document must have a top level element. Error processing resource 'http://localhost:7001/Invoke/DisplayRes'.
I deployed my .ear file on BEA Weblogic application server9.0
I found no error when i tested in SXI_MONI and RWB->Message monitor as well.
This is my servlet code:
public class DisplayRes extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request,response);
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
BufferedReader brin =new BufferedReader(new InputStreamReader(request.getInputStream()));
String inputLine;
StringBuffer sBuf = new StringBuffer();
PrintWriter out = response.getWriter();
response.setContentType("text/xml");
while ((inputLine = brin.readLine()) != null)
sBuf.append(inputLine);
//out.setContentType("text/xml");
//out.println(sBuf.toString());
out.write(sBuf.toString());
brin.close();
out.flush();
what went wrong? Help me
ThanksHi
Can anyone tell me how XI sends messages to applications like J2EE. In REceiver comm channel, I think we specify about the target system like J2EE appl.
Aadapter Type: HTTP
Receiver
Transport Protocol: HTTP1.0
Message Protocol: XI payload in HTTP body
Adapter Engine: Integration Server
Addressing Type: URL address
Target host: localhost
Service Number: 7001(Port number of Weblogic appl server--where my J2EE appl is deployed).
Path : /Invoke/DisplayRes/
Authentication Type:Use Logon Data for SAP System
Content Type: text/xml
Username: xiappluser
password: xx
XML code: UTF-8
I suppose XI sends msgs to http://localhost:7001/Invoke/DisplayRes/........
in this example if am correct?
Then I have given all tyhe necessary setting but my servlet is not able to display XML msg in browser?
This is my servlet code:
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
PrintWriter out = response.getWriter();
BufferedReader brin =new BufferedReader(new InputStreamReader(request.getInputStream()));
String inputLine;
StringBuffer sBuf = new StringBuffer();
response.setContentType("text/xml");
while ((inputLine = brin.readLine()) != null)
sBuf.append(inputLine);
out.println("hi");
out.println(sBuf.toString());
brin.close();
out.flush();
What went wrong?
Help me, all helpful answers are highly rewarded.
Thanks -
How to display an XML in Web Dynpro
Hi,
I am pretty new to Web Dynpro and have a specific requirement.
I have a web dynpro page on which we display a table. One of the columns in the table is a XML message. Now on lead selection of each row I want to display the contents of the XML in an embedded control below the table. I have already implemented the functionality to download the XML message to file system but I want a capability to show the XML contents within my page in a formatted way.
If I use a text view, the XML does not look very nice.
I do not want to implement a new tree control based control now where I parse my xml file and then try to recursively generate a tree. This will take time for me as i am not very well versed with WD programming.
Can anyone tell me if there exists any control in WD which can display the XML in formatted way?
If you guys have used the new ABAP debugger and seen the XML viewer in it then you can get an idea of what I need. I am not sure about the control that the ABAP debugger uses. It will be good if someone can help me find something like that.
After all WD is all about reusability.
Regards,
VikasHi Vikas,
see this little example which creates a xml file to download and open in the browser. Put it in an action handler method.
DATA lr_conv TYPE REF TO cl_abap_conv_out_ce.
DATA lv_data TYPE string.
DATA lv_xfile TYPE xstring.
lv_data = '<?xml version=1.0" encoding="utf-8"?> put your xml here'.
cl_abap_conv_out_ce=>create( RECEIVING conv = lr_conv ).
lr_conv->convert( EXPORTING data = lv_data
IMPORTING buffer = lv_xfile ).
cl_wd_runtime_services=>attach_file_to_response(
EXPORTING
i_filename = 'test.xml'
i_content = lv_xfile
i_mime_type = 'application/xml' ).
Hope this helps you. Revert if need some more help.
Regards,
Pavan. -
How to display / Embed XML in jsp ?
hi, i have following files in my project and i would like to display stocks.xml file in jsp, when i open stocks.xml file in browers , it opens nice with the xsl style , but i can't seem to add it in my jsp. ?. my jsp only displays simple raw text from xml not the style as it is shown in browser by just clicking the stocks.xml file.......... thanks in advance ...
==============index.jsp=====================
<%@ page contentType="text/xhtml" %>
<html>
<head>
<title>Sample Application JSP Page</title>
</head>
<body bgcolor=white>
<table border="0">
<tr>
<td align=center>
<img src="images/logo.gif">
</td>
<td>
<h1>Sample Application JSP Page</h1>
application.
</td>
</tr>
</table>
<%= new String("Hello!") %>
*{color:#ff6600}<jsp:include page="stocks.xml"></jsp:include>{color}*
</body>
</html>
==========stocks.xml======================
<?xml version="1.0" encoding="UTF-8"?>
{color:#339966}<?xml-stylesheet type="text/xsl" href="stocks.xsl"?>{color}
<portfolio>
<stock>
<symbol>SUNW</symbol>
<name>SunMicrosystems</name>
<price>17.1</price>
</stock>
<stock>
<symbol>AOL</symbol>
<name>America Online</name>
<price>51.05</price>
</stock>
<stock>
<symbol>IBM</symbol>
<name>International Business Machines</name>
<price>116.10</price>
</stock>
<stock>
<symbol>MOT</symbol>
<name>MOTOROLA</name>
<price>15.20</price>
</stock>
</portfolio>
===============================================
==================stocks.xsl======================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<html>
<head>
<title>Stocks</title>
</head>
<body bgcolor="#ffffcc" text="#0000ff">
<xsl:apply-templates />
</body>
</html>
</xsl:template>
<xsl:template match="portfolio">
<table border="2" width="50%">
<tr>
<th>Stock Symbol</th>
<th>Company Name</th>
<th>Price</th>
</tr>
<xsl:for-each select="stock">
<tr>
<td>
<i>
<xsl:value-of select="symbol" />
</i>
</td>
<td>
<xsl:value-of select="name" />
</td>
<td>
<xsl:value-of select="price" />
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
Edited by: s_dhillon on Aug 31, 2008 8:15 PM
Edited by: s_dhillon on Aug 31, 2008 8:21 PMAm not sure..
may be by contentType -
How to: Display Specific Xml Entry in AS3
I have a very simple line of code that i'm trying to modify to display a specific entry in a xml file:
AS3 Code:
// The first step is to activate the XML object
AmbientSettingsXML = new XML();
With the XML Object now active you must now load an XML foramtted document.
Any DTD or XLS formatting will be ignored.
AmbientSettingsXML.onLoad = myLoad;
AmbientSettingsXML.load("settings.xml");
// Before proceeding to far into the program, make sure the XML document has loaded
// Extract information from the XML file
function myLoad(ok) {
if (ok == true) {
trace("ok");
trace(AmbientSettingsXML);
The Trace Displays:
ok
<?xml version="1.0"?>
<settings>
<appearance>
<event_title>Streaming Demo 1</event_title>
</appearance>
</settings>
So the question is, how do I display the "event_title" entry only? (String)
Any help is appreciated,
Thanks!var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, completeHandler);
var request:URLRequest = new URLRequest("yourxmlfile.xml");
loader.load(request);
function completeHandler(event:Event):void {
var loader:URLLoader = URLLoader(event.target);
var xml:XML = XML(loader.data);
//xml.child("appearance")[0].child("event_title")[0]; -
How to display the xml content into my datagrid
Hi Experts,
i have created a webservice for sales quotation through DI-Server.iam able to add a new sales quotation through my coding & iam able to get the sales quotation based on the DOcEntry in an *XML file*.
The xml file that i got using DOCENTRY is in this way:--
<?xml version="1.0" encoding="utf-8" ?>
- <BOM>
- <BO>
- <AdmInfo>
<Object>oRecordset</Object>
</AdmInfo>
- <OQUT>
- <row>
<DocEntry>8</DocEntry>
<DocNum>8</DocNum>
<DocDate>20080715</DocDate>
<DocDueDate>20080815</DocDueDate>
<CardCode>C0003</CardCode>
<CardName>HP India</CardName>
<DocTotal>14500.000000</DocTotal>
<ItemCode>A00006</ItemCode>
<Dscription>HP Officejet 7310 All-in-One</Dscription>
<Quantity>1.000000</Quantity>
<Price>14500.000000</Price>
<Currency>INR</Currency>
<DiscPrcnt>10.000000</DiscPrcnt>
<LineTotal>14500.000000</LineTotal>
</row>
</OQUT>
</BO>
</BOM>
Now the problem is from this xml content i should display the values in my datagrid like:
DocEntryCardCodeDocDueDateItemCodeDscriptionQtyTotal
8--C000320081116--A00006-HP-off jet-2 --- 1000
can anybody suggest me some ideas that how to get the SPECIFIED values into my datagrid...........
regards,
shangai.hi vincent,
Thanks for your reply.iam unable to understand these lines in your code..iam working in vb.net
public static DataSet GetDataSetFromXML(XmlNode XMLNode)
grid.DataSource = GetDataSetFromXML(Result.SelectSingleNode(xpath_string));
this is my coding....it's throwing an error when i declare like this
Public Sub GetDataSetFromXML(ByVal XmlNode)
Dim ds As New DataSet
Dim reader As XmlNodeReader
reader = New XmlNodeReader(XmlNode)
ds.ReadXml(reader)
reader.Close()
'Return ds --->(error with syntax)
End Sub
DataGrid1.DataSource = GetDataSetFromXML(oXmlReply.SelectSingleNode("//DocDueDate"))
DataGrid1.DataBind()
regards,
shangai -
How to display an xml file using a servlet with the styles given in an XSL
Dear Developer...
i have xml and xsl files.
Now i want to display the html output produced by the xsl and xml using a servlet...give me any samplecode.... except for the "using XSLT" part. But that doesn't make sense anyway because XSLT doesn't display anything, it just transforms data.
-
How to display an xml file as a tree in html
Hi, JAVA/XML/XSLT/HTML gurus,
I have an xml file and want to display it as a tree in html using XSLT.
Is there any example for this?
King regards,
AG... except for the "using XSLT" part. But that doesn't make sense anyway because XSLT doesn't display anything, it just transforms data.
-
How to display an xml file contents in jsp as tree view
hi,
Iam trying to read an xml file and display the structure in jsp as tree view, can any one help meUse a [XML or DOM parser|http://java-source.net/open-source/xml-parsers] to read a XML file into a tree structure of Java objects.
Use the [Collections API|http://java.sun.com/docs/books/tutorial/collections/index.html] to get hold of the relevant elements in a tree structure.
Use JSTL´s [c:forEach|http://java.sun.com/javaee/5/docs/tutorial/doc/bnakh.html] tag to iterate over a Collection in JSP.
Use HTML´s [<ul>/<li>|http://www.w3.org/TR/REC-html40/struct/lists.html#h-10.2] or [<dl>/<dt>/<dd>|http://www.w3.org/TR/REC-html40/struct/lists.html#h-10.3] tags to represent a tree in HTML. -
How to display transformed XML in flex? xslt processor w/o javascript?
I have a tree view with a list of links. upon clicking the links it will display its contents in an iFrame.
some of the links in my tree are, google.com, yahoo.com, and 2 xml files, 1 of which i have transfromed into html using xsl.
google, yahoo and the xml file which i have not transformed display successfully in the iFrame. however the xml which i have transformed does not display anything. is there another way to display html in flex? or is there a way to display a transformed xml to html in flex.
also is there another way to to use an xslt processor in flex without having to use javascript?In jsp page set content type to text/xml
<%@ page contentType="text/xml" %> -
How to Display all xml files at time in the browser
Hi,
In my solution , it have one folder contain all xml files onliy like Billersettings.111.2.xml , Billersettings.113.2.xml...etc.
Each xml file have only one record like biillerid,name,amount,date..etc. Now , when i run the page ,it should be show all files contained in form of gridview....
i wrote some code , but shows error like.. Root element is missing. My code is here..
protected
void Page_Load(object
sender, EventArgs e){
if(!IsPostBack){
String sFilepath =
"Billersettings" +
"*" +
".xml";
string[] paths =
Directory.GetFiles(@"D:\Fiserv\PWSunittest\PWSunittest\BillerSettings\",
sFilepath);
foreach (string
xmlFile in paths)
dataSet.ReadXml(xmlFile);
GridView1.DataSource = dataSet;
GridView1.DataBind();
} Please help me
Enugu Srinivasulu .NET DeveloperHi,
This forum is to discuss problems of C# development. Your question is not related to the topic of this forum.
I suggestion you post the question in the ASP.NET forums at
http://forums.asp.net/. It is appropriate and more experts will assist you.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Hello All.
I am using Apex 3.0.1.x. I've uploaded an XML file into an XMLTYPE column in a table and am now trying to display this XML data in an Apex report region.
I saw a beautiful example of doing this in Denes Kubicek's wonderful demo app 31517, page 90. Here's the link to this page:
http://htmldb.oracle.com/pls/otn/f?p=31517:90
I copied the procedure code he uses to display the XML into a package. Here's the code I'm using:
<pre>
PROCEDURE DISPLAY_XML (P_ID IN INTEGER)
AS
V_PROC VARCHAR2(100);
V_ERRMSG VARCHAR2(300);
V_MIME VARCHAR2 (48);
V_LENGTH NUMBER;
V_FILE_NAME VARCHAR2 (2000);
V_LOB_LOC BLOB;
XML_TO_BLOB_ERROR EXCEPTION;
BEGIN
V_PROC := 'ONLINE_MODEL_PKG.DISPLAY_XML_DEVICES';
V_ERRMSG := NULL;
SELECT DECODE(V('APP_USER'),NULL,'N','Y')
INTO V_HTML_FLAG
FROM DUAL;
BEGIN
SELECT X.MIME_TYPE,
PROC_FUNC_PACK.CLOB2BLOB(X.DEVICE_XML.GETCLOBVAL()),
X.DEVICE_FILENAME
INTO V_MIME,
V_LOB_LOC,
V_FILE_NAME
FROM XML_DOCS X
WHERE X.ID = P_ID;
EXCEPTION
WHEN OTHERS THEN
V_ERRMSG := SUBSTR('ERROR ('||V_PROC||'): DURING DISPLAY OF XML DATA: '||SQLERRM, 1, 300);
RAISE XML_TO_BLOB_ERROR;
END;
V_LENGTH := DBMS_LOB.GETLENGTH (V_LOB_LOC);
-- set up HTTP header
-- use an NVL around the mime type and
-- if it is a null set it to application/octect
-- application/octect may launch a download window from windows
OWA_UTIL.MIME_HEADER (NVL (V_MIME, 'application/octet'), FALSE);
-- SET THE SIZE SO THE BROWSER KNOWS HOW MUCH TO DOWNLOAD
HTP.P ('Content-length: ' || V_LENGTH);
-- THE FILENAME WILL BE USED BY THE BROWSER IF THE USERS DOES A SAVE AS
HTP.P ( 'Content-Disposition: filename="'
|| V_FILE_NAME
|| '"'
-- CLOSE THE HEADERS
OWA_UTIL.HTTP_HEADER_CLOSE;
-- DOWNLOAD THE BLOB
WPG_DOCLOAD.DOWNLOAD_FILE (V_LOB_LOC);
EXCEPTION
WHEN XML_TO_BLOB_ERROR THEN
V_ERRMSG := PROC_FUNC_PACK.FORMAT_MSG(V_ERRMSG, V_HTML_FLAG);
RAISE_APPLICATION_ERROR(-20010, V_ERRMSG);
WHEN OTHERS THEN
V_ERRMSG := SUBSTR('ERROR ('||V_PROC||'): '||SQLERRM, 1, 300);
V_ERRMSG := PROC_FUNC_PACK.FORMAT_MSG(V_ERRMSG, V_HTML_FLAG);
RAISE_APPLICATION_ERROR(-20020, V_ERRMSG);
END DISPLAY_XML_DEVICES;
</pre>
I then invoke this packaged procedure in an iframe, just like what Denes is doing. I put the following code in my report region source field:
<pre>
DECLARE
v VARCHAR2 (500);
BEGIN
v :=
'SELECT '
|| '''<iframe src="#OWNER#.ONLINE_MODEL_PKG.DISPLAY_XML?p_id='
|| :p53_id
|| '"'
|| ' height="800" width="950"></iframe>'''
|| ' document_display'
|| ' FROM DUAL';
RETURN v;
END;
</pre>
When I run the report in Intenet Explorer (version 6.x), I get a strange security warning popup asking if I want to display unsecure items. When I click "Yes", the report region shows up with a "Could not find web page" error 404 inside the report region.
I then tried running the app in Fire Fox (version 2.0.0.15). This time I do not get any security warning, but the report region shows up with the message "Procedure Doesn't Exist".
Another page in my app calling other procedures in my package, and so, I know that Apex is "seeing" the package.
Does anyone know why I'm seeing these strange things? And, is there, perhaps, another way to display an XML document in an Apex page?
Thank you.
ElieHi Arthur,
I assume you are using EP6.0, below SP3.
The XML Forms can be displayed using standard SAP layouts only. There is a special type of servlet. This alongwith the CSS is applied when you click to display the "Show" form.
As far as I know, there is no other way to display as you want to. You can probably get more help by specifying the exact scenario.
Hope this helps you.
Regards,
Sagar -
How to display xml to html using xsl?
hi all...may i know how to display xml to html page?
i ve included <xsl:output method="html" indent="yes" /> inside my xsl file. i clicked on output.xml file and everything is displayed correctly but the format is xml instead of html. is there anyway to transform it to html?
below are my xsl and xml codes:
// xsl file
<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" />
<xsl:template match="/">
<html>
<body>
<h2>Document Contents</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th align="center">Document Name</th>
<th align="center">Document ID</th>
<th align="center">Owner</th>
</tr>
<xsl:for-each select="Document/Contents">
<tr>
<td><xsl:value-of select="DocumentName"/></td>
<td><xsl:value-of select="DocumentID"/></td>
<td><xsl:value-of select="Originator"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
// xml file
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="xsltStyleSheet.xsl"?>
<Document>
<Contents>
<DocumentName>register</DocumentName>
<DocumentID>1</DocumentID>
<Originator>hhh</Originator>
</Contents>
</Document>
</xsl:template></xsl:stylesheet>your XSL transforms to HTML (in fact XHTML): what more do you expect? did you expected anything different from the following output? if yes: what and why?
<html>
<body>
<h2>Document Contents</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th align="center">Document Name</th>
<th align="center">Document ID</th>
<th align="center">Owner</th>
</tr>
<tr>
<td>register</td>
<td>1</td>
<td>hhh</td>
</tr>
</table>
</body>
</html> -
How to Display XML in a UIWebView?
Hi everybody. I like how Safari displays XML files and I would like to emulate that functionality in an iPhone UIWebView. However, I just can't get it to look the same when passing a URL to the UIWebView.
For example, take a simple XML file like http://molottery.com/rss-num.xml. Viewing that in Safari looks okay, but passing that same URL into a UIWebView just shows a blank page.
I changed the web protocol from http to feed (feed://molottery.com/rss-num.xml) and it launches the page in Safari instead of my UIWebView. Looks good, but it quit my app... :- (
I noticed that XML files on the iPhone get re-routed through reader.mac.com so I tried appending that to my URL (http://reader.mac.com/mobile/v1/http://molottery.com/rss-num.xml) but that did not work either.
When I tried URLEncoding the string like Safari does (http://reader.mac.com/mobile/v1/http%3A%2F%2Fmolottery.com%2Frss-num.xml) I get a UIWebView saying that "This Application Is Viewable Only On iPhone".
So how can I emulate the regular Safari XML functionality inside my UIWebView? I will post my code upon request, if that will help. Any assistance from the Developer Community would be greatly appreciated.
Thanks!You may have better luck in the iPhone dev forums...
https://devforums.apple.com/community/iphone/web
Maybe you are looking for
-
High CPU usage in com.apple.fonts
I'm Getting alot of CPU usage from a process com.apple.fonts. Not quite sure what it is any suggestions? It goes for a while, goes to "not responding" and tehn crashes. Attacedh is the most recent crash log Process: com.apple.fonts [262
-
We were previously using the following registry key to determine where we need to install our Acrobat/Reader plugin. HKEY_LOCAL_MACHINE\Software\Adobe\Adobe Acrobat\%d\InstallPath HKEY_LOCAL_MACHINE\Software\Adobe\Acrobat Reader\%d\InstallPath (a
-
I cannot open mailto links in external websites.
when I click on an email link in some websites, it says there is no application to open the mailto link. I went through the help menus, where I am asked to find the mailto feature and add an application. There is no mailto feature listed, so I can't
-
Sapdba gives error after new QAS system build from PRD
Hello All, I brought up a new QAS system by copying oracle and sap executables, followed by restore from online backup. The system is up and running and sap is also up. When i try to execute sapdba, I get the follwoing error: <b>/usr/lib/pa20_64/dld
-
Result List.Accumulate to Table
I have List Value let Source = AllDays, FilteredRows = Table.SelectRows(Source, each [Date] >= StartEndDates{0}[StartDate] and [Date] <= StartEndDates{0}[EndDate]), SumDays = List.Accumulate( FilteredRows[IsWorkDay], 0 , (state, current)