CDATA and XML structure

Hej!
I am trying to but an entire XML structure into a CDATA-tag. But have not been successful.
Im using Xquery and trying to somthing like this:
I have an variable $example which contains a XML structure. For example:
$example = <elementA><A1>valueA1</A1><A2><A2a>text2a</A2a><A2b>text2b</A2b></A2><A3>valueA3</A3></elementA>
I want to something like this <![CDATA[$example]]> to be expanded to <![CDATA[<elementA><A1>valueA1</A1><A2><A2a>text2a</A2a><A2b>text2b</A2b></A2><A3>valueA3</A3></elementA>]]>
I have tried in many ways (eg by doing concat("<![CDATA[", $example, "]]>") ) and ended up with a CDATA tag that contains only the value of the elements in the tags of A1, A2 and A3. for example the CDATA that is created looks something like this:
<![CDATA[valueA1text2atext2bvalueA3]]>
instead of
<![CDATA[<elementA><A1>valueA1</A1><A2><A2a>text2a</A2a><A2b>text2b</A2b></A2><A3>valueA3</A3</elementA>]]>
I would really be grateful for any suggestions or tips and pointers on how to solve this.
Best Regards
Ninib
Edited by: NinibEDB on 2010-nov-09 17:35

Hi,
Which XQuery processor are you using?
According to the W3C specifications, the output of CDATA section is part of the serialization process, not the XQuery evaluation. So it's up to the implementor to provide the necessary options.
The option we need here is the "cdata-section-elements" parameter :
http://www.w3.org/TR/xslt-xquery-serialization/#XML_CDATA-SECTION-ELEMENTS
For example, using the Saxon XQuery processor :
declare option saxon:output "omit-xml-declaration=yes";
declare option saxon:output "cdata-section-elements=test";
let $example := "<elementA><A1>valueA1</A1><A2><A2a>text2a</A2a><A2b>text2b</A2b></A2><A3>valueA3</A3></elementA>"
return <test>{$example}</test>which gives :
<test><![CDATA[<elementA><A1>valueA1</A1><A2><A2a>text2a</A2a><A2b>text2b</A2b></A2><A3>valueA3</A3></elementA>]]></test>

Similar Messages

  • Indesign Javascript and xml structure

    Hi to all
    I am new to program javascript in Indesign, and I am looking for some example on how modify the xml structure inside a document using a javascript script.
    i.e.
    if I have a structure like this in the original document:
    root
    section
    tag1
    tag2
    tag3
    I need to transform it in this way( this is just an example, may be more complex):
    root
         section
              tag1
              tag2
              tag3
    Any help on where or how to solve this is very appreciate.
    Thanks a lot

    I think the MoveXMLElement.jsx script there shows pretty well what's involved. Here's something that addresses something closer to your example:
    var root = app.activeDocument.xmlElements[0];
    root.xmlElements.item("tag1").move(LocationOptions.AT_END, root.xmlElements.item("section"));
    root.xmlElements.item("tag2").move(LocationOptions.AT_END, root.xmlElements.item("section"));
    root.xmlElements.item("tag3").move(LocationOptions.AT_END, root.xmlElements.item("section"));
    You want to be careful about the order you do things and when you grab references to the xml structure objects, since you're changing them as you go (i.e. root.xmlElements[3] might refer to tag3 when you start, but will be invalid once you start moving things into section).
    If the xml structure in your InDesign document is the result of an xml import, you might consider transforming the xml as you import it. It's faster and more natural there.
    Hope that helps,
    Jeff

  • Convert IDOC XML structure to flat file - and now?

    Hi,
    we are working with input message ORDERS05 and want to convert it to flat file.
    So we used the implementation description from "how to convert an IDOC-XML structure to a flat file....".
    Looks like this is a standard procedure described here fitting for all IDOCs.
    We followed the guide, making XI ready for Abap-Mapping, implemented the Abap class like described, added an interface mapping with source ORDERS05 to a mess.type dummy destination, added with type Abap-class the class implemented from the guide and completed the Int.Dir. implementation.
    For comparism purpose we have two systems as receiver, one with a standard flat file with regular graph.mapping in XI, one with the Abap mapping.
    Result:
    Error description in SXMB_MONI:
    Didn´t expect something like that! The IDOC was delivered successfully to the other simple flat file receiver.
    Any idea what we made wrong (we are on SP17) or if there is a standard mistake you can do when following the guide?
    Best regards
    Dirk

    Hi,
    I've got the same problem. He the solution in my case:
    The problem is:
    My IDOC has no element <STDMES>, but the method IF_MAPPING~EXECUTE from the 'HOW-TO Guide' does not check this situation:
    el_element = idocument->find_from_name('STDMES').
    ls_edidc-stdmes = el_element->get_value().
    thows the exception.
    Solution:
    make shure that the field STDMESis set or change the method to:
    el_element = idocument->find_from_name('STDMES').
    if not el_element is initial.
        ls_edidc-stdmes = el_element->get_value().
    endif.
    Best regards
    Dieter

  • XML structure and FCC parameters

    Hi Experts,
    Kindly help me with the XML structure and  FCC parameters for the following sample of text file
    I am new to Text Files and FCC.
    =================================================================================
    Header
    " name of the company " ,1   
    " abc 2,10/01/1972",4
    Line items
    "ADFERT",KARNATAKA,CHIPS,G,45.560000,72.190000,100.983000,76.266000,J
    "GHTJEN",KERALA,BANANAS,G,1.135000,0.714850,1,0.755000,J
    Trailer
    DDDDDDDDD,B
    ================================================================================
    It is a CSV
    Header 1st line , first field is Variable length and 2nd field is 1 char
    Header 2nd line , first field is Variable length and 2nd field is date and last field is 1 char
    Line items
    first field fixed length 6 char but
    2nd field can be of any length
    3rd field can be of any length
    4th field 1 char
    5th field can be of any length
    6th field can be of any length
    7th field can be of any length
    8th field can be of any length
    9th field 1 char
    and then the Trailer
    Please help in the structure and content conversion parameters
    also following questions :
    a)  I have to pick up this file and pass to a proxy in AbAP on target side , so do i just create a service interface and in ECC --> Sproxy and identify my SI and do a Create Proxy ? or is there anything else required ?
    b) The Date in the header needs to be passed onto ECC as a parameter so in my XML structure in the data type do i include that as a field in the mapping ..Can any one please guide me to create the Data type structure for the above file ?
    c) DO I NEED A MAPPING FOR THIS ?? THERE ARE NO CONVERSIONS required ? what are the IR and ID steps required
    if it is a FILE to Proxy scenario with no mappings 
    Please help
    thanks
    Dev

    Hi Dev,
    Full Data type is as follows
    Sender_DT
    order_recordset  0..1
    order_header                 0..1
      header-1    0..1
      date            0..1
    order_Item                      0..unbound
      item-1          0..1
      item-2          0..1
      item-3          0..1
      item-n          0..1
    order_Trailer                    0..1
      trailer-1  0..1
      trailer-2  0..1
      trailer-n  0..1
    > What about the File Content conversion parameters , can you help me with those
    order_header.fieldNames     : f1,date
    order_header.fieldSeparator : <give the fiels separater , [if it is comma])
    order_header.endSeparator   : 'nl' (if it is new line characters)
    order_item.fieldNames     : i1,i2,.....
    order_item.fieldSeparator : :
    order_item.endSeparator   : 'nl'
    order_Trailer.fieldNames     : t1,t2,.....
    order_Trailer.fieldSeparator : :
    order_Trailer.endSeparator   : 'nl'
    If any of the two structures (header, item or trailer) in the field name is same then we have to use the key field
    Check this link
    http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417600)ID1157374550DB11273870171440820710End?blog=/pub/wlg/3228
    > b) In FCC what will be the values for fieldnames ?
    Check this link
    https://wiki.sdn.sap.com/wiki/display/XI/XI_File_Content
    Regards
    Ramesh

  • Map CDATA to Message Structure

    Recently, I've been asked to map generic message data embedded in a XML body's CDATA container to a complete message structure defined in XI.
    When I searched on SDN, I could only find information about the other way around (wrapping XML structured data  into CDATA) which is why I'm posting this thread. The solution is so easy, yet doesn't seem to be straightforward, which is why I absolutely wanted to document and share it with you.
    This is the message  sent to SAP PI:
    <?xml version="1.0" encoding="UTF-8"?>
    <Envelope>
         <Header>
              <To>Danny</To>
              <MsgType>test</MsgType>
         </Header>
         <Body><![CDATA[<hr:TestMsgRequest xsi:schemaLocation="http://tatis.com/test/schemas/ testcdata.xsd" xmlns:hr="http://danny.com/manifest/schemas/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><hr:customer><hr:name>aaaaaaaaaaaaaaaaaaaaaaa</hr:name><hr:code>1234</hr:code><hr:address>     <hr:name>test Customer</hr:name><hr:postalcode>BE9876</hr:postalcode><hr:town>Somewhere</hr:town><hr:country>Belgium</hr:country></hr:address></hr:customer>
    </hr:TestMsgRequest>]]></Body>
    </Envelope>
    As you see it consists of a Header and a Body. The Body contains the CDATA which should be unserialized and mapped to the following message structure
    <customer>
         <name>aaaaaaaaaaaaaaaaaaaaaaa</name>
         <code>1234</code>
         <address>     
              <name>test Customer</name>
              <postalcode>BE9876</postalcode>
              <town>Somewhere</town>
              <country>Belgium</country>
         </address>
    </customer>
    I've created an xslt mapping, imported it as an archive and used the XSLT mapping in the interface mapping.
    The following source code did the trick:
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://tatis.com/schemas/msg/envelope/ext">
         <xsl:template match="ns0:Envelope">
                   <xsl:value-of select="ns0:Body" disable-output-escaping="yes"/>
         </xsl:template>
    </xsl:stylesheet>
    As you might have noticed during mapping testing, XI adds a namespace to your source XML structure (ns0, ns1, etc.). You should pay attention to include this namespace in the XSLT!
    If you have questions, don't hesitate to drop a mail, Danny.

    Hi.
    Thanks. I am still not understanding.
    Where did / How did you derive the ns "xmlns:ns0="http://tatis.com/schemas/msg/envelope/ext"???
    Thanks.
    Sean

  • Mapping complete input XML structure into one field on target

    Hi,
    I have a scenario where I need to map the complete input XML structure as it is, into one field on target side. so can we achieve this in Graphical Mapping? If yes, please share your valuable info.
    Regards,
    Shiva.

    Hello,
    this is the java map code.just compile it and made a .zip file import it and use it Interface Mapping.
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.AbstractTrace;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import java.util.Map;
    import java.io.*;
    public class PayloadToXMLField1 implements StreamTransformation {
        String strXML = new String();
       //Declare the XML tag for your XML message
       String StartXMLTag = "<DocumentBody>";
       String EndXMLTag = "</DocumentBody>";
       //String StartXMLTag1 = "<Code>";
       //String EndXMLTag1 = "</Code>";
        AbstractTrace trace;
        private Map param = null;
        public void setParameter(Map param) {
            this.param = param;
        public void execute(InputStream in, OutputStream out) {
            trace =
                (AbstractTrace) param.get(
                    StreamTransformationConstants.MAPPING_TRACE);
            trace.addInfo("Process Started");
            try {
                StringBuffer strbuffer = new StringBuffer();
                byte[] b = new byte[4096];
                for (int n;(n = in.read(b)) != -1;) {
                    strbuffer.append(new String(b, 0, n));
                strXML = strbuffer.toString();
            } catch (Exception e) {
                System.out.println("Exception Occurred");
            String outputPayload =
                StartXMLTag
             + "<![CDATA["
             + strXML
             + "]]>"
             + EndXMLTag;
            try {
                out.write(outputPayload.getBytes());
             trace.addInfo("Process Completed");;
            } catch (Exception e) {
                trace.addInfo("Process Terminated: Error in writing out payload");;

  • Which way to go with PL/SQL and XML

    Hi fellows,
    I have a general question to XML on Oracle.
    I read already some parts of the three manuals coming with the online documentation of 9i
    - XML developer kit XDK
    - XML API - XDK and Oracle XML DB
    - XML database developer guide Oracle XML DB.
    Also I wrote already a PL/SQL package using DBMS_XMLGEN to generate XML data from relational Oracle tables.
    Actually I like the simplicity how I can create XML data with this DBMS package but I still missing the features like using a DTD/XML Schema to generate XML data.
    I still don't know what the best way would be to use these features of XML in Oracle.
    Hopefully someone can give me some advise and possibly can point to some code samples so that I can see the proper use of the package.
    How about DBMS_XMLQuery?
    To use this package, would that be the better solution for my problem?
    Any comment much appreciated.
    Thanks
    Fred

    Hi Fred,
    Having written a fair amount of PL/SQL code to generate and process XML in the past years, I can give you my opinion on the matter. If you look at the PL/SQL API's Oracle has been written to handle XML, you will find two types/categories of API's: PL/SQL code based on wrapping java (i.e. DBMS_XMLQUERY) and PL/SQL code based on C (i.e. DBMS_XMLGEN). The first category is usually slower, so I tend to use these only if there are no other options. You can measure execution times by executing the same query using both DBMS_XMLGEN. vs. DBMS_XMLQUERY.
    I usually tend to store xml into relational tables by extracting the xml document in PL/SQL using the functions XMLType data type offers (i.e. extract, existNode, getStringVal, etc) function rather than using DBMS_XMLSTORE for flexibility reason (more control over what's being stored).
    Besides the PL/SQL API's there are some rather neat SQL functions to handle XML (i.e. XMLElement, XMLForest, XMLAgg, XMLAttribute, etc) I like to use to build XML documents that are to complex for DBMS_XMLGEN. But, on the downside, I think these functions might cost considerable amounts of CPU, because behind the scene a DOM-tree is build in the SGA/UGA(?), especially on large XML structures or high concurrency systems. I have not measured this yet, so I say might.
    Further, what I think is lacking from the Oracle API's in general is handing of CDATA sections and the fact that some XML functions default generate "pretty-printing" XML, which can not be switched of as far as I know. In my opinion XML should never be "pretty printed", because XML basically is about data transportation, not about lay-out. CDATA sections are not handled, even worse "<![CDATA[ ]]>" is being escaped (to &lt and &gt) and not properly interpreted when processed back to text.

  • Order05 Idoc mapping in SRM XML Structure

    Hello All,
    I need to map Idoc order05 from ERP system into SAP provided SRM XML Structure.
    Anyone has done this sort of mapping before.
    Let me know the details as XML has got some 4800 fields and Idoc has some 800 fields and SRM XML seems to be superset of Idoc from ERP.
    Regards,Pankaj

    Hello,
    this is the java map code.just compile it and made a .zip file import it and use it Interface Mapping.
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.AbstractTrace;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import java.util.Map;
    import java.io.*;
    public class PayloadToXMLField1 implements StreamTransformation {
        String strXML = new String();
       //Declare the XML tag for your XML message
       String StartXMLTag = "<DocumentBody>";
       String EndXMLTag = "</DocumentBody>";
       //String StartXMLTag1 = "<Code>";
       //String EndXMLTag1 = "</Code>";
        AbstractTrace trace;
        private Map param = null;
        public void setParameter(Map param) {
            this.param = param;
        public void execute(InputStream in, OutputStream out) {
            trace =
                (AbstractTrace) param.get(
                    StreamTransformationConstants.MAPPING_TRACE);
            trace.addInfo("Process Started");
            try {
                StringBuffer strbuffer = new StringBuffer();
                byte[] b = new byte[4096];
                for (int n;(n = in.read(b)) != -1;) {
                    strbuffer.append(new String(b, 0, n));
                strXML = strbuffer.toString();
            } catch (Exception e) {
                System.out.println("Exception Occurred");
            String outputPayload =
                StartXMLTag
             + "<![CDATA["
             + strXML
             + "]]>"
             + EndXMLTag;
            try {
                out.write(outputPayload.getBytes());
             trace.addInfo("Process Completed");;
            } catch (Exception e) {
                trace.addInfo("Process Terminated: Error in writing out payload");;

  • Generic XML Structure solution/suggestions

    Hi,
    I am pretty new to XML, so looking for some suggestions.
    I want to create an XML structure for following data.
    I have Product P1, and Product P2
    P1 has following fields: F1,F2,F3,F4
    P2 has following fields:F0,F1, F3, F4, F5,F6
    You see both the products have some common fields and some extra fields.
    I want to make one XML structure (common to P1 and P2)that defines(tag value pair) both.
    I dont want something like say: If type == P1 then F5 and F6 field is null.
    It should not be defined for P1.
    lly F0 and F2 should not be defined for P2.
    Can anyone help me to define some common structure to accomplish this.

    Unless I'm missing something, what you want to do is set up the structure something like:
    <!element products(product*) >
    <!element product(f0*, f1*, f2*, f3*, f4* , f5*, f6*) >
    <!element f0 (#CDATA) >
    <!element f1 (#CDATA) >
    <!element f2 (#CDATA) >
    <!element f3 (#CDATA) >
    <!element f4 (#CDATA) >
    <!element f5 (#CDATA) >
    <!element f6 (#CDATA) >
    Obviously this changes depending on how often the data can recur and type of data, but this will give you an idea of DTD setup. Using schema would also give you the ability to define field length and such. Find a good DTD reference guide either online or from a book and it will give examples of the different recurring notations (*, + and the like). Hope this helps.

  • What is DTD (related to BC and XML)?

    Hi all,
    Could you please refer me to links/documents, after giving a brief overview of <b>DTD</b>
    Thanks,
    Charles.

    Hi,
    The purpose of a DTD is to define the legal building blocks of an XML document. It defines the document structure with a list of legal elements. A DTD can be declared inline in your XML document, or as an external reference.
    Internal DTD
    This is an XML document with a Document Type Definition: (Open it in IE5, and select view source)
    <?xml version="1.0"?>
    <!DOCTYPE note [
    ><!ELEMENT note (to,from,heading,body)>
    <!ELEMENT to (#PCDATA)>
    <!ELEMENT from (#PCDATA)>
    <!ELEMENT heading (#PCDATA)>
    <!ELEMENT body (#PCDATA)>
    ]>
    <note>
    <to>Tove</to>
    <from>Jani</from>
    <heading>Reminder</heading>
    <body>Don't forget me this weekend!</body>
    </note>
    The DTD is interpreted like this:
    !ELEMENT note (in line 2) defines the element "note" as having four elements: "to,from,heading,body".
    !ELEMENT to (in line 3) defines the "to" element to be of the type "CDATA".
    !ELEMENT from (in line 4) defines the "from" element to be of the type "CDATA"
    and so on.....
    External DTD
    This is the same XML document with an external DTD: (Open it in IE5, and select view source)
    <?xml version="1.0"?>
    <!DOCTYPE note SYSTEM "note.dtd">
    <note>
    <to>Tove</to>
    <from>Jani</from>
    <heading>Reminder</heading>
    <body>Don't forget me this weekend!</body>
    </note>
    This is a copy of the file "note.dtd" containing the Document Type Definition:
    <?xml version="1.0"?>
    <!ELEMENT note (to,from,heading,body)>
    <!ELEMENT to (#PCDATA)>
    <!ELEMENT from (#PCDATA)>
    <!ELEMENT heading (#PCDATA)>
    <!ELEMENT body (#PCDATA)>
    Why use a DTD?
    XML provides an application independent way of sharing data. With a DTD, independent groups of people can agree to use a common DTD for interchanging data. Your application can use a standard DTD to verify that data that you receive from the outside world is valid. You can also use a DTD to verify your own data.
    For more information, please check this links.
    http://help.sap.com/saphelp_nw04/helpdata/en/64/0bee3da7138e5be10000000a114084/content.htm
    http://help.sap.com/saphelp_46c/helpdata/en/dc/6b827c43d711d1893e0000e8323c4f/content.htm
    Regards,
    Ferry Lianto

  • Working with mx:tree and XML

    Hi there! I've been reading and googling for ages and I
    cannot find the solution to this problem, I want to load an xml
    into a <mx:tree> but i don't want to load all the xml
    structure. My xml look like this:
    <DataSet>
    <diffgr:diffgram>
    <NewDataSet>
    <Show>
    <uselessProperty>asdasd</uselessProperty>
    <uselessProperty1>asdasd</uselessProperty1>
    <uselessProperty2>asdasd</uselessProperty2>
    <uselessProperty3>asdasd</uselessProperty3>
    <Title>Title of the show</Title>
    <episodes>
    <episode1>
    <uselessProperty>asdasd</uselessProperty>
    <uselessProperty1>asdasd</uselessProperty1>
    <uselessProperty2>asdasd</uselessProperty2>
    <uselessProperty3>asdasd</uselessProperty3>
    <Title>Title of the show</Title>
    </episode1>
    <episode2>
    <uselessProperty>asdasd</uselessProperty>
    <uselessProperty1>asdasd</uselessProperty1>
    <uselessProperty2>asdasd</uselessProperty2>
    <uselessProperty3>asdasd</uselessProperty3>
    <Title>Title of the show</Title>
    </episode2>
    <episode3>
    <uselessProperty>asdasd</uselessProperty>
    <uselessProperty1>asdasd</uselessProperty1>
    <uselessProperty2>asdasd</uselessProperty2>
    <uselessProperty3>asdasd</uselessProperty3>
    <Title>Title of the episode</Title>
    </episode3>
    </episodes>
    </Show>
    <Show>
    <uselessProperty>asdasd</uselessProperty>
    <uselessProperty1>asdasd</uselessProperty1>
    <uselessProperty2>asdasd</uselessProperty2>
    <uselessProperty3>asdasd</uselessProperty3>
    <Title>Title of the show</Title>
    <episodes>
    <episode1>
    <uselessProperty>asdasd</uselessProperty>
    <uselessProperty1>asdasd</uselessProperty1>
    <uselessProperty2>asdasd</uselessProperty2>
    <uselessProperty3>asdasd</uselessProperty3>
    <Title>Title of the show</Title>
    </episode1>
    <episode2>
    <uselessProperty>asdasd</uselessProperty>
    <uselessProperty1>asdasd</uselessProperty1>
    <uselessProperty2>asdasd</uselessProperty2>
    <uselessProperty3>asdasd</uselessProperty3>
    <Title>Title of the show</Title>
    </episode2>
    <episode3>
    <uselessProperty>asdasd</uselessProperty>
    <uselessProperty1>asdasd</uselessProperty1>
    <uselessProperty2>asdasd</uselessProperty2>
    <uselessProperty3>asdasd</uselessProperty3>
    <Title>Title of the episode</Title>
    </episode3>
    </episodes>
    </Show>
    </NewDataSet>
    </diffgr:diffgram>
    </DataSet>
    I want to know if there is any way I can show the title of
    the show and the titles of the episodes as its children. By this
    time I've been just able to show the whole xml in the tree, but i
    just need those properties. I cannot find information about xml
    that doesn't have this format:
    <node property1="property" property1="property"
    property4="property" property3="property">
    <child property1="property" property1="property"
    property4="property" property3="property"/>
    <child property1="property" property1="property"
    property4="property" property3="property"/>
    <child property1="property" property1="property"
    property4="property" property3="property"/>
    </node>
    Please help me, my eyes will start bleeding if keep googling
    another nite.

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical"
    initialize="e4xService.send()">
    <mx:Script>
    <![CDATA[
    import mx.events.TreeEvent;
    import mx.rpc.events.ResultEvent;
    [Bindable]
    private var xmlData:XMLList;
    [Bindable]
    private var selectedXML:XML;
    private function resultHandler(event:ResultEvent):void
    var result:XML = event.result as XML;
    xmlData = result..title as XMLList;
    private function treeChangeHandler(event:Event):void
    selectedXML = myTree.selectedItem as XML;
    var xmlName:String = selectedXML.name();
    while (xmlName != "title")
    selectedXML = selectedXML.parent();
    xmlName = selectedXML.name();
    private function treeItemOpenHandler(event:TreeEvent):void
    selectedXML = event.item as XML;
    myTree.selectedItem = selectedXML;
    ]]>
    </mx:Script>
    <mx:HTTPService id="e4xService"
    url="assets/videoTitles.xml"
    result="resultHandler(event)"
    resultFormat="e4x"/>
    <mx:HBox width="800">
    <mx:Panel id="treePanel"
    title="Course Data" width="50%">
    <mx:Tree id="myTree"
    dataProvider="{xmlData}"
    labelField="@label"
    width="300"
    change="treeChangeHandler(event)"
    itemOpen="treeItemOpenHandler(event)"/>
    </mx:Panel>
    <mx:Panel width="50%"
    height="{treePanel.height}">
    <mx:Form>
    <mx:FormItem label="Course Name:">
    <mx:Label text="{selectedXML.@label}"/>
    </mx:FormItem>
    <mx:FormItem label="Duration:">
    <mx:Label text="{selectedXML.duration.@label}"/>
    </mx:FormItem>
    </mx:Form>
    </mx:Panel>
    </mx:HBox>
    </mx:Application>
    XML File:
    <?xml version="1.0"?>
    <titles>
    <title label="Flash User Experience Best Practices"
    software="Flash">
    <duration label="4.25 hours"/>
    </title>
    <title label="Flash Professional 8 New Features"
    software="Flash">
    <duration label="1.0 hours"/>
    </title>
    <title label="Flash Professional 8 Essential Training"
    software="Flash">
    <duration label="11.5 hours"/>
    </title>
    <title label="Flash Professional 8 Beyond the Basics"
    software="Flash">
    <duration label="10 hours"/>
    </title>
    <title label="Flash Professional 8 Video Integration"
    software="Flash">
    <duration label="7.25 hours"/>
    </title>
    <title label="Photoshop CS2 and Flash 8 Integration"
    software="Photoshop">
    <duration label="2.5 hours"/>
    </title>
    </titles>

  • Source XML Structure-Two Nodes with same names

    Hi All,
    I have a strange situation. I am doing a Webservice to RFC scenario. The Third party vendor provided me with the Source XML fro me to create the datatype.
    <?xml version="1.0" encoding="UTF-8"?>
    <Envelope version="01.00">
           <Sender>
                 <Id></Id>
                 <Credential></Credential>
           </Sender>
           <Recipient>
                 <Id></Id>
           </Recipient>
           <TransactInfo transactType="data">
                 <TransactId></TransactId>
                 <TimeStamp></TimeStamp>
           </TransactInfo>
           <Packet>
                 <PacketInfo packetType="data">
                        <PacketId>1</PacketId>
                        <Action></Action>
                        <Manifest></Manifest>
                 </PacketInfo>
                 <Payload><![CDATA[<?xml version="1.0"?>
    <DATA_1>
           <FIELD1></FIELD1>
           <FIELD2></FIELD2>
           <FIELD3></FIELD3>
           <FIELD4></FIELD4>
           <FIELD5></FIELD5>
    </DATA_1>]]></Payload>
           </Packet>
           <Packet>
                 <PacketInfo packetType="data">
                        <PacketId>2</PacketId>
                        <Action></Action>
                        <Manifest></Manifest>
                 </PacketInfo>
                 <Payload><![CDATA[<DATA_2 language="en">
         <FIELD1></FIELD1>
            <FIELD2></FIELD2>
            <FIELD3></FIELD3>
            <FIELD4></FIELD4>
            <FIELD5></FIELD5>
    </DATA_2>]]></Payload>
           </Packet>
    </Envelope>
    As We see Above, There are 2 Nodes named "Packet" at the Same level.
    So When I try to create my datatype in XI based on this XML, XI wont allow to create 2 nodes with same names at the same level.
    We asked the vendor to change the name of the second Packet to Packet_1, they told they cant change it.
    Is there a way in XI to handle this issue??. ie to create 2 nodes with the same name at the same level??
    Thanks,
    Harsh

    Hi,
    Thats's funy, web service is exposed by PI... but it's the thirdparty (client of our web service server) who imposes their choice for structure !! Inversed world.
    Either in Data Type, you define the "Packet" node with an occurence 0..N (or at least 0..2). That will allow you to have the 2 desired nodes by your third-party !
    Or... as your third-party does not want to chance something in their side, that means they probably already have such a web service and so a WSDL file or an XSD of this structure... So ask to them to provide you this WSDL, and you, you will use it as an External Def.
    regards.
    mickael

  • How can I get the XML structure from a flat structure?

    Hi all,
    in my XI SP 12 I use a JMS adapter to read information using the WebSphereMQ transport protocol.
    The structure that I receive have this format:
    <Name_A.KeyFieldValue><Name_A.fieldName_A1_Value>...<Name_A.fieldName_AN_Value>
    <NumberRecordType_B><NumberRecordType_c>
    <Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>
    <Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>
    <Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
    <Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
    the problem is that in this structure each line is not separated by a carriage return or a comma, I have all the information in a single line:
    <Name_A.KeyFieldValue><Name_A.fieldName_A1_Value>...<Name_A.fieldName_AN_Value><NumberRecordType_B><NumberRecordType_c><Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>...<Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value><Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>...<Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
    and the customer don't want to insert a line separator.
    Then, the question is:
    How can I get the XML structure from this structure?
    If possible, I don't want to develop new Module and add it in the JMS Module Sequence.
    PS I have already read the article "How to Use the Content Conversion Module with the XI 3 J2EE JMS Adapter.pdf" and it doesn't seem to help me.
    Best Regards,
    Paolo

    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 >");

  • One Communication Channel for two XML-Structure

    Hi to all!
    i'm Newbee in XI.
    i register one Communication Channel to recieve two different XML-Structure and when i sent second structure there was a Mapping error, because XI waiting for first XML-Structure.
    I'd like to ask if there are any additional condition that i must tune up to make it possible or just it's impossible?

    Hi,
    Please refer below links
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/121b053d-0401-0010-539f-f9295efb7bad
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3a913f71-0601-0010-7a83-dfd3208a9a0b
    how to find the URL of deployed Web services?
    Creating .NET Web service
    http://www.15seconds.com/issue/010430.htm
    Also refer SOAP Framework to generate the common wsdl for both the messages with single SOAP CC
    http://help.sap.com/saphelp_nw04s/helpdata/en/bb/ddb33d2ae46b3be10000000a114084/frameset.htm
    Thanks
    swarup

  • Special characters in XML structure when prepared using String

    Hi,
       I am preparing an XML structure using 'String'. I print the prepared XML structure in the server log. Issue is that I am seeing extra characters([[ and ]]) that I am not printing.
    Please let me know how to get rid of those.
    Code Excerpt
            String xmlHeader = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>";
            String lsb_xmlcon = xmlHeader;
            logger.info("ReqXMLString Process  1  --->" + lsb_xmlcon);
            lsb_xmlcon = lsb_xmlcon +("\n");
            logger.info("ReqXMLString Process  1.1  --->" + lsb_xmlcon);
            lsb_xmlcon = lsb_xmlcon +("<REQUEST>");
            lsb_xmlcon = lsb_xmlcon +("\n");
            logger.info("ReqXMLString Process  1.2  --->" + lsb_xmlcon);
    Log
    ReqXMLString Process  1  ---><?xml version="1.0" encoding="utf-8" ?>
    ReqXMLString Process  1.1  ---><?xml version="1.0" encoding="utf-8" ?>[[
    ReqXMLString Process  1.2  ---><?xml version="1.0" encoding="utf-8" ?>[[
    <REQUEST>
    Thanks,
    Message was edited by: 996913
    This issue is observed only while running the code in server, not from Jdev.
    When we append the additional tags without new line character, "\n", there are no extra characters being added. Also, in other case also. where we used "Marshaller" to prepare the XML, we have seen this issue.
    After we set the below property to false, we got rid of the extra characters.
                            jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, false);
    Apparently the insertion of new line when the code runs on server(Weblogic 10.3.6.0) is creating the issue.
    Please let me know if anyone has come across a similar scenario.
    Thanks,

    I am building this XML in a servlet so ,right, DOM does process XML (even though a valid HTML file can be loaded into a DOM object) but if you build XML using DOM then write the XML out using PrintWriter and Transformer objects this will cause the XML to print out in your browser. If you view source on this XML you will see that the DOM object has translated all special characters to there &xxxx; equivalent. For a example: when the string (I know "cool" java) gets loaded into a attribute using the DOM object then wrote back out it looks like (I know &xxx;cool&xxx; java) if you view the source in your browser. This is what it should do, but the DOM object is not change the � to the "&xxxxx;". This servlet is acting as a gateway between a Java API and a windows asp. The asp will call the servlet expecting to get XML back and load it directly into a DOM object. When the windows DOM object gets the xml that I am returning in this servlet is throws a exception "invalid character" because the � was not translated to &xxxx; like the other characters were. According to the book HTML 4 in 24 hours (and other references) the eacute; or #233; are how you say "�" in HTML or XML. How do you say it?

Maybe you are looking for