XML export root node attriubute?

Hi
I need to use XML export extension to generate XML to something like this:
<photos path="images/">
<photo id="1" name="Photo 1" blabla ="" url="1.jpg">This is the optional description for photo 1</photo>
<photo id="2" name="Photo 2" blabla ="" url="2.jpg">This is the optional description for photo 2</photo>
<photo id="3" name="Photo 3" blabla ="" url="3.jpg">This is the optional description for photo 3</photo>
<photo id="4" name="Photo 4" blabla ="" url="4.jpg">This is the optional description for photo 4</photo>
<photo id="5" name="Photo 5" blabla ="" url="5.jpg">This is the optional description for photo 5</photo>
</photos>
The problem is the root nodes path="images/"
Is there a way to edit the XMLExport.class.php to do that?
I can in DW edit the $xmlExportObj->setRootNode('photos'); to $xmlExportObj->setRootNode('photos path="images/"');
But that gives an error because the end node looks like </photos path="images/">
Hopefully there is an easy fix for this
Regards
olle

Thank you both.
Acctually I found out a quick way. I edit the XMLExport.class.php
In the bottom just before the headers i just put in:
$document .= '</Photos>';
Instead of:
$document .= '</' . $this->rootNodeName . '>';
Off course this is not so dynamic. And can only be used for the page I want.
Otherwise I think that the Spry export to XML is great.
Regards
olle

Similar Messages

  • Root node contains specific attribute could make the XSLT transfrom fail

    I have to convert EJB deploy desciptor in my project, but I found that XML format transfrom with Apache Xalan will fail when the root node contants some specific attribute.
    Here is an example:
    Input XML file:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <catalog xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2eehttp://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"
    version="2.1">
    <cd>
    <title>Empire Burlesque</title>
    <artist>Bob Dylan</artist>
    <country>USA</country>
    <company>Columbia</company>
    <price>10.90</price>
    <year>1985</year>
    </cd>
    <cd>
    <title>Hide your heart</title>
    <artist>Bonnie Tyler</artist>
    <country>UK</country>
    <company>CBS Records</company>
    <price>9.90</price>
    <year>1988</year>
    </cd>
    </catalog>
    XSL transfer file:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method='html' version='1.0' encoding='UTF-8' indent='yes'/>
    <xsl:template match="/">
    <html>
    <body>
    My CD Collection
    <table border="1">
    <tr bgcolor="#9acd32">
    <th align="left">Title</th>
    <th align="left">Artist</th>
    </tr>
    <xsl:for-each select="catalog/cd">
    <tr>
    <td><xsl:value-of select="title"/></td>
    <td><xsl:value-of select="artist"/></td>
    </tr>
    </xsl:for-each>
    </table>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>
    The XML transfrom will fail in this way.
    But if I remove the attributes in the input xml's root node, such as this:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <catalog>
    <cd>
    The transform operation will succeed.
    Does anyone know the reason?

    In your xslt you will have to make sure to reference the elements using the http://java.sun.com/xml/ns/j2ee namespace.
    Change your XSLT to be something like this and it should work:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:j2ee="http://java.sun.com/xml/ns/j2ee">
    <xsl:output method='html' version='1.0' encoding='UTF-8' indent='yes'/>
    <xsl:template match="/">
    <html>
    <body>
    My CD Collection
    <table border="1">
    <tr bgcolor="#9acd32">
    <th align="left">Title</th>
    <th align="left">Artist</th>
    </tr>
    <xsl:for-each select="j2ee:catalog/j2ee:cd">
    <tr>
    <td><xsl:value-of select="j2ee:title"/></td>
    <td><xsl:value-of select="j2ee:artist"/></td>
    </tr>
    </xsl:for-each>
    </table>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>

  • Grabbing the elements from the XML root node

    Hello,  I haven't worked with XML in over a year and I didn't use it much then.  I'm trying to remember the best way to get the values from the root note (not child nodes).
    For instance, in the following xml, I want the timestamp and the messageID from stumessages.
    I can't recall if you are supposed to use xmlsearch or something else.  I know how to grab the child nodes (for some reason, that part was easier to recall).
    <cfsavecontent variable="XMLFile"><?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE stuMessages SYSTEM "http://cody.glpconnect.com/DTD/StuMessage_Rev6.dtd">
    <stuMessages timeStamp="14/05/2012 08:02:11 GMT" messageID="9768c7201b6f100585fbfa3243489116">
         <stuMessage>
              <esn>0-999999</esn>
              <unixTime>1336982529</unixTime>
              <gps>N</gps>
              <payload length="9" source="pc" encoding="hex">0x3530E2B18801031200</payload>
         </stuMessage>
    </stuMessages>
    </cfsavecontent>
    <!--- Set the XML to a XML parsed variable we can use --->
    <cfset MyXMLDoc = xmlParse(XMLFile) />
    <!--- Dump the XML --->
    <h2>Dump</h2>
    <!--- <cfdump var="#MyXMLDoc#"> --->
    <!--- Get all Message Nodes --->
    <cfset messageNodes = xmlSearch(MyXMLDoc,'/stuMessages/stuMessage')>
    <cfoutput>
        <h2>Message Nodes</h2>
        <cfloop from="1" to="#arraylen(messageNodes)#" index="i">
            <!--- The array contents need to parsed so you can easily get at the child nodes children and attributes. --->
            <cfset messageXML = xmlparse(messageNodes[i]) />
            <b>esn:</b> #messageXML.stuMessage.esn.xmltext#<br>
            <b>unixTime:</b> #messageXML.stuMessage.unixTime.xmlText#<br>
            <b>gps:</b> #messageXML.stuMessage.gps.xmlText#<br>
            <b>payload:</b> #messageXML.stuMessage.payload.xmlText#<br><br>
        </cfloop>
    </cfoutput>
    Best regards
    KR

    Hello,
    I figured it out.
    I figured I would update my post in case anyone else was curious.
    I just need to add the following two lines into the code to expose the elements of the root node.
        <cfset timeStamp = MyXMLDoc.stuMessages.XmlAttributes.timeStamp>
        <cfset messageid = MyXMLDoc.stuMessages.XmlAttributes.messageID>
    The full code follows
    <!--- Set the XML to a XML parsed variable we can use --->
    <cfset MyXMLDoc = xmlParse(XMLFile) />
    <!--- Dump the XML --->
    <h2>Dump</h2>
    <!--- <cfdump var="#MyXMLDoc#"> --->
    <!--- Get all Message Nodes --->
    <cfset messageNodes = xmlSearch(MyXMLDoc,'/stuMessages/stuMessage')>
    <cfoutput>
        <cfset timeStamp = MyXMLDoc.stuMessages.XmlAttributes.timeStamp>
        <cfset messageid = MyXMLDoc.stuMessages.XmlAttributes.messageID>
        #timeStamp#<br />
        #messageid#<br />
        <h2>Message Nodes</h2>
        <cfloop from="1" to="#arraylen(messageNodes)#" index="i">
            <!--- The array contents need to parsed so you can easily get at the child nodes children and attributes. --->
            <cfset messageXML = xmlparse(messageNodes[i]) />
            <b>esn:</b> #messageXML.stuMessage.esn.xmltext#<br>
            <b>unixTime:</b> #messageXML.stuMessage.unixTime.xmlText#<br>
            <b>gps:</b> #messageXML.stuMessage.gps.xmlText#<br>
            <b>payload:</b> #messageXML.stuMessage.payload.xmlText#<br><br>
        </cfloop>
    </cfoutput>

  • Dynamically rename the root node of XML based on the child elements

    Hi Gurus,
    Is there any way to rename the root node of the resultant XML after a mapping based on the child elements.
    For ex:
    consider the following resultant XML after mapping
    <result>
    <element1> </element1>
    <result>
    if the element1 is <type> then the output should be
    <category>
    <type> </type>
    </category>
    elseif the element1 is <character> then the output should be
    <property>
    <character> </character>
    </property>
    Let me know how to do this, either in XSLT or in Graphical mapping.
    Thanks,
    Prabu

    Hi, Prabu:
    In this case, I am suggest you have Src and Tar Message.
    I am suggesting you create another type of message using key / value pair as I suggested, e.g. called Mid Message.
    My solution for you is to have two message mappings:
    1. Src -> Mid
    2. Mid -> Tar.
    In first mapping, you have no control of the structure, but you can map it to Mid structure:
    e.g.
      if Type node Exist, then map 'Type' to Key, as Key/Value can be creatd under a parent node with 0:1 Occurrence.
      saying item.
       in this case, a new item created.
    If you think of this way, any xml file can be represted in this way:
       <Employee>
          <Fname>David</Fname>
          <Lname>Miller</Lname>
       </Employee>  
       <Employee>
          <Fname>Steve</Fname>
          <Lname>Mai</Lname>
       </Employee>   
    Can be interpretd as this way:
       <Employee>
          <Element>
             <key>Fname</Key>
             <value>David</Value>
          </Element>
          <Element>
             <key>Lname</Key>
             <value>Miller</Value>
          </Element>
       </Employee>  
       <Employee>
          <Element>
             <key>Fname</Key>
             <value>Steve</Value>
          </Element>
          <Element>
             <key>Lname</Key>
             <value>Mai</Value>
          </Element>
       </Employee> 
    Now you should understand what I mean.
    In your case target structure have to desgined as following way:
    You need to put Category and Property together with their sub-structure in parallel, make occurence to 0:1
    In your second mapping, you can check the key value is "Type" or "Character", based on which one is true,
    you create corresponding structure: either Categary or Property.
    Regards
    Liang
    Edited by: Liang Ji on Oct 22, 2010 8:31 PM
    Edited by: Liang Ji on Oct 22, 2010 8:35 PM

  • XML export trouble

    Im trying to create a dynamic photo gallery using Spry and XML that will ultimately resemble the spry gallery demo(http://labs.adobe.com/technologies/spry/demos/gallery/). My troubles occur when i attempt to create a dataset off of a dynamic recordset in an XMLexport.php file (like the tutorial - Using XML Export to create dynamic Spry data sets) i have trouble.
    I have my dynamic XML file named export.php and when i navigate to export.php it displays the data in the proper format (xml style). My trouble comes when i try to incorporate export.php into my XML dataset. I navigate to the file and click schema and i get a Design Time Feed error. The first line states that it failed to get schema from dynamic data, it then ask me to provide a design time feed.
    When i close the pop-up window i get an error message in the row element window of the - invalid document structure (1,1).
    What am I missing when i do this?
    Just so its easy to establish my document structure i use Xampp on my laptop with htdocs being my root and each site in their own folder within htdocs. I have my localhost set to htdocs so the database will.
    Cheers
    Ryan

    Hi Ryan,
    I navigate to the file and click schema and i get a Design Time Feed error. The first line states that it failed to get schema from dynamic data, it then ask me to provide a design time feed
    at this point Spry´s Dreamweaver UI expects a "hardcoded" XML file containing all the nodes & values etc -- the XML structure and data of your export.php will be parsed and generated by your server, but Dreamweaver itself is no web server and can´t parse PHP files from within.
    That said, code yourself a real XML file containing just one node with "dummy" data, and make sure that its XML structure plus data format will be identical to what your export.php file will also generate -- use this static XML file to feed Spry´s UI, and when your page can be considered "ready for consumption", replace the pointer to your "dummy" XML file with a link to export.php
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • How do i add a root node to a XMLType

    Hi all
    I have a problem inserting a root node in a xml document generated by DBMS_XMLGEN.newcontextfromhierarchy. The function get_site_map_nodes generates a document like this:
    <?xml version="1.0"?>
    <siteMapNode f_page_id="1" title="rot" PATH="1">
    <siteMapNode f_page_id="2" title="1.1" PATH="1.1">
    <siteMapNode f_page_id="4" title="1.1.1" PATH="1.1.1"/>
    </siteMapNode>
    <siteMapNode f_page_id="3" title="1.2" PATH="1.2"/>
    <siteMap/>
    </siteMapNode>
    This is correct but i want to add a root node so the result shows as below:
    <?xml version="1.0"?>
    <siteMap>
    <siteMapNode f_page_id="1" title="rot" PATH="1">
    <siteMapNode f_page_id="2" title="1.1" PATH="1.1">
    <siteMapNode f_page_id="4" title="1.1.1" PATH="1.1.1"/>
    </siteMapNode>
    <siteMapNode f_page_id="3" title="1.2" PATH="1.2"/>
    <siteMap/>
    </siteMapNode>
    </siteMap>
    The problem is that i have no clue how to accomplish this.
    Best regards
    Daniel Carlsson
    PACKAGE BODY PKG_PAGE_STRUCTURE
    IS
    FUNCTION get_level_path (in_page_id IN page_structure.f_page_id%TYPE)
    RETURN VARCHAR2
    IS
    l_path VARCHAR2 (4000) := '';
    BEGIN
    SELECT MAX (SYS_CONNECT_BY_PATH (f_show_order, '.'))
    INTO l_path
    FROM page_structure
    START WITH f_page_id = in_page_id
    CONNECT BY PRIOR f_parent_page = f_page_id;
    l_path := RTRIM (l_path, '.');
    RETURN l_path;
    END get_level_path;
    FUNCTION get_site_map_nodes (in_page_id IN page_structure.f_page_id%TYPE)
    RETURN XMLTYPE
    IS
    qryctx DBMS_XMLGEN.ctxhandle;
    l_xml XMLTYPE;
    BEGIN
    qryctx :=
    DBMS_XMLGEN.newcontextfromhierarchy
    ('select level, xmlelement("siteMapNode", XMLAttributes(f_page_id as "f_page_id",
    f_title_phrase as "title", pkg_page_structure.get_level_path(f_page_id) as path))
    FROM PAGE_STRUCTURE
    START WITH f_page_id = :in_page_id
    connect by f_parent_page = prior f_page_id
    ORDER siblings BY f_show_order'
    DBMS_XMLGEN.setbindvalue (qryctx, 'in_page_id', TO_CHAR (in_page_id));
    l_xml := DBMS_XMLGEN.getxmltype (qryctx);
    DBMS_XMLGEN.closecontext (qryctx);
    RETURN l_xml;
    END get_site_map_nodes;
    END PKG_PAGE_STRUCTURE;
    CREATE TABLE page_structure
    (f_page_id NUMBER(10,0) NOT NULL,
    f_parent_page NUMBER(10,0),
    f_show_order NUMBER(10,0),
    f_title_phrase VARCHAR2(20),
    f_created_by NUMBER(10,0),
    f_created_date DATE,
    f_updated_by NUMBER(10,0),
    f_updated_date DATE)
    INSERT INTO page_structure
    (F_PAGE_ID,F_PARENT_PAGE,F_SHOW_ORDER,F_TITLE_PHRASE,F_CREATED_BY,F_CREATED_DATE,F_UPDATED_BY,F_UPDATED_DATE)
    VALUES
    (1,NULL,1,'rot',1,'30-MAR-2006',NULL,NULL)
    INSERT INTO page_structure
    (F_PAGE_ID,F_PARENT_PAGE,F_SHOW_ORDER,F_TITLE_PHRASE,F_CREATED_BY,F_CREATED_DATE,F_UPDATED_BY,F_UPDATED_DATE)
    VALUES
    (2,1,1,'1.1',1,'30-MAR-2006',NULL,NULL)
    INSERT INTO page_structure
    (F_PAGE_ID,F_PARENT_PAGE,F_SHOW_ORDER,F_TITLE_PHRASE,F_CREATED_BY,F_CREATED_DATE,F_UPDATED_BY,F_UPDATED_DATE)
    VALUES
    (3,1,2,'1.2',1,'30-MAR-2006',NULL,NULL)
    INSERT INTO page_structure
    (F_PAGE_ID,F_PARENT_PAGE,F_SHOW_ORDER,F_TITLE_PHRASE,F_CREATED_BY,F_CREATED_DATE,F_UPDATED_BY,F_UPDATED_DATE)
    VALUES
    (4,2,1,'1.1.1',1,'30-MAR-2006',NULL,NULL)
    /

    Please try below steps.
    1. Complete Prerequisite for adding cluster node
    2. Verify the node is accessible to all other nodes in the cluster. Run the following command from the existing node in the cluster.
    cluvfy stage -pre crsinst -n newNode
    3. Run cluvfy from any existing node
    cluvfy stage -pre nodeadd -n <New Node>
    Note : If cluvfy in above step shows any errors fix those and then proceed with this step
    4. Change Directory to Clusterware Home and execute addNode scripts from any existing node.
    cd $CRS_HOME/oui/bin
    ./addNode.sh -silent "CLUSTER_NEW_NODES={ <NewNode > } CLUSTER_NEW_PRIVATE_NODE_NAMES={ <Interconnect >} CLUSTER_NEW_VIRTUAL_HOSTNAMES={ < Virtual Host Name >}"
    At the end of addNode, script will prompt to run for root.sh on newly added node.
    5. Verify Node is successfully added
    cluvfy stage -post nodeadd -n <NewNode >
    6. Verify CRS Stack is running on the new Node.
    $CRS_HOME/bin/crs_stat -t
    7. To extend the Oracle RAC Installation to include the new Node, run addNode from $ORACLE_HOME/oui/bin from existing node in the cluster
    cd $CRS_HOME/oui/bin
    ./addNode.sh
    When OUI displays the Specify Cluster Nodes to Add to Installation window, select the node to be added, then click Next .
    Verify the summary and run root.sh on new node when it prompts.
    8. Adding New Instance on the New Node
    $CRS_HOME/bin/lsnrctl status
    9.Run $ORACLE_HOME/bin/dbca from any of the existing RAC Instances Oracle Home.
    Select Oracle Real Application Clusters database , and then click Next .
    Select Instance Management , and then click Next .
    Select Add an Instance , then click Next .
    Click Next to accept default instance name or it can be changed.
    Check the summary window.
    Note: Please check these steps in test environment first.
    HTH

  • How to Create Instances in the Transient Root Node and Sub Nodes from Root Node Query Method ?

    Hi All,
    I am Creating a BOPF BO with 3 Nodes,
    Node 1) ROOT -- > contains a query,
    using Root Node I have created Search UIBB Configuration in FBI.
    In testing -- > when i enter Data in the Search Criteria Fields am able to get the details in to the query method
    from Imporing parameter : 'IT_SELECTION_PARAMETERS'.
    HERE I am fetching data from a standard table and trying to fill the data in the Node : 'MNR_SEARCH_RESULT'.
    How to Append data to the Sub node 'MNR_SEARCH_RESULT' when there is no Node instance created in the ROOT Node ?
    For This  I have created an instance in the ROOT Node and Using that I tried to create Instance in the Sub Node 'MNR_SEARCH_RESULT'.
    Below is my code which i have placed in the Query method ..
    DATA : LR_DATA TYPE REF TO ZBO_S_ROOT1.
    DATA : LR_SEARCH_RES TYPE REF TO ZBO_S_MNR_SEARCH_RESULT.
    DATA : LO_CI_SERVICE_MANAGER TYPE REF TO /BOBF/IF_TRA_SERVICE_MANAGER,
            LO_TRANSACTION_MANAGER TYPE REF TO /BOBF/IF_TRA_TRANSACTION_MGR.
       LO_CI_SERVICE_MANAGER = /BOBF/CL_TRA_SERV_MGR_FACTORY=>GET_SERVICE_MANAGER( IV_BO_KEY = ZIF_BO_TEST_PO_C=>SC_BO_KEY ).
       LO_TRANSACTION_MANAGER = /BOBF/CL_TRA_TRANS_MGR_FACTORY=>GET_TRANSACTION_MANAGER( ).
    CREATE DATA LR_DATA.
    LR_DATA->KEY = LO_CI_SERVICE_MANAGER->GET_NEW_KEY( ).
    LR_DATA->ROOT_KEY   = IS_CTX-ROOT_NODE_KEY.
    LR_DATA->PIPO_MAT_ID = '100100'.
    LR_DATA->PIPO_MAT_DESC = 'MATERIAL'.
    LR_DATA->PIPO_SPRAS = 'E'.
    LR_DATA->PIPO_MATL_TYPE = 'ZPMI'.
    LR_DATA->PIPO_MATL_GROUP = 'ZKK'.
         DATA lt_mod      TYPE /bobf/t_frw_modification.
         DATA lo_change   TYPE REF TO /bobf/if_tra_change.
         DATA lo_message  TYPE REF TO /bobf/if_frw_message.
         FIELD-SYMBOLS: <ls_mod> LIKE LINE OF lt_mod.
        APPEND INITIAL LINE TO lt_mod ASSIGNING <ls_mod> .
        <ls_mod>-node        =   ZIF_BO_TEST_PO_C=>sc_node-ROOT.
        <ls_mod>-change_mode = /bobf/if_frw_c=>sc_modify_create.
        <ls_mod>-key         = LR_DATA->KEY.
        <ls_mod>-data        = LR_DATA.
    DATA : LT_CHG_FIELDS TYPE /BOBF/T_FRW_NAME.
    DATA : LS_CHG_FIELDS LIKE LINE OF LT_CHG_FIELDS.
    DATA : LV_KEY TYPE /BOBF/CONF_KEY.
    CALL METHOD IO_MODIFY->CREATE
       EXPORTING
         IV_NODE            = ZIF_BO_TEST_PO_C=>sc_node-ROOT
         IV_KEY             = LR_DATA->KEY
         IS_DATA            = LR_DATA
         IV_ROOT_KEY        = IS_CTX-ROOT_NODE_KEY
       IMPORTING
         EV_KEY             = LV_KEY .
    CREATE DATA LR_SEARCH_RES.
    LR_SEARCH_RES->KEY           = LO_CI_SERVICE_MANAGER->GET_NEW_KEY( )..
    LR_SEARCH_RES->PARENT_KEY    = LV_KEY.
    LR_SEARCH_RES->ROOT_KEY    = LV_KEY.
    LR_SEARCH_RES->MATNR    = '123'.
    LR_SEARCH_RES->ERSDA    = SY-DATUM.
    LR_SEARCH_RES->ERNAM    = SY-UNAME.
    **LR_SEARCH_RES->LAEDA    = .
    **LR_SEARCH_RES->AENAM    = .
    **LR_SEARCH_RES->VPSTA    = .
    *LR_SEARCH_RES->LVORM    = .
    LR_SEARCH_RES->MTART    = 'ZPI'.
    LR_SEARCH_RES->MBRSH    = 'ZTP' .
    LR_SEARCH_RES->MATKL    = 'MAT'.
    **LR_SEARCH_RES->BISMT    = ''
    **LR_SEARCH_RES->MEINS    =
    CALL METHOD io_modify->create
               EXPORTING
                 iv_node            = ZIF_BO_TEST_PO_C=>sc_node-MNR_SEARCH_RESULT
                 is_data            = LR_SEARCH_RES
                 iv_assoc_key       = ZIF_BO_TEST_PO_C=>sc_association-root-MNR_SEARCH_RESULT
                 iv_source_node_key = ZIF_BO_TEST_PO_C=>sc_node-root
                 iv_source_key      = LV_KEY
                 iv_root_key        = LV_KEY.
    I am Unable to set data to the Node . I did not get any error message or Dump while executing . when i tried to retrive data I got the details from the node but am unable to view those details in the FBI UI and BOBT UI while testing .
    Please provide your valuable Suggestions.
    Thanks in Adv.
    Thanks ,
    Kranthi Kumar M.

    Hi Kranthi,
    For your requirement you need only two nodes. Root Node and Result node. Use the same structure for both.
    To create Instance while search.
    Create Query method with input type which has the required fields for selection criteria.
    Fetch the data and create instance in the root node.
    Pass the new instance key as exporting parameter form Query Method.
    To Move data from ROOT to Result.
    Create a action at root node.
    Write a code to create new entries in Result node.
    Then configure the Search UIBB and display result in List UIBB. Add button and assign the action MOVE_MAT_2_RESULT.
    Create another List uibb to display data from Result node.
    Connect the UIBBs using wire schema. SEARCH -> LIST(ROOT) ---> LIST(RESULT).
    Give src node association for ROOT to RESULT Configuration.
    Regards,
    Sunil

  • How to handle unknown root node type when parsing?

    Hello all, hoping someone knows how to accomplish this...
    I'm trying to use XMLBeans to parse RIXML 2.0 documents. This schema allows for
    multiple root node types, so I don't know when I'm trying to parse a file if the
    root node is a Research node or a Product node, for example. If I try to invoke
    parse and there is a type mismatch I get the following error:
    com.bea.xml.XmlException: D:\RIXML\V2TestDoc.xml:0: error: The document is not
    a Research@http://www.rixml.org/2002/6/RIXML: document element local name mismatch
    expected Researchgot Product
         at com.bea.xbean.store.Root.verifyDocumentType(Root.java:472)
         at com.bea.xbean.store.Root.autoTypedDocument(Root.java:394)
         at com.bea.xbean.store.Root.loadXml(Root.java:763)
         at com.bea.xbean.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:286)
         at com.bea.xbean.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:224)
         at org.rixml.x2002.x6.rixml.ResearchDocument$Factory.parse(Unknown Source)
         at Test.main(Test.java:21)
    Exception in thread "main"
    So how do I generically handle parsing when I don't know what type of root node
    I'm going to get?
    Thanks,
    Joe

    Hello Joe -- You might try parsing the document as XmlObject (which your
    schema-generated types extend). Then you could use an XmlCursor to discover
    what the root element's local name is. Something like the following code
    might be a way to do it. You could also simply re-parse the document after
    discovering its root element name, but that would probably be more
    expensive.
    XmlObject xml = XmlObject.Factory.parse(mydoc.xml);
    XmlCursor cursor = xml.newCursor();
    cursor.toFirstContentToken();
    if (cursor.getName().getLocalPart().equals("Research"))
    // cast the XmlObject to your ResearchDocument type and use it.
    else if (cursor.getName().getLocalPart().equals("Product"))
    // cast the XmlObject to your ProductDocument type and use it.
    cursor.dispose();
    Steve
    "Joe Celentano" <[email protected]> wrote in message
    news:[email protected]..
    >
    Hello all, hoping someone knows how to accomplish this...
    I'm trying to use XMLBeans to parse RIXML 2.0 documents. This schemaallows for
    multiple root node types, so I don't know when I'm trying to parse a fileif the
    root node is a Research node or a Product node, for example. If I try toinvoke
    parse and there is a type mismatch I get the following error:
    com.bea.xml.XmlException: D:\RIXML\V2TestDoc.xml:0: error: The document isnot
    a Research@http://www.rixml.org/2002/6/RIXML: document element local name
    mismatch
    expected Researchgot Product
    at com.bea.xbean.store.Root.verifyDocumentType(Root.java:472)
    at com.bea.xbean.store.Root.autoTypedDocument(Root.java:394)
    at com.bea.xbean.store.Root.loadXml(Root.java:763)
    atcom.bea.xbean.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:28
    6)
    atcom.bea.xbean.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:22
    4)
    at org.rixml.x2002.x6.rixml.ResearchDocument$Factory.parse(Unknown Source)
    at Test.main(Test.java:21)
    Exception in thread "main"
    So how do I generically handle parsing when I don't know what type of rootnode
    I'm going to get?
    Thanks,
    Joe

  • Problem with Xml exporter

    Hi All,
    Thanks in advance for ur warm replies.
    I am exporting personalizations which i did but iam facing problems with this.
    Please help me on this issue.
    Steps i follwed.
    Step1: exec jdr_utils.listcustomizations('/oracle/apps/ego/item/eu/webui/EGOITEMATTRIBUTEPGL');
    It displays me the customizations which i did as follows
    /oracle/apps/ego/item/eu/webui/customizations/responsibility/24091/EGOITEMATTRIBUTEPGL
    Pl/sql procedure completed successfully.
    Step2: Iam now at command prompt on java_top and i run the following command
    java oracle.jrad.tools.xml.exporter.XMLExporter
    /oracle/apps/ego/item/eu/webui/customizations/responsibility/24091/EGOITEMATTRIBUTEPGL
    -username apps -password <mypwd> \
    -dbconnection "(description=(address_list=(address=(protocol=tcp)(host=<host>)(port=<myport>)))(connect_data=(sid=<mysid>)))" \
    -rootdir "/oracle/apps/ego/item/eu/webui/EGOITEMATTRIBUTEPGL'"
    * I don't know exactly what is root directory here. which path i need to provide here.*
    Error: No such file or directory.
    Thanks and Regards
    Zaheer

    Zaheer,
    <output_dir> - (Required) Output directory where the exported xml file structure is to be stored. You may set this to any directory, however, we recommend that you export your packages or XML files to $APPL_TOP/personalizations.
    If you run the export tool for the package
    /oracle/apps/ak/dem/webui/customizations/site/0/REQORDERSTATUSPAGE and specify -rootdir
    $APPL_TOP/personalizations, the xml file is saved as
    $APPL_TOP/personalizations/oracle/apps/ak/dem/webui/customizations/site/0/REQORDERSTATUS PAGE.xml.
    In your case define rootdir as rootdir "/oracle/apps/ego/item/eu/webui ".
    Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Binding properties of a root node and using fx:include.

    I posted a downloadable example of this here:
    https://dl.dropboxusercontent.com/u/8788282/binding-test.zip
    I've noticed some understandable, but less than perfect behaviour with the way FXML initialization is done when using fx:include.  I find it's difficult to bind properties that belong to the root node of the included view without shooting yourself in the proverbial foot.  Here is an example of what I mean:
    sample.Main
    package sample;
    import javafx.application.Application;
    import javafx.fxml.FXMLLoader;
    import javafx.scene.Parent;
    import javafx.scene.Scene;
    import javafx.stage.Stage;
    public class Main extends Application {
        @Override
        public void start(Stage primaryStage) throws Exception {
            Parent root = FXMLLoader.load(getClass().getResource("MainView.fxml"));
            primaryStage.setTitle("Hello World");
            primaryStage.setScene(new Scene(root, 300, 275));
            primaryStage.show();
        public static void main(String[] args) {
            launch(args);
    sample.MainController
    package sample;
    import javafx.fxml.FXML;
    public class MainController {
        @FXML
        void initialize() {
            System.out.println("MainController initialized.");
    sample.MainView (FXML)
    <?xml version="1.0" encoding="UTF-8"?>
    <?import javafx.scene.control.Label?>
    <?import javafx.scene.layout.*?>
    <AnchorPane prefHeight="200.0" prefWidth="200.0"
                xmlns:fx="http://javafx.com/fxml/1"
                xmlns="http://javafx.com/javafx/2.2"
                fx:controller="sample.MainController">
        <children>
            <VBox prefHeight="200.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0"
                  AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
                  AnchorPane.topAnchor="0.0">
                <children>
                    <Label text="Main"/>
                    <StackPane prefHeight="150.0" prefWidth="200.0"/>
                    <fx:include fx:id="sub" source="SubView.fxml" visible="false"/>
                </children>
            </VBox>
        </children>
    </AnchorPane>
    sample.SubController
    package sample;
    import javafx.beans.binding.Bindings;
    import javafx.fxml.FXML;
    import javafx.scene.control.Label;
    import javafx.scene.layout.AnchorPane;
    public class SubController {
        @FXML
        private AnchorPane anchorPane;
        @FXML
        private Label label;
        @FXML
        void initialize() {
            label.visibleProperty().bind(Bindings.createBooleanBinding(() -> true));
            /* When used as part of an fx:include, this controller's initialize()
             * block is called and the below binding is performed.  After that, any
             * property values set via the containing view (MainView) are applied.
             * In this example, the MainView attempts to set the visible property
             * of this included view (fx:id="sub").  Since the visible property of
             * the root node (anchorPane) has already been bound, the error
             * "A bound value cannot be set." is given.
            anchorPane.visibleProperty().bind(Bindings.createBooleanBinding(() -> true));
            System.out.println("SubController initialized.");
    sample.SubView (FXML)
    <?xml version="1.0" encoding="UTF-8"?>
    <?import javafx.scene.control.Label?>
    <?import javafx.scene.layout.*?>
    <AnchorPane id="AnchorPane" fx:id="anchorPane" maxHeight="-Infinity"
                maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity"
                prefHeight="400.0" prefWidth="600.0"
                xmlns:fx="http://javafx.com/fxml/1"
                xmlns="http://javafx.com/javafx/2.2"
                fx:controller="sample.SubController">
        <children>
            <VBox prefHeight="400.0" prefWidth="600.0" AnchorPane.bottomAnchor="0.0"
                  AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
                  AnchorPane.topAnchor="0.0">
                <children>
                    <Label fx:id="label" text="sub view"/>
                </children>
            </VBox>
        </children>
    </AnchorPane>
    The comments in the initialize method of SubController explain what's happening.  I found it a bit confusing until I figured out what was going on.  Should FXMLLoader be checking to see if a property is already bound before trying to set it, at least for nodes declared via fx:include?

    Hi Gaurave,
    We need to show the report like this to some users, thats what the requirement is. Using the Posted nodes option does not help.
    Thanks.

  • Create root node and child nodes while downloading data from internal table

    Hi all,
    i have to down load the details of three materials present in the internal table into
    a  XML file, the material number must be the root node, ERNAM,AENAM,VPSTA
    fields must be its child nodes. in this way i have to display details of three
    materials like material1,material2,material3.
    how can i do that in 4.6c version.
    Thanks,
    satish.

    Hi Satish,
    Please look into the following programs. These are sample SAP programs to deal with XML in 46c.
    BCCIIXMLT1
    BCCIIXMLT2
    BCCIIXMLT3
    Hope these will helps,
    Sumant.

  • [JAXB] Multiple imports in the root node

    Hello,
    I use JAXB and am doing this scenario : unmarshalling an XML document created manually, and automatically marshalling another from the generated Java code.
    This is a multiple schemas / multiple imports issue.
    I would like the 2 XML documents to be similar, but in the first one, I get :
    <?xml version="1.0" encoding="UTF-8"?>
    <aaa:first xmlns:aaa="http://aaa" xmlns:bbb="http://bbb">
    </aaa>
    and in the second :
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <aaa:first xmlns:aaa="http://aaa" xmlns:ns1="urn:abc" ...>
    <bbb:second xmlns:bbb="http://bbb">
    </bbb>
    </aaa>
    So, how is that possible to import multiple namespaces (xmlns) in a single node please ? It seems that JAXB does the import only when needed, and won't group all the imports in the root node.
    (moreover, how can I disable the "standalone" attribute in the header of the generated XML document please ?)
    Thanks in advance.

    Ok, I found a solution to get all namespaces placed in the root of the generated XML document : one have to implement a NamespacePrefixMapper
    marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper",new NamespacePrefixMapperImpl());and redefining its ' public String[] getPreDeclaredNamespaceUris()' method.
    For now, the problem is that namespaces declared there are somehow static. In fact, when unmarshalling Java objects from an XML document, it seems that this document namespaces are lost.
    Do you know a way these namespaces would be kept somewhere, associated with the unmarshalled object ? I need these namespaces in the case that I would create another XML file from it in the future.
    It's seems logical to keep this with the object, so did I miss something please ?

  • Add a root node and namespace declaration

    According to the requirement,I have a large appended .txt file.
    This .txt file is created by appending various xml files (without the namespace and root node).
    I need to add a root node and namespace declaration to the large appended .txt file so that it can be read as .xml.
    Please provide the pointers for the same.
    Thanks & Regards,
    Rashi

    My appended file looks like following.
    <input>
       <Store>
          <StoreHeader>
             <StoreNbr>56</StoreNbr>
             <StoreType>Retail</StoreType>
             <StoreSite>2004</StoreSite>
          </StoreHeader>
          <Transactions>
             <Transaction>
                <Item>A</Item>
                <ItemPrice>4</ItemPrice>
             </Transaction>
             <Transaction>
                <Item>C</Item>
                <ItemPrice>56</ItemPrice>
             </Transaction>
          </Transactions>
       </Store>
    </input>
    <input>
       <Store>
          <StoreHeader>
             <StoreNbr>123</StoreNbr>
             <StoreType>Retail</StoreType>
             <StoreSite>2004</StoreSite>
          </StoreHeader>
          <Transactions>
             <Transaction>
                <Item>A</Item>
                <ItemPrice>4</ItemPrice>
             </Transaction>
             <Transaction>
                <Item>B</Item>
                <ItemPrice>8</ItemPrice>
             </Transaction>
             <Transaction>
                <Item>C</Item>
                <ItemPrice>56</ItemPrice>
             </Transaction>
          </Transactions>
       </Store>
    </input>
    Now according to the requirement, I need to add namespace and root node and make it like follows:
    <ns0:output xmlns:ns0="http://xxx">
       <input>
       <Store>
          <StoreHeader>
             <StoreNbr>56</StoreNbr>
             <StoreType>Retail</StoreType>
             <StoreSite>2004</StoreSite>
          </StoreHeader>
          <Transactions>
             <Transaction>
                <Item>A</Item>
                <ItemPrice>4</ItemPrice>
             </Transaction>
             <Transaction>
                <Item>C</Item>
                <ItemPrice>56</ItemPrice>
             </Transaction>
          </Transactions>
       </Store>
    </input>
    <input>
       <Store>
          <StoreHeader>
             <StoreNbr>123</StoreNbr>
             <StoreType>Retail</StoreType>
             <StoreSite>2004</StoreSite>
          </StoreHeader>
          <Transactions>
             <Transaction>
                <Item>A</Item>
                <ItemPrice>4</ItemPrice>
             </Transaction>
             <Transaction>
                <Item>B</Item>
                <ItemPrice>8</ItemPrice>
             </Transaction>
             <Transaction>
                <Item>C</Item>
                <ItemPrice>56</ItemPrice>
             </Transaction>
          </Transactions>
       </Store>
    </input>
    </ns0:output>

  • Tree - selecting and expanding root node

    I want to have a tree root node expanded at start.
    I have tried:
    tree.selectedIndex = 0;
    if (tree.selectedItem && tree.dataDescriptor.isBranch(tree.selectedItem))
         tree.expandChildrenOf(tree.selectedItem, true);
    ...but it doesnt work.
    Anyone ...?

                    var node:XML = mainTree.root as XML;
                    mainTree.expandItem(node, true);
    You could also toggle it:
                    var node:XML = mainTree.root as XML;
                    var isOpen:Boolean = mainTree.isItemOpen(node);
                    mainTree.expandItem(node, !isOpen);

  • Change the Namespace and Root Node Name

    Hi,
    I have following xml :
    <ns2:Students xmlns:ns2="http://MyProject.CommonSchema">
        <ns2:Student>
          <HeaderSegment>
            <FName>AA</FName>
            <LName>AA</LName>
          </HeaderSegment>
        </ns2:Student>
      </ns2:Students>
    Now I want to change the root node name and namespace name.
    I want the following output:
    <ns2:MyStudents xmlns:ns2="http://MyProject.MySchema">
        <ns2:Student>
          <HeaderSegment>
            <FName>AA</FName>
            <LName>AA</LName>
          </HeaderSegment>
        </ns2:Student>
      </ns2:Students>
    I searched on the google but not found any right solution.
    Any kind of help would be appreciated.
    Prakash

    You should have told us that you wanted an XmlDocument. Anyway, you could use a XDocument to create and modify the XML and then return an XmlDocument like this:
    public static XmlDocument CreateXmlDocument(string xml) {
    //load the XML data
    XDocument doc = XDocument.Parse(xml); //or use XDocument.Load to load a file
    //change from old to the new namespace:
    XNamespace newNs = "http://MyProject.MySchema";
    var elemens = doc.Root.Elements();
    foreach (var elem in doc.Root.Elements()) {
    if (elem.Name.Namespace != string.Empty) {
    elem.Name = newNs + elem.Name.LocalName;
    //remove old namespace attribute:
    XAttribute atr = doc.Root.Attributes(XNamespace.Xmlns + "ns2").FirstOrDefault();
    if (atr != null)
    atr.Remove();
    //add the new namespace
    doc.Root.Add(new XAttribute(XNamespace.Xmlns + "ns2", newNs));
    doc.Root.Name = newNs + "Students2";
    string newXml = doc.ToString();
    XmlDocument xmlDocument = new XmlDocument();
    using (var xmlReader = doc.CreateReader()) {
    xmlDocument.Load(xmlReader);
    return xmlDocument;
    Usage:
    string xml = "<ns2:Students xmlns:ns2=\"http://MyProject.CommonSchema\"><ns2:Student><HeaderSegment><FName>AA</FName><LName>AA</LName></HeaderSegment></ns2:Student></ns2:Students>";
    XmLDocument doc = CreateXmlDocument(xml);
    Please remember to close your threads by marking all helpful posts as answer and then start a new thread if you have a new question.

Maybe you are looking for

  • How can I find the URL for an iCal calendar in iCloud so I can make a link to it on a web page.

    I have a single iCal calendar that I want people to access through my webpage.  How can I find the URL so that they can view the calendar without having to subscribe to it.  I converted to iCloud from .Mac and I can see that changes to this calendar

  • Transfer Songs off of Mac OS 9.1 to Mac OS 10.4. Tiger

    I just recently bought a new Apple Computer, ( Intel iMac 10.4) to replace my old classic 9.1 iMac. Now my question is how do I transfer the songs off of iTunes on my old iMac to my new Intel iMac, iSync will not work as it requires the second comput

  • Use handling units for subcontracting

    Hello Experts, we are currently trying to improve our subcontracting process. The stock of material is provided to the vendor in boxes, he processes the articles and delivers them back to us in the same boxes. To be able to identify the boxes when th

  • Warning-Variable If automatically Converted

    Friends, I am executing a Bw report through Portal.I changed name of Variable .When i run the report through it is giving the warning message 'variable if automatically Converted'  I did try with RSRT and also Supress warnings from Server.Still warin

  • VMWare Player 5.0 doesn't start

    I have updated VMWare to version 5.0 and since then I cannot make it work. I have followed the instructions in the wiki. The symlinks are created, the kernel modules patched and built, vmware service is started, but when I start the graphical interfa