XSLT, XML Question???
I've recently found that I can use XSLT to transform XML docs into SQL using x-path... Is there any documentation out there referencing a transformation using x-query???? I've searched the web but have not seem much on this...
Any direction would be greatly appreciated.
XSLT doesn't use XQuery. So it's not surprising you haven't found much documentation about using XQuery in XSLT. You might want to direct questions like this one to an XSLT forum rather than a Java forum.
Similar Messages
-
Hello,
when I have a question about XML, where do I ask?
XML DB issues related to XML DB
XML space for the following subspaces
General XML Discussion of the general XML language, standards (XSLT, XQuery, XMLSchema, etc.) and application management issues, suggestions and tips.
PL/SQL XML Programming PL/SQL programming using XDK and related management issues inside Oracle database server. Any question for XML DB functionality, please post your question in Products -> Database-> XML DB.
XQuery Discussion of Oracle XQuery Technology Preview, W3C XQuery specifications, and JSR 225: XQuery API for Java (XQJ) issues
I think I now have an idea (not that I'm sure about it) where my question will fit best. Now, because there is an explanation of the scope of the space, I don't remember something like this in the old forum. Nevertheless it might be confusing for a new member or one that lacks a certain knowledge about the subtleties:
One step forward everyone who understands the explanation for the PL/SQL XML Programming space!
When I have a question about XQuery, how can I decide whether XQuery is correct or General XML?
Which questions qualify for XML DB and not for any of the others.
We all know that many users are not able to see that SQL questions don't belong into the SQL Developer space, how can we expect that they will find the "correct" forum for XML questions? In the end they will end up in the SQL and PL/SQL space anyhow :-)
Regards
MarcusMy $0.02.
As I recall, the explanation for each forum was at the entry level for each forum and not displayed within the forum itself.
The PL/SQL XML Programming space refers to the Oracle XML Developer Kit. It is maintained by a different team than the XMLDB so the need for a separate space for it makes sense. That said, what it covers is also part General XML and XQuery if you dig into what you can do in the XDK.
Some questions that would qualify for the XML DB space.
Anything related to schema registration or downstream of schema registration. Such as querying/performance/indexes/etc.
Issues parsing XML via using XMLTable (or XQuery, such as the new XQuery update added in 11.2.0.3) (Yes that can conflict)
Storage of data in XMLType columns
I to have always been a bit unclear on the exact division between groups in this XML space. I see the XQuery space as being a subset of the General XML space. I watch all three forums, as they are normally low volume and you never know where a question will pop up. As you have seen, questions often end up in the wrong forum and often General XML gets an influx of questions that should go into the Business Intelligence space as well. There is no good way right now to start a generic post and let the system suggest forums that the post could go into, based on content or software involved. That would be a nice touch for the future. -
In EP6 SP2 there is an XSLT/xml transform api. Can somebody tell me what jar file is it in?
contentconversionapi.jar & contentconverterapi.jar can transform any xml file with xslt file. you can download the jar your portal install.
-
hi,
I want to display the xml file which is as following:
<item>
<title>title1</title>
<content>content1</content>
</item>
<item>
<title>title2</title>
<content>content2</content>
</item>
I want to display all titles in a table. When clicking a title, then displaying the corresponding content.
So I wrote code:
<xsl:for-each select="title">
<a>
<xsl:attribute name="href">content.jsp</xsl:text></xsl:attribute>
<xsl:apply-templates />
</a>
</xsl:for-each>
How can i transfer the title name to the content.jsp so that the corresponding content can be handled in content.jsp?
Any suggestion is helpful.Hi jacky_chenp,
I am facing a problem in JSP + XSLT + XML, just see whether you can help as I am new to it.
I am getting the following error message while try to compile JSP_Book_Inventory.jsp
Error: java.security.PrivilegedActionException <<java.lang.ClassNotFoundException: org.apache.xalan.xslt.XSLTInputSource>>
JSP_Book_Inventory.jsp
<%@ taglib uri="http://jakarta.apache.org/taglibs/xsl-1.0" prefix="xsl" %>
<html>
<head><title>Book Inventory</title></head>
<body>
<xsl:apply xml="XML_Book_Inventory" xsl="XSL_Book_Inventory.xsl" />
</body>
</html>
XML_Book_Inventory.xml
<?xml version='1.0' encoding='ISO-8859-1'?>
<books>
<book isbn="123">
<title>Web Servers for Fun and Profit</title>
<quantity>10</quantity>
<price>$17.95</price>
</book>
<book isbn="456">
<title>Web Programming for Mobile Devices</title>
<quantity>2</quantity>
<price>$38.95</price>
</book>
<book isbn="789">
<title>Duke: A Biography of the Java Evangelist</title>
<quantity>25</quantity>
<price>$15.00</price>
</book>
</books>
XSL_Book_Inventory.xsl
<?xml version='1.0' encoding='windows-1252'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Root template -->
<xsl:template match="books">
<table border="1" width="100%">
<th>ISBN</th>
<th>Title</th>
<th>Quantity</th>
<th>Price</th>
<xsl:for-each select="book">
<tr>
<td><xsl:value-of select="@isbn" /></td>
<td><xsl:value-of select="title" /></td>
<td><xsl:value-of select="quantity" /></td>
<td><xsl:value-of select="price" /></td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
Thank you. -
First, I apologize to the board in advance because I started a very similar topic already. I know this can be annoying but I think I'm worried that people will ignore my original post because there was already a reply to it. I added 2 follow up posts and nobody has responded. It could well be because they feel that my questions were already answered. After reading and re-reading the person who replied to my original question I did start to pick up many answers from his post. However, I guess I have some follow-up questions and felt compelled to start a new thread to get this "out there" again. I promise to try not to do this again and, once again, I apologize for starting multiple similar topics. Anyway, here goes my follow-up questions...
I'm pretty new to XML but I've been reading an article on msdn about it and listed some code from the article at the bottom of this post.
I have some questions about namespaces. From what I understand, a namespace is a unique identifier (it's a string). The thing that's bugging me though is this line...
<x:transform version='1.0' xmlns:x='http://www.w3.org/1999/XSL/Transform'>
Maybe I'm wrong, but my gut feeling is that this particular namespace has a special meaning (in other words, it goes beyond being just a unique identifier). Am I correct on this?
From other stuff I've read I have another gut feeling that there are certain namespaces that somehow have schemas attached to them automatically. I've read that a schema can be "namespace aware". So, as a guess at the answer to my original question - are there certain namespaces that are something like "keywords" (similar to the concept of "keywords" in programming languages)? And is the "big deal" about these particular namespaces that they have schema definitions attached to them somehow? Any help would be GREATLY appreciated!
EXAMPLE CODE FROM THE MSDN SITE:
<x:transform version='1.0'
xmlns:x='http://www.w3.org/1999/XSL/Transform'
>
<x:template match='/'>
<hello_world/>
</x:template>
</x:transform>this particular namespace has a special meaning .... Am I correct on this?Yes, that namespace has a "meaning", but only to a program that implements the XSLT language. Likewise a "purchase order" namespace has a "meaning", but only to a program that is designed to read XML with that namespace and convert it to purchase orders in somebody's accounting system. (Just as the codes 'A', 'C', and 'D' could mean 'Add', 'Change', and 'Delete' to a program that maintains a database.) Similarly element names have a "meaning", but only to a program that is designed to understand that "meaning". A Java program has a "meaning" but a COBOL compiler doesn't understand that "meaning".
From other stuff I've read I have another gut feeling that there are certain namespaces that somehow have schemas attached to them automatically.Not that I've ever heard of. -
Plugging XSLT / XML processors into Business Connector 4.7
Hi,
I need to use Xalan 2.6.0 and the associated XML parsers
in the Business Connector.
Does anyone know whether any built-in services or
SAP Adapter services would be negatively impacted by
this change? I have found nothing in the documentation.
(Among the reasons I need to do this are that the
processors in package com.inqmy.lib.jaxp do not seem to
be JAXP 1.2 compliant. Also, they neither respect the
encoding-attribute of <xsl:output>, nor allow to override
it from the outside. When generating HTML, this has
created problems for some clients).
In order to use Xalan/Xerces, one needs to set the
variable PREPENDCLASSES in server.bat to contain
the Xalan jars, and change the value of the configuration
variable watt.xslt.jaxp.properties in the server.cnf file.
The value of this variable is the name of a file in normal
Java properties syntax, which contains values for the
relevant System properties:
javax.xml.transform.TransformerFactory
javax.xml.parsers.DocumentBuilderFactory
javax.xml.parsers.SAXParserFactory
I'm using BC 4.7 SR2, Core Fix 2, JDK 1.3.1_09 under WinXP
At first glance everything seems to work fine (I can
still use recordToDocument), but I'd like to be sure.
And what about BC 4.6?
-- Sebastian Millies
IDS Scheer AGCheck out this weblog series for starters: /people/tobias.trapp/blog
Then I would suggest you post your question to the ABAP forum. -
856 xslt Mapping question ...
I was asked in the jdev forum to post this here as well :)
Ramesh,
I hate to keep bugging everyone but i have another question.
I am trying to transform data into an X-12 856 document (outbound). I have most of the looping and everything working. My only issue is how do you handle the parent child relationships in the HL01/02 ? Since xpath does not let you increment a variable how can you keep the count of the HL loops let alone tell the HL02 (parent's HL01) We are using a SOPI scenario and the items need to be subordinate to the appopriate pack level.
I really appreciate all the time and awnsers you have given me so far :)
Thank you in advance,
JadenHi,
There is a way to handle x=x+1 in XSLT....here it is..assume u want to sum all the elements of an arraylist in an XML...create a temporary variable(TransCountSumVar) and do a foreach and group them in one more variable (Transactions_Count2)
<xsl:variable name="TransCountSumVar">
<xsl:for-each select="/ns1:TotalDate/ns1:price">
<Transactions_Count2>
<xsl:value-of select="number(ns1:price)"/>
</Transactions_Count2>
</xsl:for-each>
</xsl:variable>now get the sum of those in Transactions_Count2 as follows
<xsl:variable name="TComp" select="sum(exsl:node-set($TransCountSumVar)/Transactions_Count2)"/>where Tcomp is another variable with holds the final sum and be sure to the the namespace xmlns:exsl="http://exslt.org/common" in XSL at name space declarations. -
I apologize if this topic is out of place, but I can not find any forum more suitable to my question. Please advise.
I use XML and XSLT to render a "tree" in my jsp page. When user clicks a tree leaf, a new page is loaded.
Each user will see a different tree, depending on his role defined in the application. The worst thing I can do is to have a different XML file for each role.
Is is possible that I can have just one XML file defining a generic tree, and depends on user role, certain branches and leaves are displayable. In another words, is it possbile to have a XML file parameterized by an external variable.
The external variable here is the user role, which comes from a session scope bean.
MSXML has similar feature that is quite close, but my app is based on Java, Struts on Unix.Thanks for the hint. I am newbie, and I am quite at lost to make this work.
Here is my tree xml file tree.xml ( a portion of if)
=======
<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="../css/xmlTree.xsl"?>
<!DOCTYPE tree SYSTEM 'tree.dtd'>
<tree>
<branch id="IDAdmin"> <!-- Start User Administration branch -->
<branchText> User ID Setup</branchText>
<leaf> <leafText> Add</leafText> <link>../add_user.jsp</link> </leaf>
<leaf> <leafText> Change</leafText> <link>#</link> </leaf>
</branch> <!-- End of User Administration branch -->
===================
Here is the xmlTree.xsl
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"></xsl:output>
<xsl:param name="roleNm" select="'ADMINISTRATOR'"/>
<xsl:template match="/">
<html>
<head>
<title>XML Tree Control</title>
<link rel="stylesheet" type="text/css" href="../css/xmlTree.css"/>
<script type="text/javascript" src="../js/xmlTree.js"></script>
</head>
<xsl:apply-templates/>
</html>
</xsl:template>
<xsl:template match="tree">
<body>
<b><xsl:value-of select="$roleNm"/></b>
<xsl:apply-templates/>
</body>
</xsl:template>
Here is a portion of my jsp page
<frame name="nav_frame" bgcolor="#FFFFCC" src="tree.xm"/>' frameborder="0"
Can youn kindly give me a bit more detail where the setParameter call should be set ? I guess it will be a scriplet in my jsp, but I don't know how to put them together. Thanks -
Genereting JSTL tags with an XSLT transformation question
Hi there!
I have some XML datas to display in a jsp file.
XML content is of this type:
<message>
<title>A message</title>
</message>
The most elegent way to present them is to transform XML via xslt into xhtml.
(that way I can externally change with ease the message formatting output without changing the jsp)
For that, I use the cool tag
<x:transform>
on each xml file i want to display (with x:foreEach)
The output produced for each xml file is:
<div class="message">
<h2>A message</h2>
</div>
My problem is now that I want to include custom tags in the generated content!
For exemple:
<div class="message">
<h2>A message<c:out ...></h2>
</div>
My question is:
how can I make that xslt generated tag to be executed???
Since it is the product of an xslt transformation ,I suppose it won't be executed at all...
Advices greatly appreciated! :)I'm not sure I understand what you mean when you say "how can I make that xslt generated tag to be executed???"
You've got your XML input and the XSL-T stylesheet that will transform the XML input into an XHTML stream containing JSTL tags.
I'm assuming that you're going to ask a servlet to pass the XML input to the XSL transformer and get the XHTML output stream. Once you have that, the servlet will write the XHTML to the HTTP response output stream, where it'll be rendered by the browser.
I think the key is to make sure that you tell the browser that response type is a JSP (that's the only document type in which it makes sense to put JSTL tags). When the browser gets that JSP, it'll treat it like any other: generate .java code, compile that to a .class file, and then render.
I'm not sure about efficiency, but it sure is an elegant solution. - MOD -
How do I use XSLT & XML is stored in InterMedia Text.....
I use interMedia Text to store XML document. How do I use the XSLT Processor API to transform the data which is searched by XML SQL Utility??
//***Source Code
public Document xmlquery(String tabName,String xslfilename)
Document xmlDocToReturn = null;
String xmlString;
try
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
//initiate a JDBC connection
// initialize the OracleXMLQuery
OracleXMLQuery qry = new OracleXMLQuery(conn,"select XML_TEXT from bookstore where contains (xml_text,'John WITHIN authorsec')>0");
// structure the generated XML document
qry.setMaxRows(2);
// set the maximum number of rows to be returned
// get the XML document in string format
xmlString = qry.getXMLString();
// print out the XML document
System.out.println(" OUTPUT IS:\n"+xmlString);
// get the XML document in string format
xmlDocToReturn = qry.getXMLDOM();
conn.close();
catch (SQLException e) {
return xmlDocToReturn;
xml = (XMLDocument)query.xmlquery(args[1],args[0]);
// Instantiate the stylesheet
XSLStylesheet xsl = new XSLStylesheet(xsldoc, xslURL);
XSLProcessor processor = new XSLProcessor();
// Display any warnings that may occur
processor.showWarnings(true);
processor.setErrorStream(System.err);
// Process XSL
DocumentFragment result = processor.processXSL(xsl, xml);
Thank you.
nullYour problem here is that when you store an XML document in a CLOB and search it using intermedia, when you do a query like:
SELECT xml_text
FROM bookstore
WHERE CONTAINS(xml_text,'John WITHIN authorsec')>0
The output from the XML SQL Utility using getXMLDOM() looks like this:<ROWSET>
<ROW>
<XML_TEXT><![CDATA[
<bookstuff>
<authorsec>
<name>Steve</name>
</authorsec>
etc.
</bookstuff>
]]>
</XML_TEXT>
</ROW>
</ROWSET>with the document as a single text value (it's actually just a text node, not a CDATA node) but the above illustrates conceptually that the whole XML document is one big text node.
To transform this you'll need to parse that XML text into an XML document in memory by passing constructing a StringReader() on the text value and parsing that reader.
null -
I'm trying to convert an XML message to an ABAP internal table. However, the Transformation returns 2 empty rows in the internal table (no data). When I run XSLT to debug the transformation it seems to work. Here is the ABAP program, XSLT program and XML to be transformed. Thank you.
ABAP ****************************************************
CLEAR wf_string1 .
wf_string1 = http_client->response->get_cdata( ).
TYPES: BEGIN OF OUTTAB1 ,
Service(50),
NetCharge(50),
END OF OUTTAB1 .
DATA: OUTTAB TYPE TABLE OF OUTTAB1.
DATA: s_outtab TYPE OUTTAB1.
TRY.
CALL TRANSFORMATION ('Z_XML2ABAP')
SOURCE XML wf_string1
RESULT outtab = OUTTAB.
CATCH cx_xslt_exception INTO xslt_err.
DATA: s TYPE string.
s = xslt_err->get_text( ).
WRITE: ': ', s.
STOP.
ENDTRY .
Loop at outtab into s_outtab.
Write:/ s_outtab .
Endloop .
XSLT Program **************************************
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:strip-space elements="*"/>
<xsl:output indent="no"/>
<xsl:template match="RateReply">
<asx:abap version="1.0" xmlns:asx="http://www.sap.com/abapxml">
<asx:values>
<OUTTAB>
<xsl:for-each select="Entry">
<xsl:variable name="Ent" select="Entry"/>
<OUTTAB1>
<Service><xsl:value-of select="Service"/></Service>
</OUTTAB1>
</xsl:for-each>
</OUTTAB>
</asx:values>
</asx:abap>
</xsl:template>
</xsl:transform>
Edited by: Tony Raimo on Dec 18, 2007 8:04 PMProblem Solved. SERVICE needed to be in capitals in the XSLT.
Edited by: Tony Raimo on Dec 18, 2007 8:03 PM -
Hi together!
Hope anybody can help.
I have the follow XML structure :
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">¶
<asx:values>¶
<IMPORT>¶
<Y0DPL_LATAM_INV_FILE_UPLOAD>¶
<DATA>222358 1NU 480350 29102007VENDA DE MERCADORIA 30</DATA>¶
</Y0DPL_LATAM_INV_FILE_UPLOAD>¶
<Y0DPL_LATAM_INV_FILE_UPLOAD>¶
<DATA>35403474</DATA>¶
</Y0DPL_LATAM_INV_FILE_UPLOAD>¶
<Y0DPL_LATAM_INV_FILE_UPLOAD>¶
<DATA>35403822</DATA>¶
</Y0DPL_LATAM_INV_FILE_UPLOAD>¶
<Y0DPL_LATAM_INV_FILE_UPLOAD>¶
<DATA>4480350</DATA>¶
</Y0DPL_LATAM_INV_FILE_UPLOAD>¶
<Y0DPL_LATAM_INV_FILE_UPLOAD>¶
<DATA>220089</DATA>¶
</Y0DPL_LATAM_INV_FILE_UPLOAD>¶
<Y0DPL_LATAM_INV_FILE_UPLOAD>¶
<DATA>3540347</DATA>¶
</Y0DPL_LATAM_INV_FILE_UPLOAD>¶
<Y0DPL_LATAM_INV_FILE_UPLOAD>¶
<DATA>4480351 </DATA>¶
</Y0DPL_LATAM_INV_FILE_UPLOAD>¶
</IMPORT>¶
</asx:values>¶
</asx:abap>
After the XSLT Transformation i need the data in this structure :
<data>
<invoice>
<id>222358</id>
<item>35403474</item>
<item>35403822</item>
<code>4480350</code>
</invoice>
<invoice>
<id>220089</id>
<item>35403474</item>
<code>4480351</code>
</invoice>
</data>
I tried to group the data with the tag "xsl:for-each-group". But i get no result.
Regards,
AntonHi,
no one with a good hint?
Regards,
Anton -
Well I'm diving into XSLT for the first time. I've gotten the RSS feed to display just fine, but my problem is with the XHTML 1.0 strict validation and it could just be DW.
What I have is a XSLT fragment file, saved as .xsl, with the feed. I then used the server behaviors to add the fragment to my primary PHP document. It seems that when DW adds this code into a PHP document it adds a script to the document and then includes the xsl file where I place it on the page. However, the beginning of the XSL file shows:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
That is the line that the validator says won't validate because the only place it is allowed is at the beginning of the file but since DW is including the xsl fragment file in the middle of a file it won't validate. Is the XSL fragment document still valid without that code at the top of it?Maybe this helps?
http://www.objectsbydesign.com/projects/xslt/xhtml.html
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
http://alt-web.com/
http://twitter.com/altweb
http://alt-web.blogspot.com -
Real simple xslt problem/question
Hi, i have a real simple xslt problem but i just cant figure out how to do it by looking at various examples on the net. i have a xml document and in it are some elements with a "result" tag name. i want to use xslt to reproduce exactly the same xml document except with an attribute called "id" added to those elements with a "result" tag name. i'm sure that theres a simple solution to it but i just cant figure it out. any helps greatly appreciated, thanks
Start with the XSLT identity transform (I don't have it handy and it's fairly long, but you should be able to google it up). Add this:<xsl:template match="result">
<result id="">
<xsl:apply-templates>
</result>
</xsl:template> -
XMLTYPE variable converting to XML (Question)
Friends,
I am stuck on an error and cannot find a way out. Please help. I know it's a long question but a very simple answer to many smart people here. I am just lost and need your help. (I am new to SOA so bear with me)
I have a BPEL process which invokes a PL/SQL API which returns the XMLTYPE output which has the XML data. In order to convert the XMLTYPE to normal XML I do following :-
- I added a Java embed activity in BPEL with following code (Invoke_new_get_customer_order_info_OutputVariable','OutputParameters','/ns2:OutputParameters/ns2:X_CUSTOMER_ORDER_INFO_XML is the XMLTYPE)
(responsePayoad is string variable)
try{
Node node = (Node)getVariableData("Invoke_new_get_customer_order_info_OutputVariable','OutputParameters','/ns2:OutputParameters/ns2:X_CUSTOMER_ORDER_INFO_XML");
Node childNode = (Node) node.getFirstChild();
StringWriter writer = new StringWriter();
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.transform(new DOMSource(childNode), new StreamResult(writer));
String xml = writer.toString();
String nsXML = xml.replaceFirst("<FetchCustomerInfoResponse","<FetchCustomerInfoResponse xmlns=\"http://xmlns.djoglobal.com/OrderTracking/CustomerInfo\" ");
setVariableData("responsePayload",nsXML);
addAuditTrailEntry("XML with Namespace: " + nsXML);
} catch(Exception e){
addAuditTrailEntry(e);
System.out.println("Namespace injection failed due to : " + e);
After above I have ASSIGN activity where I use parsexml function on the "responsePayload" variable to assign to a variable of type element which refers to following xsd. This is where I get an "internal xpath error" during runtime which I cannot resolve.
XSD of the element variable refering to "FetchCustomerInfoResponse" element
<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.example.org"
targetNamespace="http://xmlns.djoglobal.com/OrderTracking/DJOFetchCustomerOrderInfo"
elementFormDefault="qualified">
<xsd:element name="FetchCustomerInfoResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="DJO_ONT_ACCOUNT_ORDERS">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="DJO_ONT_ACCOUNT_ORDER" maxOccurs="unbounded">
<xsd:complexType>
<xsd:attribute name="ordered_date" type="xsd:string"/>
<xsd:attribute name="cust_po_number" type="xsd:string"/>
<xsd:attribute name="order_number" type="xsd:integer"/>
<xsd:attribute name="header_id" type="xsd:integer"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
XML returned in the XMLTYPE from the PL/SQL API :-
<Invoke_new_get_customer_order_info_OutputVariable><part name="OutputParameters" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<OutputParameters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/APPS/XXDJO_ONT_ORDER_TRACKING_WS/GET_CUSTOMER_ORDER_INFO_XML/"><X_CUSTOMER_ORDER_INFO_XML>
<FetchCustomerInfoResponse xmlns="">
<DJO_ONT_ACCOUNT_ORDERS>
<DJO_ONT_ACCOUNT_ORDER ordered_date="24-APR-12" cust_po_number="PO1" order_number="123456" header_id="7777777"/>
<DJO_ONT_ACCOUNT_ORDER ordered_date="19-APR-12" cust_po_number="PO2" order_number="4545454" header_id="888888"/>
<DJO_ONT_ACCOUNT_ORDER ordered_date="09-APR-12" cust_po_number="PO3" order_number="56565656" header_id="999999"/>
</FetchCustomerInfoResponse>
</X_CUSTOMER_ORDER_INFO_XML>
</OutputParameters></part></Invoke_new_get_customer_order_info_OutputVariable></messages>
Any help is greatly appreciated as this is driving me nuts.
ThanksFew modifications,
1. Initialize your int count to 0, int count=0;
2. Write count++; as the first statement in your for loop. 3. Remove count++; at the bottom.
4. Add a hidden field to your form (after submit button, but before your </form> tag)
<input type="hidden" name="qCount" value="<%=count%>">
Now use this code,
writeXML.jsp
<%
int qCount = Integer.parseInt(request.getParameter("qCount"));
String home ="C:\\Tomcat\\FYProject\\lib\\";
String filename = request.getParameter("file");
String extension = ".xml";
String filePath = home + filename + extension;
BufferedWriter bw = new BufferedWriter(new FileWriter(filePath,true));
bw.write("<mc_QuestionType>");
bw.newLine();
for(int count=0;count<qCount;count++) {
String Tquestion = request.getParameter("questionText"+count);
String answer1 = request.getParameter("choice_1"+count);
String answer2 = request.getParameter("choice_2"+count);
String answer3 = request.getParameter("choice_3"+count);
String answer4 = request.getParameter("choice_4"+count);
String Canswer = request.getParameter("cAnswer"+count);
bw.write(" <questionText>" Tquestion "</questionText>");
bw.newLine();
bw.write(" <choice>" answer1 "</choice>");
bw.newLine();
bw.write(" <choice>" answer2 "</choice>");
bw.newLine();
bw.write(" <choice>" answer3 "</choice>");
bw.newLine();
bw.write(" <choice>" answer4 "</choice><br>");
bw.newLine();
bw.newLine();
bw.write(" <answer>" Canswer "</answer>");
bw.newLine();
bw.write("</mc_QuestionType>");
bw.close();
%>Hope this works.
Sudha
Maybe you are looking for
-
Right hand viewer not full screen
my small viewer (at the right hand panel) suddenly became a widescreen mode rather than a full screen - means there is a gray area at the top of the bottom of the screen. it does not improve if i change the viewer size at the Windows pull down manual
-
C028:unable to connect to siebel gateway name server
Hi Siebel Guru, I am facing issue with C028:unable to connect to siebel gateway name server when i configuring a new enterprise for gateway name server. please help me out to sole this issue ASAP. Regards Prabhat
-
Colors in Fireworks CS5 / Mac
Hi, I have a problem with the color workflow in Fireworks. I think I don't fully understand how this should be used. I made a screenshot to demonstrate what I mean: If I select an object, the color is adopted properly in the toolbox color picker (1).
-
I've subscripted Acrobat Pro but I can't find my product
I've done a selling (ACROBAT Export pdf, jährl.) Can I Use ACROBAT Pro
-
HT201210 Error message 3014...when loading iOS6, what is it?
Error message 3014...when loading iOS6. What is it? How do you fix it?