Wli xml post and jmsreplyto
I'm trying to post a xml message without the jmsreplyto. Is it possible? Is it possible not to have the jmsreplyto at all?
thanks and regards
Nuno
Able to fix the issue. There was an infinite loop in the template..
Thank you,
Tom
Similar Messages
-
XML Forms and Posting Directly to iView
Hey Everyone,
This is my first time posting a question on SDN, so please forgive me if I leave anything out.
I have a question regarding XML Forms and iViews. We are using EP 6.40 SP12.
I would like to have an XML Form filled out and have it's contents sent directly to an iView which is located on the opening screen of our Portal. The scenario is that every Tuesday the form will be filled out, saved and will appear on the user's Portal. An appropriate folder structure has been created in KM to hold all the forms, etc...
Any help would be much appreciated,
Cheers
RavHi Ravinder,
After generating the forms,you have to create iViews for the Forms,Authoring iview and Render List iView.
These iViews can be assigned to users,or assigned to some page using Delta link.
The updated news will be available as a List on the Browser iView,which can be clicked to drill details.
The properties are set in the iView properties of Layout Set ,for example for authoring iView
Layout Set = NewsExplorer
For render List iView
Layout Set = NewsBrowser
Path to Initially Displayed Folder /documents/myNews
The values will change depending upon the form name.
Please go through this document for a detailed example
<a href="https://media.sdn.sap.com/html/submitted_docs/Best_Practices/EP/documentation/How-to_Guides/KM/How%20to%20create%20XML%20forms.pdf">https://media.sdn.sap.com/html/submitted_docs/Best_Practices/EP/documentation/How-to_Guides/KM/How%20to%20create%20XML%20forms.pdf</a>
This Document gives a step by step solution on using XML forms.
Regards,
Siddhartha
Message was edited by: Siddhartha Jain -
Receiving and responding to xml post
Hi there,
I have a project where I have to receive certain parameters in a Post using an XML document, and then respond with a XML response document.
My application is a standalone java app.
I have created the sockets, and can receive and send on them, I just don't quite understand yet how to receive the document and respond.
any help will really be appreciated.
Thanks
BrendaBrenda,
Tomcat is a J2EE container (well a Java web container without EJB support) it does supply javax.servlet classes.
In answer to you other question, I have a web application that uses xerces within a servelet and it's fine. A web container like Tomcat will support just about any code as long as it can load the classes.
You need to look into War (web archive) files for production use, but to get started, just consider the file locations:
C:\tomcat\webapps\ROOT\WEB-INF\classes
This is where the root context loads its class files from
C:\tomcat\webapps\ROOT\WEB-INF\lib
This is where it loads jarred class files (e.g. xerces.jar)
Also you'll need to create a servelet entry in your
C:\tomcat\webapps\acuo\WEB-INF\web.xml
file:
<servlet id="Servlet_2">
<servlet-name>name</servlet-name>
<description>Your description</description>
<servlet-class>com.package.Classname</servlet-class>
</servlet>
So, it's all straightforward enough once you know where to put everything. There are also tools around that make the war file creation easier.
So, best of luck,
Dom. -
PROBLEM WITH XML PUBLISHER AND GRAPH NOT DISPLAYING IN ORACLE APPS
Hi
All you XML Gurus here. I have a problem, When i create a report in XML Publisher desktop i can see a graph im putting into the report on preview and works fine. But when i upload the report as a rtf file into Oracle applications i can see everything else the table logo and stuff .. But just not the Graph Itself when run on the concurrant manager....
Problem number 2
Is there a way that i can use XML Desktop and create a line graph with 2 lines rather than 1 plotting
here is my xml for graph i have made with one line
chart:
<Graph>
<Title text="" visible="true" horizontalAlignment="CENTER"/>
<LocalGridData colCount="{count(.//SELF_OTHERS)}" rowCount="1">
<RowLabels><Label></Label></RowLabels>
<ColLabels>
<xsl:for-each select=".//SELF_OTHERS"> <Label><xsl:value-of select="BEHAVIOUR"/></Label>
</xsl:for-each>
</ColLabels>
<DataValues>
<RowData>
<xsl:for-each select=".//SELF_OTHERS"> <Cell><xsl:value-of select="SCORE"/></Cell>
</xsl:for-each> </RowData>
</DataValues>
</LocalGridData>
</Graph>
All help would be much appreciated to my 2 problems....
Thanks
ShaHi All
Will post solution tomorrow or Monday on blog. Heres the chart XML for now.
chart:
<Graph graphType="LINE_VERT_ABS"><LegendArea visible="true" />
<LocalGridData colCount="{count(xdoxslt:group(.//SALE, 'YEAR'))}" rowCount="3">
<RowLabels>
<Label>SOFTWARE</Label>
<Label>HARDWARE</Label>
<Label>SERVICES</Label>
</RowLabels>
<ColLabels>
<xsl:for-each-group select=".//SALE" group-by="YEAR" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<Label>
<xsl:value-of select="current-group()/YEAR" />
</Label>
</xsl:for-each-group>
</ColLabels>
<DataValues>
<RowData>
<xsl:for-each-group select=".//SALE" group-by="YEAR" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<Cell>
<xsl:value-of select="sum(current-group()/SOFTWARE)" />
</Cell>
</xsl:for-each-group>
</RowData>
<RowData>
<xsl:for-each-group select=".//SALE" group-by="YEAR" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<Cell>
<xsl:value-of select="sum(current-group()/HARDWARE)" />
</Cell>
</xsl:for-each-group>
</RowData>
<RowData>
<xsl:for-each-group select=".//SALE" group-by="YEAR" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<Cell>
<xsl:value-of select="sum(current-group()/SERVICES)" />
</Cell>
</xsl:for-each-group>
</RowData>
</DataValues>
</LocalGridData>
</Graph>
with the following data
<?xml version="1.0" encoding="UTF-8"?>
<SALES>
<SALE>
<YEAR>2006</YEAR>
<SOFTWARE>1200</SOFTWARE>
<HARDWARE>850</HARDWARE>
<SERVICES>2000</SERVICES>
</SALE>
<SALE>
<YEAR>2007</YEAR>
<SOFTWARE>1000</SOFTWARE>
<HARDWARE>800</HARDWARE>
<SERVICES>1100</SERVICES>
</SALE>
<SALE>
<YEAR>2008</YEAR>
<SOFTWARE>900</SOFTWARE>
<HARDWARE>1200</HARDWARE>
<SERVICES>1500</SERVICES>
</SALE>
</SALES>
The latest Template Builder makes this a cinch!
Regards
Tim
http://blogs.oracle.com/xmlpublisher -
Hi All,
We are trying to access the Create Deployment method stated below
http://msdn.microsoft.com/en-us/library/windowsazure/ee460813
We have uploaded the Package in the blob and browsing the configuration file. We have checked trying to upload manually the package and config file in Azure portal and its working
fine.
Below is the code we have written for creating deployment where "AzureEcoystemCloudService" is our cloud service name where we want to deploy our package. I have also highlighted the XML creation
part.
byte[] bytes =
new byte[fupldConfig.PostedFile.ContentLength + 1];
fupldConfig.PostedFile.InputStream.Read(bytes, 0, bytes.Length);
string a = Encoding.UTF8.GetString(bytes, 0, bytes.Length);
string base64ConfigurationFile = a.ToBase64();
X509Certificate2 certificate =
CertificateUtility.GetStoreCertificate(ConfigurationManager.AppSettings["thumbprint"].ToString());
HostedService.CreateNewDeployment(certificate,
ConfigurationManager.AppSettings["SubscriptionId"].ToString(),
"2012-03-01", "AzureEcoystemCloudService", Infosys.AzureEcosystem.Entities.Enums.DeploymentSlot.staging,
"AzureEcoystemDeployment",
"http://shubhendustorage.blob.core.windows.net/shubhendustorage/Infosys.AzureEcoystem.Web.cspkg",
"AzureEcoystemDeployment", base64ConfigurationFile,
true, false);
<summary>
/// </summary>
/// <param name="certificate"></param>
/// <param name="subscriptionId"></param>
/// <param name="version"></param>
/// <param name="serviceName"></param>
/// <param name="deploymentSlot"></param>
/// <param name="name"></param>
/// <param name="packageUrl"></param>
/// <param name="label"></param>
/// <param name="base64Configuration"></param>
/// <param name="startDeployment"></param>
/// <param name="treatWarningsAsError"></param>
public static
void CreateNewDeployment(X509Certificate2 certificate,
string subscriptionId,
string version, string serviceName, Infosys.AzureEcosystem.Entities.Enums.DeploymentSlot deploymentSlot,
string name, string packageUrl,
string label, string base64Configuration,
bool startDeployment, bool treatWarningsAsError)
Uri uri = new
Uri(String.Format(Constants.CreateDeploymentUrlTemplate, subscriptionId, serviceName, deploymentSlot.ToString()));
XNamespace wa = Constants.xmlNamespace;
XDocument requestBody =
new XDocument();
String base64ConfigurationFile = base64Configuration;
String base64Label = label.ToBase64();
XElement xName = new
XElement(wa + "Name", name);
XElement xPackageUrl =
new XElement(wa +
"PackageUrl", packageUrl);
XElement xLabel = new
XElement(wa + "Label", base64Label);
XElement xConfiguration =
new XElement(wa +
"Configuration", base64ConfigurationFile);
XElement xStartDeployment =
new XElement(wa +
"StartDeployment", startDeployment.ToString().ToLower());
XElement xTreatWarningsAsError =
new XElement(wa +
"TreatWarningsAsError", treatWarningsAsError.ToString().ToLower());
XElement createDeployment =
new XElement(wa +
"CreateDeployment");
createDeployment.Add(xName);
createDeployment.Add(xPackageUrl);
createDeployment.Add(xLabel);
createDeployment.Add(xConfiguration);
createDeployment.Add(xStartDeployment);
createDeployment.Add(xTreatWarningsAsError);
requestBody.Add(createDeployment);
requestBody.Declaration =
new XDeclaration("1.0",
"UTF-8", "no");
XDocument responseBody;
RestApiUtility.InvokeRequest(
uri, Infosys.AzureEcosystem.Entities.Enums.RequestMethod.POST.ToString(),
HttpStatusCode.Accepted, requestBody, certificate, version,
out responseBody);
<summary>
/// A helper function to invoke a Service Management REST API operation.
/// Throws an ApplicationException on unexpected status code results.
/// </summary>
/// <param name="uri">The URI of the operation to invoke using a web request.</param>
/// <param name="method">The method of the web request, GET, PUT, POST, or DELETE.</param>
/// <param name="expectedCode">The expected status code.</param>
/// <param name="requestBody">The XML body to send with the web request. Use null to send no request body.</param>
/// <param name="responseBody">The XML body returned by the request, if any.</param>
/// <returns>The requestId returned by the operation.</returns>
public static
string InvokeRequest(
Uri uri,
string method,
HttpStatusCode expectedCode,
XDocument requestBody,
X509Certificate2 certificate,
string version,
out XDocument responseBody)
responseBody =
null;
string requestId = String.Empty;
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri);
request.Method = method;
request.Headers.Add("x-ms-Version", version);
request.ClientCertificates.Add(certificate);
request.ContentType =
"application/xml";
if (requestBody != null)
using (Stream requestStream = request.GetRequestStream())
using (StreamWriter streamWriter =
new StreamWriter(
requestStream, System.Text.UTF8Encoding.UTF8))
requestBody.Save(streamWriter,
SaveOptions.DisableFormatting);
HttpWebResponse response;
HttpStatusCode statusCode =
HttpStatusCode.Unused;
try
response = (HttpWebResponse)request.GetResponse();
catch (WebException ex)
// GetResponse throws a WebException for 4XX and 5XX status codes
response = (HttpWebResponse)ex.Response;
try
statusCode = response.StatusCode;
if (response.ContentLength > 0)
using (XmlReader reader =
XmlReader.Create(response.GetResponseStream()))
responseBody =
XDocument.Load(reader);
if (response.Headers !=
null)
requestId = response.Headers["x-ms-request-id"];
finally
response.Close();
if (!statusCode.Equals(expectedCode))
throw new
ApplicationException(string.Format(
"Call to {0} returned an error:{1}Status Code: {2} ({3}):{1}{4}",
uri.ToString(),
Environment.NewLine,
(int)statusCode,
statusCode,
responseBody.ToString(SaveOptions.OmitDuplicateNamespaces)));
return requestId;
But every time we are getting the below error from the line
response = (HttpWebResponse)request.GetResponse();
<Error xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Code>BadRequest</Code>
<Message>The specified configuration settings for Settings are invalid. Verify that the service configuration file is a valid XML file, and that role instance counts are specified as positive integers.</Message>
</Error>
Any help is appreciated.
Thanks,
ShubhenduPlease find the request XML I have found it in debug mode
<CreateDeployment xmlns="http://schemas.microsoft.com/windowsazure">
<Name>742d0a5e-2a5d-4bd0-b4ac-dc9fa0d69610</Name>
<PackageUrl>http://shubhendustorage.blob.core.windows.net/shubhendustorage/WindowsAzure1.cspkg</PackageUrl>
<Label>QXp1cmVFY295c3RlbURlcGxveW1lbnQ=</Label>
<Configuration>77u/PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0NCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KDQogIFRoaXMgZmlsZSB3YXMgZ2VuZXJhdGVkIGJ5IGEgdG9vbCBmcm9tIHRoZSBwcm9qZWN0IGZpbGU6IFNlcnZpY2VDb25maWd1cmF0aW9uLkNsb3VkLmNzY2ZnDQoNCiAgQ2hhbmdlcyB0byB0aGlzIGZpbGUgbWF5IGNhdXNlIGluY29ycmVjdCBiZWhhdmlvciBhbmQgd2lsbCBiZSBsb3N0IGlmIHRoZSBmaWxlIGlzIHJlZ2VuZXJhdGVkLg0KDQogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCi0tPg0KPFNlcnZpY2VDb25maWd1cmF0aW9uIHNlcnZpY2VOYW1lPSJXaW5kb3dzQXp1cmUxIiB4bWxucz0iaHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS9TZXJ2aWNlSG9zdGluZy8yMDA4LzEwL1NlcnZpY2VDb25maWd1cmF0aW9uIiBvc0ZhbWlseT0iMSIgb3NWZXJzaW9uPSIqIiBzY2hlbWFWZXJzaW9uPSIyMDEyLTA1LjEuNyI+DQogIDxSb2xlIG5hbWU9IldlYlJvbGUxIj4NCiAgICA8SW5zdGFuY2VzIGNvdW50PSIyIiAvPg0KICAgIDxDb25maWd1cmF0aW9uU2V0dGluZ3M+DQogICAgICA8U2V0dGluZyBuYW1lPSJNaWNyb3NvZnQuV2luZG93c0F6dXJlLlBsdWdpbnMuRGlhZ25vc3RpY3MuQ29ubmVjdGlvblN0cmluZyIgdmFsdWU9IkRlZmF1bHRFbmRwb2ludHNQcm90b2NvbD1odHRwcztBY2NvdW50TmFtZT1zaHViaGVuZHVzdG9yYWdlO0FjY291bnRLZXk9WHIzZ3o2aUxFSkdMRHJBd1dTV3VIaUt3UklXbkFrYWo0MkFEcU5saGRKTTJwUnhnSzl4TWZEcTQ1ZHI3aDJXWUYvYUxObENnZ0FiZnhONWVBZ2lTWGc9PSIgLz4NCiAgICA8L0NvbmZpZ3VyYXRpb25TZXR0aW5ncz4NCiAgPC9Sb2xlPg0KPC9TZXJ2aWNlQ29uZmlndXJhdGlvbj4=</Configuration>
<StartDeployment>true</StartDeployment>
<TreatWarningsAsError>false</TreatWarningsAsError>
</CreateDeployment>
Shubhendu G -
Hello, do LoadVars, XML.load(), or WebService support HTTPS-based endpoints, Yes or No?
BACKGROUND
============
I've been trying to get a LoadVars to actually make a call to an HTTPS endpoint. There is nothing in the documentation that says it can't. I know that there's also XML.load() and WebService class, but from the looks of it they don't do HTTPS.
During my tests I have absolutely no issues with making calls to the same service over HTTP. When I change it to HTTPS I don't see HTTPStatus or even failures. Also, netstat on my server will show a connection being established with the endpoint when using HTTP but not when using HTTPS. I've also tried setting SSLVerifyCertificate to "false" in my Server.xml and after a restart of AMS it doesn't help, same symptom.
I've also googled and looked through all Adobe forum posts that I can find:
https://forums.adobe.com/message/4938426#4938426
https://forums.adobe.com/thread/1661461
https://forums.adobe.com/thread/782037
https://forums.adobe.com/message/74981
https://forums.adobe.com/message/5107735#5107735
https://forums.adobe.com/message/7815#7815
https://forums.adobe.com/message/53870#53870
https://forums.adobe.com/message/87797#87797
WebService Class - http://stackoverflow.com/questions/5619776/webservice-and-fms
The best I found from the posts above is a non-commital answer from adobe staff at https://forums.adobe.com/message/4938426#4938426 and a 3rd party person saying that Webservice doesn't work at http://stackoverflow.com/questions/5619776/webservice-and-fms.
All I need is an official supported/not-supported from the Adobe staff. Shouldn't be to hard after 5 years or so of ignoring the questions in the forum right?Adobe, please provide some details to your current and possibly potential customers, in at least one of the many unanswered posts about making HTTPS requests from AMS.
P.S.
realeyes_jun,
RealEyes Media has been an inspiration to me for many years, and I would like to thank them for their efforts to better the media streaming community.
Also, would it be possible to please release the source to REDbug? -
Issue with XML post when port used with server name
Hi Guys,
We are currently using an agent on our application servers which puts a server in "inservice standby" if the CPU load on the system goes above 75%. This agent is using an XML post on the CSM to achieve this and put the server back inservice using XML post as well.
Currently we are trying to use the same agent for another application which has a port number defined as well and it does not seem to work.
To give an example where it works:
serverfarm TEST
nat server
nat client TEST
real name BLABLA
inservice
The example where it does not work:
serverfarm TEST
nat server
nat client TEST
real name BLABLA 50000
When we get the server name via XML we see that CSM returns the name as BLABLA: 50000 however using the same in the script does not work.
Would someone know how to put the port number in an XML script so that the CSM understands which server need to be changed.
Thanks,
MurtazaIt would be some thing in line with the following example
<?xml version="1.0" ?>
The DTD for CSM XML will let you know what tags and attributes are available to use:
http://www.cisco.com/univercd/cc/td/doc/product/lan/cat6000/mod_icn/csm/csm4
_1_2/icn/xmldtd.htm
HTH
Syed -
In OpenScript, is there anyway to have an XML post pass if a 500 error is returned?
Hello,
We're using OpenScript 9.3.1.0 and are automating some Web Service tests. One of the scenarios is to test when data is sent to the service where no valid session exists, we expect a 500 Interval Server error to be returned. I have created a test using XML Post Data, however because the server throws a 500 error, this always reports as failed even though the "Text Match Test" with a regex testing the error message passes as expected (as you can see in the attached screenshot). Is there anyway to tell OpenScript that we expect a [500 Internal Server] error when creating the test, or not to fail on when a condition occurs?
Thanks in advance,
Michael.You probably need to keep that cookie and create an exception as well, so you can't use Private Browsing or clear the Cookies and Site Preferences via [[Clear Recent History]]. You can let all cookies expire if you close Firefox. That will keep the cookies that have an exception.
In [[Private Browsing]] mode all cookies are session cookies that expire if that session is ended, so websites won't remember you. -
XML, PHP and Flash forms
After searching several tutorials and forum posts, I still am
puzzled at how to get started on this.
I want to enable my client to upload changes to the XML file
used on his site without knowing anything about XML. He also wants
to upload images which are referenced in the XML. So, I am assuming
that I create a form that allows him to type in changes to sections
and select an image on his local drive and submit it to a PHP
script on the server which will, in turn generate/update the XML
and upload the image(s).
Is this correct or am I going about it the wrong way? Of
course, I should just tell him he'll have to pay me to update the
site. ;-) I'm really confused about how to start this whole thing
in the planning stage. I just need a little direction then I can
research the rest.
thanks!aniebel wrote:
> So, do I make fields (variables) for each node in the
XML? And can I use any
> PHP script that converts my loadvars to XML? I'm not
sure what to search for,
> specifically. I hope I'm not in over my head but it
seems getting into these
> predicaments is a great way to learn.
>
are you making this admin interface in flash then? personally
I would
steer clear of that as it will be harder to debug - doing it
in HTML
will be much more straightforward, and if you do it right you
can change
to using a flash front end in future.
Handling file uploads in PHP is a little tricky but there are
loads of
good pages of advice on using PHP on the web. Here's a good
place to
start as there's lots of notes by other users:
http://us2.php.net/manual/en/function.is-uploaded-file.php
XML with PHP I have only done once - and I think that was
just reading
it and not writing it. Should be OK though, again, lots of
help
available online!
MOLOKO
Macromedia Certified Flash MX 2004 Developer
Macromedia Certified Flash MX Developer
::remove _underwear_ to reply::
'There ain't no devil - it's just God when he's drunk' Tom
Waits
GCM/CS/IT/MC d-- S++:- a- C++ U--- P+ L++ !E W+++$ N++ O? K+
w+++$ !O M+
VMS? PS+++ PE- Y PGP+ t+ 5-- X-- R* tv++ b++++ DI++++ D+ G e
h-- r+ y++ -
hi,
i have a JSP.
this JSP has the following code..
Relevant code snippet...
<form name="myform" action="Parse.jsp" method="post" target="newWin" onsubmit="return doSubmit(this);">
<input type="hidden" name="xmldata" value=<%=array[1]%>> // array[1] is an XML string returned by a class method.
<input type="submit" value="Parse the xml">
</form>
<script>
function doSubmit(formObj) {
window.open('','newWin','scrollbars=0,menubar=0,toolbar=0,location=0,status=0');
return true;
</script>this Parse.jsp wants to perse the XML given to it....
the problem is this Parse.jsp never gets the proper xml....because you know i have the value=<%=array[1]%> in the above and this is corrupting the XML.
so, problem is how can open a pop up and send the XML string from its parent window ?please code sample ? demo code is enough to try
with.This has nothing to do with samples. You should know
which encodings you use. You decalre it in the HTML
i have not mentioned encoding in the HTML.
by html encoding , i think you mean this (bold letter)
// created by dreamweaver 2004
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
</body>
</html>if you mean that...NO, I DID NOT USE that thing in my JSP. i deleted that.
and XML headers. XML encoding, i have this at the start of XML....
<?xml version="1.0" encoding="ISO-8859-1" ?>
// XML data
Java, if nothing else is said, uses
UTF16.
in my form i have method="post".And what do you receive? What does "corrupted" mean?
Not well-formed? Garbage characters? Truncated?error message: [STDOUT] xmlStringelectric.xml.ParseException: java.io.IOException: could not find 59 line 1, char 46682:
NO, i dont blame my parser. if i provide the XML seperately, then my parser works fine.
but when i send the XML via JSP to the parser it does not work.
that means sending of XML is making some trouble. -
Read in XML file and spit out specific element
Hi all i wonder if someone could give me a hand. I've got some code (below) which reads in an xml file and spits out the contents of the file. Thats fine and dandy, however what i want to be able to do is specify which element to spit out, which i'm not sure how to do. So say i had the following xml file:
<?xml version="1.0"?>
<OpenSourceQuestions>
<question>
<setup>A raster graphics editor</setup>
<answerChoice1>The Gimp</answerChoice1>
<answerChoice2>The Chimp</answerChoice2>
<answerChoice3>The Pimp</answerChoice3>
<answerChoice4>The Blimp</answerChoice4>
<correctAnswer>The Gimp</correctAnswer>
</question>
<question>
<setup>test question 2</setup>
<answerChoice1>question2 answer1</answerChoice1>
<answerChoice2>question2 answer2</answerChoice2>
<answerChoice3>question2 answer3</answerChoice3>
<answerChoice4>question2 answer4</answerChoice4>
<correctAnswer>question2 answer1</correctAnswer>
</question>
</OpenSourceQuestions>What i want to do is only spit out the xml for the first question, i.e. "A raster graphics editor" and its answers
Here is my java code for reading in and arsing the file:
void readXML(){
try {
File fXmlFile = new File("MyXMLFile.xml");
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(fXmlFile);
doc.getDocumentElement().normalize();
System.out.println("Root element :" + doc.getDocumentElement().getNodeName());
NodeList nList = doc.getElementsByTagName("question");
System.out.println("-----------------------");
for (int temp = 0; temp < nList.getLength(); temp++) {
Node nNode = nList.item(temp);
if (nNode.getNodeType() == Node.ELEMENT_NODE) {
Element eElement = (Element) nNode;
System.out.println("Question : " + getTagValue("setup",eElement));
System.out.println("Answer1 : " + getTagValue("answerChoice1",eElement));
System.out.println("Answer2 : " + getTagValue("answerChoice2",eElement));
System.out.println("Answer3 : " + getTagValue("answerChoice3",eElement));
System.out.println("Answer4 : " + getTagValue("answerChoice4",eElement));
} catch (Exception e) {
e.printStackTrace();
private static String getTagValue(String sTag, Element eElement)
NodeList nlList= eElement.getElementsByTagName(sTag).item(0).getChildNodes();
Node nValue = (Node) nlList.item(0);
return nValue.getNodeValue();
}IN the time since i posted i have solved my own query!
-
XML Parser and Content-type/encoding problem
I've write a little and simple XML parser and a simple "trasformer" that recive an XML file and an XSL one and return HTML, here is the code:
public static String toHTML(Document doc, String xslSource){
ByteArrayOutputStream testo = new ByteArrayOutputStream();
try{
DOMSource source = new DOMSource(doc);
TransformerFactory tFactory = TransformerFactory.newInstance();
System.out.println("----> " + xslSource);
Transformer transformer = tFactory.newTransformer(new StreamSource(xslSource));
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
transformer.setOutputProperty(OutputKeys.METHOD, "html");
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
transformer.transform(source, new StreamResult(testo));
}catch(Exception ioe){
System.out.println("2 XMLTool.toHTML " + new java.util.Date());
System.out.println(ioe);
return testo.toString();
}the problem is that I would like to put the HTML code its return into a JEditorPane; now I'm trying with this code:
JEditorPane jep1 = new JEditorPane();
jep1.setContentType("text/html");
jep1.setText(v);
// 'v' is the string returned by the code posted up (the XML/XSL transformer)but I can't see anything in my JEditorPane.
I think that the problem is this line of code that the transformer add automaticaly ad HTML code:
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">Infact if I try to delete this line from the code I can see what I want but is'n good delete a line of code without understend where is the problem.
So, can anyone help me?good.
when u set ur output properties to html , transformer
searches for all entity references and converts accordingly.
if u r using xalan these files will be used for conversion of
Character entity references for markup-significant
output_html.properties
(this should be in templates package)
and HTMLEntities.res(should be in serialize package)
vasanth-ct -
How to submit both HTTP post and a PDF
I would like to know how to submit HTTP post and a PDF to a HTTPS web server that will have a php code to parse. Any ideas would be great.
-DevIf you drop a regular button on the form and make it a submit button. In teh Submit panel you can control what is being submitted. One of the options is a PDF and another is an XDP (XML Data Package) where you can control what is in th epackage. One of the options for the package is the completed PDF (base64 encoded). If you use the XDP option you will get all of your data in XML and you will get the completed PDF in a separate node. I believe the node is Chunk. Then you can get the Chunk node an decode it and voila there is your data and completed PDF in a single transmission.
-
How to convert a data set into a xml data and vice versa
i am new to oracle with xml..
my aim is to convert a data set into a xml data and vice versa..
my work is as follows...
my query:
select rggpk,rggcode,rggname from ms_regiongeo
to convert a data set into a xml*
select XMLType(trim(replace(dbms_xmlgen.getXML('select rggpk,rggcode, rggname from ms_regiongeo'),'<?xml version="1.0"?>',''))) XML_DATA from dual;
(this works fine and output of this query is as follows..)
<ROWSET>
<ROW>
<RGGPK>201</RGGPK>
<RGGCODE>Asia</RGGCODE>
<RGGNAME>Asia</RGGNAME>
</ROW>
<ROW>
<RGGPK>1</RGGPK>
<RGGCODE>OTH</RGGCODE>
<RGGNAME>Others</RGGNAME>
</ROW>
<ROW>
<RGGPK>21</RGGPK>
<RGGCODE>COB</RGGCODE>
<RGGNAME>Africa and Yemen</RGGNAME>
</ROW>
<ROW>
<RGGPK>2</RGGPK>
<RGGCODE>AUS</RGGCODE>
<RGGNAME>Australia</RGGNAME>
</ROW>
<ROW>
<RGGPK>23</RGGPK>
<RGGCODE>IND</RGGCODE>
<RGGNAME>Indian Sub Continent</RGGNAME>
</ROW>
<ROW>
<RGGPK>24</RGGPK>
<RGGCODE>TVM</RGGCODE>
<RGGNAME>North America</RGGNAME>
</ROW>
</ROWSET>
and to reverse this process, I tried a query like this..*
select EXTRACTVALUE (XML_DATA,'ROWSET/ROW/RGGPK') as EMP_ID
from(
select XMLType(trim(replace(dbms_xmlgen.getXML('select rggpk,rggcode, rggname from ms_regiongeo'),'<?xml version="1.0"?>',''))) XML_DATA from dual
)tab1but failed.. and raised with an eror: ORA-19025
help me..
regards,
johnHi-
my aim is to convert a data set into a xml data You can refer to the below posts
Adding namespace to XML output
Re: how to convert table data in xml format based on the xsd. -
How to Parse the XML File and create an IDOC?
Hello friends,
I've an xml file which needs to be parsed and create an idoc into SAP to post the New Hire process? I need to create an ABAP for this
Could somebody help me do this?
Thankshere is the sample code for loading local xml file and parsing its using the abov ementioned FM
report y_xml_upload
no standard page heading.
data: filename type string ,
xmldata type xstring .
data: result_xml type standard table of smum_xmltb .
data: return type standard table of bapiret2 .
constants: line_size type i value 255.
data: begin of xml_tab occurs 0,
raw(line_size) type x,
end of xml_tab,
file type string,
size type i.
* upload the xml file
filename = 'C:raja123.xml' .
call function 'GUI_UPLOAD'
exporting
filename = filename
filetype = 'BIN'
has_field_separator = ' '
header_length = 0
importing
filelength = size
tables
data_tab = xml_tab
exceptions
others = 1.
************uncomment this and comment the call of SCMS_BINARY_TO_XSTRING if you dont have this fm in your system.
* if sy-subrc <> 0.
* clear: xmldata.
* exit.
* else.
* data: len type i.
* len = size.
* loop at xml_tab.
* if len <= line_size. exit. endif.
* concatenate xmldata xml_tab-raw(line_size)
* into xmldata in byte mode.
* len = len - line_size.
* endloop.
* if len > 0.
* concatenate xmldata xml_tab-raw(len)
* into xmldata in byte mode.
* len = len - size.
* endif.
* endif.
******* end of comment.
call function 'SCMS_BINARY_TO_XSTRING'
exporting
input_length = size
* FIRST_LINE = 0
* LAST_LINE = 0
importing
buffer = xmldata
tables
binary_tab = xml_tab
exceptions
failed = 1
others = 2
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function 'SMUM_XML_PARSE'
exporting
xml_input = xmldata
tables
xml_table = result_xml
return = return .
Regards
Raja
do not forget to assign points to helpful answers
Maybe you are looking for
-
How to change URL of Webservice Model without reconfiguring or creating new
Hi, I have create a WebService Model with DEV url (some Dev URL ) using Import WebService Model DEPRECATED option Now my application is moving to TEST and PROD. Is it possible to change DEV URL in webdynpro application application without reconfiguri
-
Switching-off the acceptance of changes while synchronize
Hi Whenever I synchronize my BB with Desktop Software I have to accept every single change I made in my address book or the calendar. Is it possible to switch-off this acceptance? I just want to start the synchronization and then my BB should do the
-
How do I view videos that need Adobe Flash Player on my iPad?
How do I view videos that need Adobe Flash Player on my iPad? If this device does not support Adobe Flash?
-
Hi there, no-one seems to be able to help me from those I have spoken to about this; can someone here proove me wrong? I have Quicktime movie files where the picture is perfect but there is no sound whatsoever! A window pops up to tell me necessary s
-
statspack.snap has started failing (breaking the primary key on stats$sql_summary, so i ran the supplied purge script to clear all but a couple of the snaps. Again it failed, so i ran the supplied truncation script and again it failed - the truncatio