Need XML Structure & Parse Advice
Hello,
I am a CF Programmer who would normally use SQL as a datasource, however for a new project I thought I'd use XML where possible. I wanted to create an XML based navigation for the site but am having trouble figuring out the right way to structure the XML items and also parsing them back out.
The site is for travel type info, and as we grow counties, areas, projects, etc. will be added - So I saw the structure like so:
<data>
<county>County A</county>
<project>A Map</project>
<project>A Article</project>
<project>A Book</project>
</data>
This is of course wrong, and i have tried variations of the structure, but I know one of you gurus can point me in the right direction...
The gist is that each "County" can and will have many "Projects" associated with it. So I wanted to define some Counties and have their 'children' be the associated projects, so a nav would read like;
COUNTY A
A Map
A Article
A Book
COUNTY B
B Map
B Article
B Map
But no matter what I do, spry, cfml, etc I cannot query the XML for the PARENT (County) and then the CHILDREN that go only with that Parent.
without repeating the parent with each child.
Obviously this is not a big deal, for some reasons my skillset is broken today (including finding a tutorial that solves this!) So any point in the right direction will be greatly appreciated.
Thanks
I did a project while back for a library of forms and documents. Each form or document had a category. I had to display the category then children listed under that category with links. The XML feed from the database in relation to yours was like
<data>
<project>
<projectname>A Map</projectname>
<county>County A</county>
<project>
<data>
In order to display the project name under their county, I used the Muenchian Method for sorting in the XSL file. This sorting method works great on small and large files. I use this method setting lightbox of with galleries, and sometimes for loading the spry menu for navigation.
Here is a link for the method:
http://www.jenitennison.com/xslt/grouping/muenchian.html
David Pearson
www.saludalabs.com
www.workhorsecreative.net
Similar Messages
-
Hi,
I have an input structure in the below format.
Sl.No*Name*Salary
101*Hari*45000
102*Ram*30000
103* * 25000
I want XML format in the below format.
<RecordSet>
<Record1>
<Sl.No> 101 </Sl.No>
<Name> Hari </Name>
<Salary> 45000</Salary>
</Record1>
<Record2>
<Sl.No> 102 </Sl.No>
<Name> Ram</Name>
<Salary> 30000</Salary>
</Record2>
<Record3>
<Sl.No> 102 </Sl.No>
<Name> </Name>
<Salary> 25000</Salary>
</Record3>
</Recordset>
So, basically if I have 100records, it should populate 100 records in XML.
In the above input file, * is the field separator and <NL> new line is the record separator.
Any pointers are highly appreciated.
Regards,
Baburepeated post http://forum.java.sun.com/thread.jspa?threadID=5252191&tstart=0
-
Urgent : Need help in parsing XML from Sharepoint and save it into DB
Hi ,
I am Sharepoint guy and a newbie in Oracle . PL/SQL
I am using UTL_DBWS Package to call a Sharepoint WebService " and was sucessfull , Now the xml has to be parsed and stored into a Table. I am facing the issue as the XML has a different namesoace and normal XPATH query is not working
Below is the XML and need help in parsing it
declare
responsexml sys.XMLTYPE;
testparsexml sys.XMLTYPE;
begin
responsexml := sys.XMLTYPE('<GetListItemsResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<GetListItemsResult>
<listitems xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
<rs:data ItemCount="2">
<z:row ows_MetaInfo="1;#" ows__ModerationStatus="0" ows__Level="1" ows_Title="Test Title 1" ows_ID="1" ows_owshiddenversion="1" ows_UniqueId="1;#{9C45D54E-150E-4509-B59A-DB5A1B97E034}" ows_FSObjType="1;#0" ows_Created="2009-09-12 17:13:16" ows_FileRef="1;#Lists/Tasks/1_.000"/>
<z:row ows_MetaInfo="2;#" ows__ModerationStatus="0" ows__Level="1" ows_Title="Testing Tasks" ows_ID="2" ows_owshiddenversion="1" ows_UniqueId="2;#{8942E211-460B-422A-B1AD-1347F062114A}" ows_FSObjType="2;#0" ows_Created="2010-02-14 16:44:40" ows_FileRef="2;#Lists/Tasks/2_.000"/>
</rs:data>
</listitems>
</GetListItemsResult>
</GetListItemsResponse>');
testparsexml := responsexml.extract('/GetListItemsResponse/GetListItemsResult/listitems/rs:data/z:row/@ows_Title');
DBMS_OUTPUT.PUT_LINE(testparsexml.extract('/').getstringval());
end;
The issue is with rs:data , z:row nodes.... please suggest how to handle these kind of namespaces in Oracle
I need the parse the attribute "ows_Title" and save it into a DB
this script would generate "Error occured in XML Parsing"
Help is appriciated, thanks for lookingSQL> SELECT *
FROM XMLTABLE (
xmlnamespaces ('http://schemas.microsoft.com/sharepoint/soap/' as "soap",
'#RowsetSchema' AS "z"
'for $i in //soap:*//z:row return $i'
PASSING xmltype (
'<GetListItemsResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<GetListItemsResult>
<listitems xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
<rs:data ItemCount="2">
<z:row ows_MetaInfo="1;#" ows__ModerationStatus="0" ows__Level="1" ows_Title="Test Title 1" ows_ID="1" ows_owshiddenversion="1" ows_UniqueId="1;#{9C45D54E-150E-4509-B59A-DB5A1B97E034}" ows_FSObjType="1;#0" ows_Created="2009-09-12 17:13:16" ows_FileRef="1;#Lists/Tasks/1_.000"/>
<z:row ows_MetaInfo="2;#" ows__ModerationStatus="0" ows__Level="1" ows_Title="Testing Tasks" ows_ID="2" ows_owshiddenversion="1" ows_UniqueId="2;#{8942E211-460B-422A-B1AD-1347F062114A}" ows_FSObjType="2;#0" ows_Created="2010-02-14 16:44:40" ows_FileRef="2;#Lists/Tasks/2_.000"/>
</rs:data>
</listitems>
</GetListItemsResult>
</GetListItemsResponse>')
columns ows_MetaInfo varchar2(20) path '@ows_MetaInfo',
ows_Title varchar2(20) path '@ows_Title',
ows__ModerationStatus varchar2(20) path '@ows__ModerationStatus'
OWS_METAINFO OWS_TITLE OWS__MODERATIONSTATUS
1;# Test Title 1 0
2;# Testing Tasks 0
2 rows selected. -
Converting string data from a web service respons into XML structure of XI
Hi,
We receive a string structure from a web service.
The string structure has an xml type format, that is all the tags and its content are in one line .
The WSDL file of the webservice defines its response structure as a string type.
How do i convert this string into proper XML structure (predefined by me in Integration repository).
OR how do i make XI understand this string as an XML structure for further processing.
Later i have to map this XML message type into IDoc.
HimaniHi Himani,
Please find the code for ur requirement -
String need to parse -<response_webservice><from_date>20080101</from_date><to_date>20080202</to_date></response_webservice>
Below mentioned code will convert it to -<MT_DATA><FROMDATE>20080202</FROMDATE><TODATE>20080101</TODATE></MT_DATA>
Create a Message type and map it like this using java mapping ( no need to use Graphical mapping).
Use MT_DATA as source and map it to your target structure .
import java.io.FileInputStream;
import java.io.IOException;
import java.io.StringReader;
import java.util.HashMap;
import java.util.Map;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.FactoryConfigurationError;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerFactoryConfigurationError;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
public class XMLParser {
private Map param = null;
public static void main(String[] args) {
try {
XMLParser wdb = new XMLParser();
wdb.parse();
} catch (Exception e) {
e.printStackTrace();
public void setParameter(Map param) {
this.param = param;
if (param == null) {
this.param = new HashMap();
public void parse() {
String document = "<response_webservice><from_date>20080101</from_date><to_date>20080202</to_date></response_webservice>";
try {
Document sdoc;
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
// Using factory get an instance of document builder
DocumentBuilder db = dbf.newDocumentBuilder();
// parse using builder to get DOM representation of the XML file
sdoc = db.parse(new InputSource(new StringReader(document)));
Element docEle = sdoc.getDocumentElement();
NodeList nl = docEle.getElementsByTagName("from_date");
Element lstElmnt = (Element) nl.item(0);
NodeList nl1 = docEle.getElementsByTagName("to_date");
Element fstElmnt = (Element) nl1.item(0);
System.out.println(fstElmnt.getFirstChild().getNodeValue());
System.out.println(lstElmnt.getFirstChild().getNodeValue());
Document tdoc = db.newDocument();
Element structure = createElement("MT_DATA", null, tdoc);
tdoc.appendChild(structure);
Element statement = createElement("FROMDATE", fstElmnt.getFirstChild().getNodeValue(), tdoc);
structure.appendChild(statement);
Element statement2 = createElement("TODATE", lstElmnt.getFirstChild().getNodeValue(), tdoc);
structure.appendChild(statement2);
System.out.println("Struct is :::"+tdoc.getDocumentElement().toString());
} catch (DOMException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (FactoryConfigurationError e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ParserConfigurationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SAXException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (TransformerFactoryConfigurationError e) {
// TODO Auto-generated catch block
e.printStackTrace();
static Element createElement(String elementName, String content,
Document document) {
Element returnElement;
returnElement = document.createElement(elementName);
if (content != null) {
Text T = document.createTextNode(content);
returnElement.appendChild(T);
return returnElement;
static Element createElement(String elementName, String content,
String attributeName, String attributeValue, Document document) {
Element returnElement = createElement(elementName, content, document);
returnElement.setAttribute(attributeName, attributeValue);
return returnElement;
Regards,
Kishore -
How to create an xml structure in webdynpro for java using NWDS?
Hi Experts,
I need to call an webservice by passing an xml structure to the webservice.I have the input values loaded on the context,which are basically tied to an Form UI element.Is there anyway in webdynpro to build an xml structure. ,
or do i need to use any open source like JAAS or DOM parser in the webdynpro project.?
Thanks
Aravindhi,
I was working on exporting table data from wd to Excel sheet. There, i had to create an XML representaion of the context.
Please refer to link, and go through page, 10 and 11 and see id you find anything useful.
[https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-technology/webdynpro/wd%20java/wdjava%20archive/exporting%20context%20data%20into%20excel%20using%20the%20web%20dynpro%20binary%20cache.pdf] -
From String to Element with XML structure
Hello.
I have String with XML elements. Can i simple this transform in to XML format?
I need Element which has XML structure.
my string looks like that is:
<payload xmlns="http://xmlns.oracle.com/bpel/workflow/task">
<usersxmlns="http://www.google.com" xmlns:ns1="http://www.google.com">
<ns1:id_name>Mario</ns1:id_name>
<ns1:id_address>Newsburgh</ns1:id_address>
</users>
</payload>
Edited by: Tony_Fabrizzio on Feb 11, 2009 5:57 AMTony_Fabrizzio wrote:
Hello.
I have String with XML objects. No you don't. Get your terminology straight
Can i simple this transform in to XML format?
I need Element which has XML structure.
my string looks like that is:
<payload xmlns="http://xmlns.oracle.com/bpel/workflow/task">
<usersxmlns="http://www.google.com" xmlns:ns1="http://www.google.com">
<ns1:id_name>Mario</ns1:id_name>
<ns1:id_address>Newsburgh</ns1:id_address>
</users>
</payload>The short answer is "yes". The long answer is "what are you planning on doing with the result, and 'process it' or 'parse it' isn't an answer"
But really, you need to do some research -
XML C++ Parser in Solaris 2.6 could not parse with base64
I am using XML C++ Parser (version 2.0.4) in Solaris 2.6
I am using the following definition in dtd file to process binary data.
<!ELEMENT Agent (base64)>
I have two problem from xmlparse() function.
1. This declaration always produces a warning:
LPX-00103: warning: document structure does not match DTD.
2. This causes the parser to fail completely if the corresponding data is empty. This field needs to be optional.
Any ideas how to handle this situation.
Thanks in advance
Vijay KumarYou can either turn off validation or read section 3.2 of http://www.w3.org/TR/1998/REC-xml-19980210 on how to write a proper DTD.
null -
Generating Dynamic UI from XML structure
Hi All,
I have a requirement in which I need to select an entry in the first view and based on this, the second view would come come. But there are 30 different values that can be selected and each of them will have a different set of UI elements in the second screen. So if I go for normal static UI creation, then I need to create 30 odd views which is something we do not want.
The second option is to dynamically generate the UI elements in wdDoModify() method. But for 30 different conditions to check all the time will lead to performance issue.
So we are thinking if there is a way for webdynpro to dynamically read an XML structure that defines attributes and generates a layout for us dynamically.
Please provide your inputs on this. Also kindly suggest any other better ways for the solution.
Thanks and Regards,
Sayan GhoshHello!
I think you should go with second one. But I don't know any "ready to use" solutions, so you have to
- Create your own XML structure, something like
<section type="yourCondition">
<input name="somePropertyName" type="text"/>
<!-- and so on -->
</section>
- Parse this XML into Java Model (on application startup for example)
- On user selection choose requred UI Model from memory and pass it to view
- In wdDoModify() build UI(elements, context attributes, mappings etc.) according to this model
It will be rather complicated for huge UI, but possible.
Thanks, Mikhail -
XML structure inside WS string response
Hi all,
I have a PI scenario and I can find a solution.
The scenario is a ABAP PROXY that consume a WS, this is no problem, the problem is that the web service returns a string parameter, and inside the string parameter there is a XML structure.
My doubt is, how can mapping it to get the response in a structured data type instead of a string??
Thanks a lot
RaúHi ,
Is the return type is an XML structure? Then use java mapping using DOM parser to extract the string from response. Then the mapping program can generate the required target structure from the string.
you can if possible let the forum members know, the response xml message and the structure of target XML as per your requirement. Finally also the version of PI you are working is also important as java mapping procedure is different for PI7.0 and PI 7.1.
As Stefan has pointed out without java mapping it will be almost impossible to extract the target XML from String. Still you can try out with XSLT mapping, but I don't think that will be easy task to do. Java mapping is the correct procedure to solve your problem. Finally forum members will be able to assist you if you provide complete source and target XML structure alog with sample string response. you can reuse java mapping code for multiple interfaces within same SWCV. The part or module which will be calling the common code with different input parameters will vary accross interfaces depending on your need.
regards
Anupam
Edited by: anupamsap on Sep 29, 2011 1:55 PM
Edited by: anupamsap on Sep 29, 2011 2:21 PM -
XML SAX parser that support LexicalHandler
Hello,
I'm looking for an XML SAX parser that support a LexicalHandler.
I have xml files that are not well formed, ie: (&, <, >, etc...) characters within tags and I need to ignore them.
Anyone have a link to some opensource library ??
Thanks,
SamirDon't waste your time. Using a LexicalHandler isn't going to help with parsing malformed XML. You should get the person who produced those files to replace them with correct XML.
PC² -
XSLT Mapping to convert u201C.CSVu201D file into XML Structure.
Hi All,
I wanted to know can we use XSLT Mapping to convert u201C.CSVu201D file into XML Structure.
I am communicating between two XI Systems. First XI system is going to give u201C.CSVu201D file as main document. I need to post IDOC Corresponding to this. So what I want to do is read this u201C.CSVu201D file (Main document in payload) and first convet it into XML and then use second mapping which will convert XML to IDOC.
I know this is possible with JAVA Mapping but just wanted to confirm can we do this with XSLT mapping as well?
Regards,
GouriHi Amit,
I know this way it shd work as i am able see other XSLT files. But this particular file is not visible.
I am copying following code only in sample.xslt file.
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fn="fn"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="2.0" exclude-result-prefixes="xs fn">
<xsl:output indent="yes" encoding="US-ASCII" />
<xsl:param name="pathToCSV" select="'file:///c:/csv.csv'" />
<xsl:function name="fn:getTokens" as="xs:string+">
<xsl:param name="str" as="xs:string" />
<xsl:analyze-string select="concat($str, ',')" regex='(("["]*")+|[,]*),'>
<xsl:matching-substring>
<xsl:sequence select='replace(regex-group(1), "^""|""$|("")""", "$1")' />
</xsl:matching-substring>
</xsl:analyze-string>
</xsl:function>
<xsl:template match="/" name="main">
<xsl:choose>
<xsl:when test="unparsed-text-available($pathToCSV)">
<xsl:variable name="csv" select="unparsed-text($pathToCSV)" />
<xsl:variable name="lines" select="tokenize($csv, ' ')" as="xs:string+" />
<xsl:variable name="elemNames" select="fn:getTokens($lines[1])" as="xs:string+" />
<root>
<xsl:for-each select="$lines[position() > 1]">
<row>
<xsl:variable name="lineItems" select="fn:getTokens(.)" as="xs:string+" />
<xsl:for-each select="$elemNames">
<xsl:variable name="pos" select="position()" />
<elem name="{.}">
<xsl:value-of select="$lineItems[$pos]" />
</elem>
</xsl:for-each>
</row>
</xsl:for-each>
</root>
</xsl:when>
<xsl:otherwise>
<xsl:text>Cannot locate : </xsl:text><xsl:value-of select="$pathToCSV" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
Is this correct?
-Gouri -
Download XML structure to Application server
Hi all.
I am generating an XML structure based on some data that I select from HR e-Recruiting, and I need to save the generated XML file on the application server, not the presentation server (local computer). Most of the code I have found on SDN (contributed by Robert Eijpe) and I must admit that I do not understand everything the code does.
I have attached the source code and the resulting XML structure:
REPORT zhr_test2_tk.
TYPE-POOLS: ixml.
TYPES: BEGIN OF xml_line,
data(256) TYPE x,
END OF xml_line.
DATA: l_ixml TYPE REF TO if_ixml,
l_streamfactory TYPE REF TO if_ixml_stream_factory,
l_ostream TYPE REF TO if_ixml_ostream,
l_renderer TYPE REF TO if_ixml_renderer,
l_document TYPE REF TO if_ixml_document.
DATA: l_element_position TYPE REF TO if_ixml_element,
l_element_title TYPE REF TO if_ixml_element,
* l_element_flight TYPE REF TO if_ixml_element,
* l_element_from TYPE REF TO if_ixml_element,
* l_element_to TYPE REF TO if_ixml_element,
l_element_dummy TYPE REF TO if_ixml_element,
l_value TYPE string.
DATA: l_xml_table TYPE TABLE OF xml_line,
l_xml_size TYPE i,
l_rc TYPE i.
DATA: lt_erec TYPE TABLE OF hrp5126,
l_erec TYPE hrp5126.
DATA: date(10),
time(4),
filepath TYPE string.
CONSTANTS: filedir TYPE string VALUE 'C:tmp',
filename TYPE string VALUE 'ZHR_test'.
START-OF-SELECTION.
* fill internal table
SELECT * FROM hrp5126 INTO TABLE lt_erec.
* Start filling xml DOM object from internal table lt_erec.
LOOP AT lt_erec INTO l_erec.
*Create the root node 'position'
IF sy-tabix EQ 1.
* create an ixml factory
l_ixml = cl_ixml=>create( ).
* create Document Object Model
l_document = l_ixml->create_document( ).
* Fill root node with value 'position'
l_element_position = l_document->create_simple_element(
name = 'position'
parent = l_document ).
ENDIF.
IF sy-tabix GT 1.
* create element jobtitle as child of position
l_value = l_erec-jobtitle.
l_element_title = l_document->create_simple_element(
name = 'job_title'
parent = l_element_position
value = l_value ).
l_value = l_erec-empl_start_date.
l_element_dummy = l_document->create_simple_element(
name = 'StartDate'
parent = l_element_title
value = l_value ).
l_value = l_erec-empl_end_date.
l_element_dummy = l_document->create_simple_element(
name = 'EndDate'
parent = l_element_title
value = l_value ).
ENDIF.
ENDLOOP.
IF sy-subrc NE 0.
WRITE: 'No data in table hrp5125'.
ENDIF.
* create a stream factory
l_streamfactory = l_ixml->create_stream_factory( ).
* connect internal XML table to streamfactory
l_ostream = l_streamfactory->create_ostream_itable(
table = l_xml_table ).
* render the document
l_renderer = l_ixml->create_renderer( ostream = l_ostream
document = l_document ).
l_rc = l_renderer->render( ).
* Get time and date
WRITE sy-uzeit+2(2) TO time+2(2).
WRITE sy-uzeit+0(2) TO time+0(2).
WRITE sy-datum+4(2) TO date+0(2).
WRITE sy-datum+6(2) TO date+2(2).
WRITE sy-datum+0(4) TO date+4(4).
*Build filename with date and time reference
CONCATENATE filedir filename date time '.xml' INTO filepath.
<i>* This is the code I hope to modify in order to save the xml structure on the application server, with a specified filepath.</i>
<b> OPEN DATASET filepath FOR OUTPUT IN BINARY MODE.
LOOP AT lt_erec into l_erec.
TRANSFER l_erec TO filepath.
ENDLOOP.
CLOSE DATASET filepath.</b>
* save XML document
l_xml_size = l_ostream->get_num_written_raw( ).
*This is the code for download to local computer
* CALL METHOD cl_gui_frontend_services=>gui_download
* EXPORTING
* bin_filesize = l_xml_size
* filename = filepath
* filetype = 'BIN'
* CHANGING
* data_tab = l_xml_table
* EXCEPTIONS
* file_write_error = 1
* no_batch = 2
* gui_refuse_filetransfer = 3
* invalid_type = 4
* no_authority = 5
* unknown_error = 6
* header_not_allowed = 7
* separator_not_allowed = 8
* filesize_not_allowed = 9
* header_too_long = 10
* dp_error_create = 11
* dp_error_send = 12
* dp_error_write = 13
* unknown_dp_error = 14
* access_denied = 15
* dp_out_of_memory = 16
* disk_full = 17
* dp_timeout = 18
* file_not_found = 19
* dataprovider_exception = 20
* control_flush_error = 21
* OTHERS = 22.
* IF sy-subrc <> 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
<b>XML result:</b>
<?xml version="1.0" ?>
<position>
<job_title>Test Process Template</job_title>
<job_title>jjjj</job_title>
<job_title>Test Job Req. 20092005</job_title>
<job_title>Created 22.09</job_title>
<job_title>title 07.12</job_title>
<job_title>Test fra portal</job_title>
<job_title>Test med 100328</job_title>
<job_title>Test restricted recruiter</job_title>
<job_title>Test restricted recruiter</job_title>
<job_title>Workshop requisition job title</job_title>
</position>
Any help is greatly appreciated.
Best Regards,
Thomas KjelsrudHi Guillaume,
The thing is that the code I presented to you is incorrect. I am asking the question of how to download / save an XML (not an internal table) to the application server. Using the gui_download will not satisfy me need, as it only downloads to the presentation server (local machine that I run my SAP session on), when I need it to download to the application server. The Open Dataset and Transfer statements are (as far as I know) only used for downloading internal tables to the application server.
So I guess my question should be like this instead:
"How can I save the XML structure that is created in the above program to the file system in the application server?"
It is a bit hard to explain this, so please ask me more questions if required.
Thank you for helping.
Best regards,
Thomas -
How create an xml structure in a pdf form
Hi genius guys,
some one can help me to create a correct xml structure (root, subroot1, subroot2, etc etc) in a pdf form and not only the single tag?
Example: I give a pdf with form to be filled and after I extract xml data. Now I have this:
<?xml version="1.0" encoding="UTF-8"?>
<fields xmlns:xfdf="http://ns.adobe.com/xfdf-transition/"
><A1classe
>1995</A1classe
><A1cognome
>Fanna</A1cognome
><A1nome
>Tonino</A1nome
><Annodifondazione xfdf:original="Anno di fondazione"
>1965</Annodifondazione
><C1classe
>1976</C1classe
><C1cognome
>Di Gennaro</C1cognome
><C1nome
>Antonio</C1nome
><Campionato
>ECCELLENZA</Campionato
><Campodigioco
>Comunale di Villabartolomea</Campodigioco
><Colorisociali
>Giallo Rosso</Colorisociali
><D1classe
>1984</D1classe
><D1cognome
>Fontolan</D1cognome
><D1nome
>Beppe</D1nome
><Girone
>A</Girone
><P1classe
>1980</P1classe
><P1cognome
>Zoff</P1cognome
><P1nome
>Dino</P1nome
><P2classe
>1974</P2classe
><P2cognome
>Garella</P2cognome
><P2nome
>Claudio</P2nome
><S1cognome
>Baudo</S1cognome
><S1mansione
>Presidente</S1mansione
><S1nome
>Pippo</S1nome
><S2cognome
>Togni</S2cognome
><S2mansione
>Vice Presidente</S2mansione
><S2nome
>Darix</S2nome
><Sede
>Via Pisacane,8 - Villabartolomea</Sede
><Squadra
>VILLABARTOLOMEA</Squadra
><T1cognome
>Dallara</T1cognome
><T1mansione
>Allenatore</T1mansione
><T1nome
>Toni</T1nome
><T2cognome
>Silvan</T2cognome
><T2mansione
>Magazziniere</T2mansione
><T2nome
>Mago</T2nome
></fields
>
and I need this:
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:xfdf="http://ns.adobe.com/xfdf-transition/"
><attaccanti>
<A1classe
>1995</A1classe
><A1cognome
>Fanna</A1cognome
><A1nome
>Tonino</A1nome
>
</attaccanti>
<Annodifondazione xfdf:original="Anno di fondazione"
>1965</Annodifondazione
>
<centrocampisti>
<C1classe
>1976</C1classe
><C1cognome
>Di Gennaro</C1cognome
><C1nome
>Antonio</C1nome>
</centrocampisti>
<Campionato
>ECCELLENZA</Campionato
><Campodigioco
>Comunale di Villabartolomea</Campodigioco
><Colorisociali
>Giallo Rosso</Colorisociali
>
<difensori>
<D1classe
>1984</D1classe
><D1cognome
>Fontolan</D1cognome
><D1nome
>Beppe</D1nome
></difensori>
<Girone
>A</Girone
><portieri>
<P1classe
>1980</P1classe
><P1cognome
>Zoff</P1cognome
><P1nome
>Dino</P1nome
><P2classe
>1974</P2classe
><P2cognome
>Garella</P2cognome
><P2nome
>Claudio</P2nome
></portieri>
<societa>
<S1cognome
>Baudo</S1cognome
><S1mansione
>Presidente</S1mansione
><S1nome
>Pippo</S1nome
><S2cognome
>Togni</S2cognome
><S2mansione
>Vice Presidente</S2mansione
><S2nome
>Darix</S2nome
></societa>
<Sede
>Via Pisacane,8 - Villabartolomea</Sede
><Squadra
>VILLABARTOLOMEA</Squadra
><tecnici>
<T1cognome
>Dallara</T1cognome
><T1mansione
>Allenatore</T1mansione
><T1nome
>Toni</T1nome
><T2cognome
>Silvan</T2cognome
><T2mansione
>Magazziniere</T2mansione
><T2nome
>Mago</T2nome
>
</tecnici></root
>
Thanx, PaoloI solve the trouble using "." to separate the tagname and create the correct structure for xml.
example:
team.player.1name
team.player.1surname
team.player.1rol
team.player.2name
team.player.2surname
team.player.2role
this give me:
<team>
<player>
<1name>XXXX</1name>
<1surname>YYY</1surname>
<1role>forward</1role>
</player>
<player>
<2name>XXXX</2name>
<2surname>YYY</2surname>
<2role>forward</2role>
</player>
</team> -
Consistency error:more fields found in XML structure than specified in conv
Hi,
I am doing a File 0 RFC- File in PI 7.1 and facing the following error:
2009-12-07 09:45:05 Error MP: exception caught with cause com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'java.lang.Exception: Consistency error: more fields found in XML structure than specified in conversion parameters! (Value '20000000|3022|800.99|10.11.2009|Testing 22222|')', probably configuration error in file adapter (XML parser error)'
2009-12-07 09:45:05 Error File processing failed with com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'java.lang.Exception: Consistency error: more fields found in XML structure than specified in conversion parameters! (Value '20000000|3022|800.99|10.11.2009|Testing 22222|')', probably configuration error in file adapter (XML parser error)'
my output file record structure :
DT_out
itab_out 0.........1
item 0...... unbounded
STR 0........1
So i have given in the receiver FCC parameters as:
Record structure : item
Content conversion parameters:
item.fieldFixedLengths 255
item.endSeparator 'nl'
could anyone pls help me in solving this error at the earliest.
thanksmy problem has been solved by giving the FCC parameters as shown below:
my output file record structure :
DT_out
itab_out 0.........1
item 0...... unbounded
STR 0........1
So i have given in the receiver FCC parameters as:
Record structure : item,ITAB_OUT
Content conversion parameters:
item.fieldFixedLengths 255
item.endSeparator 'nl'
ITAB_OUT.fieldFixedLengths 255
ITAB_OUT.endSeparator 'nl' -
More fields in XML structure error in Adapter Monitor
Hi all
I am getting the following error in the adapter monitor
Error: Message processing failed: Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'java.lang.Exception: Consistency error: more fields found in XML structure than specified in conversion parameters! (Value ' ')', probably configuration error in file adapter (XML parser error)'
I am using FCC in the rx adapter. I have also checked the fields for any extra fields but there isnt any.
kindly suggest what could be throwing the error
regards
krishnaHi raj
here are the CC parameters.
BEGIN.addHeaderLine 0
BEGIN.fieldFixedLengths 2,1,3,2,4,1,8,12,8,2,307,12,8,12,18
BEGIN.fixedLengthTooShortHandling Ignore
BEGIN.endSeparator '0x0D''0x0A'
CLIENT_RECORD.addHeaderLine 0
CLIENT_RECORD.fieldFixedLengths 2,12,9,4,15,15,4,20,12,9,8,1,1,25,10,1,25,10,1,6,1,1,1,1,1,10,8,1,25,2,1,1,1,106,12,38
CLIENT_RECORD.fixedLengthTooShortHandling Ignore
CLIENT_RECORD.endSeparator '0x0D''0x0A'
RELATION_RECORD.addHeaderLine 0
RELATION_RECORD.fieldFixedLengths 2,12,9,4,20,20,2,2,9,8,1,25,10,1,25,10,1,6,1,1,181,12,38
RELATION_RECORD.fixedLengthTooShortHandling Ignore
RELATION_RECORD.endSeparator '0x0D''0x0A'
ADDRESS_RECORD.addHeaderLine 0
ADDRESS_RECORD.fieldFixedLengths 2,12,9,4,20,20,2,2,5,6,8,24,24,2,35,15,4,15,4,70,8,8,1,50,12,38
ADDRESS_RECORD.fixedLengthTooShortHandling Ignore
ADDRESS_RECORD.endSeparator '0x0D''0x0A'
GIVING_REC.addHeaderLine 0
GIVING_REC.fieldFixedLengths 2,12,9,4,20,9,1,1,1,1,1,1,1,1,1,1,1,1,1,281,12,38
GIVING_REC.fixedLengthTooShortHandling Ignore
GIVING_REC.endSeparator '0x0D''0x0A'
ZIKT_REC.addHeaderLine 0
ZIKT_REC.fieldFixedLengths 2,12,9,4,20,9,2,3,2,8,1,1,277,12,38
ZIKT_REC.fixedLengthTooShortHandling Ignore
ZIKT_REC.endSeparator '0x0D''0x0A'
BEPER_REC.addHeaderLine 0
BEPER_REC.fieldFixedLengths 2,12,9,4,20,9,1,1,1,291,12,38
BEPER_REC.fixedLengthTooShortHandling Cut
BEPER_REC.endSeparator '0x0D''0x0A'
SCORE_BEPER_REC.addHeaderLine 0
SCORE_BEPER_REC.fieldFixedLengths 2,12,9,4,20,9,1,3,4,1,1,284,12,38
SCORE_BEPER_REC.fixedLengthTooShortHandling Ignore
SCORE_BEPER_REC.endSeparator '0x0D''0x0A'
INDBES_REC.addHeaderLine 0
INDBES_REC.fieldFixedLengths 2,12,9,4,20,9,9,2,2,8,8,8,1,256,12,38
INDBES_REC.fixedLengthTooShortHandling Ignore
INDBES_REC.endSeparator '0x0D''0x0A'
FUNCTIONAL_REC.addHeaderLine 0
FUNCTIONAL_REC.fieldFixedLengths 2,12,9,4,20,9,9,3,2,8,8,8,1,4,2,2,1,1,1,1,8,1,1,233,12,38
FUNCTIONAL_REC.fixedLengthTooShortHandling Ignore
FUNCTIONAL_REC.endSeparator '0x0D''0x0A'
ACT_REC.addHeaderLine 0
ACT_REC.fieldFixedLengths 2,12,9,4,20,9,9,3,2,8,3,5,1,263,12,38
ACT_REC.fixedLengthTooShortHandling Ignore
ACT_REC.endSeparator '0x0D''0x0A'
SCORE_REC.addHeaderLine 0
SCORE_REC.fieldFixedLengths 2,12,9,4,20,9,3,4,1,1,285,12,38
SCORE_REC.fixedLengthTooShortHandling Ignore
SCORE_REC.endSeparator '0x0D''0x0A'
ZFUNCTIONAL_REC.addHeaderLine 0
ZFUNCTIONAL_REC.fieldFixedLengths 2,12,9,4,20,9,9,12,3,2,8,8,5,1,8,8,8,4,2,2,1,1,1,1,210,12,38
ZFUNCTIONAL_REC.fixedLengthTooShortHandling Ignore
ZFUNCTIONAL_REC.endSeparator '0x0D''0x0A'
ZACT_REC.addHeaderLine 0
ZACT_REC.fieldFixedLengths 2,12,9,4,20,9,9,3,2,3,5,8,8,5,8,1,242,12,38
ZACT_REC.fixedLengthTooShortHandling Ignore
ZACT_REC.endSeparator '0x0D''0x0A'
COMMENT.addHeaderLine 0
COMMENT.fieldFixedLengths 2,12,4,140,1,191,12,38
COMMENT.fixedLengthTooShortHandling Ignore
COMMENT.endSeparator '0x0D''0x0A'
END_REC.addHeaderLine 0
END_REC.fieldFixedLengths 2,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,1,257,50
END_REC.fixedLengthTooShortHandling Ignore
END_REC.endSeparator '0x0D''0x0A'
REgards
krishna
Maybe you are looking for
-
Iphone not showing up in itunes but it is showing up as a device on my computer
Before when I plugged my iphone 4S into my computer it said it had a problem with the device's hardware and wouldn't show up in my itunes. Now it has gone away after I updated my computer and it is still not showing up in my itunes. I have looked at
-
Iphone 5 update ios 7 then Downgrade to ios 6.1.4 lock icloud
Me for some people you would like to iphone and they have a login iCloud timing me do not know the account and then up cannot access to be iphone
-
How to define parameter ID for transaction call in query.
Hi folks, In SQ01 I've made report assignment. So now buy double click from ALV table I'm calling a new transaction and to fill fields on first screen I need define parameters ID. So how can I do it in query? Thanks.
-
How can I instantiate and load a new CachedRowSet object from a non-JDBC so
How can I instantiate and load a new CachedRowSet object from a non-JDBC source? cheers
-
I had set up my new tab page with an image I uploaded. It worked fine for months, if not years. Today, I got a 'crash' that asked me to start Firefox in 'safe' mode or 'restore'. I chose 'restore'. Thereupon, my image was gone from my new tab page. I