Exception on creation of DOM from string xml

Hi everybody,
I am creating Dom from a string cml but getting following exception
org.xml.sax.SAXParseException: name expected
XML file is < name > < age > 23 < /age > < /name >
JSP page is:-
<%@ page import="java.util.*" %>
<%@ page import="java.net.*" %>
<%@ page import="javax.xml.parsers.*" %>
<%@ page import="org.xml.sax.*" %>
<%@ page import= "org.w3c.dom.*;" %>
<HTML>
<BODY>
<%
String str= request.getParameter("user");
out.print(str);
try{
Document XMLDoc=DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(str)));
out.print(XMLDoc);
catch( SAXParseException s){out.print("Parse excepttion occured   " + s + " Message is --> " + s.getMessage()   );}
catch (SAXException sa){out.print("Sax Exception occured" + sa +"   " ) ;}
     catch (IOException fgh){out.print("IO Exception occured");}
     catch( ParserConfigurationException e) {out.print("Parser Configuration Exception occured"); }
%>
</BODY>
</HTML>

Hi Hamsa,
Did you also create and configure an "Execution Destination"?
You can test the Metadata destination configuration on Web Service Navigator.
On the web service navigator (http://hostname:portnumber/wsnavigator) search in the metatda destination you have created for the service you imported in web dynpro as a model. If you can find it there test it on the ws navigator.
Best regards,
Yasar

Similar Messages

  • ERROR Could not create DOM from control.xml

    Hi All,
    I am installaing 4.7EE on Sun Solaris 5.9 SPARC with Oracle and JDK version is 1.4.2_08. When i am running sapinst, sapinst GUI opens and after when i am selecting the Central installtion and i click on Next it giving error message that
    WARNING Could not read file control.xml. Please make sure that you called SAPinst with the correct control file (the control file is given to SAPinst as its first command line parameter or as value of the command line property SAPINST_CONTROL_URL)
    ERROR Could not create DOM from control.xml
    How to solve this error. I have searched in SDN but i am unable to get the solution.
    Mahesh C

    Hi Kiran,
    I have given all permissions to the control file. But these control files are in different places /SAPINST/UNIX/SUNOS_64/PATCOL640/WEBAS630 and ORA, DB2, DB6, IND, INF, ADA in these folders i can c the Control.xml files. But i have given all read write and execute permissions but still its getting the same error. I have downloaded the same IM for 3 times and tried.. But the result is the same.
    Is there any other way of work around for this...
    Thanks
    Mahesh C

  • Exception while loading properties from an xml file

    Hi all,
    I've got a problem while loading properties from an XML file:
    java.lang.ClassCastException: org.apache.xerces.dom.DeferredCommentImpl cannot be cast to org.w3c.dom.Element
    ERROR - Cannot load properties from the specified file <./conf/login.prop> java.lang.ClassCastException: org.apache.xerces.dom.DeferredCommentImpl cannot be cast to org.w3c.dom.Element
         at java.util.XMLUtils.importProperties(XMLUtils.java:97)
         at java.util.XMLUtils.load(XMLUtils.java:69)
         at java.util.Properties.loadFromXML(Properties.java:852)
         at g2.utility.HRPMProperties.<init>(HRPMProperties.java:78)
         at g2.utility.HRPMProperties.getInstance(HRPMProperties.java:94)
         at g2.gui.workers.ApplicationSwingWorker.<init>(ApplicationSwingWorker.java:36)
         at g2.main.Main.main(Main.java:37)but this code worked before, and I've got the xerces and xercesImpl packages in the classpath, anyone can give me an hint on how to fix the problem?

    Here there's the code that instantiates the HRPMProperties object loading the property file:
    public class HRPMProperties extends Properties {
         * A reference to myself.
        protected static HRPMProperties mySelf = null;
         * The property file to which load the configuration.
        protected static String propertyFile = "./conf/login.prop";
          * A set of static strings used as keys in the properties file.
         public final static String DATABASE_URL = "database_url";
         public final static String DATABASE_USERNAME = "database_username";
         public final static String DATABASE_PASSWORD = "database_password";
         public final static String REAL_USERNAME = "real_username";
         public final static String REAL_PASSWORD = "real_password";
         public final static String PHANTOM_LOGIN = "login_thru_phantom_user";
         public final static String AUTOCONNECT = "autoconnect";
         public final static String TRANSLATION_FILE = "translation_file";
         * Builds up an empty properties map.
        protected HRPMProperties(){
         super();
         this.reload();
         * Builds up the property map from the specified input file. <B> The file must be in XML format</B>.
         * In case of exception and/or problems reading from the specified file, an empty property map is returned.
         * @param fileName the path and the name of the file with the XML representation of the properties.
        protected HRPMProperties(String fileName){
         super();
         try{
             this.loadFromXML(new FileInputStream(fileName));        
         }catch(Exception e){
             Logger.error("Cannot load properties from the specified file <"+fileName+"> " + e);
             e.printStackTrace();
         * Provides an instance of the property class loaded from the default configuration file.
         * @return the property instance
        public static final HRPMProperties getInstance(){
         if( HRPMProperties.mySelf != null )
             return HRPMProperties.mySelf;
         else{
             HRPMProperties.mySelf = new HRPMProperties(HRPMProperties.propertyFile);
             return HRPMProperties.mySelf;
    }The constructor is the one triggering the exception, so there's a problem loading the XML property file.

  • Xerces - Parse XML from String

    I am trying to parse an xml string using Xerces.
    I have the following code:
    String xml = <segments meters="8643" seconds="538" distance="5.4 mi" time="8 mins"><segment id="seg0"  pointIndex="0" meters="122" seconds="11"  distance="0.1 mi"  time="11 secs">Head  <b>southwest</b> from <b>B Ave NE</b>
    </segment>
    <segment id="seg1" pointIndex="2" meters="239" seconds="22" distance="0.1 mi" time="21 secs">Turn <b>left</b> at <b>19th St NE</b></segment>
    <segment id="seg2" pointIndex="5" meters="2985" seconds="192" distance="1.9 mi" time="3 mins">Turn <b>right</b> at <b>1st Ave NE</b></segment>
    <segment id="seg3" pointIndex="43" meters="3280" seconds="211" distance="2.0 mi" time="3 mins">Continue on <b>1st Ave SW/1st Ave NW</b></segment>
    <segment id="seg4" pointIndex="96" meters="158" seconds="10" distance="0.1 mi" time="10 secs">Bear <b>right</b> at <b>US-151-BR S</b></segment>
    <segment id="seg5" pointIndex="102" meters="1859" seconds="93" distance="1.2 mi" time="1 min">Turn <b>right</b> at <b>16th Ave SW</b></segment>;
    XMLReader reader = new SAXParser();
    reader.setContentHandler(new Handler());
    reader.parse(xml);I am getting the followoing error:
    org.xml.sax.SAXParseException: File "<segments meters="8643" seconds="538" distance="5.4 mi" time="8 mins"><segment id="seg0" pointIndex="0" meters="122" seconds="11" distance="0.1 mi" time="11 secs">Head  <b>southwest</b> from <b>B Ave NE</b></segment><segment id="seg1" pointIndex="2" meters="239" seconds="22" distance="0.1 mi" time="21 secs">Turn <b>left</b> at <b>19th St NE</b></segment><segment id="seg2" pointIndex="5" meters="2985" seconds="192" distance="1.9 mi" time="3 mins">Turn <b>right</b> at <b>1st Ave NE</b></segment><segment id="seg3" pointIndex="43" meters="3280" seconds="211" distance="2.0 mi" time="3 mins">Continue on <b>1st Ave SW/1st Ave NW</b></segment><segment id="seg4" pointIndex="96" meters="158" seconds="10" distance="0.1 mi" time="10 secs">Bear <b>right</b> at <b>US-151-BR S</b></segment><segment id="seg5" pointIndex="102" meters="1859" seconds="93" distance="1.2 mi" time="1 min">Turn <b>right</b> at <b>16th Ave SW</b></segment></segments>" not found.
         at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1219)
         at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocument(DefaultEntityHandler.java:501)
         at org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:314)
         at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1097)
         at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1139)
         at com.shiftyeyes.xmlTest.main(xmlTest.java:34)
    Exception in thread "main" anyone know how I can fix this? Thanks!!

    reader.parse(new InputSource(new StringReader(xml)));

  • Join Nodes from different XML strings

    Hi,
    Please can you help me in joining 2 similar XML documents such that required nodes are appended.
    Need to combine the nodes of XML (input source:String) A and B as below:
    A:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MSG_Cont xmlns:ns0="http://xmlns.sample.xml.com/Xref">
        <ns0:Header>
            <ns0:ProjectName>Services-1</ns0:ProjectName>
            <ns0:TimeStamp>11-05-2007 08:24:08</ns0:TimeStamp>
        </ns0:Header>
        <ns0:Body>
            <ns0:MID_INTER_XREF>
                <ns0:INT_ID>0</ns0:INT_ID>
                <ns1:CDS_Person xmlns:ns1="http://xmlns.sample.xml.com/PXref">
                    <ns1:PERS_TITLE>MGR</ns1:PERS_TITLE>
                    <ns1:PERS_FIRST_NM>BUY</ns1:PERS_FIRST_NM>
                    <ns1:PERS_LAST_NM>INT</ns1:PERS_LAST_NM>
                </ns1:CDS_Person>
                <ns0:CLS>48</ns0:CLS>
                <ns0:COM>410</ns0:COM>
                <ns0:SW>P</ns0:SW>
                <ns0:ALT_ID>  </ns0:ALT_ID>
                <ns0:ACTV_CD>I</ns0:ACTV_CD>
                <ns0:LST_UPDT_DT>2006-01-30</ns0:LST_UPDT_DT>
            </ns0:MID_INTER_XREF>
            <ns0:MID_INTER_XREF>
             <ns0:INT_ID>96</ns0:INT_ID>
             <ns1:CDS_Person xmlns:ns1="http://xmlns.sample.xml.com/PXref">
              <ns1:PERS_TITLE>MGR</ns1:PERS_TITLE>
              <ns1:PERS_FIRST_NM>TEMP</ns1:PERS_FIRST_NM>
              <ns1:PERS_LAST_NM>GRT</ns1:PERS_LAST_NM>
             </ns1:CDS_Person>
             <ns0:CLS>48</ns0:CLS>
             <ns0:COM>935</ns0:COM>
             <ns0:SW>D</ns0:SW>
             <ns0:ALT_ID>F$</ns0:ALT_ID>
             <ns0:ACTV_CD>A</ns0:ACTV_CD>
             <ns0:LST_UPDT_DT>2006-01-30</ns0:LST_UPDT_DT>
         </ns0:MID_INTER_XREF>
        </ns0:Body>
    </ns0:MSG_Cont>B:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MSG_Cont xmlns:ns0="http://xmlns.sample.xml.com/Xref">
        <ns0:Header>
            <ns0:ProjectName>Services-1</ns0:ProjectName>
            <ns0:TimeStamp>11-05-2007 08:24:08</ns0:TimeStamp>
        </ns0:Header>
        <ns0:Body>
            <ns0:MID_INTER_XREF>
                <ns0:INT_ID>0</ns0:INT_ID>
                <ns1:CDS_Person xmlns:ns1="http://xmlns.sample.xml.com/PXref">
                    <ns1:PERS_TITLE>TECH</ns1:PERS_TITLE>
                    <ns1:PERS_FIRST_NM>BUY</ns1:PERS_FIRST_NM>
                    <ns1:PERS_LAST_NM>INT</ns1:PERS_LAST_NM>
                </ns1:CDS_Person>
                <ns0:CLS>98</ns0:CLS>
                <ns0:COM>910</ns0:COM>
                <ns0:SW>P</ns0:SW>
                <ns0:ALT_ID>  </ns0:ALT_ID>
                <ns0:ACTV_CD>I</ns0:ACTV_CD>
                <ns0:LST_UPDT_DT>2006-01-30</ns0:LST_UPDT_DT>
            </ns0:MID_INTER_XREF>
            <ns0:MID_INTER_XREF>
             <ns0:INT_ID>96</ns0:INT_ID>
             <ns1:CDS_Person xmlns:ns1="http://xmlns.sample.xml.com/PXref">
              <ns1:PERS_TITLE>TECH</ns1:PERS_TITLE>
              <ns1:PERS_FIRST_NM>TEMP</ns1:PERS_FIRST_NM>
              <ns1:PERS_LAST_NM>GRT</ns1:PERS_LAST_NM>
             </ns1:CDS_Person>
             <ns0:CLS>98</ns0:CLS>
             <ns0:COM>435</ns0:COM>
             <ns0:SW>D</ns0:SW>
             <ns0:ALT_ID>F$</ns0:ALT_ID>
             <ns0:ACTV_CD>A</ns0:ACTV_CD>
             <ns0:LST_UPDT_DT>2006-01-30</ns0:LST_UPDT_DT>
         </ns0:MID_INTER_XREF>
        </ns0:Body>
    </ns0:MSG_Cont>Combined (desired Output):
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MSG_Cont xmlns:ns0="http://xmlns.sample.xml.com/Xref">
        <ns0:Header>
            <ns0:ProjectName>Services-1</ns0:ProjectName>
            <ns0:TimeStamp>11-05-2007 08:24:08</ns0:TimeStamp>
        </ns0:Header>
        <ns0:Body>
            <ns0:MID_INTER_XREF>
                <ns0:INT_ID>0</ns0:INT_ID>
                <ns1:CDS_Person xmlns:ns1="http://xmlns.sample.xml.com/PXref">
                    <ns1:PERS_TITLE>MGR</ns1:PERS_TITLE>
                    <ns1:PERS_FIRST_NM>BUY</ns1:PERS_FIRST_NM>
                    <ns1:PERS_LAST_NM>INT</ns1:PERS_LAST_NM>
                </ns1:CDS_Person>
                <ns0:CLS>48</ns0:CLS>
                <ns0:COM>410</ns0:COM>
                <ns0:SW>P</ns0:SW>
                <ns0:ALT_ID>  </ns0:ALT_ID>
                <ns0:ACTV_CD>I</ns0:ACTV_CD>
                <ns0:LST_UPDT_DT>2006-01-30</ns0:LST_UPDT_DT>
            </ns0:MID_INTER_XREF>
            <ns0:MID_INTER_XREF>
             <ns0:INT_ID>96</ns0:INT_ID>
             <ns1:CDS_Person xmlns:ns1="http://xmlns.sample.xml.com/PXref">
              <ns1:PERS_TITLE>MGR</ns1:PERS_TITLE>
              <ns1:PERS_FIRST_NM>TEMP</ns1:PERS_FIRST_NM>
              <ns1:PERS_LAST_NM>GRT</ns1:PERS_LAST_NM>
             </ns1:CDS_Person>
             <ns0:CLS>48</ns0:CLS>
             <ns0:COM>935</ns0:COM>
             <ns0:SW>D</ns0:SW>
             <ns0:ALT_ID>F$</ns0:ALT_ID>
             <ns0:ACTV_CD>A</ns0:ACTV_CD>
             <ns0:LST_UPDT_DT>2006-01-30</ns0:LST_UPDT_DT>
         </ns0:MID_INTER_XREF>
         <ns0:MID_INTER_XREF>
             <ns0:INT_ID>0</ns0:INT_ID>
             <ns1:CDS_Person xmlns:ns1="http://xmlns.sample.xml.com/PXref">
              <ns1:PERS_TITLE>TECH</ns1:PERS_TITLE>
              <ns1:PERS_FIRST_NM>BUY</ns1:PERS_FIRST_NM>
              <ns1:PERS_LAST_NM>INT</ns1:PERS_LAST_NM>
             </ns1:CDS_Person>
             <ns0:CLS>98</ns0:CLS>
             <ns0:COM>910</ns0:COM>
             <ns0:SW>P</ns0:SW>
             <ns0:ALT_ID>  </ns0:ALT_ID>
             <ns0:ACTV_CD>I</ns0:ACTV_CD>
             <ns0:LST_UPDT_DT>2006-01-30</ns0:LST_UPDT_DT>
         </ns0:MID_INTER_XREF>
         <ns0:MID_INTER_XREF>
             <ns0:INT_ID>96</ns0:INT_ID>
             <ns1:CDS_Person xmlns:ns1="http://xmlns.sample.xml.com/PXref">
              <ns1:PERS_TITLE>TECH</ns1:PERS_TITLE>
              <ns1:PERS_FIRST_NM>TEMP</ns1:PERS_FIRST_NM>
              <ns1:PERS_LAST_NM>GRT</ns1:PERS_LAST_NM>
             </ns1:CDS_Person>
             <ns0:CLS>98</ns0:CLS>
             <ns0:COM>435</ns0:COM>
             <ns0:SW>D</ns0:SW>
             <ns0:ALT_ID>F$</ns0:ALT_ID>
             <ns0:ACTV_CD>A</ns0:ACTV_CD>
             <ns0:LST_UPDT_DT>2006-01-30</ns0:LST_UPDT_DT>
         </ns0:MID_INTER_XREF>
        </ns0:Body>
    </ns0:MSG_Cont>Trying to use the dom document.importNode() and appendChild(). But, looks like appendChild removes any already existing node (in this case - ns0:MID_INTER_XREF).
    Any help appreciated.
    TIA,
    Praveen

    Well, the requirement was to have elements from different XML in a single master XML. The way we achieved this - read from each XML, append to a string buffer and construct the combined XML (which passes on for use elsewhere).
    Hope this helps anyone with a similar requirement.
    Many Thanks for looking.

  • Assigning a node value from an XML variable to a String type  in Weblogic Process Integrator

    Hi,
    Is there any way to assign a node value from an XML variable to a String variable
    in Weblogic Process Integrator...
    Thanx.
    Narendra.

    Nerendra
    Are you talking about using Xpath on the XML document and assigning to a
    variable, it is unclear what you are asking
    Tony
    "Narendra" <[email protected]> wrote in message
    news:3bba1215$[email protected]..
    >
    Hi,
    Is there any way to assign a node value from an XML variable to a Stringvariable
    in Weblogic Process Integrator...
    Thanx.
    Narendra.

  • Creation of a shipping notification for a PO in EBP from a XML file via XI.

    Hi everybody.
    We are trying to create a shipping notification for a Purchase Order in Enterprise Buyer from a XML file via XI.
    For to do it, we are using ‘DespatchedDeliveryNotification_In’ message interface (transaction SPROXY).
    But when we execute it, the system show us next message:
    "An error occured within an XI interface: An exception with the type CX_GDT_CONVERSION occurred, but was neither handled locally, nor declared in a RAISING clause Programm: SAPLBBP_BD_MAPPING_SAPXML1; Include: LBBP_BD_MAPPING_SAPXML1F5B; Line: 4"
    No more information is available.
    Is there any additional transaction to see more information about the error message?
    Is there any documentation about this XML file, mandatory fields, examples…?
    We populated some fields in our XML file, but we do not know if the problem is with mandatory fields, data, program error…
    I will thank for any information
    Thanks in advance.
    Raúl Moncada.

    Raúl,
    This is because of the inbound UOM.
    The include LBBP_BD_MAPPING_SAPXML1F5B is in charge of mapping the item Unit Of Mesure (UOM) sent in the ASN XML file (it should be an ISO code).
    You can test FM UNIT_OF_MEASURE_ISO_TO_SAP with this inbound ISO code.
    PS: you should create an OSS message so the mapping sends back an error message instead of generating an uncatched exception (that generates a dump).
    Rgds
    Christophe
    PS: please reward points for helpfull answers

  • How can I read an XML string that's not from an XML file?

    I've got a script I'm trying to setup that communicates over a socket to retrieve different directions from a custom built Java program.  The Java program listens to requests from the Adobe scripting engine (in my case it's a Photoshop script) on a socket and immediately responds with the next set of directions.  These directions are currently in XML format.  The issue I'm having is that I can't parse the XML data since it's entered into a new XML object from a string rather than being read from a file.  Even without the socket code, you can see the issue by doing the following:
    var xml = new XML("<test><data>hey!</data></test>");
    alert(xml.test.data);
    alert(xml);
    The first alert "should" return "hey!" (without quotes, of course), but it doesn't, while the second alert returns what you would expect it to:
    <test>
        <data>hey!</data>
    </test>
    It works fine if read from an XML file, but from a string, like shown above, it just presents an empty alert box when attempting to access "xml.test.data".  Any ideas on how to fix this issue?  Can it be fixed?  Has it been fixed in newer versions (I'm currently using CS4)?
    Thanks in advance for any help!

    Duh... found my error... I was attempting to access the data by referencing the created "root" element.  Since <test> is the very first element tag, it's setup as the root element, which you don't need to reference.  Changing the alert to alert(xml.data); fixed it.
    Now I just feel dumb, lol...

  • Best method to transfer large strings (XML data) to/from stored procedure

    Hi!
    I'm trying to call a PL/SQL procedure from Java. The procedure inputs a string (XML) that is parsed, and returns a result string (also XML).
    Typical size of the string is 5kb -> 1mb.
    I can see two possible solutions:
    1) String / LONG
    2) CLOB (Using DMBS_LOB.createTemporary and getting a CLOB locator and passing the locator to the stored procedure)
    Does anyone have other suggestions?
    What is the fastest method for transferring XML structures from to and from stored procedures?
    Anders

    Anders,
    I would say it depends on your requirement. Both the methods have some advantages and disadvantages.
    Using a CLOB means that you have to use vendor specific libraries but this is more extendible and I fast too.
    Using String/Long will be more portable in the long run but again you lose on speed/performance.
    Just a doubt of mine... If I got it correct, you are transforming one XML to another XML based on some conditions. Why dont you use XSL and XSL StyleSheet Processor packaged with XDK for this? I think this would be the fastest way.
    Hope this helps.

  • Fastest way to remove html tags except url in href from string using java

    Hi All,
    Please suggest the, fastest way to remove html tags (stripe) except url in href of an anchor tag from string using java.
    Please help me with the best solution as I use parser but it's taking time to remove the html tags from string of file.
    I want the program should give the performance as 1 millisecond for 2kb file.
    Please help me out... Thanks in advance

    Hi,
    how can I replace the anchor tag in a string, by the url in the href of that anchor tag by using jsoup,
    e. g.
    <code>
    suppose input text is :
    test, string using, dsfg, 1:14 PM, < a t a r ge t="_ablank" s t y l e = " color: red" h r e f = " h t t p : / / t e s t u r l . c o m / i n d e x . j s p ? a = 1 2 3 4 " > s u p p o r t < / a >, s c h e d u l a r t a g , < a t a r g e t = " _ vbblank " s t y l e = " c o l o r : g r e e n " h r e f = " h t t p : / / t e s t u r l g r e e n . c o m / i n d e x . j s p ? a = a s d f a s df 4 " > s u pp o r t r e q < / a > a s d f pq r
    then out put text should be :
    test, string using, dsfg, 1:14 PM, http://testurl.com/index.jsp?a=1234, schedular tag, http://testurlgreen.com/index.jsp?a=asdfasdf4 asdf pqr
    </code>
    Please help at the earliest..
    Thanks in advance
    as this text editor is not supporting html anchor tag the example is not displaying correctly
    Edited by: 976815 on Dec 17, 2012 5:17 AM

  • Creation of XSD from XML

    Hi SDN,
    Can anybody guide me to solve this problem.
    I have created a custom repository as per the requirement(repository has text fields, taxonomy fields etc). I have created a XSD structure using xomLite from the XML(by exporting from Console).
    Now if I open the XSD I am finding only a Category field but the attributes that were created in Datamanager are not present.
    I want an XSD with attrbutes , please help me out.
    Very urgent.
    Regrads,
    Pramod

    Creating XSD with attributes:
    since attributes are created in Data mgr they are not part of data structure which we define in console hence the xsd from console will not have attributes. you can create an xml file from MDM syndicator with all the attributes and from that xml file convert to XSD using the software.
    I want to syndicate all the attributes
    since we dont have the xsd while syndicating we need to add all attributes first then do the mapping.how to add fields in the xsd in syndicator Manager pls refer the ref guide for MDM Syndicator.
    hope it helps.reward points if suitable
    Regards-
    Ravi

  • Read from an XML previously created by LabView

    Hi everyone,
    My problem is, as the title says, I need to read Data from an XML file, if the file does not exist, LabView creates it. So far it works. After the creation though, when I go through the subroutine again and want to read the data back from the XML file, it brings me the Error Code 1006 and tells me something about not being able to read it since "the XML-Tag isn't the same type as the type of the variable connected." (roughly translated from German)
    The Variable I want to read something back to is a Cluster consisting of 2 Clusters constisting of 1) two numeric elements and 2) a string and a 1-D array of 12 numeric element.
    The part that's confusing me is, that LabView saved the data itself w/o problems and in its own XML format. So it shouldn't really bring up any problems reading it back to the same variable, now should it?
    If anyone has an answer, I'm happy about anything, this has been driving me nuts the whole day
    Thanks in advance and Regards,
    Pedro
    Solved!
    Go to Solution.

    Hi,
    sorry for my vague description, lets try to fix this:
    For writing the XML-File, I use "Write To XML File.vi", the LabView standard XML writing VI.
    For reading from it again, I use "Read From XML File.vi", also the LabView standard.
    My LabView version is 8.5
    I'll attach some pictures and the created XML file which I hope will be of help.
    "Limits Template.png" is my Cluster to save the data in. As I said previously, the data was written from this very cluster, yet it cannot be read back to it. As you can see in there, the array is created correctly with 12 elements and their corresponding sizes.
    Thanks in advance,
    Regards,
    Pedro
    EDIT: checked again, the error code indeed is 1106
    Attachments:
    Limits Template.png ‏13 KB
    test123788_Limits.txt ‏2 KB

  • Exception on creation of service metadata for WS metadata destination

    Hi,
    I have imported a webservice from the backend to the model in webdynpro and i have also configured the destination for the metadata in the CE server but when i execute it its giving me  error as
    Exceptioncom.sap.tc.webdynpro.model.webservice.exception.WSModelRuntimeException: Exception on creation of service metadata for WS metadata destination FLIGHT_GETLIST  and WS interface ZBapi_Flight_Getlist. One possible reason is that the metadata destination FLIGHT_GETLIST  has not been properly configured; check configuration.
    and during deployment i am getting the following warning
    local/SampleFlightList : References Test: There are no matching deploy time references (described in META-INF/SAP_MANIFEST.MF) for the following runtime references [sap.com/tcwdapi, sap.com/tcwdwslib~api] (described in the META-INF/application-j2ee-engine.xml)., file: SampleFlightList.ear, column 0, line 0, severity: warning
    can any one please help me to solve this issue.
    Thanks&Regards,
    Hamsa Shree

    Hi Hamsa,
    Did you also create and configure an "Execution Destination"?
    You can test the Metadata destination configuration on Web Service Navigator.
    On the web service navigator (http://hostname:portnumber/wsnavigator) search in the metatda destination you have created for the service you imported in web dynpro as a model. If you can find it there test it on the ws navigator.
    Best regards,
    Yasar

  • DOM to String & String to DOM too Complicated

    Hi Java Comunity,
    I'm just wondering why one of the simplest tasks on the XML development such as creating (parsing) a DOM from a String and viceversa (Obtaining the XML as String from a DOM Document) is so Complicated.
    Obviously I'm a newbie in JAXP, but not in XML, the common sense dictaminates that these tasks should be as simple as something like:
    String xmlString = "<mytag>...</mytag>";
    org.w3c.dom.Document xmlDoc = new org.w3c.dom.Document(xmlString);
    and
    String anotherXmlString = xmlDoc.getXmlString();
    I already know how to perform these conversions, but I'm just wondering why you Java Developers enjoy making suffer all the programmers in the world with such complicated (and not intuitive) ways to perform simple tasks.
    Comunity, what do you think???

    This needs some cleanup, but it transforms an org.w3c.dom.Document object to a String.
    import java.io.*;
    import java.util.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.*;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    public static String DocumentToString(Document doc)
    try
    ByteArrayOutputStream out;
    Transformer transformer;
    TransformerFactory tFactory;
    tFactory = TransformerFactory.newInstance();
    transformer = tFactory.newTransformer();
    out = new ByteArrayOutputStream();
    transformer.transform(new DOMSource(doc.getDocumentElement()), new StreamResult(out));
    if (out != null)
    return new String(out.toByteArray());
    else
    return null;
    catch (TransformerException te)
    te.printStackTrace();
    return null;

  • How to transform DOM into String

    Hi,
    Can any one provide an example of transforming DOM into String using TransformationFactory or any other API of JAXP?
    Regards...
    Shamit

    And for finer output:
          * Prints a textual representation of a DOM object into a text string..
          * @param document DOM object to parse.
          * @return String representation of <i>document</i>.
        static public String toString(Document document) {
            String result = null;
            if (document != null) {
                StringWriter strWtr = new StringWriter();
                StreamResult strResult = new StreamResult(strWtr);
                TransformerFactory tfac = TransformerFactory.newInstance();
                try {
                    Transformer t = tfac.newTransformer();
                    t.setOutputProperty(OutputKeys.ENCODING, "iso-8859-1");
                    t.setOutputProperty(OutputKeys.INDENT, "yes");
                    t.setOutputProperty(OutputKeys.METHOD, "xml"); //xml, html, text
                    t.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
                    t.transform(new DOMSource(document.getDocumentElement()), strResult);
                } catch (Exception e) {
                    System.err.println("XML.toString(Document): " + e);
                result = strResult.getWriter().toString();
            return result;
        }//toString()

Maybe you are looking for

  • How can multiple computers have the same library?

    My family has one iTunes account, but our iTunes library is different on every computer. Our iPods are each synced with a different computer. How can we have one library with all of our purchases together? We use the same account, so it doesn't make

  • OBIEE 11g- unable to start application server

    Dear All, I have recently installed OBIEE 11g 11.1.1.6.0 for the first time (enterprise install) am able to login to anaytics page and create reports, but Iam not able to connect to enterprise manger , console. Going through various posts, i came to

  • Issues with Time Machine File Restore Permissions and Interface

    Hi All,I bought a Time Capsule in January 2010, and i've had backups since then. Time Machine's interface has pretty much always been laggy as ****, but I've always put that down to using it over wifi, perhaps that was a wrong assumption. Anyway, I w

  • Report in excel from java

    I'm generating report in Excel from Java.In this is it posssible to place background color upto the text in the single cell

  • Is this a legitimate email from Apple Support?

    I received the following email today from "Apple Support" and wonder if it's legitimate - they are asking for SS#, charge card information, etc.   It seems "phishy" to me....thought I'd check in on this before doing anything! Dear Customer, We are cu