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

Similar Messages

  • When parsing a large size xml file , OutOfMemorry exception(attach code)

    Dear all ,
    I met a OutOfMemorry exception when I parse a xml file (20M) in my application(I extract data in xml file for building my application data), but I found that it take long time(for 2 more minutes) even just searching the xml file , because my application is viewed by web page , so it's too bad for waiting.
    what I used is org.jdom.input.SAXBuilder(jdom1.0beta8-dev) , and my xml file structure is like :
    <errors>
    <item1>content</item1>
    <item2>content</item2>
    </errors>
    and this is my source code of parsing xml file :
    import java.io.*;
    import java.text.*;
    import java.util.*;
    import org.jdom.*;
    import org.jdom.input.*;
    import org.jdom.output.*;
    public class XMLProperties {
        private File file;
        private Document doc;
        private Map propertyCache = new HashMap();
        public XMLProperties(String filename) {
                SAXBuilder builder = new SAXBuilder();
                // Strip formatting
                DataUnformatFilter format = new DataUnformatFilter();
                builder.setXMLFilter(format);
                long time_start = System.currentTimeMillis();
                Runtime run = Runtime.getRuntime();
                doc = builder.build(new File(filename));
                System.out.println("Build doc memory ="+(run.totalMemory()-
                         run.freeMemory())/1024+"K");
                System.out.println("Build doc used time :"+(
                         System.currentTimeMillis()-time_start)/1000+" s");
            catch (Exception e) {
                System.err.println("Error creating XML parser in "
                    + "PropertyManager.java");
                e.printStackTrace();
         public String [] getChildrenProperties(String parent) {
            // Search for this property by traversing down the XML heirarchy.
            Element element = doc.getRootElement();
            element = element.getChild(parent);
            if (element == null) {
                // This node doesn't match this part of the property name which
                // indicates this property doesn't exist so return empty array.
                return new String [] { };
            // We found matching property, return names of children.
            List children = element.getChildren();
            int childCount = children.size();
            String [] childrenNames = new String[childCount];
            for (int i=0; i<childCount; i++) {
                childrenNames[i] = ((Element)children.get(i)).getName();
            return childrenNames;
        }the test main class:
    import java.util.Map;
    import java.util.HashMap;
    import org.jdom.*;
    import org.jdom.input.*;
    public class MyTest {
      public static void main(String[] args) {
        long time_start = System.currentTimeMillis();
        Runtime run = Runtime.getRuntime();
        Map childs = new HashMap();
        System.out.println("Used memory before="+(run.totalMemory()-run.freeMemory())/1024 + "K");
        XMLProperties parser = new XMLProperties("D:\\projects\\edr\\jsp\\status-data\\edr-status-2003-09-01.xml");
        String[] child = parser.getChildrenProperties("errors");
        for(int i=0;i<child.length;i++) {
    //      childs.put(new Integer(i), child);
    if(i%1000 == 0) {
    System.out.println("Used memory while="+(run.totalMemory()-run.freeMemory()/1024+"K"));
    System.out.println("child.length="+child.length);
    System.out.println("Used memory after="+(run.totalMemory()-run.freeMemory())/1024+"K");
    System.out.println("Time used: "+(System.currentTimeMillis()-time_start)/1000+"s");
    The result is : Used memory before=139K
    Used memory while=56963K
    Used memory after=51442K
    child.length=27343
    Time used: 146s
    is that some way to solve this problem ?
    Thanks for your help

    I met a OutOfMemorry exception when I parse a xml
    l file (20M) in my application(I extract data in xml
    file for building my application data)...Rule of thumb for parsing XML: the memory you need is about 10 times the size of the XML file. So in your case you need 200 MB of free memory.
    , but I found
    that it take long time(for 2 more minutes) even just
    searching the xml file , because my application is
    viewed by web page...Then you need to redesign your application. Parsing 20 megabytes of XML for every request is -- as you can see -- impractical. Sorry I can't suggest how, since I have no idea what your application is.

  • 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 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

  • XML File Mapping Syntax

    Xcelsius 2008
    I have an XML file sitting in the same dir as the .xlf file.  Path to the XML is:
    servername\d$\Xcelsius\XML\PatSat4.xml
    Entry in Data Manager as  both a hard-coded path above and pointing to a cell containing the path.
    Preview SWF functions as expected, editing the XML will refresh with the refresh button.
    Exporting to a standalone SWF file sitting in the same dir fails with Error # 2032 meaning it doesn't see the XML file.
    Tried several combinations of  forward vs back-slash.
    Preceding with file://, file:
    , file:
    without success.
    Using only filename PatSat4.xml doesn't work.
    Thing is: works in preview mode, not as export.
    Anybody know either the proper syntax or the trick?
    TIA

    This is an ADOBE issue based on their security methodology/policy.  Similar to the issue when xml files are coming from a server/across domains.
    You may find more info on error messages at
    http://livedocs.adobe.com/flex/3/html/help.html?content=rsl_10.html
    To resolve the issue, go to
    http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
    and flag the folders (or parent folders) holding the xml files as "trusted".  You will need to do this for every (physical) machine you or your customers are working with. The xml files need not be in the same folder as the xlf or swf file.
    Hope this helps

  • 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.

  • 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

  • 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?

  • 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,

  • 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)

  • How to get ALL validate-errors while insert xml-file into xml_schema_table

    How to get all validate-errors while using insert into xml_schema when having a xml-instance with more then one error inside ?
    Hi,
    I can validate a xml-file by using isSchemaValid() - function to get the validate-status 0 or 1 .
    To get a error-output about the reason I do validate
    the xml-file against xdb-schema, by insert it into schema_table.
    When more than one validate-errors inside the xml-file,
    the exception shows me the first error only.
    How to get all errors at one time ?
    regards
    Norbert
    ... for example like this matter:
    declare
         xmldoc CLOB;
         vStatus varchar
    begin     
    -- ... create xmldoc by using DBMS_XMLGEN ...
    -- validate by using insert ( I do not need insert ;-) )      
         begin
         -- there is the xml_schema in xdb with defaultTable XML_SCHEMA_DEFAULT_TABLE     
         insert into XML_SCHEMA_DEFAULT_TABLE values (xmltype(xmldoc) ) ;
         vStatus := 'XML-Instance is valid ' ;
         exception
         when others then
         -- it's only the first error while parsing the xml-file :     
              vStatus := 'Instance is NOT valid: '||sqlerrm ;
              dbms_output.put_line( vStatus );      
         end ;
    end ;

    If I am not mistaken, the you probably could google this one while using "Steven Feuerstein Validation" or such. I know I have seen a very decent validation / error handling from Steven about this.

  • 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

  • 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

  • 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());

Maybe you are looking for