Script to convert metadata to xml file - Bridge CS6/InDesign CS6
I need a script that will convert metadata in Bridge to an xml file I can import into InDesign so that when I export long documents the alt text for photos is already included with the images.
Two problems -
1) I need the scripting for dummies version - from step 1 to end. I have zero experience with using scripts, as in - did not know they existed until a few days ago.
2) If the script needs adapted - see #1; there is very little hope that I will have any idea of how to do that without assistance.
I will be grateful for any assistance!! I do want to learn how to do this, if I can.
I need a script that will convert metadata in Bridge to an xml file I can import into InDesign so that when I export long documents the alt text for photos is already included with the images.
Two problems -
1) I need the scripting for dummies version - from step 1 to end. I have zero experience with using scripts, as in - did not know they existed until a few days ago.
2) If the script needs adapted - see #1; there is very little hope that I will have any idea of how to do that without assistance.
I will be grateful for any assistance!! I do want to learn how to do this, if I can.
Similar Messages
-
Convert ArrayList into XML file
Hi,
Can anyone tell me how to convert ArrayList to XML file and save that file.
ManojThere is an easy to understand example here:
http://totheriver.com/learn/xml/code/XMLCreatorExample.java.
You only have to replace Book objects from example with objects you need. -
How to read an external XML file in a indesign Plugin?
Hi All,
Can you please guide in reading an external XML file in a indesign Plugin in MAC system. I am an windows user.We are using this file for reading some inputs.
Thanks,
DanielHello Daniel,
I am uncertain about the actual question. If you are developing a plug-in or otherwise interfacing with the guts of ID, I suggest asking the question in the SDK forum:
InDesign SDK Forum
Otherwise, what is it you are wanting to know concerning importing XML into InDesign?
Mike -
Updating EXIF date/time in XML files (Bridge CS4)
Is there a way to re-read the EXIF date/time information from RAW camera files and update that existing information in the XML files?
To my knowledge not with Bridge, maybe with a script.
Basically the problem occurs while using multiple camera's that have not all the same correct date and time. To my experience the quickest way is to bite the bullet once and using the filters for date time for each dslr and apply labels to each dslr, then manual select the correct sequence and rename the whole bunch with a sequence number in front of all the filenames so you can use filename to sort the correct order.
And after this of course check next time all date and time settings before starting a new job :-) -
Hi Guys,
I need to generate the XML from Excel file. The XML file will have the definition like this:
<people_list>
<name>Fred Bloggs</name>
<birthdate>27/11/2008</birthdate>
<gender>Male</gender>
</people_list>
The Excel file will look like this:
A B C
1 Fred Bloggs 10/21/2008 Male
2 ABC 12/23/2008 Female
3 XYZ 07/16/2008 Male
All the values in name,birthdaye,gender will come from the Excel file. I am having 100 rows in the Excel file with the data and I want to parse this excel file and create the XML file with the above template.
Any ideas how to do this?
Thanks,
MaheshHi Mahesh,
there are tons of ways to do what you need. It all depends on how your workflow is organized and how complicated it may become.
Alternative 1:
Export your Excel file as a cvs and convert cvs to XML (which shouldn't be so hard).
Pro: Relative easy transformation.
Con: Every time you want to convert the Excel file to XML you first needs to export it out of Excel by a manual step.
Alternative 2:
Save you Excel file as XML (e. g. the new *.xslx documents) and transform it as you like.
Pro: Very clean way to do this. You can access the single source Excel file directly from Java. No further steps needed.
Con: It's very very hard to program because the Excel xml structure is ridiculously complex.
Alternative 3:
You can create a little Excel VBA Script which generates the XML File.
Pro: Easy programing.
Con: Needs some experience in Visual Basic 6 programming.
Alternative 4:
Use http://jexcelapi.sourceforge.net/ or any other Excel-API to Access the Excel application out of Java.
Pro: Clean way to do it. You need no further manual actions to prepare something. (maybe the most flexible and at the same time easyest way)
Con: Additional license.
Best Wishes
esprimo -
Convert FMB to XML File on Unix
Hello,
I want to convert a FMB-File to XML in my HP-UX-Middletier-Environment.The Script frm2xml.sh is only shipped with IDS.
Can someone upload the frmf2xml.sh from a linux or Solaris IDS-Enviroment?
RobertSo if we were to keep text-based source files, the process would have to be:
- check-out to local working copy
- convert XML to FMB
- make changes using Forms Developer
- convert FMB to XML
- commit to svn
I'm concerned about the side-effects of the conversion process (edge-cases, incompatibilities), and I also expect that even with some automation, the above will be a pretty slow process that will slow the team down. I guess we'll probably stick with fmb.
I guess as a compromise, it may be worthwhile generating the xml or fmt alongside the fmb and committing both. At least we'd then have a text-based file to compare revisions with. So the process then becomes:
- check-out to local working copy
- make changes using Forms Developer
- generate XML from FMB
- commit both to svn
I'm still baffled as to why Oracle has chosen a binary source format, even 15 years ago. This basically precludes a vast number of tools and techniques that are essential to the software craft :( -
Hi,
I have 2 weblogic startup scripts (startWebLogic.sh and
startWebLogic_recovery.sh) for the same domain.
startWebLogic.sh uses config.xml file.
I would like to use config_recovery.xml as the configuration file for startWebLogic_recovery.sh
How would I do this ?
I am using WebLogic Server 6.1 on SunOS 5.8 / HP-UX 11.0.
Appreciate any help.
Regards
Gunaseelan VenkateswaranI guess you're using Weblogic 6.1 with WLCS 3.5. I think you're supposed to work with one config.xml for the same domain, and not have a different config.xml.
To start up different applications or EJBs, use the "target" property to control which applications to start up for the particular instance.
YY -
How can I autorun a script that will process an XML file on open?
I am using Frame 11. I have a registered script that looks for event notification Constants.FA_Note_PostOpenXML. When this event fires, the script is supposed to examine the root element (so I only edit appropriate XML files), then make some edits to the file. Specifically, I want to be able to delete empty pages, remove room for side heads, and fix table formatting (such as left indent, which I can't directly access, apparently, in the EDD or R/W rules). The snippet of code that starts doing the work follows:
Notification(Constants.FA_Note_PostOpenXML,true);
function Notify(note, object, sparam, iparam) {
switch (note) {
case Constants.FA_Note_PostOpenXML:
doTheWork();
break;
function doTheWork() {
var doc, flow, root, elemName, mPageAttrib, topicElem, topicElemName, allAttribs;
doc = app.ActiveDoc;
flow = doc.MainFlowInDoc;
root = flow.HighestLevelElement; // will always get something even if unstructured document
while(root.ObjectValid()) { //only do something for structured docs
elemName = getElementName(root);
...more code to do stuff....
I then check the root element name, and if it matches, I make some changes. This code works fine when run manually. But, when run as a registered script, the app.ActiveDoc object is invalid, and there is no structure to edit. (I added debug line if(!doc.ObjectValid()){alert("not valid");}, which is not included above.) It appears that the Constants.FA_Note_PostOpenXML event fires as soon as the XML file is opened, but BEFORE Frame actually reads it.
Does anyone have any recommendations on how to work around this? Is there another event I could use instead of Constants.FA_Note_PostOpenXML? Is there any other way to automatically manipulate an XML file when it loads?
Thanks in advanceThe Notify event receives four parameters: note, object, sparam, and iparam. For the event you are using, object should be the document object of the FrameMaker document being opened. So, you should be able to use this:
doTheWork(object);
Make sure you update your doTheWork function to receive the Doc object:
function doTheWork(doc) {
var flow, root, elemName, mPageAttrib, topicElem, topicElemName, allAttribs;
flow = doc.MainFlowInDoc;
root = flow.HighestLevelElement; // will always get something even if unstructured document
while(root.ObjectValid()) { //only do something for structured docs
elemName = getElementName(root);
...more code to do stuff....
-Rick -
Problem converting data in XML file to internal table data
Hi all,
I have a requirement. I need to convert an XML file to internal table data and based on that data do Goods Receipt in SAP.
With the help of this blog /people/r.eijpe/blog/2005/11/10/xml-dom-processing-in-abap-part-i--convert-an-abap-table-into-xml-file-using-sap-dom-approach
I am able to convert the XML file to data in SAP. But this blog will display the output on screen as ELELEMNT = nodename VALUE= value of that node.
But I donu2019t want in that way, I want to store all the data in XML file in an internal table so that I can make use of those values and do Goods Recipt in SAP.
Can some one suggest how should I read the data in an internal table.
Here is my code..what changes should I make?
*& Report z_xit_xml_check
REPORT z_xit_xml_check.
TYPE-POOLS: ixml.
TYPES: BEGIN OF t_xml_line,
data(256) TYPE x,
END OF t_xml_line.
DATA: l_ixml TYPE REF TO if_ixml,
l_streamfactory TYPE REF TO if_ixml_stream_factory,
l_parser TYPE REF TO if_ixml_parser,
l_istream TYPE REF TO if_ixml_istream,
l_document TYPE REF TO if_ixml_document,
l_node TYPE REF TO if_ixml_node,
l_xmldata TYPE string.
DATA: l_elem TYPE REF TO if_ixml_element,
l_root_node TYPE REF TO if_ixml_node,
l_next_node TYPE REF TO if_ixml_node,
l_name TYPE string,
l_iterator TYPE REF TO if_ixml_node_iterator.
DATA: l_xml_table TYPE TABLE OF t_xml_line,
l_xml_line TYPE t_xml_line,
l_xml_table_size TYPE i.
DATA: l_filename TYPE string.
PARAMETERS: pa_file TYPE char1024 DEFAULT 'c:\temp\orders_dtd.xml'.
Validation of XML file: Only DTD included in xml document is supported
PARAMETERS: pa_val TYPE char1 AS CHECKBOX.
START-OF-SELECTION.
Creating the main iXML factory
l_ixml = cl_ixml=>create( ).
Creating a stream factory
l_streamfactory = l_ixml->create_stream_factory( ).
PERFORM get_xml_table CHANGING l_xml_table_size l_xml_table.
wrap the table containing the file into a stream
l_istream = l_streamfactory->create_istream_itable( table = l_xml_table
size = l_xml_table_size ).
Creating a document
l_document = l_ixml->create_document( ).
Create a Parser
l_parser = l_ixml->create_parser( stream_factory = l_streamfactory
istream = l_istream
document = l_document ).
Validate a document
IF pa_val EQ 'X'.
l_parser->set_validating( mode = if_ixml_parser=>co_validate ).
ENDIF.
Parse the stream
IF l_parser->parse( ) NE 0.
IF l_parser->num_errors( ) NE 0.
DATA: parseerror TYPE REF TO if_ixml_parse_error,
str TYPE string,
i TYPE i,
count TYPE i,
index TYPE i.
count = l_parser->num_errors( ).
WRITE: count, ' parse errors have occured:'.
index = 0.
WHILE index < count.
parseerror = l_parser->get_error( index = index ).
i = parseerror->get_line( ).
WRITE: 'line: ', i.
i = parseerror->get_column( ).
WRITE: 'column: ', i.
str = parseerror->get_reason( ).
WRITE: str.
index = index + 1.
ENDWHILE.
ENDIF.
ENDIF.
Process the document
IF l_parser->is_dom_generating( ) EQ 'X'.
PERFORM process_dom USING l_document.
ENDIF.
*& Form get_xml_table
FORM get_xml_table CHANGING l_xml_table_size TYPE i
l_xml_table TYPE STANDARD TABLE.
Local variable declaration
DATA: l_len TYPE i,
l_len2 TYPE i,
l_tab TYPE tsfixml,
l_content TYPE string,
l_str1 TYPE string,
c_conv TYPE REF TO cl_abap_conv_in_ce,
l_itab TYPE TABLE OF string.
l_filename = pa_file.
upload a file from the client's workstation
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = l_filename
filetype = 'BIN'
IMPORTING
filelength = l_xml_table_size
CHANGING
data_tab = l_xml_table
EXCEPTIONS
OTHERS = 19.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Writing the XML document to the screen
CLEAR l_str1.
LOOP AT l_xml_table INTO l_xml_line.
c_conv = cl_abap_conv_in_ce=>create( input = l_xml_line-data replacement = space ).
c_conv->read( IMPORTING data = l_content len = l_len ).
CONCATENATE l_str1 l_content INTO l_str1.
ENDLOOP.
l_str1 = l_str1+0(l_xml_table_size).
SPLIT l_str1 AT cl_abap_char_utilities=>cr_lf INTO TABLE l_itab.
WRITE: /.
WRITE: /' XML File'.
WRITE: /.
LOOP AT l_itab INTO l_str1.
REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>horizontal_tab IN
l_str1 WITH space.
WRITE: / l_str1.
ENDLOOP.
WRITE: /.
ENDFORM. "get_xml_table
*& Form process_dom
FORM process_dom USING document TYPE REF TO if_ixml_document.
DATA: node TYPE REF TO if_ixml_node,
iterator TYPE REF TO if_ixml_node_iterator,
nodemap TYPE REF TO if_ixml_named_node_map,
attr TYPE REF TO if_ixml_node,
name TYPE string,
prefix TYPE string,
value TYPE string,
indent TYPE i,
count TYPE i,
index TYPE i.
node ?= document.
CHECK NOT node IS INITIAL.
ULINE.
WRITE: /.
WRITE: /' DOM-TREE'.
WRITE: /.
IF node IS INITIAL. EXIT. ENDIF.
create a node iterator
iterator = node->create_iterator( ).
get current node
node = iterator->get_next( ).
loop over all nodes
WHILE NOT node IS INITIAL.
indent = node->get_height( ) * 2.
indent = indent + 20.
CASE node->get_type( ).
WHEN if_ixml_node=>co_node_element.
element node
name = node->get_name( ).
nodemap = node->get_attributes( ).
WRITE: / 'ELEMENT :'.
WRITE: AT indent name COLOR COL_POSITIVE INVERSE.
IF NOT nodemap IS INITIAL.
attributes
count = nodemap->get_length( ).
DO count TIMES.
index = sy-index - 1.
attr = nodemap->get_item( index ).
name = attr->get_name( ).
prefix = attr->get_namespace_prefix( ).
value = attr->get_value( ).
WRITE: / 'ATTRIBUTE:'.
WRITE: AT indent name COLOR COL_HEADING INVERSE, '=',
value COLOR COL_TOTAL INVERSE.
ENDDO.
ENDIF.
WHEN if_ixml_node=>co_node_text OR
if_ixml_node=>co_node_cdata_section.
text node
value = node->get_value( ).
WRITE: / 'VALUE :'.
WRITE: AT indent value COLOR COL_GROUP INVERSE.
ENDCASE.
advance to next node
node = iterator->get_next( ).
ENDWHILE.
ENDFORM. "process_dom
Any help would be highly apperciated.
regards,
Jessica SamPavel Vera,
With your example i tries doing the following .....
I tried to convert the data of XML file to internal table data. I am collecting the data in internal table to do goos recipt with that data.
Please find my XML file, ABAP pgm and XSLT pgm . I donu2019t know what I am missing I am not getting any output. I donu2019t know what is wrong please help me with this
Below is my XML file, My code and XSLT Program. In the below XML file I need to collect Vendor Number, Order Number, and Date tags which occur only once for one XML file.
I also need to collect the following tags from <Shipmentdetail>
<Shipmentdetail> has following child nodes and I need to collect them
TrackingNumber
Freight
Weight
ShipmentDate
ShipmentMethod
Need to collect to collect the following tags from <ProductInformation>
<ProductInformation> has following child nodes and I need to collect them
LineNumber
SKUNumber
OrderedQuantity
ShippedQuantity
UOM
The <Shipmentdetail> and <ProductInformation> are child nodes of <OrderShipment>
The <Shipmentdetail> occurs only ones but the <ProductInformation> can occur once or many times and will be dynamic and differs depening on the input file.
My XML file is as follows
<?xml version="1.0" encoding="iso-8859-1" ?>
- <ShipmentHeader>
<AccountID />
- <OrderShipment>
<VendorNumber>1000</VendorNumber>
<OrderNumber>P00009238</OrderNumber>
<OrderType>Stock</OrderType>
<Company />
<Division />
<Department />
<Date>20061120</Date>
<CartonCount>2</CartonCount>
<ShipAllProducts>No</ShipAllProducts>
- <ShipmentDetail>
<TrackingNumber>1ZR3W891PG47477811</TrackingNumber>
<Freight>000000010000</Freight>
<ShipmentDate>20061120</ShipmentDate>
<ShipmentMethod>UPS1PS</ShipmentMethod>
</ShipmentDetail>
- <ProductInformation>
<LineNumber>000000001</LineNumber>
<SKUNumber>110FR</SKUNumber>
<AdvSKUNumber>003 4518</AdvSKUNumber>
<SKUID />
<OrderedQuantity>00000001000000</OrderedQuantity>
<ShippedQuantity>00000001000000</ShippedQuantity>
<UOM>EA</UOM>
<Factor>1</Factor>
</ProductInformation>
- <ProductInformation>
<LineNumber>000000002</LineNumber>
<SKUNumber>938EN</SKUNumber>
<AdvSKUNumber>001 7294</AdvSKUNumber>
<SKUID />
<OrderedQuantity>00000000450000</OrderedQuantity>
<ShippedQuantity>00000000450000</ShippedQuantity>
<UOM>EA</UOM>
<Factor>1</Factor>
</ProductInformation>
- <CaseInformation>
<LineNumber>000000001</LineNumber>
<SKUNumber>110FR</SKUNumber>
<AdvSKUNumber>003 4518</AdvSKUNumber>
<SKUID />
<SSCCNumber>00000001668000002487</SSCCNumber>
<CaseQuantity>00000001000000</CaseQuantity>
<UOM>EA</UOM>
<Factor>1</Factor>
</CaseInformation>
<CaseInformation>
<LineNumber>000000001</LineNumber>
<SKUNumber>110FR</SKUNumber>
<AdvSKUNumber>003 4518</AdvSKUNumber>
<SKUID />
<SSCCNumber>00000001668000002487</SSCCNumber>
<CaseQuantity>00000001000000</CaseQuantity>
<UOM>EA</UOM>
<Factor>1</Factor>
</CaseInformation>
- </OrderShipment>
</ShipmentHeader>
My Program
TYPE-POOLS abap.
CONSTANTS gs_file TYPE string VALUE 'C:\temp\test.xml'.
* This is the structure for the data from the XML file
TYPES: BEGIN OF ts_shipment,
VendorNumber(10) TYPE n,
OrderNumber(20) TYPE n,
OrderType(8) TYPE c,
Date(8) TYPE c,
END OF ts_shipment.
TYPES: BEGIN OF ts_shipmentdetail,
TrackingNumber(30) TYPE n,
Freight(12) TYPE n,
Weight(14) TYPE n,
ShipmentDate(8) TYPE c,
ShipmentMethod(8) TYPE c,
END OF ts_shipmentdetail.
TYPES: BEGIN OF ts_productinformation,
LineNumber(9) TYPE n,
SKUNumber(20) TYPE c,
OrderedQuantity(14) TYPE n,
ShippedQuantity(14) TYPE n,
UOM(4) TYPE c,
END OF ts_productinformation.
* Table for the XML content
DATA: gt_itab TYPE STANDARD TABLE OF char2048.
* Table and work ares for the data from the XML file
DATA: gt_shipment TYPE STANDARD TABLE OF ts_shipment,
gs_shipment TYPE ts_shipment.
DATA: gt_shipmentdetail TYPE STANDARD TABLE OF ts_shipmentdetail,
gs_shipmentdetail TYPE ts_shipmentdetail.
DATA: gt_productinformation TYPE STANDARD TABLE OF ts_productinformation,
gs_productinformation TYPE ts_productinformation.
* Result table that contains references
* of the internal tables to be filled
DATA: gt_result_xml TYPE abap_trans_resbind_tab,
gs_result_xml TYPE abap_trans_resbind.
* For error handling
DATA: gs_rif_ex TYPE REF TO cx_root,
gs_var_text TYPE string.
* Get the XML file from your client
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = gs_file
CHANGING
data_tab = gt_itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
not_supported_by_gui = 17
error_no_gui = 18
OTHERS = 19.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* Fill the result table with a reference to the data table.
* Within the XSLT stylesheet, the data table can be accessed with
* "ISHIPMENT".
GET REFERENCE OF gt_shipment INTO gs_result_xml-value.
gs_result_xml-name = 'ISHIPMENT'.
APPEND gs_result_xml TO gt_result_xml.
* Fill the result table with a reference to the data table.
* Within the XSLT stylesheet, the data table can be accessed with
* "ISHIPDET".
GET REFERENCE OF gt_shipmentdetail INTO gs_result_xml-value.
gs_result_xml-name = 'ISHIPDET'.
APPEND gs_result_xml TO gt_result_xml.
* Fill the result table with a reference to the data table.
* Within the XSLT stylesheet, the data table can be accessed with
* "IPRODDET".
GET REFERENCE OF gt_productinformation INTO gs_result_xml-value.
gs_result_xml-name = 'IPRODDET'.
APPEND gs_result_xml TO gt_result_xml.
* Perform the XSLT stylesheet
TRY.
CALL TRANSFORMATION z_xml_to_abap3
SOURCE XML gt_itab
RESULT (gt_result_xml).
CATCH cx_root INTO gs_rif_ex.
gs_var_text = gs_rif_ex->get_text( ).
MESSAGE gs_var_text TYPE 'E'.
ENDTRY.
* Writing the data from file for gt_shipment
*Collecting the Shipping Data from the XML file to internal table gt_shipment
*and writing the data to the screen
LOOP AT gt_shipment INTO gs_shipment.
WRITE: / 'VendorNumber:', gs_shipment-VendorNumber.
WRITE: / 'OrderNumber :', gs_shipment-OrderNumber.
WRITE: / 'OrderType :', gs_shipment-OrderType.
WRITE: / 'Date :', gs_shipment-Date.
WRITE : /.
ENDLOOP. "gt_shipment.
LOOP AT gt_shipmentdetail INTO gs_shipmentdetail.
WRITE: / 'TrackingNumber:', gs_shipmentdetail-TrackingNumber.
WRITE: / 'Freight :', gs_shipmentdetail-Freight.
WRITE: / 'Weight :', gs_shipmentdetail-Weight.
WRITE: / 'ShipmentDate :', gs_shipmentdetail-ShipmentDate.
* WRITE: / 'ShipmentMethod :' gs_shipmentdetail-ShipmentMethod
WRITE : /.
ENDLOOP. "gt_shipmentdetail.
LOOP AT gt_productinformation INTO gs_productinformation.
WRITE: / 'LineNumber:', gs_productinformation-LineNumber.
WRITE: / 'SKUNumber :', gs_productinformation-SKUNumber.
WRITE: / 'OrderedQuantity :', gs_productinformation-OrderedQuantity.
WRITE: / 'ShippedQuantity :', gs_productinformation-ShippedQuantity.
WRITE: / 'UOM :', gs_productinformation-UOM.
WRITE : /.
ENDLOOP. "gt_productinformation.
XSLT Program
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output encoding="iso-8859-1" indent="yes" method="xml" version="1.0"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<ISHIPMENT>
<xsl:apply-templates select="//OrderShipment"/>
</ISHIPMENT>
</asx:values>
</asx:abap>
</xsl:template>
<xsl:template match="OrderShipment">
<item>
<VENDORNUMBER>
<xsl:value-of select="VendorNumber"/>
</VENDORNUMBER>
<ORDERNUMBER>
<xsl:value-of select="OrderNumber"/>
</ORDERNUMBER>
<ORDERTYPE>
<xsl:value-of select="OrderType"/>
</ORDERTYPE>
<DATE>
<xsl:value-of select="Date"/>
</DATE>
</item>
</xsl:template>
<xsl:template match="/">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<ISHIPDET>
<xsl:apply-templates select="//OrderShipment/ShipmentDetail"/>
</ISHIPDET>
</asx:values>
</asx:abap>
</xsl:template>
<xsl:template match="ShipmentDetail">
<item>
<TRACKINGNUMBER>
<xsl:value-of select="TrackingNumber"/>
</TRACKINGNUMBER>
<FREIGHT>
<xsl:value-of select="Freight"/>
</FREIGHT>
<SHIPMENTDATE>
<xsl:value-of select="ShipmentDate"/>
</SHIPMENTDATE>
<SHIPMENTMETHOD>
<xsl:value-of select="ShipmentMethod"/>
</SHIPMENTMETHOD>
</item>
</xsl:template>
</xsl:transform> .
Any help is highly appreciated. If anyone encountered this situation before please let me know where i am going wrong in my XSLT transformation.
Any Help will be highly apppreciated. Thanks in advance
Regards,
Jessica Sam -
Help needed in converting Excel from XML file
Hi Can anyone help me in converting XML in to Excel.
Thanx,
Ananth.well, that still isn't much to go off of. I give it a try though.
I guess you want to parse out the relevent data out of the xml file and then decide on your favorite delimated file format for Excel. Two popular formats are comma delimated:
"info1","info2","info3","info4"
and tab delimeted:
info <tab> info2 <tab> info3 <tab> info4
Excel should be able to unsestand either of these formats. -
Regd: Converting Data in XML file
Hi All,
We hav a requirement to convert the data from Internal table into a XML file.
The scenario is we hav developed a program to download the data in XML format,the problem is when the file is converted inot XML format its giving erreor that
<b>The XML page cannot be displayed
End tag 'KUN' does not match the start tag 'KUNNR'. Error processing resource 'file:///C:/TEST.xml'. Line 2, Position 1712
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0"><asx:values><IT_XML_OUT><item><VBE...</b>
The code is specified below for understanding.
TBALES DECLARATION
TABLES: VBAK, "Sale Order Header
VBAP, "Sale Order Item Data
VBEP, "Schedule Line Data
KNA1, "General Data in Customer Master
VBRP. "Billing Document Item Data
TYPES DECLARATION
TYPES : BEGIN OF TY_SOSTATUS,
KUNNR LIKE VBAK-KUNNR, "Customer Number
NAME1 LIKE KNA1-NAME1, "Customer Name
BSTNK LIKE VBAK-BSTNK, "Customer P.O.
BSTDK LIKE VBAK-BSTDK, "Customer P.O. Date
VBELN LIKE VBAK-VBELN, "Sale Order Number
ERDAT LIKE VBAK-ERDAT, "Sale Order Date
POSNR LIKE VBAP-POSNR, "Sale Order Line Item
MATNR LIKE VBAP-MATNR, "Material Number
ARKTX LIKE VBAP-ARKTX, "Material Description
KWMENG LIKE VBAP-KWMENG, "Sale Order Quantity
VRKME LIKE VBAP-VRKME, "Unit of Measurement
EDATU LIKE VBEP-EDATU, "Sale Order Schedule Date
FKIMG LIKE VBRP-FKIMG, "Despatch Quantity
GBSTA LIKE VBUP-GBSTA, "Overall Sale Order Status
PNDQTY TYPE I,
END OF TY_SOSTATUS.
TYPES : BEGIN OF TEMP_DISP,
VBELN LIKE VBAK-VBELN,
AUART LIKE VBAK-AUART,
ERDAT LIKE VBAK-ERDAT,
KUNNR LIKE VBAK-KUNNR,
BSTNK LIKE VBAK-BSTNK,
BSTDK LIKE VBAK-BSTDK,
POSNR LIKE VBAP-POSNR,
MATNR LIKE VBAP-MATNR,
ARKTX LIKE VBAP-ARKTX,
KWMENG LIKE VBAP-KWMENG,
VRKME LIKE VBAP-VRKME,
END OF TEMP_DISP.
DATA: XML_OUT TYPE STRING.
INTERNAL TABLE DECLARATION
DATA : IT_SOSTATUS TYPE STANDARD TABLE OF TY_SOSTATUS
WITH HEADER LINE INITIAL SIZE 100 WITH DEFAULT KEY.
DATA : IT_TEMP TYPE STANDARD TABLE OF TEMP_DISP
WITH HEADER LINE INITIAL SIZE 100 WITH DEFAULT KEY.
DATA : BEGIN OF IT_XML_OUT OCCURS 0,
A(1500) TYPE C,
END OF IT_XML_OUT.
SELECTION SCREEN DECLARATION
SELECTION-SCREEN BEGIN OF BLOCK SOBLOCK WITH FRAME.
SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN,
S_ERDAT FOR VBAK-ERDAT,
S_AUART FOR VBAK-AUART,
S_WERKS FOR VBAP-WERKS.
SELECTION-SCREEN END OF BLOCK SOBLOCK.
START OF SELECTION
SELECT SVBELN SAUART SERDAT SKUNNR SBSTNK SBSTDK
LPOSNR LMATNR LARKTX LKWMENG L~VRKME FROM VBAK AS S
INNER JOIN VBAP AS L
ON SVBELN = LVBELN
INTO CORRESPONDING FIELDS OF TABLE IT_TEMP
WHERE S~AUART IN S_AUART AND
S~ERDAT IN S_ERDAT AND
L~WERKS IN S_WERKS .
CALL TRANSFORMATION (`ID`) SOURCE IT_XML_OUT = IT_TEMP[] RESULT XML XML_OUT.
CALL FUNCTION 'SOTR_SERV_STRING_TO_TABLE'
EXPORTING
TEXT = XML_OUT
FLAG_NO_LINE_BREAKS = 'X'
LINE_LENGTH = 65000
LANGU = SY-LANGU
TABLES
TEXT_TAB = IT_XML_OUT[].
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filetype = 'BIN'
filename = 'C:\TEST.xml'
TABLES
data_tab = IT_XML_OUT[].
Is there any other way to process this and download in XML format.
Help and Suggestions will be much Appreciated.
Thanks & Regds.
Ramesh.Hi ramesh,
1. itab --- > xml
xml ---> itab.
2. This program will do both.
(just copy paste in new program)
3.
REPORT abc.
DATA
DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.
DATA : BEGIN OF itab OCCURS 0,
a(100) TYPE c,
END OF itab.
DATA: xml_out TYPE string .
DATA : BEGIN OF upl OCCURS 0,
f(255) TYPE c,
END OF upl.
DATA: xmlupl TYPE string .
FIRST PHASE
FIRST PHASE
FIRST PHASE
Fetch Data
SELECT * FROM t001 INTO TABLE t001.
XML
CALL TRANSFORMATION ('ID')
SOURCE tab = t001[]
RESULT XML xml_out.
Convert to TABLE
CALL FUNCTION 'HR_EFI_CONVERT_STRING_TO_TABLE'
EXPORTING
i_string = xml_out
i_tabline_length = 100
TABLES
et_table = itab.
Download
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filetype = 'BIN'
filename = 'd:\xx.xml'
TABLES
data_tab = itab.
SECOND PHASE
SECOND PHASE
SECOND PHASE
BREAK-POINT.
REFRESH t001.
CLEAR t001.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'D:\XX.XML'
filetype = 'BIN'
TABLES
data_tab = upl.
LOOP AT upl.
CONCATENATE xmlupl upl-f INTO xmlupl.
ENDLOOP.
XML
CALL TRANSFORMATION ('ID')
SOURCE XML xmlupl
RESULT tab = t001[]
BREAK-POINT.
regards,
amit m. -
Hi all
I want a sample procedure in which i would to like to fetch data and save the output to a XML File.
Someone please help me in giving me the sample procedure.
Regds
Nirmalsee this link, may be it will help
http://blog.oraclecontractors.com/?p=147
Well that shows you how to extract data on the database as XML, but it doesn't show how to output it to a file.
I'll give a hint. If you have your data as an XMLTYPE you can convert it via CLOB to and XMLDOMDocument type (as in the DBMS_XMLDOM package). Once you have an XMLDOMDocument you can use one of the DBMS_XMLDOM procedures to write out the XML to a file...
DBMS_XMLDOM.WRITETOFILE(
doc IN DOMDOCUMENT,
filename IN VARCHAR2);
;) -
Hi ,
Can anyone help me in converting a JTree to XML file.
The Jtree is build from an xml file, the user can add, delete nodes in JTree and save to the xml file. Is there any way I can update the same xml file.
Suggestions are greatly appreciated.
Thanks,
SS..Hi ,
Can anyone help me in converting a JTree to XML file.
The Jtree is build from an xml file, the user can add, delete nodes in JTree and save to the xml file. Is there any way I can update the same xml file.
Suggestions are greatly appreciated.
Thanks,
SS.. -
SQL insert scripts generation from repository data xml file
Hi All,
I want to generate sql insert scripts from repository data xml file which contain <add-item>elements.
Example: data xml file is contains
<add-item item-descriptor="user" id="741">
<set-property name="gender"><![CDATA[female]]></set-property>
<set-property name="emailStatus"><![CDATA[__NULL__]]></set-property>
<set-property name="receiveEmail"><![CDATA[__NULL__]]></set-property>
<set-property name="email"><![CDATA[[email protected]]]></set-property>
<set-property name="password"><![CDATA[a694cb1d6d011eddc444acb77338c1df6a22bac5de26330e2fe1d20f15f97ed6]]></set-property>
<!-- rdonly derived <set-property name="abandonedOrderCount"><![CDATA[0]]></set-property> -->
<set-property name="locale"><![CDATA[de_DE]]></set-property>
<set-property name="userType"><![CDATA[1]]></set-property>
<set-property name="autoLogin"><![CDATA[__NULL__]]></set-property>
<set-property name="lastName"><![CDATA[Springford]]></set-property>
<set-property name="member"><![CDATA[true]]></set-property>
<set-property name="dateOfBirth"><![CDATA[7/18/1951 00:00:00]]></set-property>
<!-- rdonly derived <set-property name="age"><![CDATA[61]]></set-property> -->
<set-property name="registrationDate"><![CDATA[5/16/1996 00:00:00]]></set-property>
<set-property name="login"><![CDATA[sally]]></set-property>
<set-property name="lastActivity"><![CDATA[6/9/1999 00:00:00]]></set-property>
<set-property name="homeAddress"><![CDATA[741]]></set-property>
<set-property name="passwordSalt"><![CDATA[sally]]></set-property>
<set-property name="generatedPassword"><![CDATA[__NULL__]]></set-property>
<set-property name="firstName"><![CDATA[Sally]]></set-property>
<set-property name="lastPasswordUpdate"><![CDATA[__NULL__]]></set-property>
</add-item>
Thanks
SivaHI Rohan,
Thanks for reply..
I have checked the startSQLRepository script by using this we can export or import repository data from xml to repository.But in startSQLRepository there is no attribute to generate sql
insert scripts from data xmls but there is a option to get the sql scripts(-ouputSQL). -
I'm using the XMP toolkit successfully in several graphics files that support metadata. I'm trying to find a solution for files that don't support it (e.g. Bmp files). One solution is to create an xml file with the same name as the original graphic file and use that file to store and retrieve metadata. For example: the metadata file for test.bmp will be test.bmp.xml. <br /><br />The xml file to start with is very simple:<br /><?xml version="1.0"?><br /><Root/><br /><br />However, the call to CanPutXmp fails with this file. Any suggestions?
hi,
im trying to use xmp toolkit for adding metadata to a jpeg file, i didn't get any idea about that, will you tell me how or will you show me the sample code? this will be very much useful for me.
thanks and regards
Maybe you are looking for
-
A pop-up window keeps appearing with the message that a script is not completing correctly - " "Script: chrome://forecastfox/content/observers.js:1" I'm given the choice to a) let it continue in the hopes it will complete or b) cancel. No matter whic
-
Vector.get() vs. Vector.elementAt()?
The API docs say they're identical. As I understand, the get() method is from the List interface. Is elementAt() from Vectors prior to 1.2? Curious...
-
Unexpected secure name resolution error (code -9812). The server name is in correct
-
Sold to party and ship to address is different
Dear Experts, Sold to party and ship to party is different address but when invoice is happened sold toparty adrees displayed in ship to party how i can make the changes for ship to party kindly help me in this regards Thanks a Basavaraj
-
Hi Im doing CWA with my 3850 wlc, but the client seems to be stuck in "WEBAUTH_PEND " on the WLC client list. It all looks ok in the ISE logs and in the client detail i can see that it has gotten the redirect url, but nothing is happening. Someone wh