From string to XML

Hi,
How can i convert a string to XML so i can use it's tags?

sergei_developer wrote:
you have to use :
var x:XML =<info><titel>blaaaaaaat</titel></info>;
var s:String = x.info.@title;
That code is incorrect and it won't work. "titel" is not an attribute but a node so you should access it that way and also, the root node ( called "info" ) is considered implicit, which means that you would access the "titel" node this way: var s:String = x.titel;
Good luck,
Barni

Similar Messages

  • From String to Element with XML structure

    Hello.
    I have String with XML elements. Can i simple this transform in to XML format?
    I need Element which has XML structure.
    my string looks like that is:
    <payload xmlns="http://xmlns.oracle.com/bpel/workflow/task">
    <usersxmlns="http://www.google.com" xmlns:ns1="http://www.google.com">
    <ns1:id_name>Mario</ns1:id_name>
    <ns1:id_address>Newsburgh</ns1:id_address>
    </users>
    </payload>
    Edited by: Tony_Fabrizzio on Feb 11, 2009 5:57 AM

    Tony_Fabrizzio wrote:
    Hello.
    I have String with XML objects. No you don't. Get your terminology straight
    Can i simple this transform in to XML format?
    I need Element which has XML structure.
    my string looks like that is:
    <payload xmlns="http://xmlns.oracle.com/bpel/workflow/task">
    <usersxmlns="http://www.google.com" xmlns:ns1="http://www.google.com">
    <ns1:id_name>Mario</ns1:id_name>
    <ns1:id_address>Newsburgh</ns1:id_address>
    </users>
    </payload>The short answer is "yes". The long answer is "what are you planning on doing with the result, and 'process it' or 'parse it' isn't an answer"
    But really, you need to do some research

  • How can I get the context-parm from a web.xml file using struts?

    Hello:
    I need get the context-param from the web.xml file of my web project using struts. I want configurate the jdbc datasource connection pooling here. For example:
    <context-param>
    <param-name>datasource</param-name>
    <param-value>jdbc/formacion</param-value>
    <description>Jdbc datasource</description>
    </context-param>
    and then from any Action class get this parameter.
    Similar using a simple server can be:
    /** Initiates new XServlet */
    public void init(ServletConfig config) throws ServletException {
              for (Enumeration e = config.getInitParameterNames(); e.hasMoreElements();) {
                   System.out.println(e.nextElement());
              super.init(config);
              String str = config.getInitParameter("datasource");
              System.out.println(str);
         public void doPost(HttpServletRequest req, HttpServletResponse res)
              throws ServletException, IOException {
              // res.setContentType( );
              System.out.println("Got post request in XServlet");
              PrintWriter out = res.getWriter();
              out.println("nada");
              out.flush();
              out.close();
    but only this works for init-params, if I use
    <servlet>
         <servlet-name>MyServlet</servlet-name>
         <display-name>MyServlet</display-name>
         <servlet-class>myExamples.servlet.MyServlet</servlet-class>
         <init-param>
         <param-name>datasource</param-name>
         <param-value>jdbc/formacion</param-value>
    </init-param>
    </servlet>
    inside my web.xml. I need something similar, but using struts inside the action class for that I can get the context-params and call my database.
    Thank you

    To get context parameters from your web.xml file you can simply get the ActionServlet object from an implementing action object class. In the perform (or execute) method make the following call.
    ServletContext context = getServlet().getServletContext();
    String tempContextVar =
    context.getInitParameter("<your context param >");

  • String to XML

    Hi everyone,
    i'm just writing a method, that gets a string and a XPath and want writes the string to the specific XPath in my xml document. The problem ist, that the string itself can contain nodes like (e.g. <image> or something else from my dtd, so i got some problems converting the string to xml. Actually i'm trying this:
         public static void setEditFragment(String content, String xPath) throws Exception {
             DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
             DocumentBuilder builder  = factory.newDocumentBuilder();
             Document document = builder.parse("data.xml");
             XPath xpath = XPathFactory.newInstance().newXPath();
             Node node = (Node)xpath.evaluate(xPath, document, XPathConstants.NODE);
             System.out.println(content);
             node.setTextContent(content);
             // Use a XSLT transformer for writing the new XML file
                Transformer transformer = TransformerFactory.newInstance().newTransformer();
                // Set output to IsoLatin1
                transformer.setOutputProperty(OutputKeys.ENCODING, "ISO-8859-1");
             DOMSource        source = new DOMSource( document );
             FileOutputStream os     = new FileOutputStream("tmp.xml");
             StreamResult     result = new StreamResult( os );
             transformer.transform( source, result ); 
         }but of course this will not work and sets up some cryptic signs in mein xml document....
    can anyone give me advice ?
    Thanks !

    Well, if you already have the data XML encoded, then just write them to a file:
    http://java.sun.com/docs/books/tutorial/essential/io/index.html
    Make sure you encode the data with UTF8:
    http://java.sun.com/javase/6/docs/api/java/lang/String.html#getBytes(java.lang.String)
    Write "<?xml version="1.0" encoding="utf-8"?>" before the data!
    Note however, I generally don't recommend to write XML data by hand. Rather use a framework like JAXB.
    -Puce
    Edited by: Puce on May 8, 2008 1:36 PM

  • Conversion of string into XML object

    Hi
    I am having some problems with conversion of string (containing XML data) into Flex XML object and binding it later to UI elements to output/maintain this data.
    Binding of XML structure to UI elements works perfectly fine if I will do following:
    1)      Hardcode XML object within Flex file
    2)      Read xml file from repository (xml file inside the Flex project)
    3)      Use HTTP request to retrieve XML data
    Unfortunately none of the above scenarios suits my solution.
    I am developing a prototype application for processing Flex forms inside SAP system. I have decided to make data bindings using XML structure stored in Data Base. When rendering form inside web browser based application I am retrieving corresponding XML schema (empty for new forms and populated for saved forms) and pass it to Flex form as a string type import parameter. Data is being passed correctly (I can display it on TextArea control for instance) but after conversion to XML and binding to DataGrid I am not getting any results.
    I am converting string (containing XML) to XML object in following way:
    Private var xml_obj:XML = new XML(string_xml );
    I am catching any potential errors but conversion is going well. After conversion I am not getting any results after binding it to DataGrid control and I am not able to access any of the nodes using AS code either. At the same time variable xml_obj is not empty (not null).
    Any help would be much appreciated.
    Regards
    Michael

    David
    First of all sorry for not stating it clearly but I am using Flex 3 for this development (at the moment it is the only choice when embedding Flex objects inside SAP applications).
    You must have missed the bit where I am describing how this XML data finds its way inside Flex. I am passing it to Flex as String type parameter during rendering (directly from DB where it is stored).
    Now, following code works perfect (XML is embedded inside Flex project):
                    <mx:XML id="form_data" source="../assets/example_xml_data.xml"/>
                    <mx:Script>
                                    <![CDATA[
                                                    import mx.collections.XMLListCollection;
                                                    import mx.controls.Alert;
                                                    [Bindable]
                                                    public var XML_list:XMLListCollection;
                                                    private function setParameters():void
                                                                   XML_list = new XMLListCollection(form_data.*);             
                                    ]]>
                    </mx:Script>
                    <mx:DataGrid id="myDataGrid" dataProvider="{XML_list}">
                                    <mx:columns>
                                                    <mx:DataGridColumn dataField="COMMON" headerText="Popular name"/>
                                                    <mx:DataGridColumn dataField="BOTANICAL" headerText="Botanical name"/>
                                                    <mx:DataGridColumn dataField="ZONE" headerText="Zone"/>
                                                    <mx:DataGridColumn dataField="LIGHT" headerText="Light"/>                                                                                                                                               
                                                    <mx:DataGridColumn dataField="PRICE" headerText="Price"/>                                               
                                                    <mx:DataGridColumn dataField="AVAILABILITY" headerText="Availability"/>                                    
                                    </mx:columns>               
                    </mx:DataGrid>
    But following code does not work (XML passed to Flex form as String input parameter):
    import sap.FlashIsland;
    import mx.controls.Alert;
    import mx.collections.XMLListCollection;
    [Bindable]
    public var xml_data:String;
    private var form_data:XML;
    [Bindable]
    private var XML_list:XMLListCollection;
    private function initApp():void
                    FlashIsland.register(this);
    private function setParameters():void
                    try
                                    form_data=new XML(xml_data);
                    catch (error:Error)
                                    Alert.show(error.toString());
                      XML_list = new XMLListCollection(form_data.*);           
    XML string does find its way inside Flex form. I can display content of variable xml_data in TextArea and all looks fine. Conversion to XML (variable form_data) goes well (no error)
    Please helpJ
    Regards
    Michael

  • How to populate target directory from the source XML in Receiver File Adap?

    Hi All,
    Our scenario is IDoc - XI -(Receiver File adapter) File. Is it possible to populate complete "Target Directory" from the source XML message??
    Lets say we added field to maintain target directory in Idoc structure and some how populated value to it, then grab this target directory from the IDoc-XML and pass in Comunication Channel. I think its possible through Variable Substitation ...just want to make sure and if sombody has done the similar scenario their inputs would be great.
    Thanx
    Navin

    Hi,
    Please see the belowlinks
    /people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii
    /people/sriram.vasudevan3/blog/2005/11/21/effective-xsl-for-multimapping-getting-source-filenames-in-legacy-legacy-scenarios
    Re: Dynamic  File Name for Receiver File Adapter
    Variable Substitution
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    try with adapter specific
    Example code...
    String newfilename="";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    // Get Sourcefilename
    String oldfilename=conf.get(key);
    //extract first 3 chars of source filename
    newfilename=oldfilename.substring(0,2);
    //get the date
    java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat( "yyyyMMdd" );
    dateformat.format( new java.util.Date() );
    //append sourcedateL
    newfilename=newfilenamedateformat"L";
    // determine if prod/ dev / qa
    map = container.getTransformationParameters();
    senderService = (String) map.get("SenderService");
    if(senderServcie.equald("Prod"){
    newfilename=newfilename+"P";
    // change to new file name
    conf.put(key, newfilename+".tmp");
    Change it according to your requirement
    Regards
    Chilla..

  • Change over from a simple Xml call to a rpc-Http call ....

    Hi there,
    I need to change over from a simple Xml call:
    <mx:XML id="urlsGeneral" source="http://www.mySite.com//.../AFS.xml"/>
    to a rpc-Http call which is updating the readout if Xml is changed at any time.
    I forgot to mention the most important item yet a very simple one: I need this only to be displayed in a title etc, and NOT a datagrid or else example below.
    title="{urlsGeneral.urlGeneral.(@name==0).age}
    I tried a lot today, but just can't get it right as the id="urlsGeneral" is always the problem.
    Any help would be appriciated !!! Thanks in advance. regards aktell2007
    <urlsGeneral>
    <urlGeneral>
    <name>Jim</name>
    <age>32</age>
    </urlGeneral>
    <urlGeneral>
    <name>Jim</name>
    <age>32</age>
    </urlGeneral>
    </urlsGeneral>
    Another call:
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import mx.rpc.events.ResultEvent;
    public var myData:ArrayCollection;
    protected function myHttpService_resultHandler(event:ResultEvent):void {
    myData = event.result.urlsGeneral.urlGeneral;
    ]]>
    </mx:Script>
    <mx:HTTPService
    id="myHttpService"
    url="http://www.mySite.com//..../AFS.xml"
    result="myHttpService_resultHandler(event)"/>
    Preferable I wanted something like this to work:
    <mx:Script>
    <![CDATA[
    import mx.rpc.events.FaultEvent;
    import mx.managers.CursorManager;
    import mx.controls.Alert;
    import mx.rpc.events.ResultEvent;
    import mx.rpc.xml.SimpleXMLDecoder;
    // Don't use here as it is already used in .swc !
    /* import mx.rpc.http.HTTPService; */
    private var myHTTP:HTTPService;
    private function initConfigCall():void {
    myHTTP = new HTTPService();
    myHTTP.url = "com/assets/data/changesAppAIRPIOne001.xml";
    myHTTP.send();
    myHTTP.resultFormat = "xml";
    myHTTP.addEventListener(ResultEvent.RESULT, resultHandler);
    myHTTP.addEventListener(FaultEvent.FAULT, faultHandler);
    CursorManager.setBusyCursor();
    private function resultHandler(evt:ResultEvent):void {
    var xmlStr:String = evt.result.toString();
    var xmlDoc:XMLDocument = new XMLDocument(xmlStr);
    var decoder:SimpleXMLDecoder = new SimpleXMLDecoder(true);
    var resultObj:Object = decoder.decodeXML(xmlDoc);
    // Removed [0] on single node !
    appUpdateAvl.text = resultObj.application.configApp.appNewUpDate;
    appLastChanged.text = resultObj.application.configApp.appLastChanged;
    appChangedSections.text = resultObj.application.configApp.appChangedSections;
    CursorManager.removeBusyCursor();
    myHTTP.disconnect();
    private function faultHandler(event:mx.rpc.events.FaultEvent):void {
    var faultInfo:String="fault details: "+event.fault.faultDetail+"\n\n";
    faultInfo+="fault faultString: "+event.fault.faultString+"\n\n";
    mx.controls.Alert.show(faultInfo,"Fault Information");
    var eventInfo:String="event target: "+event.target+"\n\n";
    eventInfo+="event type: "+event.type+"\n\n";
    mx.controls.Alert.show(eventInfo,"Event Information");
    CursorManager.removeBusyCursor();
    myHTTP.disconnect();
    ]]>
    </mx:Script>

    Hi again,
    These days there are more quetions than answeres on any forum, and very seldom anybody shares the answer if they lucky enough to work it out so here is my answer for the above question
    Change over from a simple Xml call to a rpc-Http call ....
    I had it all along as a commend noted: // Removed [0] on single node !
    So instead of title="{urlsGeneral.urlGeneral.(@name==0).age} it would be now title="{resultObj.urlsGeneral.urlGeneral.[0].age} and now it works perfectly well. I hope that one or the other of you can use the answer and the code !!! regards aktell2007

  • Convert XML string into XML

    Hi All,
    Can you please let me know for any sample code in xslt/java mapping for converting XML string into XML. We use SAP Pi 7.0
    My XML string starts like this
    <?xml version="1.0" encoding="UTF-8" ?> 
    - <ns0:MT_ReceiverFileStructure <namespace>"><Output><?xml version="1.0" encoding="ISO-8859-9"?><?xml-stylesheet type="text/xsl" href="<xsl>"?><Tarih_Date Tarih="11.09.2014" Date="09/11/2014>
       Thanks,
       Pavithra

    Thanks Praveen. It worked.
    However, the xml i have is an extract from a exchange rate URL and it has the reference to a xsl in it as below
    <?xml version="1.0" encoding="ISO-8859-9"?><?xml-stylesheet type="text/xsl" href="<ABC.xsl>"?>.
    So there is an error in sxmb_moni. Is it possible to remove this.

  • How to transform with xquery from CDATA to XML

    Hi everyone
    I want to transform from CDATA to XML and I don´t know how to do.
    anyone can help me please?
    I'm using OSB OEPE PS3, I have artifacts: person.PROXY, person.BIZ, BIZ-Person.WSDL, PROXY-Person.WSDL, Person-response.xq and Person.xsd.
    I Use Message Flow Within Route, Routing (Request and Response Actions)
    To Request Xquery transformation is ok, for Response Action I need help. I receive a String and inside with CDATA:
    +<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
    +<soapenv:Body>+
    +<executeResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">+
    +<executeReturn xsi:type="xsd:string">+
    +*<![CDATA[<example-data rows="1"><person><id>123</id><name>JHON</name><surname>MAGNESS</surname>+*
    *+<code>123456789V</code></person></example-data>]]>+*
    +</executeReturn>+
    +</executeResponse>+
    +</soapenv:Body>+
    +</soapenv:Envelope>+
    I want to map from CDATA to XML like this (Person.xsd):
    <xs:schema xmlns="http://www.domain.com/XSD/Persons" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://www.domain.com/XSD/ABCD" targetNamespace="http://www.domain.com/XSD/Persons" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:import namespace="http://www.domain.com/XSD/ABCD"
    <xs:complexType name="Persons">
              <xs:sequence>++
                   <xs:element name="id" type="xs:string"/>
                   <xs:element name="surname1" type="xs:string" minOccurs="0"/>
                   <xs:element name="surname2" type="xs:string" minOccurs="0"/>
                   <xs:element name="name" type="xs:string" minOccurs="0"/>
                   <xs:element name="code" type="xs:string"/>
              </xs:sequence>
         </xs:complexType>
    Edited by: user10070593 on Aug 29, 2012 10:58 PM
    Edited by: user10070593 on Aug 29, 2012 10:58 PM
    Edited by: user10070593 on Aug 29, 2012 11:00 PM

    Hey Patrick / Vlad thank you very much for your help :)
    I have solved it like this:
    Within my proxy in Message Flow (*using Routing -- Route -- Response Action*)
    I'm using the elements Assing and Replace
    In Assing element (expression: Person-response.xq, variable: varBStoPS)
    In Replace element (xpath : executeResponse/executeReturn/text() , in Variable: body, expression:
    *$varBStoPS*)
    Now, within Person-Response.xq , I am using the parameter: *$anyType1*, but this is a string, I don´t know to use a FOR loop in Xquery, as I can apply it to the XML mapping (Person.xsd)?, Knowing I get the list:
    *+<example-data rows="1"><person><id>123</id><name>JHON</name><surname>MAGNESS</surname>+*
    *+<code>123456789V</code></person></example-data>+*
    Person.xsd:
    <xs:element name="processResponse">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="ns1:HeaderMsgABCD"/>
                        <xs:element name="bodyResponse">
                             <xs:complexType>
                                  <xs:sequence>
                                       <xs:element name="PersonsCollection">
                                            <xs:complexType>
                                                 <xs:sequence>
              <xs:element name="Persons" type="Persons" minOccurs="0" maxOccurs="unbounded"/>
                                                 </xs:sequence>
                                            </xs:complexType>
                                       </xs:element>
                                  </xs:sequence>
                             </xs:complexType>
                        </xs:element>
                        <xs:element ref="ns1:ErrorMsgABCD"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    Person-response.xq:
    xquery version "1.0" encoding "Cp1252";
    (:: pragma parameter="$anyType1" type="xs:anyType" ::)
    (:: pragma bea:global-element-return element="ns0:processResponse" location="../XSD/ Person-response.xq" ::)
    declare namespace xf = "http://tempuri.org/oracle/xquery/Person-response/";
    declare namespace ns1 = "http://www.domain.com/XSD/ABCD";
    declare namespace ns0 = " http://www.domain.com/XSD/Persons";
    declare function xf:XQ_SEARCH_PERSONS_RESPONSE($anyType1 as element(*))
    as element(ns0:processResponse) {
    <ns0:processResponse>
    <ns0:bodyResponse>
         <ns0:PersonsCollection>
    <ns0:Persons>
    <ns0:id>{ data(0) }</ns0:id>
    <ns0:surname1>{ data(0) }</ns0:surname1>
    <ns0:surname2>{ data(0) }</ns0:surname2>
    <ns0:name>{ data(0) }</ns0:name>
    <ns0:code>{ data(0) }</ns0:code>
              </ns0:Persons>
         </ns0:PersonsCollection>
    </ns0:bodyResponse>
    </ns0:processResponse>
    declare variable $anyType1 as element(*) external;
    xf:XQ_SEARCH_PERSONS_RESPONSE ($anyType1)
    Edited by: chromosoma on Aug 30, 2012 12:47 PM
    Edited by: chromosoma on Aug 30, 2012 12:50 PM
    Edited by: chromosoma on Aug 30, 2012 1:00 PM

  • CRIO: Unflatten from string into lvclass not working in deployment

    Hello,
    I am working on a problem for some hours now and I need some help.
    I am using a cRIO-9022. I need to do some tasks, and I created a couple of classes which contain the parameters and the methods. They contain using dynamic dispatch VIs. I have an array of these classes (all derived from a parent class) which is my "configuration". I am using "flatten to string" and saving those file on disk. "Unflatten from string" is working fine. These file is created on a LV WIndows Application.
    I need to use this file on my cRIO: Unflatten from string, and then work with the array of my classes. When running the cRIO Main VI it's working fine. But when building the application and deploying it as startup, it's not working. I am getting:
    Error 1403 occurred at Unflatten From String in Gantry CommEngine.vi->RT Main.vi
    Possible reason(s):
    LabVIEW:  Attempted to read flattened data of a LabVIEW class. The data is corrupt. LabVIEW could not interpret the data as any valid flattened LabVIEW class.
    What I tried so far:
    - Added the whole lvlib containing the classes and also every single class to "Source files / always included".
    - Created constants of the array (containing the classes) to the VI (forcing LV to include the classes?)
    - Loaded the file from cRIOs flash and also by shared variable
    What else can I do?
    Thanks a lot for support!

    I tried to reproduce the matter, but couldn't. 
    I attached my example to the post. 
    What it does:
    It creates a class with only a string a bool and a number. This class oblect is saved to C:/somename.xml. The number is a random number.
    In the second case the same file is read and the number broadcasted to a variable.
    It worked quite fine building it as a startupexe.
    Nothing else was necessary. Does it work for you?
    Attachments:
    class exe.zip ‏45 KB

  • How to extract a tagged string using XML in sql server 2014?

    A column stores the string data with tag as below.I have to retrieve the value of ATRB_C1 as val1234 through xml
    Query:
    CREATE TABLE #test (col varchar(500))
    INSERT INTO #test VALUES('< ATRB_C value ="val1" />< ATRB_C1 value ="val234" />')
    SELECT * FROM  #test FOR XML RAW
    Output:
    <row col="&lt; ATRB_C value =&quot;val1&quot; /&gt;&lt; ATRB_C1 value =&quot;val234&quot; /&gt;" />
    Since the format is incorrect, not able to extract using xml.value
    Any help would be appreciated!!

    CREATE TABLE #test (col xml)
    INSERT INTO #test(col) VALUES('<ATRB_C value ="val1"/><ATRB_C1 value ="val234" />')
    SELECT * FROM #test
    Select Col1.value('(@value)[1]','varchar(20)') as [tab1_col1],col2.value('(@value)[1]','varchar(20)') as [tab2_col2]
    from #test cross apply col.nodes('/ATRB_C') as tab1(col1)
    cross apply col.nodes('/ATRB_C1') as tab2(col2)
    drop table #test
    Hope it Helps!!

  • Need help: String to XML

    Hi everyone,
    Im looking for some assistance regarding string to xml. I wanted to extract the xml from the field 'sendDataReturn'. Is my xsl script correct?
    XML in String
    <sendDataResponse xmlns="http://service.aes.cust.mic.at" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <sendDataReturn><b><?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?> <MicExportResponseMessage xmlns="http://www.mic-cust.com/Webservice/MicExportWS/v1.1"><Connection><connectionID>MICWEBSERVICE</connectionID><partnerID>SAPKLD400</partnerID><dateTime>2008-12-12T09:35:40</dateTime></Connection><Messages><Message><Envelope><messageID>1</messageID><partyID>01</partyID><schemaID>V 1.0 B01</schemaID><sequenceNum>1</sequenceNum><transActionID>970002570-01-TR-V3</transActionID></Envelope><Detail><actionCode><code>ER</code></actionCode><error><errorSource>MIC</errorSource><errorCode>106615</errorCode><errorType>ERR</errorType><errorText>Objekt ist schon in der Datenbank vorhanden</errorText></error></Detail></Message></Messages></MicExportResponseMessage></b></sendDataReturn>
      </sendDataResponse>
    XSL SCRIPT
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://service.aes.cust.mic.at">
    <xsl:template match="/">
    <xsl:for-each select="//sendDataReturn">
    <xsl:value-of select="." disable-output-escaping="yes"/>
    </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>
    Thanks

    Hi
    In order to apply an xsl your input needs to be valid xml. In your example this starts at the XML declaration
    <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
    <MicExportResponseMessage xmlns="http://www.mic-cust.com/Webservice/MicExportWS/v1.1">
         <Connection>
              <connectionID>MICWEBSERVICE</connectionID>
              <partnerID>SAPKLD400</partnerID>
              <dateTime>2008-12-12T09:35:40</dateTime>
         </Connection>
         <Messages>
              <Message>
                   <Envelope>
                        <messageID>1</messageID>
                        <partyID>01</partyID>
                        <schemaID>V 1.0 B01</schemaID>
                        <sequenceNum>1</sequenceNum>
                        <transActionID>970002570-01-TR-V3</transActionID>
                   </Envelope>
                   <Detail>
                        <actionCode>
                             <code>ER</code>
                        </actionCode>
                        <error>
                             <errorSource>MIC</errorSource>
                             <errorCode>106615</errorCode>
                             <errorType>ERR</errorType>
                             <errorText>Objekt ist schon in der Datenbank vorhanden</errorText>
                        </error>
                   </Detail>
              </Message>
         </Messages>
    </MicExportResponseMessage>
    To Output all the inpit xml see here use the xsl:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://service.aes.cust.mic.at">
         <xsl:template match="node()|@*">
              <xsl:copy>
                   <xsl:apply-templates select="@*|node()"/>
              </xsl:copy>
         </xsl:template>
    </xsl:stylesheet>
    It looks like you are trying to extract the xml from a syschronous call response, the xsl above may bot be the entire solution but a atarting point at least to extract data, tags included .. you can eaisly test this in a xsl tool such as xml spy (there is a trial version) ..

  • How to convert a delimited string to XML?

    Hi there,
    Please help me to convert a pipe delimited string into XML, e.g.
    string -------SubName:abc|SuvValue:123|
    required XML:
    <ROWS>
    <ROW>
    <SubName>abc</SubName>
    <SubValue>123</SubValue>
    </ROW>
    </ROWS>
    or
    string -------abc|123|
    required XML:
    <ROWS>
    <ROW>
    <SubName>abc</SubName>
    <SubValue>123</SubValue>
    </ROW>
    </ROWS>
    -----i am trying to first parse the string into a table type and then using the DBMS_XMLGen.getXML function but unable to get values from table type...
    any prompt response is highly appriciated...
    Regards, Hassan

    Hi Hassan,
    If your version supports it (ie 10gR2 and upwards), you can use XQuery to directly parse the string and generate the XML :
    SQL> SELECT XMLQuery(
      2   '<ROWS>
      3    <ROW> {
      4     for $i in ora:tokenize($str,"\|")
      5     return
      6      if ($i) then element {substring-before($i,":")} {substring-after($i,":")}
      7      else ()
      8   } </ROW>
      9   </ROWS>'
    10   passing sys_xmlgen('SubName:abc|SubValue:123|') as "str"
    11   returning content
    12  ).getClobVal()
    13  FROM dual;
    XMLQUERY('<ROWS><ROW>{FOR$IINO
    <ROWS><ROW><SubName>abc</SubName><SubValue>123</SubValue></ROW></ROWS>
    Each element is built based on its name from the input string.

  • Need help getting rid of those ASX:ABAP tags from the generated XML file!

    I was able to transfer xml data from abap internal tables to a string.
    Here is the content of the string:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <asx:abap version="1.0" xmlns:asx="http://www.sap.com/abapxml">
    <asx:values>
    <DATA>
    <item>
    <UOM1 />
    <UOM2>L</UOM2>
    <GL_PR_SEG />
    <RECORDMODE>A</RECORDMODE>
    </item>
    </DATA>
    </asx:values>
    </asx:abap>
    Now my goal is to strip out a couple of tags out of that string directly using xslt.
    Do you know of any way i could take out the <asx:abap> and <asx:values> tags using an xslt program. I'd like to be able to strip them out directly from the string itself.

    its not function. its within abap.
    within your abap program, the xml code is in a string for example xml_string .
    use
    replace all occurrences of '<ASX:ABAP>' in xml_string with '' .
    replace all occurrences of '</ASX:ABAP>' in xml_string with '' .
    replace all occurrences of '<ASX:VALUES>' in xml_string with '' .
    replace all occurrences of '</ASX:VALUES>' in xml_string with '' .
    Hope this solves your issue.
    If your question is answered, reward the helpful answers with points and close the thread.
    Regards
    Raja

  • How to retrieve elements from 3 different xml file in one url

    Hi all,
    Could anyone please let me how can we retrieve elements from 3 different xml file in one url?
    i just can only do it with one file only, any help would very appreciate.
    Thank in advance
    Jim

    Hi Philip
    Thanks for replying me.
    I tried on that way, In my mdx query i am using one slice attribute (i.e [Customer].[Gender].allmembers) in rows so getting error "The  Hierarchy already appears in Axis1".
    SELECT
    {[Measures].[Internet Sales Amount] } ON 0,
    NON EMPTY
    {[Customer].[Gender].allmembers } ON 1 -- Used
    FROM
    [Adventure Works]
    WHERE
    [Customer].[Gender].&[M]
    ,[Product].[Size Range].[(All)]
    ,[Customer].[Country].[All Customers]
    [Customer].[Gender].[All Customers]
    ,[Product].[Size Range].&[XL]
    ,[Customer].[Country].[All Customers]
    [Customer].[Gender].[All Customers]
    ,[Product].[Size Range].[(All)]
    ,[Customer].[Country].&[Australia]
    Can you provide alternate ways to get resolved.
    Thanks in advance

Maybe you are looking for