Query to create XML for a Tree Menu

Hi,
How can I generate a hierarchical xml. I have one table with 4 columns with menuid, menuname, parentid, link.
MenuID    MenuName       ParentID      HREF
1            File
12           Open              1
11           New               1
21           Program           11
61           Program2          11
31           Blank             21
2            View     
22           Printer          
23            Doc
4            Tools
5            Win               1Here is the output I am trying to have.
<menus>
  <menu name="File" id="1">
    <menu name="Open" id="12" href="Open.jsp"/>
    <menu name="New" id="11">
      <menu name="Program" id="21">
        <menu name="Blank" id="31" href="Blank.jsp"/>
      </menu>
      <menu name="Program2" id="61" href="Program2.jsp"/>
    </menu>
    <menu name="Win" id="5" href="Win.jsp"/>
  </menu>
  <menu name="View" id="2">
    <menu name="Printer" id="22" href="Printer.jsp"/>
  </menu>
  <menu name="Doc" id="3" href="Doc.jsp"/>
  <menu name="Tools" id="4" href="Tools.jsp"/>
</menus>Thanks

Hi,
How can I generate a hierarchical xml. I have one table with 4 columns with menuid, menuname, parentid, link.
MenuID    MenuName       ParentID      HREF
1            File
12           Open              1
11           New               1
21           Program           11
61           Program2          11
31           Blank             21
2            View     
22           Printer          
23            Doc
4            Tools
5            Win               1Here is the output I am trying to have.
<menus>
  <menu name="File" id="1">
    <menu name="Open" id="12" href="Open.jsp"/>
    <menu name="New" id="11">
      <menu name="Program" id="21">
        <menu name="Blank" id="31" href="Blank.jsp"/>
      </menu>
      <menu name="Program2" id="61" href="Program2.jsp"/>
    </menu>
    <menu name="Win" id="5" href="Win.jsp"/>
  </menu>
  <menu name="View" id="2">
    <menu name="Printer" id="22" href="Printer.jsp"/>
  </menu>
  <menu name="Doc" id="3" href="Doc.jsp"/>
  <menu name="Tools" id="4" href="Tools.jsp"/>
</menus>Thanks

Similar Messages

  • How Create XML for Purcase Order

    Dea all,
    Please advise how to create standard SAP XML for Purchase Order .
    In customizing (WE20) we have set the partner profile, and the PO creates an IDOC on the system.
    Now what should be done to convert it to XML , and where is the definition of the destination for sending the XML file?
    Thanks,
    Moshe

    Various tools are available generate an XML document from a DTD.
    http://www.eclipse.org/webtools/community/tutorials/XMLWizards/XMLWizards.html
    http://www.altova.com/products/xmlspy/dtd_editor.html
    http://www.stylusstudio.com/xml_generator.html

  • Create Shortcut for Right-Click Menu

    I know you can create shorcuts from System Pref. - Keyboard - Keyboard shortcuts.
    But this only works with commands that are on the menu bar, but not with menu that only appears when you click the right button of the mouse (or two finger tapping on trackpad)
    I'd like to know if there is any way to make a shortcut (like apple + D or sth) for the mouse menu. I suppose Automator can give us some way to work it out?
    Thanks

  • XML for a Tree Control

    I am trying to create a Tree control for my application that lists account reps as branches with their clients as leaves below them.
    I created the xml below from a CGI script, but when the tree renders it the account reps are leaves and the clients don't show up at all. There is evidently something basic I am missing. Can anyone tell me what xml to do what I am shooting for should look like?
    <Result>
    <node>
      <label>Bill Smith</label>
      <data>AM|01</data>
        <node>
          <label>125 Company</label>
          <data>COMPID|2177</data>
        </node>
        <node>
          <label>ABC Manufacturing</label>
          <data>COMPID|2167</data>
        </node>
        <node>
          <label>Test Company</label>
          <data>COMPID|2172</data>
        </node>
    </node>
    <node>
      <label>Jane Jones</label>
      <data>AM|01</data>
        <node>
          <label>126 Company</label>
          <data>COMPID|2100</data>
        </node>
        <node>
          <label>XYZ Service Company</label>
          <data>COMPID|2101</data>
        </node>
        <node>
          <label>Test Company 2</label>
          <data>COMPID|2102</data>
        </node>
    </node>
    </Result>

    At this point it is just a test application so the code is pretty small. For retrieving the data, I pretty much copied code from one of the examples. I created an HTTP request since I plan to return results from a CGI interface rather than a web service. My data provider is derived from the lastResult property of the HTTPService "userRequest".
    <?xml version="1.0"?>
    <!-- containers\layouts\HDivBoxSimple.mxml -->
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" creationComplete="send_data()">
        <mx:Script>
            <![CDATA[
                private function send_data():void {
                    userRequest.send();
            ]]>
        </mx:Script>
        <mx:TitleWindow width="100%" height="100%" layout="absolute" title="Task Management" fontFamily="Verdana" fontSize="12" backgroundColor="#F0F0F0">
            <mx:HDividedBox x="0" y="30" width="100%" height="95%" >
                <mx:Tree width="15%" height="100%" id="treeCompList" dataProvider="{userRequest.lastResult.Result.node}" enabled="true"></mx:Tree>
                <mx:TileList width="60%" height="100%"></mx:TileList>
                <mx:DateChooser width="180"/>
            </mx:HDividedBox>
            <mx:Canvas x="0" y="-10" width="390" height="35">
                <mx:Button x="4" y="10" label="Reports"   cornerRadius="0"/>
                <mx:Button x="80" y="10" label="Due Today"   cornerRadius="0"/>
                <mx:Button x="174" y="10" label="Past Due"   cornerRadius="0"/>
                <mx:Button x="258" y="10" label="Events"   cornerRadius="0"/>
            </mx:Canvas>
        </mx:TitleWindow>
        <mx:HTTPService id="userRequest" url="http://192.168.1.20/cgiGroupFlex.exe" useProxy="false" method="POST">
            <mx:request xmlns="">
                <FUNCTION>GetAMCompList</FUNCTION>
                <FORMAT>TREE</FORMAT>
            </mx:request>
        </mx:HTTPService>
    </mx:Application>

  • FRM-41072:Can't create Group (for a tree)

    Hello,
    the following code is trying to refresh data while saving the record which is a child of the child of the Grand parent.
    In Key-commit Trigger..
    The Query was working just fine without the new modification concept to have a child from the child.
    e.g.
    Electrical Equipment
    |_ Computer
           |_ Mother BoardAny way the Query works fine in Toad it displays what i want but in the forms' tree ..!!!
    Getting the following Error:
    --===========================
    FRM-41072:Can't create Group RG_DAL_MED
    FRM-41076 :Error populating Group.
    FRM-41085 :Error getting Group Row count.
    --===========================
    Using Forms 6i Windows XP ..!
    DECLARE
        selektas VARCHAR2(5000);
          rg_name VARCHAR2(4000) := 'RG_DAL_MED';
          rg_id      RecordGroup;
          find_node Ftree.NODE;
          n NUMBER (38);
          htree ITEM := Find_Item('TREE_BLOCK_TEST.TREE13');
          v_WHERE   VARCHAR2(5000);
    BEGIN
      rg_id := Find_Group(rg_name);
       IF NOT Id_null(rg_id) THEN
        DELETE_GROUP(rg_id);
       END IF; 
              V_WHERE := ('PARENT_ID IN ( SELECT   INSP_EQUIPMENT.EQUIPMENT_ID FROM INSP_EQUIPMENT 
         WHERE CLASS_ID IN (1,2,3,4)');
              V_WHERE := V_WHERE || (' AND INSP_EQUIPMENT.EQUIPMENT_TYPE_ID = ' || :INSP_EQUIPMENT.EQUIP_TYPE_ID ||'' );
              V_WHERE := V_WHERE || ( '     AND ( INSP_EQUIPMENT.PARENT_ID= '|| :EQUIP_ID );
              V_WHERE := V_WHERE || ( '   OR INSP_EQUIPMENT.PARENT_ID IS NULL ))');
              V_WHERE := V_WHERE  ||(' CONNECT BY PRIOR INSP_EQUIPMENT.EQUIPMENT_ID = INSP_EQUIPMENT.PARENT_ID START WITH  INSP_EQUIPMENT.PARENT_ID IS NULL ORDER BY EQUIPMENT_id ');
            selektas :=  'SELECT       1       NODE_STATE,                    LEVEL               NODE_DEPTH,
                                                       EQUIPMENT            NODE_LABEL,
                                     NULL                 NODE_ICON,
                        EQUIPMENT_ID         NODE_VALUE                           FROM                 INSP_EQUIPMENT
              WHERE V_WHERE ';
         rg_id := Create_Group_From_Query(rg_name, selektas);         
               n := Populate_Group(rg_id);
                n := Get_Group_Row_Count(rg_id);
    IF n > 0 THEN
       Ftree.set_tree_property(htree,Ftree.record_group,rg_id);
    END IF;
    END;Regards,
    Abdetu..

         selektas := 'SELECT 1 NODE_STATE,                    LEVEL NODE_DEPTH,
                                       EQUIPMENT NODE_LABEL,
    NULL NODE_ICON,
         EQUIPMENT_ID NODE_VALUE           FROM INSP_EQUIPMENT
              WHERE V_WHERE ';You have to add the V_WHERE as a value to your select:
    selektas :=  'SELECT  1       NODE_STATE,
                          LEVEL               NODE_DEPTH,
                          EQUIPMENT            NODE_LABEL,
                          NULL                 NODE_ICON,
                          EQUIPMENT_ID         NODE_VALUE                          
                     FROM INSP_EQUIPMENT
                    WHERE ' || V_WHERE;

  • Create columns for HTMLB:TREE

    Hi All,
    In our appplication we are are using <htmlb:tree />. Using CL_BSP_BEE_TABLE we were able to show checkbox inside the tree node. CL_BSP_BEE_TABLE was of great help.
    Now we need columns in tree. Is there a way to create columns using BEE?
    Thanks and regards,
    Bindiya

    I am using a tree with about 2500 nodes and and around 5000 final children (leaves)  and we dont face any problem using the approach i have explained in my weblog.
    i guess the best approach would be to just do it and check whether you are having problem.
    <i>Do you know of any good alternatives to the htmlb:tree?</i>
    there are other javascrip/dhtml trees but you will still face the same kind of issues.
    Regards
    Raja

  • FM EDI_PATH_CREATE_CLIENT_DOCNUM is creating XML ONLY for control record

    Hi Experts,
    We have configured a port of XML type and used EDI_PATH_CREATE_CLIENT_DOCNUM function module to create XML and put that XML in a directory path (Configured in FILE transaction).
    IDOCs are being generated using sales order output type and EDI partner for the same is using above configured XML port.
    The problem here is, it does not create a complete XML, it just creates XML for control data.
    Could you please help us here...
    Thanks
    Mohit

    DATA: L_DIRNAME LIKE EPSF-EPSDIRNAM,
            L_FILEMASK LIKE EPSF-EPSFILNAM,
    CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
        EXPORTING
          dir_name                     = l_dirname
          file_mask                    = l_filemask
    * IMPORTING
    *   DIR_NAME                     =
    *   FILE_COUNTER                 =
    *   ERROR_COUNTER                =
        TABLES
          dir_list                     = pi_filelist
    EXCEPTIONS
       invalid_eps_subdir           = 1
       sapgparam_failed             = 2
       build_directory_failed       = 3
       no_authorization             = 4
       read_directory_failed        = 5
       too_many_read_errors         = 6
       empty_directory_list         = 7
       OTHERS                       = 8

  • Of Explorer Trees & Menu bars

    This may seem like a dumb question, or that I'm not doing my work but I'm really stumped.
    Using JSP, and HTML tag <DIV> one should be able to create a JTree equivalent display in a frame on the browser right? how is this done?
    Plus, what about a menu bar?? the drop down would use <SELECT> tag?
    thx.

    Here is an excellent site with a free API for doing tree menu's. Its in javascript. But, you could use JSP page to dynamically generate the tree. The author has examples. It works great and I think this is what you are looking for:
    http://www.treemenu.com/

  • Create xml file with nested internla table or with header & item tables

    Hi I have a requirement like, I need to create an xml file for header and item details. For 1 header there may be multiple line items.
    I did search in forums some where I came to know that we can use XSL:IF to achieve this. but I could not able to do this.
    I tried with using nested internal tables also but now luck.
    can anybody please suggest how can we create xml for header and item detials.
    <xsl:transform version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:sap="http://www.sap.com/sapxsl"
      xmlns:asx="http://www.sap.com/abapxml"
      exclude-result-prefixes="asx"
    >
    <xsl:template match="/">
      <OrbisomRequest>
        <xsl:attribute name="Version">
          <xsl:value-of select="11.1"/>
        </xsl:attribute>
        <xsl:attribute name="IssuerID">
          <xsl:value-of select="1"/>
        </xsl:attribute>
        <xsl:for-each select="asx:abap[1]/asx:values[1]/T_FINAL[1]/*">
    <CreateApprovedPurchaseRequest
           RerquestID="{VBLNR}"
           CommonName="User1"
           Amount="{WRBTR}"
           Comment="TestComment"
           CurrencyCode="978"
           PurchaseType="All"
           SupplierName="All"
           VCardAlias="PurchaseCard"
           ValidFrom="1M"
           CurrencyType="B">
                    <CDFs>
                      <Invoice> <xsl:value-of select="BELNR"/> </Invoice>
                      <Amount> <xsl:value-of select="WRBTR"/> </Amount>
                    </CDFs>
          </CreateApprovedPurchaseRequest>
        </xsl:for-each>
      </OrbisomRequest>
    </xsl:template>
    </xsl:transform>
    here belnr and wrbtr will be my item details. for each payment document I can have multiple invoices. in CDF I need to display the invoices for that particular payment document.
    what conditions can I put there before CDFs to make the item internal table to loop based on header internal table.
    Regards,
    Ranganadh.

    Looks like you have already created the transformation "Z_ID"
    Take a look at the following thread, it answers many of the questions you have asked:
    [ABAP data to XML conv with UTF-8 encoding and custom namespace|Re: ABAP data to XML conv with UTF-8 encoding and custom namespace;
    Che

  • Horizontal tree menu, Java script

    Please let me know where can i get Javascript code(not css) for horizontal tree menu. If you have please send the code.
    good luck.

    ManasaSri wrote:
    Please let me know where can i get Javascript code(not css) for horizontal tree menu. If you have please send the code.
    good luck.You are confusing JavaScript with Java. The two languages are only vaguely similar. You may want to direct your question to a [Javascript Forum|http://forums.devshed.com/javascript-development-115/]. As this question is unrelated to Java, I will lock this thread.

  • Overlays for a motion menu

    I'm having trouble creating overlays for a motion menu. I've imported my background for my motion menu into dvdsp and it works fine. Now I need to add buttons to it and that's where I'm having trouble. How do I accomplish this? My background has all of the text, I just want to add arrows and use those as buttons over my moving background.
    Help is appreciated.

    You create an overlay and map it out such as this
    http://dvdstepbystep.com/newmap.php
    And this highlights the text
    http://dvdstepbystep.com/motion.php
    So what you should do (easy way) is export the motion menu (last frame) in the proper size and drop it into Photoshop. In what app did you create the background and do you have Photoshop? Can be some sizing issues depending on the workflow.

  • Build XML for Custom Nested Accordian (like Tree View Structure) for SharePoint List Data

    Expected output in Xml:
    <?xml version="1.0" encoding="utf-8" ?>
    - <TopRoot>
    - <Root id="1" Name="Department">
    - <Type id="2" Name="IT">
    - <SubType id="3" Name="Technology">
      <SubSubType id="4" Name="Sharepoint" />
      <SubSubType id="5" Name="ASP.NET" />
      <SubSubType id="6" Name="HTML 5" />
      </SubType>
      </Type>
    </Root>
    </TopRoot>
    List Details:
    list details for storing category / sub category data and code to build tree structure for the same.
    1.Create Custom List named “CategoryDetails”:
    2.Create Column “Category Name” of type single line of text. Make it as required field and check Yes for Enforce Unique values.
    3.Create column “Parent Category” of type lookup. under Additional Column Settings.
    Get information dropdown, select “CategoryDetails”.
    4.Choice column ["SRTypeName"] 1.Root,2.SRTYPE,3.SubSRTYPE, 4.SUBSUBSRTYPE
    In this column dropdown, select “Category Name”:  
    Referance:
    http://www.codeproject.com/Tips/627580/Build-Tree-View-Structure-for-SharePoint-List-Data    -fine but don't want tree view just generate xml string
    i just follwed above link it work perferfectly fine for building tree view but i don't want server control.
    Expected Result:
    My ultimate goal is to generate xml string like above format without building tree view.
    I want to generate xml using web service and using xml i could convert into nested Tree View Accordian in html.
    I developed some code but its not working to generate xml /string.
    My modified Code:
    public const string DYNAMIC_CAML_QUERY =
            "<Where><IsNull><FieldRef Name='{0}' /></IsNull></Where>";
            public const string DYNAMIC_CAML_QUERY_GET_CHILD_NODE =
            "<Where><Eq><FieldRef Name='{0}' /><Value Type='LookupMulti'>{1}</Value></Eq></Where>";
            protected void Page_Load(object sender, EventArgs e)
                if (!Page.IsPostBack)
                 string TreeViewStr= BuildTree();
                 Literal1.Text = TreeViewStr;
            StringBuilder sbRoot= new StringBuilder();
            protected string BuildTree()
                SPList TasksList;
                SPQuery objSPQuery;
                StringBuilder Query = new StringBuilder();
                SPListItemCollection objItems;
                string DisplayColumn = string.Empty;
                string Title = string.Empty;
                string[] valueArray = null;
                try
                    using (SPSite site = new SPSite(SPContext.Current.Web.Url))
                        using (SPWeb web = site.OpenWeb())
                            TasksList = SPContext.Current.Web.Lists["Service"];
                            if (TasksList != null)
                                objSPQuery = new SPQuery();
                                Query.Append(String.Format(DYNAMIC_CAML_QUERY, "Parent_x0020_Service_x0020_Id"));
                                objSPQuery.Query = Query.ToString();
                                objItems = TasksList.GetItems(objSPQuery);
                                if (objItems != null && objItems.Count > 0)
                                    foreach (SPListItem objItem in objItems)
                                        DisplayColumn = Convert.ToString(objItem["Title"]);
                                        Title = Convert.ToString(objItem["Title"]);
                                        int rootId=objItem["ID"].ToString();
                                        sbRoot.Append("<Root id="+rootId+"
    Name="+Title+">");
                                        string SRAndSUBSRTpe = CreateTree(Title, valueArray,
    null, DisplayColumn, objItem["ID"].ToString());
                                        sbRoot.Append(SRAndSUBSRTpe);
                                        SRType.Clear();//make SRType Empty
                                        strhtml.Clear();
                                    SRType.Append("</Root>");
                catch (Exception ex)
                    throw ex;
                return SRType.ToString();
             StringBuilder strhtml = new StringBuilder();
            private string CreateTree(string RootNode, string[] valueArray,
          List<SPListItem> objNodeCollection, string DisplayValue, string KeyValue)
                try
                    strhtml.Appends(GetSRType(KeyValue, valueArray, objNodeCollection);
                catch (Exception ex)
                    throw ex;
                return strhtml;
            StringBuilder SRType = new StringBuilder();
            private string GetSRType(string RootNode,
            string[] valueArray, List<SPListItem> objListItemColn)
                SPQuery objSPQuery;
                SPListItemCollection objItems = null;
                List<SPListItem> objNodeListItems = new List<SPListItem>();
                objSPQuery = new SPQuery();
                string objNodeTitle = string.Empty;
                string objLookupColumn = string.Empty;
                StringBuilder Query = new StringBuilder();
                SPList objTaskList;
                SPField spField;
                string objKeyColumn;
                string SrTypeCategory;
                try
                    objTaskList = SPContext.Current.Web.Lists["Service"];
                    objLookupColumn = "Parent_x0020_Service_x0020_Id";//objTreeViewControlField.ParentLookup;
                    Query.Append(String.Format
                    (DYNAMIC_CAML_QUERY_GET_CHILD_NODE, objLookupColumn, RootNode));
                    objSPQuery.Query = Query.ToString();
                    objItems = objTaskList.GetItems(objSPQuery);
                    foreach (SPListItem objItem in objItems)
                        objNodeListItems.Add(objItem);
                    if (objNodeListItems != null && objNodeListItems.Count > 0)
                        foreach (SPListItem objItem in objNodeListItems)
                            RootNode = Convert.ToString(objItem["Title"]);
                            objKeyColumn = Convert.ToString(objItem["ID"]);
                            objNodeTitle = Convert.ToString(objItem["Title"]);
                            SrTypeCategory= Convert.ToString(objItem["SRTypeName"]);
                           if(SrTypeCategory =="SRtYpe")
                              SRType.Append("<Type  id="+objKeyColumn+" Name="+RootNode+ ">");
                             if (!String.IsNullOrEmpty(objNodeTitle))
                              SRType.Append(GetSRType(objKeyColumn, valueArray, objListItemColn));
                          if(SrTypeCategory =="SRSubTYpe")
                              SRType.Append("<SRSubType  id="+objKeyColumn+" Name="+RootNode+
    ">");  
                             if (!String.IsNullOrEmpty(objNodeTitle))
                              SRType.Append(GetSRType(objKeyColumn, valueArray, objListItemColn));
                          if(SrTypeCategory =="SubSubTYpe")
                              SRType.Append("<SubSubType  id="+objKeyColumn+" Name="+RootNode +"
    ></SubSubType");  
                        SRType.Append("</SubType>");
                        SRType.Append("</Type>");
                catch (Exception ex)
                    throw ex;
                return SRType.ToString();
                // Call method again (recursion) to get the child items

    Hi,
    According to your post, my understanding is that you want to custom action for context menu in "Site Content and Structure" in SharePoint 2010.
    In "SiteManager.aspx", SharePoint use MenuItemTemplate class which represent a control that creates an item in a drop-down menu.
    For example, to create or delete the ECB menu for a list item in
    "Site Content and Structure", we can follow the steps below:
    To add the “My Like” menu, we can add the code below:      
    <SharePoint:MenuItemTemplate
    UseShortId=false
    id="OLListItemLike"
    runat="server"
    Text="My Like"
    ImageUrl="/_layouts/images/DelItem.gif"
    ClientOnClickNavigateUrl="https://www.google.com.hk/"
    />
    To remove the “Delete” menu, we can comment the code below:
    <SharePoint:MenuItemTemplate
    UseShortId=false
    id="OLListItemDelete"
    runat="server"
    Text="<%$Resources:cms,SmtDelete%>"
    ImageUrl="/_layouts/images/DelItem.gif"
    ClientOnClickScript="%SmtObjectDeleteScript%"
    />            
    The result is as below:
    More information:
    MenuItemTemplate Class (Microsoft.SharePoint.WebControls)
    MenuItemTemplate.ClientOnClickScript property (Microsoft.SharePoint.WebControls)
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Invalid xml decl while creating template for a report created in BIP

    Hi
    I am in the process developing a report - extracting data from an xmltype column. I defined my query - as simple as (for now):
    select xmlcol.getclobval() from table1
    The way information is stored in each xmltype column is with the xml declaration - something like
    <?xml version="1.0" encoding="UTF-8"?>
    <rootelem>
    <a>adjaghd</a>
    <b>adjaghd</b>
    <c>adjaghd</c>
    </rootelem>
    So when I get the output, I have the declaration (...xml version...)for each row returned. I am assuming that being the reason when I try to create the template in work for this report, it given me Invalid XML Decl. How can I extract from xmltype column without getting the header information for each row?

    Anyone can answer this question please?

  • Creation of a Popup Menu for a Tree Node

    Hi Ppl,
      I need to create a Pop-up Menu for a tree node in WebDynpro Application, please give me a "How to .." sort of material or a link which would have same sort of information...
    Also, My requirement is to call the pop-up on the right click of mouse on the tree node, please let me know on which event handler I can call it ? Do I require a custom event handler for it ?
    Thanks in advance
    Anish

    Hi Anish,
    You simply add a Tree UI element, and then right-click the tree UI element and insert a TreeNode element.
    To the TreeNode element you can add a menu, and then to this menu you can add menu items. When the user right click the tree node, the menu item is displayed. If the user clicks the menu item, the action for the menuitem is run.
    Hope that helps.
    Daniel

  • Creating a Java content tree from scratch and then marshal it to XML data

    Hi,
    After binding a schema using JAXB binding, I wrote a class to create a Java content tree from scratch and then marshal it to create an XML document. To see if the resulting xml document is correct, I opened it in XMLSpy and tried to validate it against the original schema.... I got the following error:
    "Unable to locate a reference to a supported schema kind (DTD, DCD, W3C Schema, XML-Data, Biz Talk) within this document instance"
    Then I realized that the generated xml document didnot contain the following for the root element:
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" and xsi:schemaLocation="....."
    i.e, the XML Schema Instance namespace and the schema location.
    How do I get these attributes incorporated into the XML document generated during the marshal process.
    Thanks.

    How do I get these attributes incorporated into the XML document generated during the marshal process.
    Add xmlns:xsi and xsi:schemaLocation attributes to the root element in the schema.
    <xsd:attribute name="xmlns:xsi"  fixed="http://www.w3.org/2001/XMLSchema-instance"/>

Maybe you are looking for