Nombre XML

Hola!
He creado un programa que copia un archivo xml y lo guarda en un nuevo archivo. Al copiarlo deja el antiguo xml en blanco y me gustaria que el nuevo archivo se guardara con el nombre de la fecha actual, ¿Como podria hacerlo?. Querria que se copiara cada 24H automaticamente. Muchas gracias de antemano. 
Attachments:
copiar y borrar xml.vi ‏9 KB
copiar y borrar xml.vi ‏9 KB

If I call the procedure with SQL Plus, it run ok. Are you using the same user to run it in SQL*Plus as runs it from Java.
The normal reason for procedures to fail like this is privileges. Particularly, we cannot run procedures using privileges we have been granted through roles.
The user has CTXAPP, DBA roles, so I supouse it is not a privileges problem. Try granting the system privilege CREATE MATERIALIZED VIEW to the user and see what happens.
I drop the materialized and create again, cause it's the fastest way I've found. With a DBMS_MVIEW.REFRESH is too slow.I find that surprising as drop & create has to do all the work that a refresh has to do plus some more - maybe it's something to do with XML. Did you try adding a snapshot log and going for FAST? I don't know whwther the XML procesing would render the view complex - have you explained it?
Cheers, APC

Similar Messages

  • XML PDS Error 63001

    I developed a Report which proces an XML document based on the following schema:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema targetNamespace="http://palaciohierro.com.mx/mde/ebre"
    xmlns="http://palaciohierro.com.mx/mde/ebre"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:phtypes="http://palaciohierro.com.mx/mde/phtypes"
    elementFormDefault="qualified">
         <xsd:import namespace="http://palaciohierro.com.mx/mde/phtypes"
         schemaLocation="http://serreg2.palaciohierro.com.mx:8888/mdews/schema/services-types.xsd"/>
         <xsd:annotation>
              <xsd:documentation xml:lang="es">
    Esquema de respuesta de busqueda de eventos para la Mesa de Eventos Web
    Copyright 2002 palaciodehierro.com.mx. Todos los derechos reservados.
    </xsd:documentation>
         </xsd:annotation>
         <xsd:element name="evento-busqueda-respuesta">
              <xsd:complexType>
                   <xsd:complexContent>
                        <xsd:extension base="erType">
                             <xsd:attributeGroup ref="phtypes:servicioIdGroup"/>
                        </xsd:extension>
                   </xsd:complexContent>
              </xsd:complexType>
              <xsd:unique name="id_busqueda">
                   <xsd:selector xpath="busqueda"/>
                   <xsd:field xpath="@id_busqueda"/>
              </xsd:unique>
         </xsd:element>
         <xsd:complexType name="erType">
              <xsd:annotation>
                   <xsd:documentation>respuesta de busqueda de eventos</xsd:documentation>
              </xsd:annotation>
              <xsd:sequence>
                   <xsd:element name="busqueda" type="busquedaType" maxOccurs="unbounded"/>
              </xsd:sequence>
         </xsd:complexType>
         <xsd:complexType name="busquedaType">
              <xsd:annotation>
                   <xsd:documentation>evento</xsd:documentation>
              </xsd:annotation>
              <xsd:sequence>
                   <xsd:element name="evento" type="eventoType" minOccurs="0"/>
              </xsd:sequence>
              <xsd:attribute name="id_busqueda" type="phtypes:identifierType" use="required"/>
              <xsd:attribute name="encontrado" type="xsd:boolean" use="optional" default="true"/>
              <xsd:attribute name="comentario" type="phtypes:comentarioType" use="optional"/>
         </xsd:complexType>
         <xsd:complexType name="eventoType">
              <xsd:annotation>
                   <xsd:documentation>datos del evento</xsd:documentation>
              </xsd:annotation>
              <xsd:sequence>
                   <xsd:element name="organizador" type="organizadorType" minOccurs="0" maxOccurs="unbounded"/>
                   <xsd:element name="entrega" minOccurs="0" maxOccurs="unbounded">
                        <xsd:complexType>
                             <xsd:complexContent>
                                  <xsd:extension base="domicilioType">
                                       <xsd:sequence>
                                            <xsd:element name="persona" type="phtypes:personaType" minOccurs="0" maxOccurs="unbounded"/>
                                       </xsd:sequence>
                                  </xsd:extension>
                             </xsd:complexContent>
                        </xsd:complexType>
                   </xsd:element>
              </xsd:sequence>
              <xsd:attribute name="id_evento" type="phtypes:identifierType" use="required"/>
              <xsd:attribute name="numero" type="phtypes:identifierType" use="optional"/>
              <xsd:attribute name="envoltura" type="xsd:string" use="optional"/>
              <xsd:attribute name="usuario" type="xsd:string" use="required"/>
              <xsd:attribute name="tipo_evento" type="xsd:string" use="required"/>
              <xsd:attribute name="tipo_cliente" type="xsd:string" use="required"/>
              <xsd:attribute name="tienda" type="xsd:positiveInteger" use="required"/>
              <xsd:attribute name="plan" type="xsd:string" use="optional"/>
              <xsd:attribute name="fecha_evento" type="xsd:date" use="required"/>
              <xsd:attribute name="fecha_registro" type="xsd:date" use="required"/>
              <xsd:attribute name="fecha_lista" type="xsd:date" use="optional"/>
              <xsd:attribute name="fecha_cierre" type="xsd:date" use="optional"/>
              <xsd:attribute name="estado" type="phtypes:estadoEventoType" use="optional"/>
              <xsd:attribute name="com_general" type="xsd:string" use="optional"/>
              <xsd:attribute name="com_envio" type="xsd:string" use="optional"/>
              <xsd:attribute name="NIP" type="xsd:string" use="optional"/>
              <xsd:attribute name="VIP" type="xsd:boolean" use="optional" default="false"/>
         </xsd:complexType>
         <xsd:complexType name="organizadorType">
              <xsd:annotation>
                   <xsd:documentation>datos del organizador</xsd:documentation>
              </xsd:annotation>
              <xsd:complexContent>
                   <xsd:extension base="phtypes:personaType">
    <xsd:attribute name="id_participante" type="phtypes:identifierType" use="required"/>
              <xsd:attribute name="tipo" type="xsd:string" use="required"/>
                   </xsd:extension>
              </xsd:complexContent>
         </xsd:complexType>
    <xsd:complexType name="entregaType">
              <xsd:annotation>
                   <xsd:documentation>domicilio de entrega de regalos</xsd:documentation>
              </xsd:annotation>
              <xsd:sequence>
                   <xsd:element name="domicilio" type="domicilioType" minOccurs="0" maxOccurs="unbounded"/>
              </xsd:sequence>
              <xsd:attribute name="tipo" type="xsd:string" use="required"/>
              <xsd:attribute name="nombre" type="xsd:string" use="required"/>
         </xsd:complexType>
    <xsd:complexType name="domicilioType">
              <xsd:annotation>
                   <xsd:documentation>datos del domicilio</xsd:documentation>
              </xsd:annotation>
              <xsd:complexContent>
                   <xsd:extension base="phtypes:domicilioType">
                        <xsd:attribute name="id_domicilio" type="phtypes:identifierType" use="required"/>
                   </xsd:extension>
              </xsd:complexContent>
         </xsd:complexType>
    </xsd:schema>
    after setting both the schema and the XML document I want the Report to be based on, I get the following error:
    ERROR 63001: Invalid stream in the URL address of the data definition http://myserver:8888/myapp/evento-estadocuenta-respuesta.xsd eventoType.
    Are there any restrictions on the schema that the XML Reports PDS can process?
    Where could I find documentation on this isssues?
    Thanks,
    Fedro

    Indeed, I have found that no xsd includes and complex types will work. There's a faint mention of this in the Report's Realease Notes, but nothing complete and thorough.
    I have found that only the simpliest XML schemas with no custom types and (only a few elements of simple types will work). And also, a simple File-Row-column XML layout will work.
    It seems to me that the XML PDS is still a newborn, and a lot of work still needs to be done to be practical and useful... long way to get something like FOP.
    Well, the whole idea of having a web service which will feed XML docs to both parties and Report's services will have to stay in the oven a little longer (or may be not so little).
    Thanks anyway,
    Fedro

  • How to hide elements from xml file when dumping to JTree?

    Hi everybody,
    I got a XML file similar to this one:
    <Dios>
    <Adan>
    <Hijos>
    <Vivos>
    <Nombre>Isaac</Nombre>
    <ColorOjos>Verdes</ColorOjos>
    <ColorPelo>Casta�o</ColorPelo>
    <Nombre>Paris</Nombre>
    <ColorOjos>Verdes</ColorOjos>
    <ColorPelo>Casta�o</ColorPelo>
    </Vivos>
    </Hijos>
    </Adan>
    <Eva>
    <Hijos>
    <Vivos>
    <Nombre>Jose</Nombre>
    <ColorOjos>Azules</ColorOjos>
    <ColorPelo>Rubio</ColorPelo>
    <Nombre>Marta</Nombre>
    <ColorOjos>Oscuros</ColorOjos>
    <ColorPelo>Casta�o</ColorPelo>
    </Vivos>
    <Fallecidos>
    <Nombre>Miriam</Nombre>
    <ColorOjos>Verdes</ColorOjos>
    <ColorPelo>Casta�o</ColorPelo>
    <Nombre>Dorian</Nombre>
    <ColorOjos>Azules</ColorOjos>
    <ColorPelo>Casta�o</ColorPelo>
    </Fallecidos>
    </Hijos>
    </Eva>
    </Dios>
    I must:
    1)Show datas on a Tree, with the exception that "ColorPelo" and "ColorOjos" values should not be displayed on the tree.
    2)When clicking over one leaf (for example: Miriam) on the right side of panel, should write the values of "ColorPelo" and "ColorOjos", verdes and casta�o.
    Don�t know where start. Any idea will be welcome
    Thanks in advance

    Sorry, the xml above was wrong, this is right xml:
    <Dios>
         <Adan>
              <Hijos>
                   <Vivos>
                        <Nombre>Isaac</Nombre>
                        <Caracteristicas>
                                  <ColorOjos>Verdes</ColorOjos>
                                  <ColorPelo>Casta�o</ColorPelo>
                        </Caracteristicas>
                        <Nombre>Paris</Nombre>
                        <Caracteristicas>
                                  <ColorOjos>Verdes</ColorOjos>
                                  <ColorPelo>Casta�o</ColorPelo>
                        </Caracteristicas>
                   </Vivos>
              </Hijos>
         </Adan>
         <Eva>
              <Hijos>
                   <Vivos>
                        <Nombre>Jose</Nombre>
                        <Caracteristicas>
                                  <ColorOjos>Azules</ColorOjos>
                                  <ColorPelo>Rubio</ColorPelo>
                        </Caracteristicas>
                        <Nombre>Marta</Nombre>
                        <Caracteristicas>
                                  <ColorOjos>Oscuros</ColorOjos>
                                  <ColorPelo>Casta�o</ColorPelo>
                        </Caracteristicas>
                   </Vivos>
                   <Fallecidos>
                        <Nombre>Miriam</Nombre>
                        <Caracteristicas>
                             <ColorOjos>Verdes</ColorOjos>
                             <ColorPelo>Casta�o</ColorPelo>
                        </Caracteristicas>
                        <Nombre>Dorian</Nombre>
                        <Caracteristicas>
                             <ColorOjos>Azules</ColorOjos>
                             <ColorPelo>Casta�o</ColorPelo>
                        </Caracteristicas>
                   </Fallecidos>
              </Hijos>Finally I know how to do first point, when creating the nodes(recursively):
    if( (children != null )&& *!root.getNodeName().equals("Caracteristicas")*)
    numChildren = children.getLength();
         for (int i=0; i < numChildren; i++)
         node = children.item(i);
         if( node != null && *!node.getNodeName().equals("Caracteristicas")*)
    ...

  • Generating an XML Document from an internal table in ABAP

    Good day to all of you;
    With ABAP, in the R/3 system, I'm trying to figure out a way to accomplish the following:
    1) SELECT a set of Purchase Order data into an internal table.
    2) Generate an XML document, containing the above data, using a specific schema.
    I've been playing around with function module SAP_CONVERT_TO_XML_FORMAT which has the following interface:
    CALL FUNCTION 'SAP_CONVERT_TO_XML_FORMAT'
          EXPORTING
          I_FIELD_SEPERATOR    = ''
          I_LINE_HEADER        = ''
            I_FILENAME           = v_fname
          I_APPL_KEEP          = ''
          I_XML_DOC_NAME      = v_docname
          IMPORTING
            PE_BIN_FILESIZE      = v_byte
          TABLES
            I_TAB_SAP_DATA       = i_SapData
          CHANGING
            I_TAB_CONVERTED_DATA = i_XMLData
          EXCEPTIONS
            CONVERSION_FAILED    = 1
            OTHERS               = 2.
    I'm uncertain as to whether or not the Export parameter, I_XML_DOC_NAME refers to some schema or definition and therefore have been excluding it.  In doing so, the generated XML document seems to use the field name/type information from my itab for the tags.
    If this function module requires an XML Document Name, how do I create one and where do I store it in R/3?  If this is not the recommended solution, is anyone familiar with a way to load an XML schema, retrieve some data then have SAP generate an XML document using the schema?
    Many thanks for any help available.
    T

    Hai Phillips
    Try with the following Code
    This program exports an internal table to an XML file.
    Report ZPRUEBA_MML_13 *
    Export an internal table to XML document *
    NO BORRAR ESTE CODIGO *
    REPORT ZPRUEBA_MML_13.
    PANTALLA SELECCION *
        PARAMETERS: GK_RUTA TYPE RLGRAP-FILENAME.
    PANTALLA SELECCION *
    TYPE TURNOS *
    TYPES: BEGIN OF TURNOS,
        LU LIKE T552A-TPR01,
        MA LIKE T552A-TPR01,
        MI LIKE T552A-TPR01,
        JU LIKE T552A-TPR01,
        VI LIKE T552A-TPR01,
        SA LIKE T552A-TPR01,
        DO LIKE T552A-TPR01,
    END OF TURNOS.
    TYPE TURNOS *
    TYPE SOCIO *
    TYPES: BEGIN OF SOCIO,
        NUMERO LIKE PERNR-PERNR,
        REPOSICION LIKE PA0050-ZAUVE,
        NOMBRE LIKE PA0002-VORNA,
        TURNOS TYPE TURNOS,
    END OF SOCIO.
    TYPE SOCIO *
    ESTRUCTURA ACCESOS *
    DATA: BEGIN OF ACCESOS OCCURS 0,
        SOCIO TYPE SOCIO,
    END OF ACCESOS.
    ESTRUCTURA ACCESOS *
    START OF SELECTION *
    START-OF-SELECTION.
        PERFORM LLENA_ACCESOS.
        PERFORM DESCARGA_XML.
    END-OF-SELECTION.
    END OF SELECTION *
    FORM LLENA_ACCESOS *
    FORM LLENA_ACCESOS.
    REFRESH ACCESOS.
    CLEAR ACCESOS.
    MOVE: '45050' TO ACCESOS-SOCIO-NUMERO,
                  'MOISES MORENO' TO ACCESOS-SOCIO-NOMBRE,
                  '0' TO ACCESOS-SOCIO-REPOSICION,
                  'T1' TO ACCESOS-SOCIO-TURNOS-LU,
                  'T2' TO ACCESOS-SOCIO-TURNOS-MA,
                  'T3' TO ACCESOS-SOCIO-TURNOS-MI,
                  'T4' TO ACCESOS-SOCIO-TURNOS-JU,
                  'T5' TO ACCESOS-SOCIO-TURNOS-VI,
                  'T6' TO ACCESOS-SOCIO-TURNOS-SA,
                  'T7' TO ACCESOS-SOCIO-TURNOS-DO.
    APPEND ACCESOS.
    CLEAR ACCESOS.
    MOVE: '45051' TO ACCESOS-SOCIO-NUMERO,
                  'RUTH PEÑA' TO ACCESOS-SOCIO-NOMBRE,
                  '0' TO ACCESOS-SOCIO-REPOSICION,
                  'T1' TO ACCESOS-SOCIO-TURNOS-LU,
                  'T2' TO ACCESOS-SOCIO-TURNOS-MA,
                  'T3' TO ACCESOS-SOCIO-TURNOS-MI,
                  'T4' TO ACCESOS-SOCIO-TURNOS-JU,
                  'T5' TO ACCESOS-SOCIO-TURNOS-VI,
                  'T6' TO ACCESOS-SOCIO-TURNOS-SA,
                  'T7' TO ACCESOS-SOCIO-TURNOS-DO.
    APPEND ACCESOS.
    ENDFORM.
    FORM LLENA_ACCESOS *
    FORM DESCARGA_XML *
    FORM DESCARGA_XML.
    DATA: L_DOM TYPE REF TO IF_IXML_ELEMENT,
                  M_DOCUMENT TYPE REF TO IF_IXML_DOCUMENT,
                  G_IXML TYPE REF TO IF_IXML,
                  W_STRING TYPE XSTRING,
                  W_SIZE TYPE I,
                  W_RESULT TYPE I,
                  W_LINE TYPE STRING,
                  IT_XML TYPE DCXMLLINES,
                  S_XML LIKE LINE OF IT_XML,
                  W_RC LIKE SY-SUBRC.
    DATA: XML TYPE DCXMLLINES.
    DATA: RC TYPE SY-SUBRC,
    BEGIN OF XML_TAB OCCURS 0,
                  D LIKE LINE OF XML,
    END OF XML_TAB.
    CLASS CL_IXML DEFINITION LOAD.
    G_IXML = CL_IXML=>CREATE( ).
    CHECK NOT G_IXML IS INITIAL.
    M_DOCUMENT = G_IXML->CREATE_DOCUMENT( ).
    CHECK NOT M_DOCUMENT IS INITIAL.
    WRITE: / 'Converting DATA TO DOM 1:'.
    CALL FUNCTION 'SDIXML_DATA_TO_DOM'
    EXPORTING
                  NAME = 'ACCESOS'
                  DATAOBJECT = ACCESOS[]
    IMPORTING
                  DATA_AS_DOM = L_DOM
    CHANGING
                  DOCUMENT = M_DOCUMENT
    EXCEPTIONS
                  ILLEGAL_NAME = 1
                  OTHERS = 2.
    IF SY-SUBRC = 0.
                  WRITE 'Ok'.
    ELSE.
                  WRITE: 'Err =',
                  SY-SUBRC.
    ENDIF.
    CHECK NOT L_DOM IS INITIAL.
    W_RC = M_DOCUMENT->APPEND_CHILD( NEW_CHILD = L_DOM ).
    IF W_RC IS INITIAL.
                  WRITE 'Ok'.
    ELSE.
                  WRITE: 'Err =',
                  W_RC.
    ENDIF.
    CALL FUNCTION 'SDIXML_DOM_TO_XML'
    EXPORTING
                  DOCUMENT = M_DOCUMENT
    IMPORTING
                  XML_AS_STRING = W_STRING
                  SIZE = W_SIZE
    TABLES
                  XML_AS_TABLE = IT_XML
    EXCEPTIONS
                  NO_DOCUMENT = 1
                  OTHERS = 2.
    IF SY-SUBRC = 0.
                  WRITE 'Ok'.
    ELSE.
                  WRITE: 'Err =',
                  SY-SUBRC.
    ENDIF.
    LOOP AT IT_XML INTO XML_TAB-D.
                  APPEND XML_TAB.
    ENDLOOP.
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
                  BIN_FILESIZE = W_SIZE
                  FILENAME = GK_RUTA
                  FILETYPE = 'BIN'
    TABLES
                  DATA_TAB = XML_TAB
    EXCEPTIONS
                  OTHERS = 10.
    IF SY-SUBRC <> 0.
                  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.
    FORM DESCARGA_XML *
    Thanks & regards
    Sreenivasulu P

  • Import xml file from server to itab

    Hi all,
    I have a little issue loading data from xml file in server into my itab.
    With my file in local (C:\example\example.xml) works fine, but if try this with the same file in the server (e:\example\example.xml) dont work. This is my code resume.
    TYPES: BEGIN OF TY_TAB,
    NAME TYPE STRING,
    VALUE TYPE STRING,
    END OF TY_TAB.
    DATA: ITAB TYPE STANDARD TABLE OF TY_TAB,
    WA TYPE TY_TAB.
    * Nombre del fichero
    DATA: NOMBREFICHEROXML LIKE IBIPPARMS-PATH,
    * data XML
    DATA: LCL_XML_DOC TYPE REF TO CL_XML_DOCUMENT,
    V_SUBRC TYPE SYSUBRC,
    V_NODE TYPE REF TO IF_IXML_NODE,
    V_CHILD_NODE TYPE REF TO IF_IXML_NODE,
    V_ROOT TYPE REF TO IF_IXML_NODE,
    V_ITERATOR TYPE REF TO IF_IXML_NODE_ITERATOR,
    V_NODEMAP TYPE REF TO IF_IXML_NAMED_NODE_MAP,
    V_COUNT TYPE I,
    V_INDEX TYPE I,
    V_ATTR TYPE REF TO IF_IXML_NODE,
    V_NAME TYPE STRING,
    V_PREFIX TYPE STRING,
    V_VALUE TYPE STRING,
    V_CHAR TYPE CHAR2.
    NOMBREFICHEROXML = 'E:\example\example.xml'.
    CREATE OBJECT LCL_XML_DOC.
    CALL METHOD LCL_XML_DOC->IMPORT_FROM_FILE
    EXPORTING
    FILENAME = NOMBREFICHEROXML
    RECEIVING
    RETCODE = V_SUBRC.
    IF V_SUBRC EQ '0'.
    V_NODE = LCL_XML_DOC->M_DOCUMENT.
    CHECK NOT V_NODE IS INITIAL.
    V_ITERATOR = V_NODE->CREATE_ITERATOR( ).
    V_NODE = V_ITERATOR->GET_NEXT( ).
    WHILE NOT V_NODE IS INITIAL.
    CASE V_NODE->GET_TYPE( ).
    WHEN IF_IXML_NODE=>CO_NODE_ELEMENT.
    V_NAME = V_NODE->GET_NAME( ).
    WHEN IF_IXML_NODE=>CO_NODE_TEXT OR
    IF_IXML_NODE=>CO_NODE_CDATA_SECTION.
    *text node
    V_VALUE = V_NODE->GET_VALUE( ).
    MOVE V_VALUE TO V_CHAR.
    IF V_CHAR <> CL_ABAP_CHAR_UTILITIES=>CR_LF.
    WA-NAME = V_NAME.
    WA-VALUE = V_VALUE.
    APPEND WA TO ITAB.
    CLEAR WA.
    ENDIF.
    ENDCASE.
    *advance to next node
    V_NODE = V_ITERATOR->GET_NEXT( ).
    ENDWHILE.
    WRITE:/ 'file ok'.
    ELSE.
    WRITE:/ 'file ko'.
    Anyone can help, or tell me a easy way to load xml file from server to my itab that works with my old sap 4.7.
    thanks
    Edited by: DIEGO_GT on Nov 18, 2011 12:04 PM

    Hi Diego.
    Next time try to search in [www.sdn.sap.com] first.
    See the following example: [http://wiki.sdn.sap.com/wiki/display/ABAP/UploadXMLfiletointernal+table]
    Regards.
    Rafael Rojas.

  • Redaing an XML file to an internal table

    hi ,
    I want to import an XML file in an interface program for ABAP. I was looking for an optimal method of parsing and reading the XML data to an intrenal table so that I can display errors corresponding to invidual records.
    Sangeet

    Hai Sangeeta
    go through the following Code
    This program exports an internal table to an XML file.
    Report ZPRUEBA_MML_13 *
    Export an internal table to XML document *
    NO BORRAR ESTE CODIGO *
    REPORT ZPRUEBA_MML_13.
    PANTALLA SELECCION *
        PARAMETERS: GK_RUTA TYPE RLGRAP-FILENAME.
    PANTALLA SELECCION *
    TYPE TURNOS *
    TYPES: BEGIN OF TURNOS,
        LU LIKE T552A-TPR01,
        MA LIKE T552A-TPR01,
        MI LIKE T552A-TPR01,
        JU LIKE T552A-TPR01,
        VI LIKE T552A-TPR01,
        SA LIKE T552A-TPR01,
        DO LIKE T552A-TPR01,
    END OF TURNOS.
    TYPE TURNOS *
    TYPE SOCIO *
    TYPES: BEGIN OF SOCIO,
        NUMERO LIKE PERNR-PERNR,
        REPOSICION LIKE PA0050-ZAUVE,
        NOMBRE LIKE PA0002-VORNA,
        TURNOS TYPE TURNOS,
    END OF SOCIO.
    TYPE SOCIO *
    ESTRUCTURA ACCESOS *
    DATA: BEGIN OF ACCESOS OCCURS 0,
        SOCIO TYPE SOCIO,
    END OF ACCESOS.
    ESTRUCTURA ACCESOS *
    START OF SELECTION *
    START-OF-SELECTION.
        PERFORM LLENA_ACCESOS.
        PERFORM DESCARGA_XML.
    END-OF-SELECTION.
    END OF SELECTION *
    FORM LLENA_ACCESOS *
    FORM LLENA_ACCESOS.
    REFRESH ACCESOS.
    CLEAR ACCESOS.
    MOVE: '45050' TO ACCESOS-SOCIO-NUMERO,
                  'MOISES MORENO' TO ACCESOS-SOCIO-NOMBRE,
                  '0' TO ACCESOS-SOCIO-REPOSICION,
                  'T1' TO ACCESOS-SOCIO-TURNOS-LU,
                  'T2' TO ACCESOS-SOCIO-TURNOS-MA,
                  'T3' TO ACCESOS-SOCIO-TURNOS-MI,
                  'T4' TO ACCESOS-SOCIO-TURNOS-JU,
                  'T5' TO ACCESOS-SOCIO-TURNOS-VI,
                  'T6' TO ACCESOS-SOCIO-TURNOS-SA,
                  'T7' TO ACCESOS-SOCIO-TURNOS-DO.
    APPEND ACCESOS.
    CLEAR ACCESOS.
    MOVE: '45051' TO ACCESOS-SOCIO-NUMERO,
                  'RUTH PEÑA' TO ACCESOS-SOCIO-NOMBRE,
                  '0' TO ACCESOS-SOCIO-REPOSICION,
                  'T1' TO ACCESOS-SOCIO-TURNOS-LU,
                  'T2' TO ACCESOS-SOCIO-TURNOS-MA,
                  'T3' TO ACCESOS-SOCIO-TURNOS-MI,
                  'T4' TO ACCESOS-SOCIO-TURNOS-JU,
                  'T5' TO ACCESOS-SOCIO-TURNOS-VI,
                  'T6' TO ACCESOS-SOCIO-TURNOS-SA,
                  'T7' TO ACCESOS-SOCIO-TURNOS-DO.
    APPEND ACCESOS.
    ENDFORM.
    FORM LLENA_ACCESOS *
    FORM DESCARGA_XML *
    FORM DESCARGA_XML.
    DATA: L_DOM TYPE REF TO IF_IXML_ELEMENT,
                  M_DOCUMENT TYPE REF TO IF_IXML_DOCUMENT,
                  G_IXML TYPE REF TO IF_IXML,
                  W_STRING TYPE XSTRING,
                  W_SIZE TYPE I,
                  W_RESULT TYPE I,
                  W_LINE TYPE STRING,
                  IT_XML TYPE DCXMLLINES,
                  S_XML LIKE LINE OF IT_XML,
                  W_RC LIKE SY-SUBRC.
    DATA: XML TYPE DCXMLLINES.
    DATA: RC TYPE SY-SUBRC,
    BEGIN OF XML_TAB OCCURS 0,
                  D LIKE LINE OF XML,
    END OF XML_TAB.
    CLASS CL_IXML DEFINITION LOAD.
    G_IXML = CL_IXML=>CREATE( ).
    CHECK NOT G_IXML IS INITIAL.
    M_DOCUMENT = G_IXML->CREATE_DOCUMENT( ).
    CHECK NOT M_DOCUMENT IS INITIAL.
    WRITE: / 'Converting DATA TO DOM 1:'.
    CALL FUNCTION 'SDIXML_DATA_TO_DOM'
    EXPORTING
                  NAME = 'ACCESOS'
                  DATAOBJECT = ACCESOS[]
    IMPORTING
                  DATA_AS_DOM = L_DOM
    CHANGING
                  DOCUMENT = M_DOCUMENT
    EXCEPTIONS
                  ILLEGAL_NAME = 1
                  OTHERS = 2.
    IF SY-SUBRC = 0.
                  WRITE 'Ok'.
    ELSE.
                  WRITE: 'Err =',
                  SY-SUBRC.
    ENDIF.
    CHECK NOT L_DOM IS INITIAL.
    W_RC = M_DOCUMENT->APPEND_CHILD( NEW_CHILD = L_DOM ).
    IF W_RC IS INITIAL.
                  WRITE 'Ok'.
    ELSE.
                  WRITE: 'Err =',
                  W_RC.
    ENDIF.
    CALL FUNCTION 'SDIXML_DOM_TO_XML'
    EXPORTING
                  DOCUMENT = M_DOCUMENT
    IMPORTING
                  XML_AS_STRING = W_STRING
                  SIZE = W_SIZE
    TABLES
                  XML_AS_TABLE = IT_XML
    EXCEPTIONS
                  NO_DOCUMENT = 1
                  OTHERS = 2.
    IF SY-SUBRC = 0.
                  WRITE 'Ok'.
    ELSE.
                  WRITE: 'Err =',
                  SY-SUBRC.
    ENDIF.
    LOOP AT IT_XML INTO XML_TAB-D.
                  APPEND XML_TAB.
    ENDLOOP.
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
                  BIN_FILESIZE = W_SIZE
                  FILENAME = GK_RUTA
                  FILETYPE = 'BIN'
    TABLES
                  DATA_TAB = XML_TAB
    EXCEPTIONS
                  OTHERS = 10.
    IF SY-SUBRC <> 0.
                  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.
    FORM DESCARGA_XML *
    Thanks & regards
    Sreenivasulu P

  • Write XML to the server... ? Problem !

    Hi,
    I need your help !
    I'm trying to reach the "Weather" example web service in WL 6.1.
    My aim is to write XML direct into a socket, over HTTP, and read the
    response...
    I have included the code I am using, but it is not successful for the
    moment.
    I keep getting a parse exception :
    HTTP/1.1 200 OK
    Date: Thu, 26 Jun 2003 07:57:33 GMT
    Server: WebLogic WebLogic Server 6.1 SP2 12/18/2001 11:13:46 #154529
    Content-Type: text/xml; charset=UTF-8
    Transfer-Encoding: Chunked
    Connection: Close
    04da
    <?xml version="1.0" ?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <soap:Fault>
    <faultcode>
    Server
    </faultcode>
    <faultstring>
    org.xml.sax.SAXException
    </faultstring>
    <detail>
    Server side error:
    org.xml.sax.SAXException: Could not find envelope element
    at weblogic.soap.codec.SoapMessage.read(SoapMessage.java:87)
    at
    weblogic.soap.server.servlet.StatelessBeanAdapter.getInputMessage(Sta
    telessBeanAdapter.java:150)
    at
    weblogic.soap.server.servlet.StatelessBeanAdapter.doPost(StatelessBea
    nAdapter.java:100)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:265)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:200)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:2495)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2204)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    </detail>
    </soap:Fault>
    </soap:Body>
    </soap:Envelope>
    0000
    ============ code ===============
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import java.text.*;
    public class ClientSocket {
    public static void main(String args[]) throws Exception
    if (args.length != 5)
    throw new Exception("Nombre de parametres incorrect");
    String site = args[0];
    Socket sock = new Socket("localhost", 7001);
    PrintWriter out = new PrintWriter(sock.getOutputStream());
    out.println("POST /weather/weatheruri HTTP/1.1");
    out.println("Host: localhost");
    out.println("Content-Type: text/xml; charset=\"utf-8\"");
    out.println("Content-Length: nnnn");
    //out.println("SOAPAction: \"http://localhost:7001/weather/weatheruri\"");
    //out.println("SOAPAction: ");
    out.println("SOAPAction: \"Some-URI\"");
    out.println("");
    out.println("<?xml version='1.0' encoding='UTF-8'?>");
    out.println("<SOAP-ENV:Envelope
    xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'
    xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/'
    xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance'
    xmlns:xsd='http://www.w3.org/1999/XMLSchema'>");
    out.println("<SOAP-ENV:Body>");
    out.println("<getTemp
    SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>");
    out.println("<message xsi:type='xsd:string'>");
    out.println("1212");
    out.println("</message>");
    out.println("</getTemp>");
    out.println("</SOAP-ENV:Body>");
    out.println("</SOAP-ENV:Envelope>");
    out.flush();
    BufferedReader in = new BufferedReader(new
    InputStreamReader(sock.getInputStream()));
    String str = null;
    while (((str = in.readLine()) != null))
    System.out.println(str);
    sock.close();

    Many thanks, Mike !!
    Mathew
    "Michael Wooten" <[email protected]> wrote in message
    news:[email protected]...
    >
    The attached Java source shows one example of how to use a Socket to senda SOAP
    message. Check it out, and see if it helps. It has some optimizations thataren't
    currently in the code you provided.
    Regards,
    Mike Wooten
    "W@p" <[email protected]> wrote:
    Hi,
    I need your help !
    I'm trying to reach the "Weather" example web service in WL 6.1.
    My aim is to write XML direct into a socket, over HTTP, and read the
    response...
    I have included the code I am using, but it is not successful for the
    moment.
    I keep getting a parse exception :
    HTTP/1.1 200 OK
    Date: Thu, 26 Jun 2003 07:57:33 GMT
    Server: WebLogic WebLogic Server 6.1 SP2 12/18/2001 11:13:46 #154529
    Transfer-Encoding: Chunked
    Connection: Close
    04da
    <?xml version="1.0" ?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <soap:Fault>
    <faultcode>
    Server
    </faultcode>
    <faultstring>
    org.xml.sax.SAXException
    </faultstring>
    <detail>
    Server side error:
    org.xml.sax.SAXException: Could not find envelope element
    at weblogic.soap.codec.SoapMessage.read(SoapMessage.java:87)
    at
    weblogic.soap.server.servlet.StatelessBeanAdapter.getInputMessage(Sta
    telessBeanAdapter.java:150)
    at
    weblogic.soap.server.servlet.StatelessBeanAdapter.doPost(StatelessBea
    nAdapter.java:100)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:265)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:200)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:2495)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2204)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    </detail>
    </soap:Fault>
    </soap:Body>
    </soap:Envelope>
    0000
    ============ code ===============
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import java.text.*;
    public class ClientSocket {
    public static void main(String args[]) throws Exception
    if (args.length != 5)
    throw new Exception("Nombre de parametres incorrect");
    String site = args[0];
    Socket sock = new Socket("localhost", 7001);
    PrintWriter out = new PrintWriter(sock.getOutputStream());
    out.println("POST /weather/weatheruri HTTP/1.1");
    out.println("Host: localhost");
    out.println("Content-Type: text/xml; charset=\"utf-8\"");
    out.println("Content-Length: nnnn");
    //out.println("SOAPAction:
    \"http://localhost:7001/weather/weatheruri\"");
    //out.println("SOAPAction: ");
    out.println("SOAPAction: \"Some-URI\"");
    out.println("");
    out.println("<?xml version='1.0' encoding='UTF-8'?>");
    out.println("<SOAP-ENV:Envelope
    xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'
    xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/'
    xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance'
    xmlns:xsd='http://www.w3.org/1999/XMLSchema'>");
    out.println("<SOAP-ENV:Body>");
    out.println("<getTemp
    SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>");
    out.println("<message xsi:type='xsd:string'>");
    out.println("1212");
    out.println("</message>");
    out.println("</getTemp>");
    out.println("</SOAP-ENV:Body>");
    out.println("</SOAP-ENV:Envelope>");
    out.flush();
    BufferedReader in = new BufferedReader(new
    InputStreamReader(sock.getInputStream()));
    String str = null;
    while (((str = in.readLine()) != null))
    System.out.println(str);
    sock.close();

  • Sample abap program to create XML files

    Hi friends,
    IS there is a sample abap program to create an XML file.
    regards
    kaushik

    Hope the below code is helpfull.....
    *& Report  ZSAN_XML                                                    *
    REPORT  ZSAN_XML                                .
    * Report ZPRUEBA_MML_13 *
    * Export an internal table to XML document *
    * NO BORRAR ESTE CODIGO *
    *REPORT ZPRUEBA_MML_13.
    * PANTALLA SELECCION *
    PARAMETERS: GK_RUTA TYPE RLGRAP-FILENAME.
    * PANTALLA SELECCION *
    * TYPE TURNOS *
    TYPES: BEGIN OF TURNOS,
    LU LIKE T552A-TPR01,
    MA LIKE T552A-TPR01,
    MI LIKE T552A-TPR01,
    JU LIKE T552A-TPR01,
    VI LIKE T552A-TPR01,
    SA LIKE T552A-TPR01,
    DO LIKE T552A-TPR01,
    END OF TURNOS.
    * TYPE TURNOS *
    * TYPE SOCIO *
    TYPES: BEGIN OF SOCIO,
    NUMERO LIKE PERNR-PERNR,
    REPOSICION LIKE PA0050-ZAUVE,
    NOMBRE LIKE PA0002-VORNA,
    TURNOS TYPE TURNOS,
    END OF SOCIO.
    * TYPE SOCIO *
    * ESTRUCTURA ACCESOS *
    DATA: BEGIN OF ACCESOS OCCURS 0,
    SOCIO TYPE SOCIO,
    END OF ACCESOS.
    * ESTRUCTURA ACCESOS *
    * START OF SELECTION *
    START-OF-SELECTION.
    PERFORM LLENA_ACCESOS.
    PERFORM DESCARGA_XML.
    END-OF-SELECTION.
    * END OF SELECTION *
    * FORM LLENA_ACCESOS *
    FORM LLENA_ACCESOS.
    REFRESH ACCESOS.
    CLEAR ACCESOS.
    MOVE: '45050' TO ACCESOS-SOCIO-NUMERO,
    'MOISES MORENO' TO ACCESOS-SOCIO-NOMBRE,
    '0' TO ACCESOS-SOCIO-REPOSICION,
    'T1' TO ACCESOS-SOCIO-TURNOS-LU,
    'T2' TO ACCESOS-SOCIO-TURNOS-MA,
    'T3' TO ACCESOS-SOCIO-TURNOS-MI,
    'T4' TO ACCESOS-SOCIO-TURNOS-JU,
    'T5' TO ACCESOS-SOCIO-TURNOS-VI,
    'T6' TO ACCESOS-SOCIO-TURNOS-SA,
    'T7' TO ACCESOS-SOCIO-TURNOS-DO.
    APPEND ACCESOS.
    CLEAR ACCESOS.
    MOVE: '45051' TO ACCESOS-SOCIO-NUMERO,
    'RUTH PEÑA' TO ACCESOS-SOCIO-NOMBRE,
    '0' TO ACCESOS-SOCIO-REPOSICION,
    'T1' TO ACCESOS-SOCIO-TURNOS-LU,
    'T2' TO ACCESOS-SOCIO-TURNOS-MA,
    'T3' TO ACCESOS-SOCIO-TURNOS-MI,
    'T4' TO ACCESOS-SOCIO-TURNOS-JU,
    'T5' TO ACCESOS-SOCIO-TURNOS-VI,
    'T6' TO ACCESOS-SOCIO-TURNOS-SA,
    'T7' TO ACCESOS-SOCIO-TURNOS-DO.
    APPEND ACCESOS.
    ENDFORM.
    * FORM LLENA_ACCESOS *
    * FORM DESCARGA_XML *
    FORM DESCARGA_XML.
    DATA: L_DOM TYPE REF TO IF_IXML_ELEMENT,
    M_DOCUMENT TYPE REF TO IF_IXML_DOCUMENT,
    G_IXML TYPE REF TO IF_IXML,
    W_STRING TYPE XSTRING,
    W_SIZE TYPE I,
    W_RESULT TYPE I,
    W_LINE TYPE STRING,
    IT_XML TYPE DCXMLLINES,
    S_XML LIKE LINE OF IT_XML,
    W_RC LIKE SY-SUBRC.
    DATA: XML TYPE DCXMLLINES.
    DATA: RC TYPE SY-SUBRC,
    BEGIN OF XML_TAB OCCURS 0,
    D LIKE LINE OF XML,
    END OF XML_TAB.
    CLASS CL_IXML DEFINITION LOAD.
    G_IXML = CL_IXML=>CREATE( ).
    CHECK NOT G_IXML IS INITIAL.
    M_DOCUMENT = G_IXML->CREATE_DOCUMENT( ).
    CHECK NOT M_DOCUMENT IS INITIAL.
    WRITE: / 'Converting DATA TO DOM 1:'.
    CALL FUNCTION 'SDIXML_DATA_TO_DOM'
    EXPORTING
    NAME = 'ACCESOS'
    DATAOBJECT = ACCESOS[]
    IMPORTING
    DATA_AS_DOM = L_DOM
    CHANGING
    DOCUMENT = M_DOCUMENT
    EXCEPTIONS
    ILLEGAL_NAME = 1
    OTHERS = 2.
    IF SY-SUBRC = 0.
    WRITE 'Ok'.
    ELSE.
    WRITE: 'Err =',
    SY-SUBRC.
    ENDIF.
    CHECK NOT L_DOM IS INITIAL.
    W_RC = M_DOCUMENT->APPEND_CHILD( NEW_CHILD = L_DOM ).
    IF W_RC IS INITIAL.
    WRITE 'Ok'.
    ELSE.
    WRITE: 'Err =',
    W_RC.
    ENDIF.
    CALL FUNCTION 'SDIXML_DOM_TO_XML'
    EXPORTING
    DOCUMENT = M_DOCUMENT
    IMPORTING
    XML_AS_STRING = W_STRING
    SIZE = W_SIZE
    TABLES
    XML_AS_TABLE = IT_XML
    EXCEPTIONS
    NO_DOCUMENT = 1
    OTHERS = 2.
    IF SY-SUBRC = 0.
    WRITE 'Ok'.
    ELSE.
    WRITE: 'Err =',
    SY-SUBRC.
    ENDIF.
    LOOP AT IT_XML INTO XML_TAB-D.
    APPEND XML_TAB.
    ENDLOOP.
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
    BIN_FILESIZE = W_SIZE
    FILENAME = GK_RUTA
    FILETYPE = 'BIN'
    TABLES
    DATA_TAB = XML_TAB
    EXCEPTIONS
    OTHERS = 10.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.
    * FORM DESCARGA_XML *

  • ABAP to XML

    hi all,
    i wanto to convert the data of internal table in to XML,
    using CALL TRANSFORMATION.
    my internal table has 4 records and i want all the four records to come in same XML file but only my last record is coming,
    my XSLT program is as shown below:
    XSLT:
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
      <tt:root name="ROOT"/>
      <tt:template>
      <file tt:ref="ROOT">
      <header>
      <MANDT tt:value-ref="MANDT"/>
      <CUSNO tt:value-ref="CUSNO"/>
      <CUSNAME tt:value-ref="CUSNAME"/>
      <CUSCITY tt:value-ref="CUSCITY"/>
      </header>
      </file>
      </tt:template>
      </tt:transform>
    and my ABAP code is:
    select * from zpidoc into corresponding fields of table i_data.
    loop at i_data INTO wa_data.
        call TRANSFORMATION ZTRANS_XML_27
        OPTIONS XML_HEADER = 'NO'
        SOURCE root = wa_data
              string = string integer = integer
        RESULT XML ZXML_TEST.
      endloop.
    can any one helpme in this
    thanks in advance.

    check the internal table in debugg mode how records.
    refer this code.
    found this on aUser forum sometime back... pl go through it..
    *& Report  ZTESTXML                                                    *
    * Report ZPRUEBA_MML_13 *
    * Export an internal table to XML document *
    * NO BORRAR ESTE CODIGO *
    report zprueba_mml_13.
    * PANTALLA SELECCION *
    parameters: gk_ruta type rlgrap-filename.
    * PANTALLA SELECCION *
    * TYPE TURNOS *
    types: begin of turnos,
        lu like t552a-tpr01,
        ma like t552a-tpr01,
        mi like t552a-tpr01,
        ju like t552a-tpr01,
        vi like t552a-tpr01,
        sa like t552a-tpr01,
        do like t552a-tpr01,
    end of turnos.
    * TYPE TURNOS *
    * TYPE SOCIO *
    types: begin of socio,
        numero like pernr-pernr,
        reposicion like pa0050-zauve,
        nombre like pa0002-vorna,
        turnos type turnos,
    end of socio.
    * TYPE SOCIO *
    * ESTRUCTURA ACCESOS *
    data: begin of accesos occurs 0,
        socio type socio,
    end of accesos.
    * ESTRUCTURA ACCESOS *
    * START OF SELECTION *
    start-of-selection.
      perform llena_accesos.
      perform descarga_xml.
    end-of-selection.
    * END OF SELECTION *
    * FORM LLENA_ACCESOS *
    form llena_accesos.
      refresh accesos.
      clear accesos.
      move: '45050' to accesos-socio-numero,
                    'MOISES MORENO' to accesos-socio-nombre,
                    '0' to accesos-socio-reposicion,
                    'T1' to accesos-socio-turnos-lu,
                    'T2' to accesos-socio-turnos-ma,
                    'T3' to accesos-socio-turnos-mi,
                    'T4' to accesos-socio-turnos-ju,
                    'T5' to accesos-socio-turnos-vi,
                    'T6' to accesos-socio-turnos-sa,
                    'T7' to accesos-socio-turnos-do.
      append accesos.
      clear accesos.
      move: '45051' to accesos-socio-numero,
                    'RUTH PEÑA' to accesos-socio-nombre,
                    '0' to accesos-socio-reposicion,
                    'T1' to accesos-socio-turnos-lu,
                    'T2' to accesos-socio-turnos-ma,
                    'T3' to accesos-socio-turnos-mi,
                    'T4' to accesos-socio-turnos-ju,
                    'T5' to accesos-socio-turnos-vi,
                    'T6' to accesos-socio-turnos-sa,
                    'T7' to accesos-socio-turnos-do.
      append accesos.
    endform.                    "LLENA_ACCESOS
    * FORM LLENA_ACCESOS *
    * FORM DESCARGA_XML *
    form descarga_xml.
      data: l_dom type ref to if_ixml_element,
                    m_document type ref to if_ixml_document,
                    g_ixml type ref to if_ixml,
                    w_string type xstring,
                    w_size type i,
                    w_result type i,
                    w_line type string,
                    it_xml type dcxmllines,
                    s_xml like line of it_xml,
                    w_rc like sy-subrc.
      data: xml type dcxmllines.
      data: rc type sy-subrc,
      begin of xml_tab occurs 0,
                    d like line of xml,
      end of xml_tab.
      class cl_ixml definition load.
      g_ixml = cl_ixml=>create( ).
      check not g_ixml is initial.
      m_document = g_ixml->create_document( ).
      check not m_document is initial.
      write: / 'Converting DATA TO DOM 1:'.
      call function 'SDIXML_DATA_TO_DOM'
        exporting
          name         = 'ACCESOS'
          dataobject   = accesos[]
        importing
          data_as_dom  = l_dom
        changing
          document     = m_document
        exceptions
          illegal_name = 1
          others       = 2.
      if sy-subrc = 0.
        write 'Ok'.
      else.
        write: 'Err =',
        sy-subrc.
      endif.
      check not l_dom is initial.
      w_rc = m_document->append_child( new_child = l_dom ).
      if w_rc is initial.
        write 'Ok'.
      else.
        write: 'Err =',
        w_rc.
      endif.
      call function 'SDIXML_DOM_TO_XML'
        exporting
          document      = m_document
        importing
          xml_as_string = w_string
          size          = w_size
        tables
          xml_as_table  = it_xml
        exceptions
          no_document   = 1
          others        = 2.
      if sy-subrc = 0.
        write 'Ok'.
      else.
        write: 'Err =',
        sy-subrc.
      endif.
      loop at it_xml into xml_tab-d.
        append xml_tab.
      endloop.
      call function 'WS_DOWNLOAD'
        exporting
          bin_filesize = w_size
          filename     = gk_ruta
          filetype     = 'BIN'
        tables
          data_tab     = xml_tab
        exceptions
          others       = 10.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
        with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    endform.                    "DESCARGA_XML
    * FORM DESCARGA_XML *
    SAP_CONVERT_TO_XML_FORMAT
    SDIXML_DOM_TO_XML to do this.
    Regards,

  • Flat file to XML

    Hi guys,
    Anyone knows standard functions to convert a flat file to XML? Or maybe from an internal table to XML.
    Thanks in advance,
    Ricardo.

    Hello ricardo,
    Check this sample:
    *& Report  ZULH_MM_RP_XMLtest001
    REPORT  ZULH_MM_RP_XMLtest001.
    PARAMETERS: GK_RUTA TYPE RLGRAP-FILENAME DEFAULT 'C:test01.XML'.
    * TYPE TURNOS *
    TYPES: BEGIN OF TURNOS,
        LU LIKE T552A-TPR01,
        MA LIKE T552A-TPR01,
        MI LIKE T552A-TPR01,
        JU LIKE T552A-TPR01,
        VI LIKE T55AA-TPR01,
        SA LIKE T552A-TPR01,
        DO LIKE T552A-TPR01,
    END OF TURNOS.
    * TYPE TURNOS *
    * TYPE SOCIO *
    TYPES: BEGIN OF SOCIO,
        NUMERO LIKE PERNR-PERNR,
        REPOSICION LIKE PA0050-ZAUVE,
        NOMBRE LIKE PA0002-VORNA,
        TURNOS TYPE TURNOS,
    END OF SOCIO.
    * TYPE SOCIO *
    * ESTRUCTURA ACCESOS *
    DATA: BEGIN OF ACCESOS OCCURS 0,
        SOCIO TYPE SOCIO,
    END OF ACCESOS.
    * ESTRUCTURA ACCESOS *
    * START OF SELECTION *
    START-OF-SELECTION.
        PERFORM LLENA_ACCESOS.
        PERFORM DESCARGA_XML.
    END-OF-SELECTION.
    * END OF SELECTION *
    * FORM LLENA_ACCESOS *
    FORM LLENA_ACCESOS.
    REFRESH ACCESOS.
    CLEAR ACCESOS.
    MOVE: '45050' TO ACCESOS-SOCIO-NUMERO,
                  'MOISES MORENO' TO ACCESOS-SOCIO-NOMBRE,
                  '0' TO ACCESOS-SOCIO-REPOSICION,
                  'T1' TO ACCESOS-SOCIO-TURNOS-LU,
                  'T2' TO ACCESOS-SOCIO-TURNOS-MA,
                  'T3' TO ACCESOS-SOCIO-TURNOS-MI,
                  'T4' TO ACCESOS-SOCIO-TURNOS-JU,
                  'T5' TO ACCESOS-SOCIO-TURNOS-VI,
                  'T6' TO ACCESOS-SOCIO-TURNOS-SA,
                  'T7' TO ACCESOS-SOCIO-TURNOS-DO.
    APPEND ACCESOS.
    CLEAR ACCESOS.
    MOVE: '45051' TO ACCESOS-SOCIO-NUMERO,
                  'RUTH PEÑA' TO ACCESOS-SOCIO-NOMBRE,
                  '0' TO ACCESOS-SOCIO-REPOSICION,
                  'T1' TO ACCESOS-SOCIO-TURNOS-LU,
                  'T2' TO ACCESOS-SOCIO-TURNOS-MA,
                  'T3' TO ACCESOS-SOCIO-TURNOS-MI,
                  'T4' TO ACCESOS-SOCIO-TURNOS-JU,
                  'T5' TO ACCESOS-SOCIO-TURNOS-VI,
                  'T6' TO ACCESOS-SOCIO-TURNOS-SA,
                  'T7' TO ACCESOS-SOCIO-TURNOS-DO.
    APPEND ACCESOS.
    ENDFORM.
    * FORM LLENA_ACCESOS *
    * FORM DESCARGA_XML *
    FORM DESCARGA_XML.
    DATA: L_DOM TYPE REF TO IF_IXML_ELEMENT,
                  M_DOCUMENT TYPE REF TO IF_IXML_DOCUMENT,
                  G_IXML TYPE REF TO IF_IXML,
                  W_STRING TYPE XSTRING,
                  W_SIZE TYPE I,
                  W_RESULT TYPE I,
                  W_LINE TYPE STRING,
                  IT_XML TYPE DCXMLLINES,
                  S_XML LIKE LINE OF IT_XML,
                  W_RC LIKE SY-SUBRC.
    DATA: XML TYPE DCXMLLINES.
    DATA: RC TYPE SY-SUBRC,
    BEGIN OF XML_TAB OCCURS 0,
                  D LIKE LINE OF XML,
    END OF XML_TAB.
    CLASS CL_IXML DEFINITION LOAD.
    G_IXML = CL_IXML=>CREATE( ).
    CHECK NOT G_IXML IS INITIAL.
    M_DOCUMENT = G_IXML->CREATE_DOCUMENT( ).
    CHECK NOT M_DOCUMENT IS INITIAL.
    WRITE: / 'Converting DATA TO DOM 1:'.
    CALL FUNCTION 'SDIXML_DATA_TO_DOM'
    EXPORTING
                  NAME = 'ACCESOS'
                  DATAOBJECT = ACCESOS[]
    IMPORTING
                  DATA_AS_DOM = L_DOM
    CHANGING
                  DOCUMENT = M_DOCUMENT
    EXCEPTIONS
                  ILLEGAL_NAME = 1
                  OTHERS = 2.
    IF SY-SUBRC = 0.
                  WRITE 'Ok'.
    ELSE.
                  WRITE: 'Err =',
                  SY-SUBRC.
    ENDIF.
    CHECK NOT L_DOM IS INITIAL.
    W_RC = M_DOCUMENT->APPEND_CHILD( NEW_CHILD = L_DOM ).
    IF W_RC IS INITIAL.
                  WRITE 'Ok'.
    ELSE.
                  WRITE: 'Err =',
                  W_RC.
    ENDIF.
    CALL FUNCTION 'SDIXML_DOM_TO_XML'
    EXPORTING
                  DOCUMENT = M_DOCUMENT
    IMPORTING
                  XML_AS_STRING = W_STRING
                  SIZE = W_SIZE
    TABLES
                  XML_AS_TABLE = IT_XML
    EXCEPTIONS
                  NO_DOCUMENT = 1
                  OTHERS = 2.
    IF SY-SUBRC = 0.
                  WRITE 'Ok'.
    ELSE.
                  WRITE: 'Err =',
                  SY-SUBRC.
    ENDIF.
    LOOP AT IT_XML INTO XML_TAB-D.
                  APPEND XML_TAB.
    ENDLOOP.
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
                  BIN_FILESIZE = W_SIZE
                  FILENAME = GK_RUTA
                  FILETYPE = 'BIN'
    TABLES
                  DATA_TAB = XML_TAB
    EXCEPTIONS
                  OTHERS = 10.
    IF SY-SUBRC <> 0.
                  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.
    Regards,
    Vasanth

  • Using multiple XSL files parsing a XML file

    Hi,
    Can a single XML be procesed by a XSL file in which are included many XSL stylesheet?
    I mean, my Java servlet writes the results of the SQL
    queries in a single XML document. Something like this:
    <?xml version="1.0" encoding="UTF-8" ?>
    <body>
    <!-- Part 1 -->
    <record>
    <nombre>Monica</nombre>
    <apellido1>Amann</apellido1>
    <apellido2>Ostos</apellido2>
    </record>
    <!-- Part 2 -->
    <record>
    <domicilio>Rodriguez Arias</domicilio>
    <numero>41</numero>
    <piso>5</piso>
    </record>
    <!-- Part 3 -->
    <record>
    <nombre>Ana</nombre>
    <apellido1>Garcia</apellido1>
    <apellido2>Ostos</apellido2>
    <domicilio>Rodriguez Arias</domicilio>
    <numero>41</numero>
    <piso>5</piso>
    <mano>Decha</mano>
    </record>
    </body>
    I want to be able to apply a particular stylesheet into diferent part of the XML file.
    I mean, i have a XSL (father), in which are included various XSL. My problem is that
    i can apply the bloque1.xsl to process part1 in the xml, and bloque2.xsl to process
    part2 in the xml and the same with the thrid.
    This is my XSL (father), but i don't know whats the way to do it. And i don�t konw if
    it's possible to do it.
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:fo="http://www.w3.org/1999/XSL/Format"
    version="1.0">
    <xsl:include href="/aplic/fop/ejemplos/bloque1.xsl" />
    <xsl:include href="/aplic/fop/ejemplos/bloque2.xsl" />
    <xsl:include href="/aplic/fop/ejemplos/bloque3.xsl" />
    <xsl:template match="body">
         <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
              <fo:layout-master-set>
              <fo:simple-page-master master-name="simple"
                   page-height="21cm"
                   page-width="21cm"
                   margin-top="1cm"
                   margin-bottom="1cm"
                   margin-left="1.5cm"
                   margin-right="1.5cm">
                   <fo:region-body margin-top="1.5cm"
                   margin-bottom="1.5cm"/>
              </fo:simple-page-master>
              </fo:layout-master-set>
              <fo:page-sequence master-reference="simple">
              <fo:flow flow-name="xsl-region-body">
              <fo:block text-align="right">
                        <fo:external-graphic src="c:\aplic\fop\ejemplos\barcode.jpeg" width="8.1cm" height="3.7cm"/>
              </fo:block>
                   <xsl:apply-templates/>
              </fo:flow>
              </fo:page-sequence>
         </fo:root>
    </xsl:template>
    <!-- Here i should code the rest of the XSL to join the diferents parts of the XML with its corresponded XSL -->
    </xsl:stylesheet>
    Finally i have to produce a single resultant report into pdf outformat. For this, i am using XSL-FO.
    Thanks a lot, and i'm sorry for my english language.

    The examples of Xalan (check xml.apache.org) do just that.
    Micks

  • File Adapter NFS: Doubt with th Data Type corresponding to the XML

    Hi All!!
    On my scenario, a file is caught from the server and its information is passed to a proxy.
    My doubt is how must be the XML format and the Data Type to the data be correctly retrieved?
    The XML I have designed is the next:
    Is correct? If yes, How must be defined its Data Type?
    Thanks and regards,
    Manuel Míguez.

    Hi!
    I will try to elaborate my question.
    I have the next XML Data on the Server:
    <?xml version='1.0' encoding='UTF-8'?>
    <DT_File_Req>
    <NumeroDocumento>2/0211/M015010010N</NumeroDocumento>
    <Tipo>ZEP</Tipo>
    <Version>000</Version>
    <Parcial>00</Parcial>
    <Descripciones>
    <Item>
    <Idioma>ES</Idioma>
    <DescripcionCorta>Prueba descripcion corta</DescripcionCorta>
    <DescripcionLarga>Prueba descripcion larga swfiwjeflijwelifjlwejlkfdsjfelsdjflkjdslkfjsjdoifjposdjfojsdkjfslkdjfwehjfjdslfkjsdlfhswfsdfl</DescripcionLarga>
    </Item>
    <Item>
    <Idioma>FR</Idioma>
    <DescripcionCorta>Prueba descripcion corta en frances</DescripcionCorta>
    <DescripcionLarga>Prueba descripcion larga en frances ejlkfdsjfelsdjflkjdslkfjsjdoifjposdjfojsdkjfslkdjfwehjfjdslfkjsdlfhswfsdfl</DescripcionLarga>
    </Item>
    </Descripciones>
    <Caracteristicas>
    <Item>
    <Nombre>Fecha Inicio Plano</Nombre>
    <Valor>12032008</Valor>
    </Item>
    <Item>
    <Nombre>Fecha Fin Plano</Nombre>
    <Valor>20032008</Valor>
    </Item>
    </Caracteristicas>
    </DT_File_Req>
    This XML is polled by XI.
    I have created the next Data Dype corresponding with structure of the XML (I hope will be understable):
    DT_File_Req
    Numero Documento STRING
    Tipo STRING
    Parcial STRING
    Descripciones
    Item 1..n
    Idioma STRING
    DescripcionCorta STRING
    DescripcionLarga STRING
    Caracteristicas
    Item 1..n
    Nombre STRING
    Valor STRING
    My question is if this XML structure and this Data Type are compatible. I get on SXMB_MONI an error on the Mapping and I guess that the error is produced because the XML Format is not correct.
    Thanks and regards,
    Manuel.

  • How to load movies from a xml file?

    I have a movie called "index.swf" and a class called "index.as"
    The problem is that loads the movies in the same position.
    index.as:
    package
        import flash.utils.getDefinitionByName;
        import flash.display.Loader;
        import flash.display.Sprite;
        import flash.events.Event;
        import flash.net.URLLoader;
        import flash.net.URLRequest;
        import flash.display.Loader;
        import flash.events.ProgressEvent;
        import flash.display.MovieClip;
        public class index extends Sprite
            private var _xml:XML;
            private var swf_id:String
            private var swf_m:String
            private var swf_x:Number
            private var swf_y:Number
            private var swf_width:Number
            private var swf_height:Number
    function startLoad()
    var mLoader:Loader = new Loader();
    var mRequest:URLRequest = new URLRequest(swf_m);
    mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
    mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
    mLoader.name=swf_id
    mLoader.load(mRequest);
    function onCompleteHandler(loadEvent:Event)
    loadEvent.currentTarget.content.width=swf_width
    loadEvent.currentTarget.content.height=swf_height
    addChild(loadEvent.currentTarget.content);
    function onProgressHandler(mProgress:ProgressEvent)
    var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal;
    trace(percent);
            public function index()
                loadXMLFile();
            private function loadXMLFile():void
                var loader= new URLLoader(new URLRequest("/configuracion.xml"));
                loader.addEventListener(Event.COMPLETE, loadedCompleteHandler);
            private function loadedCompleteHandler(e:Event):void
                e.target.removeEventListener(Event.COMPLETE, loadedCompleteHandler);
                _xml = XML(e.target.data);
                for each (var conf:XML in _xml.secciones.seccion) {
                   swf_id = conf.id
                    swf_m = conf.nombre;
                    swf_x = conf.pos_x
                    swf_y = conf.pos_y
                    swf_width = conf.width
                    swf_height = conf.height
                    startLoad();
    Xml File: "configuracion.xml"
    <?xml version="1.0" encoding="utf-8"?>
    <config>
      <secciones>
        <seccion>
          <id>1</id>
          <nombre>pelicula1.swf</nombre>
          <pos_x>20</pos_x>
          <pos_y>10</pos_y>
          <width>200</width>
          <height>200</height>
        </seccion>
        <seccion>
          <id>2</id>
          <nombre>pelicula2.swf</nombre>
          <pos_x>80</pos_x>
          <pos_y>10</pos_y>
          <width>200</width>
          <height>200</height>
        </seccion>
      </secciones>
    </config>
    thanks for your help...

    thanks rziller
    I already tried this,
    x,y values work...
    height and width values do not work.....
    thanks but I fix the problem....
    here this...
    package
        import flash.display.Sprite;
        import flash.events.Event;
        import flash.net.URLLoader;
        import flash.net.URLRequest;
        import flash.display.Loader;
       public class index extends Sprite
            private var _xml:XML;
            private var i:Number=0;
            private var Swf_List:Array = new Array();
            private var mLoader:Loader;
                function startLoad()
                     mLoader = new Loader();
                     var mRequest:URLRequest = new URLRequest(Swf_List[i][1]);
                     mLoader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
                     mLoader.load(mRequest);   
                     mLoader.name=Swf_List[i][0]
                     addChild(mLoader);
                function initHandler(event:Event):void {
                    var ii:Number = event.target.loader.name-1
                    event.target.loader.x=Swf_List[ii][2]
                    event.target.loader.y=Swf_List[ii][3]
                    event.target.loader.width=Swf_List[ii][4];       
                    event.target.loader.height=Swf_List[ii][5];
                    trace(event.target.loader.name)
                public function index()
                loadXMLFile();
                private function loadXMLFile():void
                    var loader= new URLLoader(new URLRequest("config.xml"));
                    loader.addEventListener(Event.COMPLETE, loadedCompleteHandler);
                private function loadedCompleteHandler(e:Event):void
                    e.target.removeEventListener(Event.COMPLETE, loadedCompleteHandler);
                    _xml = XML(e.target.data);
                    _xml.ignoreWhitespace=true;
                        for each (var conf:XML in _xml.secciones.seccion)
                            Swf_List[i] = [conf.id,conf.nombre,conf.pos_x,conf.pos_y,conf.width,conf.height];
                            startLoad()
                            i++;
    maybe not the best way....
    but it works!!!.........

  • Export Internal Table to XML in Background

    Hi
    I need to export a internal table into xml file in background using open dataset. The file is getting created but i am not able to open the file using IE/XML editor . When i open the file uisng wordpad i can see some charcters at the end of file which prevents it from opening in xml editor. if i delete the characters(box like) and save the file. i am able to open the file
    When i downalod the same internal table via frontend using ws_downlod it works pefectly. no junk charcters are appended in the end. and hence files opens perfectly
    below is the extract of program
    START-OF-SELECTION.
       PERFORM get_data.
       PERFORM create_xml.
    FORM get_data.
       REFRESH accesos.
       CLEAR accesos.
       MOVE: '45050' TO accesos-socio-numero,
                     'MOISES MORENO' TO accesos-socio-nombre,
                     '0' TO accesos-socio-reposicion.
       APPEND accesos.
    ENDFORM.
    i am using the following function modules
    CALL FUNCTION 'SDIXML_DATA_TO_DOM'
            EXPORTING
                 name         = 'ACCESOS'
                 dataobject   = accesos[]
            IMPORTING
                 data_as_dom  = l_dom
    CHANGING
                 document     = m_document
            EXCEPTIONS
                 illegal_name = 1
                 OTHERS       = 2.
           CHECK NOT l_dom IS INITIAL.
    w_rc = m_document->append_child( new_child = l_dom ).
    CALL FUNCTION 'SDIXML_DOM_TO_XML'
    EXPORTING
    document      = m_document
    IMPORTING
    xml_as_string = w_string
    size          = w_size
    TABLES
    xml_as_table  = it_xml
    EXCEPTIONS
    no_document   = 1
    OTHERS        = 2.
    LOOP AT it_xml INTO xml_tab-d.
         APPEND xml_tab.
       ENDLOOP.
    The following syntax for open datset which does not work
      lv_physcial_file = '
    hdat03\test.xml'.
    OPEN DATASET lv_physcial_file IN BINARY MODE   FOR OUTPUT MESSAGE l_msg.
       LOOP AT xml_tab.
         TRANSFER xml_tab TO lv_physcial_file.
       ENDLOOP.
    The ws_download function works
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
                   BIN_FILESIZE = W_SIZE
                   FILENAME = GK_RUTA
                   FILETYPE = 'BIN'
    TABLES
                   DATA_TAB = XML_TAB
    EXCEPTIONS
                   OTHERS = 10.
    many thnaks

    Hi Chetan,
    Can you just try changing the syntax to the following, I not sure if that will help but just try and see.
    OPEN DATASET  lv_physcial_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    Regards
    Mohamed

  • JSP XML file parsing XSLT using Xalan

    Hi all
    I have created an XML file "view_campaign.xml" using JSP as shown in a code below and i wanna know how i should proceed to parse the XML file and so i can display this XML as the XSLT file i created.
    <%@ page import="java.sql.*" %>
    <%@ page import="java.io.*" %>
    <%
    // Identify a carriage return character for each output line
    int iLf = 10;
    char cLf = (char)iLf;
    // Create a new empty binary file, which will content XML output
    File outputFile = new File("C:\\WebContent\\view_campaigns.xml");
    //outputFile.createNewFile();
    FileWriter outfile = new FileWriter(outputFile);
    // the header for XML file
    outfile.write("<?xml version='1.0' encoding='ISO-8859-1'?>"+cLf);
    try {
         // Define connection string and make a connection to database
         //DriverManager.registerDriver (new org.apache.derby.jdbc.ClientDriver());
         Connection conn = DriverManager.getConnection("jdbc:derby://localhost:1527/sample","app","app");
         Statement stat = conn.createStatement();
         // Create a recordset
         ResultSet rset = stat.executeQuery("Select * From campagn");
         // Expecting at least one record
         if( !rset.next() ) {
              throw new IllegalArgumentException("No data found for the campaigns table");
         outfile.write("<campaigns>"+cLf);
         outfile.write("<campaign>"+cLf);
         outfile.write("<campaign_id>" + rset.getString("campagn_id") +"</campaign_id>"+cLf);
         outfile.write("<campaign_name>" + rset.getString("campagn_name") +"</campaign_name>"+cLf);
         outfile.write("<campaign_type>" + rset.getString("campagn_type") +"</campaign_type>"+cLf);
         outfile.write("<client>" + rset.getString("client_name") +"</client>"+cLf);
         outfile.write("<positions>" + rset.getString("positions_nbr") +"</positions>"+cLf);
         outfile.write("<begin>" + rset.getString("campagn_beginning_date") +"</begin>"+cLf);
         outfile.write("<close>" + rset.getString("campagn_ending_date") +"</close>"+cLf);
         outfile.write("</campaign>"+cLf);
         // Parse our recordset
    // Parse our recordset
         while(rset.next()) {
              outfile.write("<campaign>"+cLf);
              outfile.write("<campaign_id>" + rset.getString("campagn_id") +"</campaign_id>"+cLf);
              outfile.write("<campaign_name>" + rset.getString("campagn_name") +"</campaign_name>"+cLf);
              outfile.write("<campaign_type>" + rset.getString("campagn_type") +"</campaign_type>"+cLf);
              outfile.write("<client>" + rset.getString("client_name") +"</client>"+cLf);
              outfile.write("<positions>" + rset.getString("positions_nbr") +"</positions>"+cLf);
              outfile.write("<begin>" + rset.getString("campagn_beginning_date") +"</begin>"+cLf);
              outfile.write("<close>" + rset.getString("campagn_ending_date") +"</close>"+cLf);
              outfile.write("</campaign>"+cLf);
         outfile.write("</campaigns>"+cLf);
         // Everything must be closed
         rset.close();
         stat.close();
         conn.close();
         outfile.close();
    catch( Exception er ) {
    %>////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    this is my .XSL file
    <?xml version="1.0" encoding="iso-8859-1" ?>
    - <!--  DWXMLSource="view_campaigns.xml"
      -->
      <!DOCTYPE xsl:stylesheet (View Source for full doctype...)>
    - <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output method="html" encoding="iso-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
    - <xsl:template match="/">
    - <html xmlns="http://www.w3.org/1999/xhtml">
    - <head>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      <title>Gestion des campagnes</title>
      </head>
    - <body>
      Gestion des campagnes
    - <table border="1">
    - <tr bgcolor="#9acd32">
      <th align="left">Code</th>
      <th align="left">Nom</th>
      <th align="left">Type</th>
      <th align="left">Client</th>
      <th align="left">Nombre de positions</th>
      <th align="left">Date d'ouverture</th>
      <th align="left">Date de cl�ture</th>
      </tr>
    - <xsl:for-each select="campaigns/campaign">
    - <tr>
    - <td>
      <xsl:value-of select="campaign_id" />
      </td>
    - <td>
      <xsl:value-of select="campaign_name" />
      </td>
    - <td>
      <xsl:value-of select="campaign_type" />
      </td>
    - <td>
      <xsl:value-of select="client" />
      </td>
    - <td>
      <xsl:value-of select="positions" />
      </td>
    - <td>
      <xsl:value-of select="begin" />
      </td>
    - <td>
      <xsl:value-of select="close" />
      </td>
      </tr>
      </xsl:for-each>
      </table>
      </body>
      </html>
      </xsl:template>
      </xsl:stylesheet>I would be greatful that u answer my question what i should do have any exemple case study.

    Hi,
    Try this code
    JspWriter out = pageContext.getOut(); // Get JSP output writter
          javax.xml.transform.TransformerFactory tFactory = javax.xml.transform.TransformerFactory.newInstance(); //Instantiate a TransformerFactory.           
          String realPath = "c:/applyXsl.xsl";
          java.io.File file = new java.io.File(realPath); // crearte a file object for given XSL.
          // Use the TransformerFactory to process the stylesheet Source and  generate a Transformer.           
          javax.xml.transform.Transformer transformer = tFactory.newTransformer(new javax.xml.transform.stream.StreamSource(file));
          java.io.StringReader inputStream = new java.io.StringReader("c:/xmlFile.xml"); // create an input stream for given XML doc
          java.io.ByteArrayOutputStream obj = new java.io.ByteArrayOutputStream(); // Create an output stream for XSL applied XML doc.
          // 3. Use the Transformer to transform an XML Source and send the output to a Result object.
          transformer.transform(new javax.xml.transform.stream.StreamSource(inputStream), new javax.xml.transform.stream.StreamResult(obj));
          String outputString = obj.toString(); // get the XSL applied applied XML document for print
          out.println(outputString); // print the XSL applied XML in to JSP.
    however you need xercesImpl.jar  and xml-apis.jar files  to run this program.
    Regards,
    Ananth.P

Maybe you are looking for

  • Finally updated to iTunes 11.1.3 and now TV shows will not play?

    With the HD videos, it says "This movie can be played only on displays that support HDCP (High-bandwidth Digital Content Protection)." With the SD videos, the audio plays, but the video is just scrambled colours. Is there any way to fix this, or remo

  • Nokia DT-901 chirping noise 24/7

    Is it normal that DT-901 wireless charger makes chirping noise all the time, even without phone on the charging plate? Noise comes from the power supply (Nokia AC-301E), not from the plate. The noise is not loud but I have good hearing so it gets ann

  • Displaying Master-Data using ADF DI

    Hi I'm trying to display a master data(as a form) and a detail data(as a table) in excel sheet using ADF DI. The process I followed is as below. 1. This is on HR schema. I created a departmentsVO, and dragged Departments from the data control to the

  • Displaying album artwork 'fullscreen' on 160GB iPod classic?

    I recently upgraded by 80GB iPod to a 160GB one. I see the menu/interface is all "souped up". Whilst it does look quite slick, I guess, one thing i miss is the ability to press the centre button a couple of times, and it displays the album art "full

  • How to change row colour without using WDTableCellDesign

    Hi I change the row colour of my tree table depending on the level of the tree. WDTableCellDesign doesn't have the colours that I want. I want to use different shades of blue. How do i do this? I have a variable of type type     com.sap.ide.webdynpro