Simple XML file storage/retrieval

I am trying to store an XML file into a CLOB. I am having trouble "seeing" the data. I have examples of dealing with pulling BLOBs (pics), but not CLOBs. I don't necessarily need to use a CLOB (I don't think), since all I need to do is store an XML file and then later get it back (i.e. no operations on it). If anyone has any ideas/exp with this, please let me know.
Thanks, A. Morris

By "seeing" I was meaning during a SQL*Plus session. Setting LONG worked... Also I wanted to retrieve the clob data from a Pro*C exe. This was more involved and the DBMS_LOB stuff worked really well! I really appreciate your help.
Adam Morris
<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Sandeepan ([email protected]):
In some cases, if the CLOB is too long, you may have to set LONG xxxx (a big enough value) in SQL*Plus to see the entire clob. You can also use the DBMS_LOB routines to read and print the clob. Please take a look at the App Dev guide for LOBs for more detail. If that doesn't suffice, please post details of what problem you encounter 'seeing ' the CLOB.
Thanks!
Originally posted by amorris:[b]I am trying to store an XML file into a CLOB. I am having trouble "seeing" the data. I have examples of dealing with pulling BLOBs (pics), but not CLOBs. I don't necessarily need to use a CLOB (I don't think), since all I need to do is store an XML file and then later get it back (i.e. no operations on it). If anyone has any ideas/exp with this, please let me know.
Thanks, A. Morris<HR></BLOCKQUOTE>
null

Similar Messages

  • Urgent: how to query/index xml files to retrieve information belonging to a section?

    os: linux
    db: oracle 9iR2
    Hi,
    how can I extract -> only <- the matching entry information from within a xml file, that belongs to the result of a query?
    For example, given the following xml:
    <QualifierRecordSet>
    <QualifierRecord QualifierType = "1">
    <QualifierUI>Q000002</QualifierUI>
    <QualifierName>
    <String>test1</String>
    </QualifierName>
    <DateCreated>
    <Year>1973</Year>
    <Month>12</Month>
    <Day>27</Day>
    </DateCreated>
    </QualifierRecord>
    <QualifierRecord QualifierType = "1">
    <QualifierUI>Q000003</QualifierUI>
    <QualifierName>
    <String>test2</String>
    </QualifierName>
    <DateCreated>
    <Year>1975</Year>
    <Month>10</Month>
    <Day10</Day>
    </DateCreated>
    </QualifierRecord>
    <QualifierRecordSet>
    I would like to query for '/QualifierRecordSet/QualifierRecord/QualifierName[String = "test2"]' and retrieve ONLY the second 'QualifierRecord' - entry, i.e.:
    <QualifierRecord QualifierType = "1">
    <QualifierUI>Q000003</QualifierUI>
    <QualifierName>
    <String>test2</String>
    </QualifierName>
    <DateCreated>
    <Year>1975</Year>
    <Month>10</Month>
    <Day10</Day>
    </DateCreated>
    </QualifierRecord>
    ...but not the' id' or 'name' of the xml-document(I have only one document).
    Thanks for your help in advance.
    Best Regards,
    Dan

    extract() would do what you want. But your whole approach of only have 1 document makes no sense when working with an XML database. See my reply to the other post for more reasons.

  • Simple XML file and XSD

    I have following xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    <data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\schema.xsd">
         <trans>
              <element>aaa</element>
              <element>bbb</element>
              <element>ccc</element>
         </trans>
    </data>
    and for this file I created schema (XSD) file:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
         <xs:element name="trans">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="element" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="element">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                        <xs:enumeration value="aaa"/>
                        <xs:enumeration value="bbb"/>
                        <xs:enumeration value="ccc"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:element name="data">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="trans"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    </xs:schema>
    My XML file is compatible with this schema file.
    But when I remove element <data> from my XML file, like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <trans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\schema.xsd">
         <element>aaa</element>
         <element>bbb</element>
         <element>ccc</element>
    </trans>
    then, that file is compatible with schema file as well and it is problem for me.
    Element data is required in my XML file as like other elements.
    How should look schema file with restriction which informs that element <data> is always required?
    Is it possible to do?
    regards,
    Jarek

    That is a good question and the answer can depend upon how complex your schema is. For the simple example you gave, it could be rewritten as
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
         <xs:element name="data" type="dataType"/>
         <xs:complexType name="dataType">
              <xs:sequence>
                   <xs:element name="trans">
                        <xs:complexType>
                             <xs:sequence>
                                  <xs:element name="element" maxOccurs="unbounded">
                                       <xs:simpleType>
                                            <xs:restriction base="xs:string">
                                                 <xs:enumeration value="aaa"/>
                                                 <xs:enumeration value="bbb"/>
                                                 <xs:enumeration value="ccc"/>
                                            </xs:restriction>
                                       </xs:simpleType>
                                  </xs:element>
                             </xs:sequence>
                        </xs:complexType>
                   </xs:element>
              </xs:sequence>
         </xs:complexType>
    </xs:schema>This has only one element in it that can be used as a root node in the corresponding XML. If the root node of the XML is anything but data, then validation will fail.
    If your schema is too large or cumbersome to redo as that, then you could perform a simple check just to see what the root node is and create an error situation when it is not the data node. Another option could be to create a second schema that has all the nodes (or maybe just the root desired node of type xs:anyType) that is used for cardinality validation. I'm not a fan of using a second schema for validation purposes but it is an option.

  • Simple xml file mapping exception

    How come a file with this content works fine:
    <?xml version="1.0" encoding="utf-8" ?>
    <ns:Data xmlns:ns="http://natoil.com/xi/XI/TestFile">
    <Name>Joe</Name>
    </ns:Data>
    But a file with this content gives a mapping exception:
    <?xml version="1.0" encoding="utf-8" ?>
    <Data>
    <Name>Joe</Name>
    </Data>
    How can I get the second version to work? What am I not understanding?
    thanks-

    Hi Henry:)
    to achive your scenario:
    1. go to the <b>Message Type</b> of your file message (repository)
    2. remove <b>XML namespace</b> - you can leave it empty
    3. check if your mapping based on this message type works - now it shouldn't show the namespace when you go to <i>Source Document View</i> of the Source message
    4. recreate message interface
    5. activate it all again  
    6. now your scenario without the namespace should work:) 
    Regards,
    michal
    Message was edited by: Michal Krawczyk

  • When I try to insert simple xml file in to database get ORA-29532:

    procedure insProc(xmlDoc IN CLOB, tableName IN VARCHAR2) is
    insCtx DBMS_XMLSave.ctxType;
    rows number;
    begin
    insCtx := DBMS_XMLSave.newContext(tableName); -- get the context handle
    rows := DBMS_XMLSave.insertXML(insCtx,xmlDoc); -- this inserts the document
    DBMS_XMLSave.closeContext(insCtx); -- this closes the handle
    end;
    trying to insert one record into table A
    SQL> begin
    2 insProc(
    3 '<?xml version = 1.0?>
    4 <ROWSET>
    5 <ROW num="1">
    6 <A>1</A>
    7 </ROW>
    8 </ROWSET>','A');
    9 end;
    10 /
    begin
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception: oracle.xml.sql.OracleXMLSQLException: Ex
    ORA-06512: at "SYS.DBMS_XMLSAVE", line 115
    ORA-06512: at "VKAKURU.INSPROC", line 6
    ORA-06512: at line 2

    Tried reinstalling Adobe, didn't change anything.I've tried Control click when opening the PDF link, still a blank, grey page.

  • Parsing an xml file using xerces DOM  parser

    Hi
    I want to parse a simple xml file using DOM parser.
    The file is
    <Item>
         <SubItem>
              <title>SubItem0</title>
              <attr1>0</attr1>
              <attr2>0</attr2>
              <attr3>0</attr3>
         </SubItem>
         <SubItem>
              <title>SubItem1</title>
              <attr1>1</attr1>
              <attr2>0</attr2>
              <attr3>0</attr3>
         </SubItem>
         <SubItem>
              <title>SubItem2</title>
              <attr1>1</attr1>
              <attr2>1</attr2>
              <attr3>0</attr3>
              <SubItem>
                   <title>SubItem20</title>
                   <attr1>2</attr1>
                   <attr2>1</attr2>
                   <attr3>0</attr3>
              </SubItem>
              <SubItem>
                   <title>SubItem21</title>
                   <attr1>1</attr1>
                   <attr2>1</attr2>
                   <attr3>0</attr3>
              </SubItem>
         </SubItem>
    </Item>
    I just want to parse this file and want to store the values in desired datastructures,
    I am trying using DOM parser, since it gives a tree structure, which is ok in this case.
    public void init()
              InputReader ir     =new InputReader("Habsys");
              Document      doc     =ir.read("Habitat");
              System.out.println(doc);
              traverse(doc);
    private void traverse(Document idoc)
              NodeList lchildren=idoc.getElementsByTagName("SubItem");
              for(int i=0;i<lchildren.getLength();i++)
                   String lgstr=lchildren.item(i).getNodeName();
                   if(lgstr.equals("SubItem"))
                        traverse(lchildren.item(i));
    private void traverse (Node node) {
    int type = node.getNodeType();
    if (type == Node.ELEMENT_NODE)
    System.out.println ("Name :"+node.getNodeName());
    if(!node.hasChildNodes())
    System.out.println ("Value :"+node.getNodeValue());
    NodeList children = node.getChildNodes();
    if (children != null) {
    for (int i=0; i< children.getLength(); i++)
    traverse (children.item(i));
    But I am not getting required results, a lot of values I am getting as null
    Could anybody tell me how to retrieve the data from the xml file, I simply want to read data and store it in data structures. For eg, for tag Subitem with title as ' SubItem1' has attr1 as '1', attr2 as'0' and attr3 as '0'.
    Thanks
    Gaurav

    Check This Sample Code....
    public void amethod(){
    DocumentBuilderFactory dbf = null;
    DocumentBuilder docBuilder = null;
    Document doc = null;
    try{
         dbf = DocumentBuilderFactory.newInstance();
         db = dbf.newDocumentBuilder();
         doc = db.parse(New File("path/to/your/file"));
         Node root = doc.getDocumentElement();
         System.out.println("Root Node = " + root.getNodeName());
         readNode(root);
    }catch(FactoryConfigurationError fce){ fce.printStackTrace();
    }catch(ParserConfigurationException pce){  pce.printStackTrace();
    }catch(IOException ioe){  ioe.printStackTrace();
    }catch(SAXException saxe){  saxe.printStackTrace();
    private void readNode(Node node) {
    System.out.println("Current Node = " + node.getNodeName());
    readAttributes(node);
    readChildren(node);
    private void readAttributes(Node node) {
    if (!node.hasAttributes())
         return;
    System.out.println("Attributes:");
    NamedNodeMap attrNodes = node.getAttributes();
    for (int i=0; i<attrNodes.getLength(); i++) {
    Attr attr = (Attr)attrNodes.item(i);
    System.out.println(attr.getNodeName() + " => " + attr.getNodeValue());
    private void readChildren(Node node) {
    if (!node.hasChildNodes())
         return;
    System.out.println("Value/s:");
    NodeList childNodes = node.getChildNodes();
    for (int i=0; i<childNodes.getLength(); i++) {
    Node child = (Node)childNodes.item(i);
    if (child.getNodeType() == Node.ELEMENT_NODE) {
    readNode(child);
    continue;
    if (child.getNodeType() == Node.TEXT_NODE) {
    if (child.getNodeValue()!=null)
    System.out.println(child.getNodeValue());

  • I m not able to create xml file in Java Project

    hi all,
    I have created one java project just to try with Ant Builder. I have created one class inside it. and now i m creating an XML file inside that project.
    But as soon as i try to create the File -> New -> File and give the .xml extention of the file this gives error into the project.
    Will you suggest me the solution for that?
    Thanks in advance.

    Assuming that you are facing this problem in NDS, here is the solution.
    Go to Windows--> Preferences --> WorkBench -->File Associations
    In the File Types list select *.xml
    This will display the default associated XML editor as
    XML Editor(default) in the bottom list box.
    Click on add button near the bottom list box and select Text Editor, click Ok.You will see one more entry in the list box as "Text Editor".
    Select this entry and click on the default button.
    Click Ok and close the preferences dialogue.
    Now create a new xml file.You wont see the error this time.
    Please note that this will treat all simple xml files you will create as TEXT Files and always open with Text Editor.You can override this behaviour with right click on the file and select appropriate editor from the "Open With" context menu.
    The error you are talking about is because the XML editor tries to check well-formedness and basic syntax rules for the file that you newly created, actually is a noce feature of the IDE.
    Rgds,
    Amol

  • Error while saving xml file using PDFDocument API

    Hi,
    I am trying to save xml file using byte array obtained from interactive form element in webdynpro java.
    The file gets saved but I get fllowing error message when I open the file.
    The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    An invalid character was found in text content. Error processing resource 'http://uxjciesk.wdf.sap.corp:50000/irj/go/km/doc...
    The code I am trying to achieve the functionality is:
    byte[] byteArray  = wdContext.currentContextElement().getPdfSource();
    IWDPDFDocumentHandler pdfDocumentHandler = WDPDFDocumentFactory.getDocumentHandler();
    IWDPDFDocumentAccessibleContext documentAccessibleContext = pdfDocumentHandler.getDocumentAccessibleContext();
    documentAccessibleContext.setPDF(byteArray);
    IWDPDFDocument pdfDocument = documentAccessibleContext.execute();
    ByteArrayInputStream dataInputStream = (ByteArrayInputStream) pdfDocument.getPDFAsStream();
    further, the datainputstream is used to store the file. I am able to save same xdp template in pdf file format successfully, the error only occurs for xml file storage.
    Please, advise.
    Regards,
    Urvashi

    Hi Urvashi,
        Try this code
              String contentStr = getXMLData(wdContext.currentContextElement().getPdfSource().read(false));
              String data = "";
              ByteArrayOutputStream pdfSourceOutputStream = new ByteArrayOutputStream();
              try {
                   InputStream pdfSourceInputStream = wdContext.currentContextElement().getData().read(false);
                   BufferedInputStream bufferedInputStream = new BufferedInputStream(wdContext.currentContextElement().getData().read(false));
                   int aByte;
                   while ((aByte = bufferedInputStream.read()) != -1) {
                        pdfSourceOutputStream.write(aByte);
                   pdfSourceOutputStream.flush();
                   pdfSourceOutputStream.close();
                   IWDPDFDocument pdfDocument = null;
                   try {
                        // Create an instance for PDFDocumnetHandler
                        IWDPDFDocumentHandler pdfDocumentHandler = WDPDFDocumentFactory.getDocumentHandler();
                        //Create an Inatance for PDFDocumentAccessibleContext
                        IWDPDFDocumentAccessibleContext documentAccessibleContext =     pdfDocumentHandler.getDocumentAccessibleContext();
                        //set the pdf data as OutputStream to the PDFDocumentAccessibleContext instance
                        documentAccessibleContext.setPDF(pdfSourceOutputStream);
                        //call the server to get the data                      
                        pdfDocument = documentAccessibleContext.execute();
                        //get the xml data in a InputStream
                        ByteArrayInputStream dataInputStream = (ByteArrayInputStream) pdfDocument.getData();
                   } catch (Exception e) {
                        data = "Null";
              } catch (IOException e) {
    Regards,
    Mathan

  • How to read an XML file into a java program?

    hi,
    i want to load the following very simple xml file in my java program.
    <root>
    <weblogic>
    <url value="t3://192.168.1.160:7001" />
    <context value="weblogic.jndi.WLInitialContextFactory" />
    </weblogic>
    </root>
    I am getting the error: " Line=1: cvc-elt.1: Cannot find the declaration of element 'root'."
    What might be the problem can anyone help me out.
    My java class code is:
    public class BIXMLReader {
    /** All output will use this encoding */
    static final String outputEncoding = "UTF-8";
    // Parses an XML file and returns a DOM document.
    // If validating is true, the contents is validated against the DTD
    // specified in the file.
    public static Document parseXmlFile(String filename, boolean validating) {
    try {
    // Create a builder factory
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setNamespaceAware(true);
    factory.setIgnoringComments(false);
    factory.setIgnoringElementContentWhitespace(false);
    factory.setCoalescing(false);
    factory.setValidating(validating);
    // Create the builder and parse the file
    System.out.println("filename = " + filename);
    DocumentBuilder db = factory.newDocumentBuilder();
    // Set an ErrorHandler before parsing
    OutputStreamWriter errorWriter = new OutputStreamWriter(System.err, outputEncoding);
    db.setErrorHandler(new MyErrorHandler(new PrintWriter(errorWriter, true)));
    Document doc = db.parse(new File(filename));
    System.out.println(doc.toString());
    return doc;
    } catch (SAXException e) {
    System.out.println("A parsing error occurred; the xml input is not valid. " + e.getMessage());
    } catch (ParserConfigurationException e) {
    System.out.println("Parser configuration exception has occured");
    } catch (IOException e) {
    System.out.println("IO Exception has occured " + e.getMessage());
    return null;
    // Error handler to report errors and warnings
    private static class MyErrorHandler implements ErrorHandler {
    /** Error handler output goes here */
    private PrintWriter out;
    MyErrorHandler(PrintWriter out) {
    this.out = out;
    * Returns a string describing parse exception details
    private String getParseExceptionInfo(SAXParseException spe) {
    String systemId = spe.getSystemId();
    if (systemId == null) {
    systemId = "null";
    String info = "URI=" + systemId +
    " Line=" + spe.getLineNumber() +
    ": " + spe.getMessage();
    return info;
    // The following methods are standard SAX ErrorHandler methods.
    // See SAX documentation for more info.
    public void warning(SAXParseException spe) throws SAXException {
    out.println("Warning: " + getParseExceptionInfo(spe));
    public void error(SAXParseException spe) throws SAXException {
    String message = "Error: " + getParseExceptionInfo(spe);
    throw new SAXException(message);
    public void fatalError(SAXParseException spe) throws SAXException {
    String message = "Fatal Error: " + getParseExceptionInfo(spe);
    throw new SAXException(message);
    }

    ok thanks, i can get the elements, but why did it not validate it?
    I want to read the child nodes of "weblogic" not by their name but by their index. Because i dont want to confine the reader so i want to read all the child nodes of weblogic (looping over them). i m doing the following but its not returning me the correct result and giving me the wrong count of child nodes.
    Element elementNode = (Element)doc.getElementsByTagName("weblogic").item(0);
    NodeList nodeList = elementNode.getChildNodes();
    int length = nodeList.getLength();
    System.out.println("length = "+ length); // the length its giving is 5 but i shuld get only 2
    for(int i=0; i < length; i++) {
    Element elmChild = (Element) nodeList.item(i);
    System.out.println(elmChild.getAttribute("value"));
    what might be the problem?

  • Import of XML file failed in portal using XML Content and Action

    Hi Friends,
    I am trying to import the simple XML file which is just creating the folder in the PORTAL_CONTENT using XML CONTENT AND ACTIONS  which is one way of creating the portal content. GO TO SYSTEM ADMINISTRATION > TRANSPORT > XML CONTENT AND ACTIONS > IMPORT.
    The reason for using this import tool is to upload the backend Business roles, which is not not working on our corporate portal. To test the import functionality I used the following xml file (I got this XML file by exporting the test folder in the portal using the same tool)
    <GenericCreator author="XML Creator" version="XML Automatic Creation" mode="clean,execute" report.level="success" createMode="1" default.locale="en" ignore="false">
    <Context name="portal_content" objectClass="com.sap.portal.pcd.gl.GlContext"></Context>     <Property name="parent1" value="pcd:portal_content"/>
         <Context name="com.dri.fldr.im" objectClass="com.sap.portal.pcd.gl.GlContext" create_as="0" parent="$">
              <Attributes>
                   <Attribute name="com.sap.portal.pcm.Description" type="text">
                        <AttributeValue value="" locale=""/>
                        <Attribute name="administration" type="string">
                             <AttributeValue value=""/>
                        </Attribute>
                        <Attribute name="Inheritance" type="string">
                             <AttributeValue value="NONFINAL"/>
                        </Attribute>
                   </Attribute>
                   <Attribute name="com.sap.portal.pcm.Title" type="text">
                        <AttributeValue value="test" locale=""/>
                        <AttributeValue value="test" locale="en"/>
                        <Attribute name="administration" type="string">
                             <AttributeValue value=""/>
                        </Attribute>
                        <Attribute name="mandatory" type="string">
                             <AttributeValue value="true"/>
                        </Attribute>
                        <Attribute name="Inheritance" type="string">
                             <AttributeValue value="NONFINAL"/>
                        </Attribute>
                   </Attribute>
              </Attributes>
         </Context>
    </GenericCreator>
    SDN BLOCKED THE XML The above XML file works fine in other portal in the landscape but not in corporate portal ( which is freshly build recently).Following error message is display when i am trying to upload the file
    Status Name Action Type Comment
    General Extracting root node E:\usr\sap\EPD\JC00\j2ee\cluster\server0\%USERPROFILE%\AppData\Local\Temp\tmp_masscontent4135391959047431276.xml Failed to extract root node
    General Extracting root node E:\usr\sap\EPD\JC00\j2ee\cluster\server0\%USERPROFILE%\AppData\Local\Temp\tmp_masscontent4135391959047431276.xml Parsing failed .
    Dont know is there a service/ configurations needs to be done to enable this feature?.
    Thanks
    Edited by: hammad on Sep 4, 2009 5:48 PM
    Edited by: hammad on Sep 4, 2009 5:49 PM

    The problem statement is not very clear.
    Try following this how to guide [https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/207a2141-c870-2910-e080-90c920b24f47&overridelayout=true|How-To]
    Best Regards,
    Prasanna K

  • XML file to Internal table through XSLT - Call Transformation

    Hi Friends,
    I am trying to work a scenario where i have a simple XML file and i need to convert the data in to an internal table. When i execute the XSLT seperately, it works fine. I get the output, but when it is invoked through a ABAP program, i am getting the error "The called method START_XSLT_DEBUGGER of the calss CL_WB_XSLT_DEBUGGER returned the exception CX_XSLT_FORMAT_ERROR"
    I feel my XSLT program is not correct, but i am unable to find out what the issue is. Any help is really apreciated. I have gone through the SDN forum replies. But could not figure out what is wrong with my program
    Below given are the details.
    My XML File:
    <?xml version="1.0" encoding="utf-8"?>
    <List>
      <ITEM>
        <ITEMQUALF>ITEM1</ITEMQUALF>
        <MATERIAL>MAT1</MATERIAL>
      </ITEM>
      <ITEM>
        <ITEMQUALF>ITEM2</ITEMQUALF>
        <MATERIAL>MAT2</MATERIAL>
      </ITEM>
      <ITEM>
        <ITEMQUALF>ITEM3</ITEMQUALF>
        <MATERIAL>MAT3</MATERIAL>
      </ITEM>
    </List>
    My XSLT program:
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" xmlns:asx="http://www.sap.com/abapxml" exclude-result-prefixes="asx" version="1.0">
      <xsl:strip-space elements="*"/>
      <xsl:output encoding="utf-8" indent="yes" omit-xml-declaration="yes"/>
      <!--xsl:template match="/"-->
      <xsl:template match="List">
        <asx:abap version="1.0">
          <asx:values>
            <T_ACTUAL>
              <xsl:for-each select="*">
                <ITEMQUALF>
                  <xsl:value-of select="ITEMQUALF" />
                </ITEMQUALF>
                <MATERIAL>
                  <xsl:value-of select="MATERIAL" />
                </MATERIAL>
              </xsl:for-each>
            </T_ACTUAL>
          </asx:values>
        </asx:abap>
      </xsl:template>
    </xsl:transform>
    In my ABAP program:
    REPORT  z_xslt_abap_2.
    TYPES:
      BEGIN OF ty_actual,
        itemqualf   TYPE char50,
        material    TYPE char50,
      END OF ty_actual,
      line_t(4096)  TYPE x,
      table_t       TYPE STANDARD TABLE OF line_t,
      ty_t_actual   TYPE STANDARD TABLE OF ty_actual.
    DATA:
      t_actual    TYPE ty_t_actual,
      t_srctab    TYPE table_t,
      v_filename  TYPE string.
    DATA: gs_rif_ex     TYPE REF TO cx_root,
          gs_var_text   TYPE string.
    v_filename = 'D:\XML\xslt_test.xml'.
    * Function call
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename = v_filename
        filetype = 'BIN'
      TABLES
        data_tab = t_srctab
      EXCEPTIONS
        OTHERS   = 1.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    * Call Transformation
    TRY.
        CALL TRANSFORMATION (`ZXSLT_RAM`)
                SOURCE XML t_srctab
                RESULT     t_actual = t_actual.
      CATCH cx_root INTO gs_rif_ex.
        gs_var_text = gs_rif_ex->get_text( ).
        MESSAGE gs_var_text TYPE 'E'.
    ENDTRY .
    IF t_actual IS NOT INITIAL.
      WRITE: 'Success'.
    ENDIF.
    When i run the XSLT program seperately, this is the output that i get:
    <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
      <asx:values>
        <T_ACTUAL>
          <ITEMQUALF>ITEM1</ITEMQUALF>
          <MATERIAL>MAT1</MATERIAL>
          <ITEMQUALF>ITEM2</ITEMQUALF>
          <MATERIAL>MAT2</MATERIAL>
          <ITEMQUALF>ITEM3</ITEMQUALF>
          <MATERIAL>MAT3</MATERIAL>
        </T_ACTUAL>
      </asx:values>
    </asx:abap>
    I have been stuck with this for more than two days. If anyone can help me out with this, it would be really great. Please let me know, where i am going wrong.
    Thanks in advance.
    Best Regards,
    Ram.

    Hi,
    You can try this sample program, hopefully will help you.
    <a href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/readdatafromXMLfileviaXSLT+program&">Read Data From XML</a>.
    Regards,

  • Binding an XML file into LiveCycle

    Currently we are using a .dat file to populate a .docx file, but we are having issues with layout and formatting and I want to switch it to using a PDF.
    I have found lots of information on adding an XML Data Connection to a PDF, but nothing to do with troubleshooting. I created a simple XML file with three fields and I was able to connect it to a dynamic PDF and then generate the fields into the document. Now when I preview the PDF the values dont fill in, nor when I open it in Reader.
    I have tested this on Designer ES2 and ES3 and Reader X.
    I cant seem to find a way to attach the XML and PDF, but i will include the XML for reference:
    <?xml version="1.0" encoding="UTF-8" ?>
        <draft>
            <number>100040</number>
            <entered>02-18-2015</entered>
            <name>Name</name>
        </draft>

    Hello,
    I believe I spoke too soon, the data now binds when I Preview the PDF in LiveCycle, but when I save it and then open it in Acrobat Pro or Reader, it does not bind the XML data in.
    Any help is appreciated.
    Ian

  • XML file Issue..

    Hi guys,
    My question is in a real time scenario how the file is asked for ?
    As for testing a simple file scenario we usually get the sample file in XI from Message mapping tool only, this sample file contains primary tag of message type with attribute of namespace  : <b><ns0:MT_FILE_INPUT xmlns:ns0="http://bsptrng.file2file"> </b> "
    <ns0:MT_FILE_INPUT xmlns:ns0="http://bsptrng.file2file">
       <Record>
          <Row>
             <FirstName>q</FirstName>
             <LastName>R</LastName>
             <MiddleName>S</MiddleName>
             <City>Delhi</City>
           </Row>
       </Record>
    </ns0:MT_FILE_INPUT>
    but when a client will provide us a file it will be a simple xml file like...
    <Record>
          <Row>
             <FirstName>q</FirstName>
             <LastName>R</LastName>
             <MiddleName>S</MiddleName>
             <City>Delhi</City>
           </Row>
       </Record>
    As you can see primary tag of Message type with namespace will be missing...
    because of that mapping exception is thrown in pipeline service....
    <b>My question is how to tackle this ...</b>
    Regards,

    Hi
    While creating the message type there will be a tab called "XML Namespace", remove the entry of http://bsptrng.file2file from there.
    regards
    Sam

  • XML file issue real time

    Hi guys,
    My question is in a real time scenario how the file is asked for ?
    As for testing a simple file scenario we usually get the sample file in XI from Message mapping tool only, this sample file contains primary tag of message type with attribute of namespace  : <b><ns0:MT_FILE_INPUT xmlns:ns0="http://bsptrng.file2file"> </b> "
    <ns0:MT_FILE_INPUT xmlns:ns0="http://bsptrng.file2file">
       <Record>
          <Row>
             <FirstName>q</FirstName>
             <LastName>R</LastName>
             <MiddleName>S</MiddleName>
             <City>Dehradun</City>
           </Row>
       </Record>
    </ns0:MT_FILE_INPUT>
    but when a client will provide us a file it will be a simple xml file like...
    <Record>
          <Row>
             <FirstName>q</FirstName>
             <LastName>R</LastName>
             <MiddleName>S</MiddleName>
             <City>Dehradun</City>
           </Row>
       </Record>
    As you can see primary tag of Message type with namespace will be missing...
    because of that mapping exception is thrown in pipeline service....
    <b>My question is how to tackle this ...</b>
    Regards,

    Why you can not create XSD with the client specification?
    Like This:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
         <xs:element name="City">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                        <xs:enumeration value="Dehradun"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:element name="FirstName">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                        <xs:enumeration value="q"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:element name="LastName">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                        <xs:enumeration value="R"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:element name="MiddleName">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                        <xs:enumeration value="S"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:element name="Record">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="Row" type="RowType"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:complexType name="RowType">
              <xs:sequence>
                   <xs:element ref="FirstName"/>
                   <xs:element ref="LastName"/>
                   <xs:element ref="MiddleName"/>
                   <xs:element ref="City"/>
              </xs:sequence>
         </xs:complexType>
    </xs:schema>
    Regards.
    Message was edited by:
            Iñaki Vila

  • UCCX8 - script that reads XML file failing, used to work fine in UCCX 5 and 7

    I have a existing script that I've used many times before to read a simple XML file to check open hours for a queue. In both UCCX 5 and 7
    I loaded up all my same scripts, documents , structure, etc..
    When I run script I get the below error.
    The error implies its a security problem but I also wonder if it could simply be a incorrect directory structure as well
    I have the document located in the repository under en\GlobalDocuments\HolidayDatesWithHours.xml
    Is there a differnet way we need to reference documents in UCCX 8 than 5 or 7
    I think I doing it correctly, using the CreateFileDocument and CreateXMLDocument steps, NOT trying to access the filesystem directly
    Do I need to use forward slashes in the file path for UCCX 8 ,
    Any ideas where to look.  This same error appears wherever in my script that I'm trying to read a XML file. different scripts as well so it seems that I'm doing something consistently wrong that used to work correctly on multiple UCCX 5&7 servers in the past.
    Thanks.
    <ERROR>
    527258: Aug 23 14:19:36.635 CDT %MIVR-SECURITY_MGR-2-SECURITY_VIOLATION:Security violation: Permission Name=.\documents\user\en\GlobalDocuments\\HolidayDatesWithHours.xml,Permission Action=read,Application=TrainingQueue,Script=CoreBTS-QueueScript.aef,Step id=437,Step Class=com.cisco.wfframework.obj.WFBeanStep,Step Description=boolTrueFalse = objFile.exists(),Expression=null,Exception=java.security.AccessControlException: access denied (java.io.FilePermission .\documents\user\en\GlobalDocuments\\HolidayDatesWithHours.xml read)
    </END ERROR>

    It should be fine, I assume you mean to reference the full location of your files such as:
    DOC[en\GlobalDocuments\HolidayDatesWithHours.xml]
    Or you could use a document variable such as:
    docVariable = DOC[en\GlobalDocuments\HolidayDateWithHours.xml]
    then in the script reference that:
    doc = Create XML Document (docVariable)

Maybe you are looking for

  • Screen is blank and stays on

    screen is blank but stays on lit.

  • IBook G3 as file server

    I am looking for some information on using an old iBook G3 as a file server. Specifically I am wondering if it will be possible to store HD video on this computer (or attached external drives) then link this to my airport extreme base station for wir

  • ICHAT AV & KYE 320S USB Webcam

    I installed this low cost "genius" (25US$) webcam and it works fine with the IChatUSECam driver but I cannot "zoom out" so only a close up of my face is visible.. This is obviously better than nothing and a great economical solution, but it would be

  • HT1414 I get an error code 1418 while formatting my ipod. How do i proceed with formatting it?

    Hi My ipod nano has been corrupted and I am unable to format it. An error code #1418 appears when i try formatting. Can anyone help me to format the same?

  • Computer renamed automatically after 10.5.7 update

    The standalone Combo update I did on my two Macs went generally well even if so many experienced major problems (read other threads). I just got the recurring blue screen when restarting my iMac (only) but this was solved simply by shutting it off an