How to add namespace prefix to XML file?

I have a file(XML) to proxy scenario. I 've created an asynch Inbound message and a asynch Outbound message.
I have generated the class in Sproxy of my R/3 System.
In the Integration directory I have 2 business system :
-one which sent the file
-my r/3 system
System which send file generate XML like this:
<?xml version="1.0" encoding="UTF-8" ?>
   <batch id="20080211001" customer="some customer" user="user" language="EN">
     <structure>
       <localization>
          <string id="customer" text="Customer" />
etc........
As you see, it have not any namespace prefix.
How can I insert namespace prefix in this file with XI tools?

Hi Pavel
I am also facing the same issue
my XML structure is quite complex
<ROW EVENT="RE" SEQ="9" MORE="Y" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  <FileDate Internal="61409" ROWID="Y">02/17/2009</FileDate>
  <FileSeq ROWID="Y">9</FileSeq>
  <Event>RE</Event>
  <Grp>3</Grp>
  <LinkFileTime>42324</LinkFileTime>
  <Mrn></Mrn>
  <ROW DESCR="RE" TABLE="PAT" EVENT="RE">
    <BusTel/>
    <BusTelHipaaConsent/>
    <Cont1Addr1/>
  <ROW DESCR="RE" TABLE="INS" EVENT="RE">
    <DictRef1/>
    <DictRef10/>
Do i have to create the Message Interface  for Outbound Synchronous ..
<DictRef11/>

Similar Messages

  • How to add payment advice for XML file filed in vendor account group

    Hi All,
    I have a requirment to add Payment advice for XML file field in vendor account group under payment transcation tap,
    kindly advice where i can add above mention field in vendor account group.
    thanks
    khaja

    done

  • How to add namespace prefixes to XMLType created from Object?

    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE 11.2.0.3.0 Production
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    I'm working with SOAP request creation from Schema derived Types.
    Consider the registration of the following annotated schema (I wanted Oracle to create the types for me, but with my own names):
    exec dbms_xmlschema.deleteSchema(schemaURL => 'Parameters4.xsd');
    declare
    v_xsd xmltype := xmltype('<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
               xmlns:oraxdb="http://xmlns.oracle.com/xdb"
               xmlns = "http://www.cognera.com"
               targetNamespace = "http://www.cognera.com">
      <xs:element name="Parameters" oraxdb:SQLName="Parameters" oraxdb:SQLType="Parameters">
        <xs:complexType oraxdb:SQLType="Parameters">
          <xs:sequence>
            <xs:element name="Param1" type="xs:string" oraxdb:SQLName="Param1" oraxdb:SQLType="VARCHAR2" />
            <xs:element name="NestedItems" oraxdb:SQLName="NestedItems" oraxdb:SQLType="NestedItemsType">
              <xs:complexType oraxdb:SQLType="NestedItemsType">
                <xs:sequence>
                  <xs:element name="NestedItem" type="NestedItemType" oraxdb:SQLName="NestedItem" oraxdb:SQLType="NestedItemType"/>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:complexType name="NestedItemType" oraxdb:SQLType="NestedItemType">
        <xs:sequence>
          <xs:element name="nParam1" type="xs:string" oraxdb:SQLName="nParam1" oraxdb:SQLType="VARCHAR2"/>
          <xs:element name="nParam2" type="xs:string" oraxdb:SQLName="nParam2" oraxdb:SQLType="VARCHAR2"/>
          <xs:element name="nParam3" type="xs:string" oraxdb:SQLName="nParam3" oraxdb:SQLType="VARCHAR2"/>
        </xs:sequence>
      </xs:complexType>
    </xs:schema>
    begin
      dbms_xmlschema.registerSchema(schemaURL => 'Parameters4.xsd', --this name is local to each ERS schema.                                
                                          schemaDoc => v_xsd,
                                          local => TRUE,
                                          genTypes => TRUE, --only want the types
                                          genbean => FALSE,
                                          genTables => TRUE, --not sure if I need this
                                          force => TRUE,
                                          owner => user);
    end;
    Types created were:
    CREATE OR REPLACE TYPE "NestedItemType" AS OBJECT ("SYS_XDBPD$" "XDB"."XDB$RAW_LIST_T","nParam1" VARCHAR2(4000 CHAR),"nParam2" VARCHAR2(4000 CHAR),"nParam3" VARCHAR2(4000 CHAR))NOT FINAL INSTANTIABLE
    CREATE OR REPLACE TYPE "NestedItemsType" AS OBJECT ("SYS_XDBPD$" "XDB"."XDB$RAW_LIST_T","NestedItem" "NestedItemType")FINAL INSTANTIABLE
    CREATE OR REPLACE TYPE "Parameters" AS OBJECT ("SYS_XDBPD$" "XDB"."XDB$RAW_LIST_T","Param1" VARCHAR2(4000 CHAR),"NestedItems" "NestedItemsType")FINAL INSTANTIABLE
    I found that in order to build these types using constructors (to avoid PLS-00306: wrong number or types of arguments in call to 'NestedItemType'), that I needed to edit these types (drop the xdb magic):
    CREATE OR REPLACE TYPE "NestedItemType" AS OBJECT ("nParam1" VARCHAR2(4000 CHAR),"nParam2" VARCHAR2(4000 CHAR),"nParam3" VARCHAR2(4000 CHAR))FINAL INSTANTIABLE
    CREATE OR REPLACE TYPE "NestedItemsType" AS OBJECT ("NestedItem" "NestedItemType")FINAL INSTANTIABLE
    CREATE OR REPLACE TYPE "Parameters" AS OBJECT ("Param1" VARCHAR2(4000 CHAR),"NestedItems" "NestedItemsType")FINAL INSTANTIABLE
    I read on the forums of a hack to get a namespace added in the output:
    CREATE OR REPLACE TYPE "Parameters" AS OBJECT ("@xmlns" VARCHAR2(4000), -- namespace attribute HACK
                                                           "Param1" VARCHAR2(4000 CHAR),"NestedItems" "NestedItemsType")FINAL INSTANTIABLE
    Putting it all together, I have:
    DECLARE
      v_Parameters    "Parameters";
      v_xml           xmltype;
      v_print_output  clob;     
    begin
      v_Parameters :=  "Parameters"('www.cognera.com',
                                    'hello',
                                  "NestedItemsType"("NestedItemType"('one',
                                                                 'two',
                                                                 'three'
      v_xml := xmltype(xmlData => v_Parameters);
      select xmlserialize(document
                          xmlquery('declare namespace soap = "http://www.w3.org/2003/05/soap-envelope";                                                             
                                    declare namespace cognera = "http://www.cognera.com";
                                    <soap:Envelope>
                                       <soap:Header/>
                                       <soap:Body>
                                       </soap:Body>
                                     </soap:Envelope>
                                   ' passing v_xml returning content) as clob
                          indent size=2
                         ) into v_print_output from dual;
      dbms_output.put_line(v_print_output);
    end;
    This outputs:
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
      <soap:Header/>
      <soap:Body>
        <Parameters xmlns="www.cognera.com">
          <Param1>hello</Param1>
          <NestedItems>
            <NestedItem>
              <nParam1>one</nParam1>
              <nParam2>two</nParam2>
              <nParam3>three</nParam3>
            </NestedItem>
          </NestedItems>
        </Parameters>
      </soap:Body>
    </soap:Envelope>
    What I really want is:
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:c="www.cognera.com">
      <soap:Header/>
      <soap:Body>
        <c:Parameters>
          <c:Param1>hello</c:Param1>
          <c:NestedItems>
            <c:NestedItem>
              <c:nParam1>one</c:nParam1>
              <c:nParam2>two</c:nParam2>
              <c:nParam3>three</c:nParam3>
            </c:NestedItem>
          </c:NestedItems>
        </c:Parameters>
      </soap:Body>
    </soap:Envelope>
    How do I do this without having to programatically add the namespace using a custom XQuery function?

    See this similar thread, it should give you some better alternatives than the "@xmlns" hack :
    Add Namespaces via XQuery to an XML Instance
    For example :
    SQL> SELECT XMLSerialize(DOCUMENT
      2           XMLTransform(
      3             xmltype(
      4               "Parameters"('hello', "NestedItemsType"("NestedItemType"('one','two','three')))
      5             )
      6           , xmlparse(content
      7  '<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      8    <xsl:output encoding="UTF-8" indent="yes" method="xml"/>
      9    <xsl:param name="ns"/>
    10    <xsl:template match="/">
    11      <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    12        <soap:Header/>
    13          <soap:Body>
    14               <xsl:apply-templates select="*"/>
    15             </soap:Body>
    16         </soap:Envelope>
    17    </xsl:template>
    18    <xsl:template match="*">
    19      <xsl:element name="{local-name()}" namespace="{$ns}">
    20        <xsl:apply-templates select="@*|node()"/>
    21      </xsl:element>
    22    </xsl:template>
    23  </xsl:stylesheet>')
    24           , q'{ns="'www.cognera.com'"}'
    25           )
    26           INDENT
    27         ) AS "XSLT Output"
    28  FROM dual ;
    XSLT Output
    <?xml version="1.0" encoding="UTF-8"?>
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
      <soap:Header/>
      <soap:Body>
        <Parameters xmlns="www.cognera.com">
          <Param1>hello</Param1>
          <NestedItems>
            <NestedItem>
              <nParam1>one</nParam1>
              <nParam2>two</nParam2>
              <nParam3>three</nParam3>
            </NestedItem>
          </NestedItems>
        </Parameters>
      </soap:Body>
    </soap:Envelope>
    You can store the stylesheet in the XDB repository or in a table and access it using a DBUriType.
    It then provides a concise way to both add the namespace and wrap the payload in the envelope.

  • How to add namespace prefix to root tag in XSL version 1.1  SOA 11g

    Hi Experts,
       Can any one post solution for adding namespace prefix to root tag using XSL version 1.1 in SOA 11g?
    I have tried the below options and none is working.
    1. Removing prefix add in exclude-prefixes in XSL.But still seeing no prefix for root tag.
    2. Added the <xsl-element>   tag with namespace.But it is not working
    3. Added the below XSL code and it is not working.
      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
       xmlns:ns0="https://api.ladbrokes.com/v1/sportsbook-couchbase/Temp.xsd">
      <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
      <xsl:template match="@* | node()">
       <xsl:copy>
       <xsl:apply-templates select="@* | node()"/>
       </xsl:copy>
      </xsl:template>
      <xsl:template match="/*">
       <xsl:element name="ns0:{local-name()}">
       <xsl:copy-of select="namespace::*" />
       <xsl:apply-templates select="@* | node()" />
       </xsl:element>
      </xsl:template>
    </xsl:stylesheet>

    Try this:
    <xsl:stylesheet  version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="@*|text()|comment()|processing-instruction()">
            <xsl:copy>
                <xsl:apply-templates select="@*|node()"/>
            </xsl:copy>
        </xsl:template>
        <xsl:template match="/">
            <RootTag xmlns:ns0="https://api.ladbrokes.com/v1/sportsbook-couchbase/Temp.xsd">
                <xsl:apply-templates select="@*|node()"/>          
            </RootTag >
        </xsl:template>
        <xsl:template match="*">
            <xsl:element name="{local-name()}">
                <xsl:apply-templates select="@*|node()"/>
            </xsl:element>
        </xsl:template>
    </xsl:stylesheet>

  • How to add URL links in XML file?

    Hi,
    I'm having problem with adding the URL links to the flash output. I'm using the XML file to call images and then the corrsponding links. Images are called correctly but when I try to add a link I'm not getting the links, but instead getting the HTML anchor tags as texts. I'm using the XML escape characters to escape the HTML tags but the results are not what I need.
    I'm using the following code:
    <thumbnail preview="large.jpg" thumb="thumb.jpg">
                <title><![CDATA[Finance Services]]></title>
                <discription><![CDATA[&lt;a href=&quot;http://www.google.ca">Google</a>]]></discription>
    </thumbnail>
    Output:
    Images are displayed correctly, but instead of getting the links, I'm getting following text message:
    <a href="http://www.google.ca">Google</a>
    I need to find out what I'm doing wrong. Am I using the correct way to add the links or not?
    Thanks for your time.

    I'm using following code for the Description part, where I need to place the HTML tags:
    var _discription:TextField = previewHolder.discriptionText.discriptionText;
    _discription.htmlText = _xml.thumbnails.thumbnail[photoNum].discription.toString()
    I'm using the htmlText, I tried replacing htmlText with tf.htmlText, but it didn't work. I'm importing the text field using import flash.text.TextField; do I need to import something for HTML tags to work?

  • Can't Figure Out How to Add Nodes to Existing XML File by Attribute

    <?xml version="1.0" encoding="UTF-8"?>
    -<Project_Data>
    -<Project_Info>
    <Client>frankLINVILE</Client>
    <Name>COOKIE MONSTER INDICTMNET</Name>
    <Number>198883cookie</Number>
    <Tester>JK</Tester>
    <Reviewer>CM</Reviewer>
    <Location>Sesame Street, MD</Location>
    <SD>03/10/2015</SD>
    <Boring_Header>Boring1</Boring_Header>
    <Sample_Header>Sample2</Sample_Header>
    <Depth_Header>Depth3</Depth_Header>
    <Location_Header>Location4</Location_Header>
    <SD_Header>Sample Date5</SD_Header>
    <Remarks>asdf sdafas</Remarks>
    <Is_LOC_Global>True</Is_LOC_Global>
    <Is_SD_Global>True</Is_SD_Global>
    <Count>12</Count>
    <Has_MC_Data>N</Has_MC_Data>
    </Project_Info>
    -<Samples>
    -<Sample ID="@B1 S1 1-2 SESAME STREET, MD 03/10/2015">
    <Boring>b1</Boring>
    <Sample>s1</Sample>
    <Depth>1-2</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>frank1</Remarks>
    <Login_Order>1</Login_Order>
    <Report_Order>1</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    -<Sample ID="@B2 S2 2-2 SESAME STREET, MD 03/10/2015">
    <Boring>b2</Boring>
    <Sample>s2</Sample>
    <Depth>2-2</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>frakn2</Remarks>
    <Login_Order>2</Login_Order>
    <Report_Order>2</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    -<Sample ID="@B3 S3 3-3 SESAME STREET, MD 03/10/2015">
    <Boring>b3</Boring>
    <Sample>s3</Sample>
    <Depth>3-3</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>frakn3</Remarks>
    <Login_Order>3</Login_Order>
    <Report_Order>3</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    -<Sample ID="@B4 S4 4-4 SESAME STREET, MD 03/10/2015">
    <Boring>b4</Boring>
    <Sample>s4</Sample>
    <Depth>4-4</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi4</Remarks>
    <Login_Order>4</Login_Order>
    <Report_Order>4</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    -<Sample ID="@B5 S5 5-5 SESAME STREET, MD 03/10/2015">
    <Boring>b5</Boring>
    <Sample>s5</Sample>
    <Depth>5-5</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi5</Remarks>
    <Login_Order>5</Login_Order>
    <Report_Order>5</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    -<Sample ID="@B6 S6 6-6 SESAME STREET, MD 03/10/2015">
    <Boring>b6</Boring>
    <Sample>s6</Sample>
    <Depth>6-6</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi6</Remarks>
    <Login_Order>6</Login_Order>
    <Report_Order>6</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    -<Sample ID="@B7 S7 7-7 SESAME STREET, MD 03/10/2015">
    <Boring>b7</Boring>
    <Sample>s7</Sample>
    <Depth>7-7</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi7</Remarks>
    <Login_Order>9</Login_Order>
    <Report_Order>9</Report_Order>
    <Has_Data>N</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    -<Sample ID="@B8 S8 8-8 SESAME STREET, MD 03/10/2015">
    <Boring>b8</Boring>
    <Sample>s8</Sample>
    <Depth>8-8</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi8</Remarks>
    <Login_Order>10</Login_Order>
    <Report_Order>10</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    -<Sample ID="@B9 S9 9-9 SESAME STREET, MD 03/10/2015">
    <Boring>b9</Boring>
    <Sample>s9</Sample>
    <Depth>9-9</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi9</Remarks>
    <Login_Order>11</Login_Order>
    <Report_Order>11</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    -<Sample ID="@B10 S10 10-10 SESAME STREET, MD 03/10/2015">
    <Boring>b10</Boring>
    <Sample>s10</Sample>
    <Depth>10-10</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi10</Remarks>
    <Login_Order>12</Login_Order>
    <Report_Order>12</Report_Order>
    <Has_Data>N</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    -<Sample ID="@FRANK FARKN2">
    <Boring>frank</Boring>
    <Sample>farkn2</Sample>
    <Depth> </Depth>
    <Location> </Location>
    <SD> </SD>
    <Remarks> </Remarks>
    <Login_Order>7</Login_Order>
    <Report_Order>7</Report_Order>
    <Has_Data>N</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    -<Sample ID="@FRANK FRANK">
    <Boring>frank</Boring>
    <Sample>frank</Sample>
    <Depth> </Depth>
    <Location> </Location>
    <SD> </SD>
    <Remarks> </Remarks>
    <Login_Order>8</Login_Order>
    <Report_Order>8</Report_Order>
    <Has_Data>N</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    </Samples>
    </Project_Data
    What I need to do is find the sample by its ID attribute...IN THEN add the following
    <MC_Data>
    <Wet>blah</Wet
    <Dry>blah</Dry>
    </MC_Data>
    Here is the code I have now, which doesn't work...
    Public Sub XML_Add_Child_Node_Group(Sample_ID As String, Which_Category As Integer)
            If File.Exists(Program_Settings_File.PG_Filepath) = False Then MsgBox("The program settings file for the program has been moved or deleted! Cancelled.") : Exit Sub
            Dim XMLFile As New Xml.XmlDocument, NewNode As Xml.XmlElement = Nothing, NewChild As Xml.XmlElement = Nothing
            XMLFile.Load(Current_File.Current_File_Path)
            Dim Root_Node As XmlNode = XMLFile.SelectSingleNode("/Project_Data/Samples/[@ID='" & Sample_ID & "']")
            Dim Root_Element As Xml.XmlElement = CType(XMLFile.SelectSingleNode("/Project_Data/Samples/[@ID='" & Sample_ID & "']"), XmlElement)
            '1 = Add MC nodes
            Select Which_Category
                Case 1
                    '----Add new node.
                    NewNode = XMLFile.CreateElement("MC_Data")
                    '----Add children nodes.
                    NewChild = XMLFile.CreateElement("MC_Wet") : NewNode.AppendChild(NewChild)
                    'MsgBox(NewNode.Name)
                    NewChild = XMLFile.CreateElement("MC_Dry") : NewNode.AppendChild(NewChild)
                    NewChild = XMLFile.CreateElement("MC_Tare") : NewNode.AppendChild(NewChild)
                    NewChild = XMLFile.CreateElement("MC_Tare_No") : NewNode.AppendChild(NewChild)
                    NewChild = XMLFile.CreateElement("MC_Remarks") : NewNode.AppendChild(NewChild)
                    NewChild = XMLFile.CreateElement("MC_MC") : NewNode.AppendChild(NewChild)
                    Root_Element.AppendChild(NewNode)
            End Select
            '----Add entire tree.
            XMLFile.Save(Current_File.Current_File_Path)
        End Sub
    No matter what, it will not add these nodes. Can anyone help me out? Thanks ahead of time...
    Shawn

    Here is the XML
    <?xml version="1.0" encoding="UTF-8"?>
    <Project_Data>
    <Project_Info>
    <Client>frankLINVILE</Client>
    <Name>COOKIE MONSTER INDICTMNET</Name>
    <Number>198883cookie</Number>
    <Tester>JK</Tester>
    <Reviewer>CM</Reviewer>
    <Location>Sesame Street, MD</Location>
    <SD>03/10/2015</SD>
    <Boring_Header>Boring1</Boring_Header>
    <Sample_Header>Sample2</Sample_Header>
    <Depth_Header>Depth3</Depth_Header>
    <Location_Header>Location4</Location_Header>
    <SD_Header>Sample Date5</SD_Header>
    <Remarks>asdf sdafas</Remarks>
    <Is_LOC_Global>True</Is_LOC_Global>
    <Is_SD_Global>True</Is_SD_Global>
    <Count>12</Count>
    <Has_MC_Data>N</Has_MC_Data>
    </Project_Info>
    <Samples>
    <Sample ID="@B1 S1 1-2 SESAME STREET, MD 03/10/2015">
    <Boring>b1</Boring>
    <Sample>s1</Sample>
    <Depth>1-2</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>frank1</Remarks>
    <Login_Order>1</Login_Order>
    <Report_Order>1</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    <Sample ID="@B2 S2 2-2 SESAME STREET, MD 03/10/2015">
    <Boring>b2</Boring>
    <Sample>s2</Sample>
    <Depth>2-2</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>frakn2</Remarks>
    <Login_Order>2</Login_Order>
    <Report_Order>2</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    <Sample ID="@B3 S3 3-3 SESAME STREET, MD 03/10/2015">
    <Boring>b3</Boring>
    <Sample>s3</Sample>
    <Depth>3-3</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>frakn3</Remarks>
    <Login_Order>3</Login_Order>
    <Report_Order>3</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    <Sample ID="@B4 S4 4-4 SESAME STREET, MD 03/10/2015">
    <Boring>b4</Boring>
    <Sample>s4</Sample>
    <Depth>4-4</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi4</Remarks>
    <Login_Order>4</Login_Order>
    <Report_Order>4</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    <Sample ID="@B5 S5 5-5 SESAME STREET, MD 03/10/2015">
    <Boring>b5</Boring>
    <Sample>s5</Sample>
    <Depth>5-5</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi5</Remarks>
    <Login_Order>5</Login_Order>
    <Report_Order>5</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    <Sample ID="@B6 S6 6-6 SESAME STREET, MD 03/10/2015">
    <Boring>b6</Boring>
    <Sample>s6</Sample>
    <Depth>6-6</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi6</Remarks>
    <Login_Order>6</Login_Order>
    <Report_Order>6</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    <Sample ID="@B7 S7 7-7 SESAME STREET, MD 03/10/2015">
    <Boring>b7</Boring>
    <Sample>s7</Sample>
    <Depth>7-7</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi7</Remarks>
    <Login_Order>9</Login_Order>
    <Report_Order>9</Report_Order>
    <Has_Data>N</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    <Sample ID="@B8 S8 8-8 SESAME STREET, MD 03/10/2015">
    <Boring>b8</Boring>
    <Sample>s8</Sample>
    <Depth>8-8</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi8</Remarks>
    <Login_Order>10</Login_Order>
    <Report_Order>10</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    <Sample ID="@B9 S9 9-9 SESAME STREET, MD 03/10/2015">
    <Boring>b9</Boring>
    <Sample>s9</Sample>
    <Depth>9-9</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi9</Remarks>
    <Login_Order>11</Login_Order>
    <Report_Order>11</Report_Order>
    <Has_Data>Y</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    <Sample ID="@B10 S10 10-10 SESAME STREET, MD 03/10/2015">
    <Boring>b10</Boring>
    <Sample>s10</Sample>
    <Depth>10-10</Depth>
    <Location>SESAME STREET, MD</Location>
    <SD>03/10/2015</SD>
    <Remarks>hi10</Remarks>
    <Login_Order>12</Login_Order>
    <Report_Order>12</Report_Order>
    <Has_Data>N</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    <Sample ID="@FRANK FARKN2">
    <Boring>frank</Boring>
    <Sample>farkn2</Sample>
    <Depth> </Depth>
    <Location> </Location>
    <SD> </SD>
    <Remarks> </Remarks>
    <Login_Order>7</Login_Order>
    <Report_Order>7</Report_Order>
    <Has_Data>N</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    <Sample ID="@FRANK FRANK">
    <Boring>frank</Boring>
    <Sample>frank</Sample>
    <Depth> </Depth>
    <Location> </Location>
    <SD> </SD>
    <Remarks> </Remarks>
    <Login_Order>8</Login_Order>
    <Report_Order>8</Report_Order>
    <Has_Data>N</Has_Data>
    <Has_MC_Data>N</Has_MC_Data>
    <Has_GSA_Data>N</Has_GSA_Data>
    <Has_P_Data>N</Has_P_Data>
    <Has_C_Data>N</Has_C_Data>
    <Has_H_Data>N</Has_H_Data>
    <Has_USDA_Data>N</Has_USDA_Data>
    <Has_CM_Data>N</Has_CM_Data>
    <Has_UCS_Data>N</Has_UCS_Data>
    <Has_Cons_Data>N</Has_Cons_Data>
    <Has_ConsSw_Data>N</Has_ConsSw_Data>
    <Has_Pills_Data>N</Has_Pills_Data>
    <Has_UCSC_Data>N</Has_UCSC_Data>
    </Sample>
    </Samples>
    </Project_Data>
    jdweng

  • How can i write also to xml file the settings of the Tag property to identify if it's "file" or "directory" ?

    The first thing i'm doing is to get from my ftp server all the ftp content information and i tag it so i can identify later if it's a file or a directory:
    private int total_dirs;
    private int searched_until_now_dirs;
    private int max_percentage;
    private TreeNode directories_real_time;
    private string SummaryText;
    private TreeNode CreateDirectoryNode(string path, string name , int recursive_levl )
    var directoryNode = new TreeNode(name);
    var directoryListing = GetDirectoryListing(path);
    var directories = directoryListing.Where(d => d.IsDirectory);
    var files = directoryListing.Where(d => !d.IsDirectory);
    total_dirs += directories.Count<FTPListDetail>();
    searched_until_now_dirs++;
    int percentage = 0;
    foreach (var dir in directories)
    directoryNode.Nodes.Add(CreateDirectoryNode(dir.FullPath, dir.Name, recursive_levl+1));
    if (recursive_levl == 1)
    TreeNode temp_tn = (TreeNode)directoryNode.Clone();
    this.BeginInvoke(new MethodInvoker( delegate
    UpdateList(temp_tn);
    percentage = (searched_until_now_dirs * 100) / total_dirs;
    if (percentage > max_percentage)
    SummaryText = String.Format("Searched dirs {0} / Total dirs {1}", searched_until_now_dirs, total_dirs);
    max_percentage = percentage;
    backgroundWorker1.ReportProgress(percentage, SummaryText);
    percentage = (searched_until_now_dirs * 100) / total_dirs;
    if (percentage > max_percentage)
    SummaryText = String.Format("Searched dirs {0} / Total dirs {1}", searched_until_now_dirs, total_dirs);
    max_percentage = percentage;
    backgroundWorker1.ReportProgress(percentage, SummaryText);
    foreach (var file in files)
    TreeNode file_tree_node = new TreeNode(file.Name);
    file_tree_node.Tag = "file";
    directoryNode.Nodes.Add(file_tree_node);
    numberOfFiles.Add(file.FullPath);
    return directoryNode;
    The line i'm using to Tag is:
    file_tree_node.Tag = "file";
    So i know what is "file" then i make a simple check if the Tag is not null then i know it's a "file" if it's null then it's directory.
    For example this is how i'm checking if it's file or directory after getting all the content from my ftp server:
    if (treeViewMS1.SelectedNode.Tag != null)
    string s = (string)treeViewMS1.SelectedNode.Tag;
    if (s == "file")
    file = false;
    DeleteFile(treeViewMS1.SelectedNode.FullPath, file);
    else
    RemoveDirectoriesRecursive(treeViewMS1.SelectedNode, treeViewMS1.SelectedNode.FullPath);
    I also update in real time when getting the content of the ftp server xml file on my hard disk with the treeView structure information so when i'm running the program each time it will load the treeView structure with all directories and files.
    This is the class of the xml file:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Xml;
    using System.Windows.Forms;
    namespace FTP_ProgressBar
    class TreeViewXmlPopulation
    // Xml tag for node, e.g. 'node' in case of <node></node>
    private const string XmlNodeTag = "node";
    // Xml attributes for node e.g. <node text="Asia" tag=""
    // imageindex="1"></node>
    private const string XmlNodeTextAtt = "text";
    private const string XmlNodeTagAtt = "tag";
    private const string XmlNodeImageIndexAtt = "imageindex";
    public static void DeserializeTreeView(TreeView treeView, string fileName)
    XmlTextReader reader = null;
    try
    // disabling re-drawing of treeview till all nodes are added
    treeView.BeginUpdate();
    reader = new XmlTextReader(fileName);
    TreeNode parentNode = null;
    while (reader.Read())
    if (reader.NodeType == XmlNodeType.Element)
    if (reader.Name == XmlNodeTag)
    TreeNode newNode = new TreeNode();
    bool isEmptyElement = reader.IsEmptyElement;
    // loading node attributes
    int attributeCount = reader.AttributeCount;
    if (attributeCount > 0)
    for (int i = 0; i < attributeCount; i++)
    reader.MoveToAttribute(i);
    SetAttributeValue(newNode,
    reader.Name, reader.Value);
    // add new node to Parent Node or TreeView
    if (parentNode != null)
    parentNode.Nodes.Add(newNode);
    else
    treeView.Nodes.Add(newNode);
    // making current node 'ParentNode' if its not empty
    if (!isEmptyElement)
    parentNode = newNode;
    // moving up to in TreeView if end tag is encountered
    else if (reader.NodeType == XmlNodeType.EndElement)
    if (reader.Name == XmlNodeTag)
    parentNode = parentNode.Parent;
    else if (reader.NodeType == XmlNodeType.XmlDeclaration)
    //Ignore Xml Declaration
    else if (reader.NodeType == XmlNodeType.None)
    return;
    else if (reader.NodeType == XmlNodeType.Text)
    parentNode.Nodes.Add(reader.Value);
    finally
    // enabling redrawing of treeview after all nodes are added
    treeView.EndUpdate();
    reader.Close();
    /// <span class="code-SummaryComment"><summary>
    /// Used by Deserialize method for setting properties of
    /// TreeNode from xml node attributes
    /// <span class="code-SummaryComment"></summary>
    private static void SetAttributeValue(TreeNode node,
    string propertyName, string value)
    if (propertyName == XmlNodeTextAtt)
    node.Text = value;
    else if (propertyName == XmlNodeImageIndexAtt)
    node.ImageIndex = int.Parse(value);
    else if (propertyName == XmlNodeTagAtt)
    node.Tag = value;
    public static void SerializeTreeView(TreeView treeView, string fileName)
    XmlTextWriter textWriter = new XmlTextWriter(fileName,
    System.Text.Encoding.ASCII);
    // writing the xml declaration tag
    textWriter.WriteStartDocument();
    //textWriter.WriteRaw("\r\n");
    // writing the main tag that encloses all node tags
    textWriter.WriteStartElement("TreeView");
    // save the nodes, recursive method
    SaveNodes(treeView.Nodes, textWriter);
    textWriter.WriteEndElement();
    textWriter.Close();
    private static void SaveNodes(TreeNodeCollection nodesCollection,
    XmlTextWriter textWriter)
    for (int i = 0; i < nodesCollection.Count; i++)
    TreeNode node = nodesCollection[i];
    textWriter.WriteStartElement(XmlNodeTag);
    textWriter.WriteAttributeString(XmlNodeTextAtt,
    node.Text);
    textWriter.WriteAttributeString(
    XmlNodeImageIndexAtt, node.ImageIndex.ToString());
    if (node.Tag != null)
    textWriter.WriteAttributeString(XmlNodeTagAtt,
    node.Tag.ToString());
    // add other node properties to serialize here
    if (node.Nodes.Count > 0)
    SaveNodes(node.Nodes, textWriter);
    textWriter.WriteEndElement();
    And this is how i'm using the class this method i'm calling it inside the CreateDirectoryNode and i'm updating the treeView in real time when getting the ftp content from the server i build the treeView structure in real time.
    DateTime last_update;
    private void UpdateList(TreeNode tn_rt)
    TimeSpan ts = DateTime.Now - last_update;
    if (ts.TotalMilliseconds > 200)
    last_update = DateTime.Now;
    treeViewMS1.BeginUpdate();
    treeViewMS1.Nodes.Clear();
    treeViewMS1.Nodes.Add(tn_rt);
    TreeViewXmlPopulation.SerializeTreeView(treeViewMS1, @"c:\XmlFile\Original.xml");
    ExpandToLevel(treeViewMS1.Nodes, 1);
    treeViewMS1.EndUpdate();
    And when i'm running the program again in the constructor i'm doing:
    if (File.Exists(@"c:\XmlFile\Original.xml"))
    TreeViewXmlPopulation.DeserializeTreeView(treeViewMS1, @"c:\XmlFile\Original.xml");
    My question is how can i update the xml file in real time like i'm doing now but also with the Tag property so next time i will run the program and will not get the content from the ftp i will know in the treeView what is file and what is directory.
    The problem is that now if i will run the program the Tag property is null. I must get the ftp content from the server each time.
    But i want that withoutout getting the ftp content from server to Tag each file as file in the treeView structure.
    So what i need is somehow where i;m Tagging "file" or maybe when updating the treeView also to add something to the xml file so when i will run the progrma again and read back the xml file it will also Tag the files in the treeView.

    Hi
    Chocolade1972,
    Your case related to Winform Data Controls, So i will move your thread to Windows Forms> Windows
    Forms Data Controls and Databinding  forum for better support.
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to check the element  in xml file by xpath

    hi all,
    * How to check the element in xml file by xpath
    for the following XML file,
    * I want to check whether
    the element (sage) is present or not in the following xml file XPATH expression...
    * I have tried by the following expression ,
    NodeList result = (NodeList) xpath.evaluate("//*:student/*:sage/text()",xml_dom,XPathConstants.STRING);
    System.out.println(result.item(0).getLocalName()); * I want to get the Element sage as String value....
    but i am not able to get the element,why that ??? and How to do that ???
    MyXML File :
    <x:student>
    <x:sname>aaa</x:sname>
    <x:sage>26</x:sage>
    </x:student>
    Thanks,
    JavaImran

    <code>* Thanks for reply....
    * </code><code>In </code>
    <code>x:student element x represents the namespace...thats why i put *:student in my expression....
    "//*[local-name() = 'student']/*[local-name() = 'sage']/text()"* By the above code , i am not able to get the sage as string from
    </code> resul.item(0).getLocalName() method.......?
    * How to get that as string format ?

  • How to view AR dunning letter XML file (raw data)?

    Hi,
    Can anybody tell how to view AR dunning letter XML file (raw data) as I like to modified the dunning letter and like to know which fields I can add to our dunning letter layout. thanks.

    Hi
    These are the steps you need to do to get the output in XML Raw format.
    Step 1
    1- Go to System Administrator -> Concurrent -> Program - Define
    2- Query the Dunning Letter Print
    3- Set the format output as XML
    Step 2
    1- Ftp Oracle E-business suite Server
    2- Get the file ARDLP.rdf from $AR_TOP/reports
    3- Open the report using Oracle Reports
    4- Change the output to XML.
    ARDLP.rdf is a report provided by Oracle Corporation so it is a good idea to make a backup of the same,
    before making any changes. Hope this will help.
    Regards
    Ali

  • How-to use Excel for the XML file input?

    Hello all,
    Following our discussion with Gerhard Steinhuber on the very nice tutorial from Horst Schaude , "How to upload mass data via XML File Input" , I am starting this new discussion.
    In the comments section of this previous cited tutorial, Rufat Gadirov explains how to use a generated XML from Eclipse instead of your XSD file as your source in Excel.
    However, in spite of all the instructions, I am still facing the same issue in Excel when I try to save my file as XML : "The XML maps in this workbook are not exportable".
    What I try to do is to create one or more Sales Orders with multiple Items in it from a XML File Input, using excel to enter data.
    The part with the File input is working (if I directly upload my file to the webDAV, it creates a sales order instance with multiple items).
    The only missing part is the Excel data input that I cannot make work. Any help on this matter would be greatly appreciated.
    Here is my XML file that I try to use as a source in Excel before inputing data from Excel:
    <?xml version="1.0" encoding="UTF-8"?>
    <p:MySalesOrderUploadedIntegrationInputRequest xmlns:p="http://001365xxx-one-off.sap.com/YUUD0G3OY_" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <MessageHeader>
        <CreationDateTime>2015-03-02T12:00:00.000Z</CreationDateTime>
    </MessageHeader>
        <List actionCode="01" listCompleteTransmissionIndicator="true" reconciliationPeriodCounterValue="0">
            <MySalesOrderUploaded>
              <MySalesOrderUploadedID>idvalue0</MySalesOrderUploadedID>
              <MyBuyerID schemeAgencyID="token" schemeAgencySchemeAgencyID="1" schemeID="token">token</MyBuyerID>
              <MyDateTime>2015-03-02T12:00:00.000Z</MyDateTime>
              <MyName languageCode="EN">MyName</MyName>
              <MyBillToParty schemeAgencyID="token" schemeAgencySchemeAgencyID="1" schemeAgencySchemeID="token" schemeID="token">token</MyBillToParty>
              <MyDateToBeDelivered>2001-01-01</MyDateToBeDelivered>
              <MyEmployeeResponsible schemeAgencyID="token" schemeAgencySchemeAgencyID="1" schemeAgencySchemeID="token" schemeID="token">token</MyEmployeeResponsible>
              <MySalesUnit schemeAgencyID="token" schemeAgencySchemeAgencyID="1" schemeAgencySchemeID="token" schemeID="token">token</MySalesUnit>
                <MyItem>
                    <MyItemID>token</MyItemID>
                    <MyItemProductID schemeAgencyID="token" schemeID="token">token</MyItemProductID>
                    <MyItemDescription languageCode="EN">MyItemDescription</MyItemDescription>
                    <MyProductTypeCode>token</MyProductTypeCode>
                    <MyRequestedQuantity unitCode="token">0.0</MyRequestedQuantity>
                    <MyConfirmedQuantity unitCode="token">0.0</MyConfirmedQuantity>
                    <MyNetAmount currencyCode="token">0.0</MyNetAmount>
                </MyItem>
            </MySalesOrderUploaded>
            <MySalesOrderUploaded>
              <MySalesOrderUploadedID>idvalue0</MySalesOrderUploadedID>
              <MyBuyerID schemeAgencyID="token" schemeAgencySchemeAgencyID="1" schemeID="token">token</MyBuyerID>
              <MyDateTime>2015-03-02T12:00:00.000Z</MyDateTime>
              <MyName languageCode="EN">MyName</MyName>
              <MyBillToParty schemeAgencyID="token" schemeAgencySchemeAgencyID="1" schemeAgencySchemeID="token" schemeID="token">token</MyBillToParty>
              <MyDateToBeDelivered>2001-01-01</MyDateToBeDelivered>
              <MyEmployeeResponsible schemeAgencyID="token" schemeAgencySchemeAgencyID="1" schemeAgencySchemeID="token" schemeID="token">token</MyEmployeeResponsible>
              <MySalesUnit schemeAgencyID="token" schemeAgencySchemeAgencyID="1" schemeAgencySchemeID="token" schemeID="token">token</MySalesUnit>
                <MyItem>
                    <MyItemID>token</MyItemID>
                    <MyItemProductID schemeAgencyID="token" schemeID="token">token</MyItemProductID>
                    <MyItemDescription languageCode="EN">MyItemDescription</MyItemDescription>
                    <MyProductTypeCode>token</MyProductTypeCode>
                    <MyRequestedQuantity unitCode="token">0.0</MyRequestedQuantity>
                    <MyConfirmedQuantity unitCode="token">0.0</MyConfirmedQuantity>
                    <MyNetAmount currencyCode="token">0.0</MyNetAmount>
                </MyItem>
            </MySalesOrderUploaded>
        </List>
    </p:MySalesOrderUploadedIntegrationInputRequest>
    Thank you all for your attention.
    Best regards.
    Jacques-Antoine Ollier

    Hello Jacques-Antoine,
    I suppose that as you have tried to construct a map from the schema, you have taken the elements from the List level down. In this case I also can't export the map.
    But if you take the elements from the level MySalesOrderUploaded down, you'll get the exportable map (screenshots)
    Best regards,
    Leonid Granatstein

  • How can we get  tag of XML file using SAX

    Hi ,
    I'm parsing one SAX parser , I'have almost done this parsing. i have faced problem for one case, i'e how can we get tag from XML file using SAX parser?
    XML file is
    <DFProperties>
    <AccessType>
    <Get/>
    </AccessType> <Description>
    gdhhd
    </Description>
    <DFFormat>
    <chr/>
    </DFFormat>
    <Scope>
    <Permanent/>
    </Scope>
    <DFTitle>gsgd</DFTitle>
    <DFType>
    <MIME>text/plain</MIME>
    </DFType>
    </DFProperties>
    I want out like GET and Permanent... means this one tag which is present inside of another tag.
    Handler class like
    public void startElement(String namespaceURI, String localName,
                   String qName, Attributes atts) throws SAXException {
    if(_ACCESSTYPE.equals(localName)){
                   accessTypeElement=ACCESSTYPE;
    public void characters(char[] ch, int start, int length)
                   throws SAXException {
    if (_ACCESSTYPE.equals(_accessTypeElement)) {
                   String strValue = new String(ch, start, length);
                   System.out.println("Accestype-----------------------------> " + strValue);
                   //System.out.println(" " + strValue);
    public void endElement(String namespaceURI, String localName, String qName)
                   throws SAXException {
    if (_ACCESSTYPE.equals(localName)) {
                   _accessTypeElement = "";
    . please any body help me

    Hi ,
    I have one problem,Please help me.
    1. How can I'll identify where exactly my Node is ended,means how how can we find corresponding nodename? in partcular place
    <Node> .............starttag1
    <NodeName>Test</NodeName>
    <Node>................starttag2
    <nodeName>test1</NodeName>
    </Node>..................endtag2
    <Node>.....................starttag3
    <NodeName><NodeName>
    <Node> .........................starttag4
    <NodeName>test4</NodeName>
    </Node>.......enddtag4
    </Node>...........end tag3
    </Node>............endtag1
    my code is below
    private final String _NODENAME = "NodeName";
    private final String _NODE = "Node";
    private String _nodeElement = "";
         private String _NodeNameElement = "";
    public void startElement(String namespaceURI, String localName,
                   String qName, Attributes atts) throws SAXException {
    if (_NODENAME.equals(localName)) {
                   NodeNameElement = NODENAME;
    if(_NODE.equals(localName)){
         System.out.println("start");
         if (_NODENAME.equals(localName)) {
                   NodeNameElement = NODENAME;
    public void characters(char[] ch, int start, int length)
                   throws SAXException {
    if (_NODENAME.equals(_NodeNameElement)) {
                   String strValue = new String(ch, start, length);
                   String sttt=strValue;
                   System.out.println("NODENAME: ************* " + strValue);
    if(_NODE.equals(_nodeElement)){
                   if (_NODENAME.equals(_NodeNameElement)) {
                        String strValue = new String(ch, start, length);
                        String sttt=strValue;
                        System.out.println("nodevalue********** " + strValue);
    public void endElement(String namespaceURI, String localName, String qName)
                   throws SAXException {
    if (_NODENAME.equals(localName)) {
                   _NodeNameElement = "";
    if(_NODE.equals(localName)){
                   System.out.println("NODENAME: %%%%%%%%%");
    please help me. How can I figure node ending for particular nodename

  • How to convert DOM Tree in XML File

    Hi there,
    I am successful to build a DOM tree in memory where i am adding elements. Now after all this i want to make a XML file of that DOM representation. Now, i am confused with my code that how to transfer DOM structure to xml file ? A small code is attached herewith ?
    doc = db.newDocument();
                   doc.normalizeDocument();
                   doc.setXmlVersion("1.0");
                   doc.createComment("Created By: Sachin Kulkarni");
                   Element rn = doc.createElement("RootNode");
                   Element n1 = doc.createElement("A1");
                   ((Node)n1).setNodeValue("Element A1");
                   Element n11 = doc.createElement("A11");
                   ((Node)n11).setNodeValue("Element A11");
                   Element n12 = doc.createElement("A12");
                   ((Node)n12).setNodeValue("Element A12");
                   ((Node)n1).appendChild( ((Node)n11) );
                   ((Node)n1).appendChild( ((Node)n12) );
                   Element n2 = doc.createElement("A2");
                   ((Node)n2).setNodeValue("Element A2");
                   Element n3 = doc.createElement("A3");
                   ((Node)n3).setNodeValue("Element A3");
                   ((Node)rn).appendChild( ((Node)n1) );
                   ((Node)rn).appendChild( ((Node)n2) );
                   ((Node)rn).appendChild( ((Node)n3) );
    //creating the xml file
                   Source source = new DOMSource((Element) doc.getElementsByTagName("RootNode").item(0));
                   StringWriter out = new StringWriter();
                   StreamResult result = new StreamResult(out);
                   Transformer transformer = TransformerFactory.newInstance().newTransformer();
                   transformer.setOutputProperty("encoding", "iso-8859-1");
                   transformer.setOutputProperty("indent", "yes");
                   //transformer.setOutputProperty("test.xml","1");
                   //transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
                   transformer.transform(source,result);
                   result.getWriter().toString();
    ==================
    Is it any problem with the implementation ? How to use fileoutputstream with this ?

    I have done like this:
    DocumentBuilderFactory docBuildFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = docBuildFactory.newDocumentBuilder();
    Document doc = builder.newDocument();
    Element root = (Element)doc.createElement("Root");
    doc.appendChild(root);
    Element address = (Element)doc.createElement("Address");
    address.appendChild((Element)doc.createElement("Street"));
    address.appendChild((Element)doc.createElement("PostCode"));
    address.appendChild((Element)doc.createElement("Town"));
    Element country = (Element)doc.createElement("Country");
    country.setAttribute("type","EU");
    Text cname = doc.createTextNode("Spain");
    country.appendChild(cname);
    address.appendChild(country);
    root.appendChild(address);
    TransformerFactory tranFactory = TransformerFactory.newInstance();
    Transformer aTransformer = tranFactory.newTransformer();
    aTransformer.setOutputProperty(OutputKeys.INDENT, "yes");
    Source src = new DOMSource(doc);
    Result dest = new StreamResult(new FileOutputStream(new File("test.xml")));
    aTransformer.transform(src, dest);

  • Add carriage return in XML file

    Hi,
    I found a topic that correspond to my requirement :
    [Add carriage return in XML file|https://wiki.sdn.sap.com/wiki/display/XI/HowtoappendCarriageReturnintheendofeachtagofxml+file]
    But i don't know where created this udf, which input parameter pass?
    Thank you for your help.

    Hi Frantzy,
    The link does not give enough explanation. What I am assuming is if you have xml string in one field then if you need to add new line after each tag then you can follow that.
    If you want a udf where you want to insert a new line use this udf:
    Create a Value UDF with one input argument 'a' and name the udf as addnewline. Then add this code:
    Imports: java.*;
    String lines;
    lines = "";
    lines = lines.concat(a + '\n' );
    return lines;
    Then where ever you want a new line just add this udf in your mapping. If you want a new line for 10 fields then you can put in all the 10 fields.
    Example:
    Source field --> logic --> udf (addnewline) --> target.
    So after logic if you have the value as 123 then in the target you will see 123 followed by a carriage return.
    Regards,
    ---Satish

  • How to create Inbound Idoc from XML file-Need help urgently

    Hi,
    can any one tell how to create inbound Idoc from XML file.
    we have xml file in application server Ex. /usr/INT/SMS/PAYTEXT.xml'  we want to generate inbound idoc from this file.we are successfully able to generate outbound XML file from outbound Idoc by using the XML port. But not able to generate idoc from XML file by using we19 or we16.
    Please let me know the process to trigger inbound Idoc with out using  XI and any other components.
    Thanks in advance
    Dora Reddy

    Hi .. Did either of you get a result on this?
    My question is the same really .. I am testing with WE19 and it seems SAP cannot accept an XML inbound file as standard.
    I see lots of mention of using a Function Module.
    Am I correct in saying therefore that ABAP development is required to create a program to run the FM and process the idoc?
    Or is there something tht can be done with Standard SAP?
    Thanks
    Lee

  • How to add a table to pdf file ?

    How to add a table to pdf file ?
    Not able to use the table component. Its not active.
    Any help pls
    Thanks
    Peter
    http://www.ethos.ag

    http://forum.java.sun.com/faq.jsp#format

Maybe you are looking for

  • How to create xsd's for each table in repository instead of entire repos

    Hi Gurus, Is there any way i could create xsd's for each table in the repository separately instead of creating single xsd file from "Export repository schema" option which creates a single xml file for the entire repository.I need to create xsd for

  • BDC using SAVE text in VA01

    Hi All, I'm creating a BDC session calling the VA01. my problem is where do I put my code? I test it and I still got a blank in header text pick list. Codes is more helpful so I can compare my work. Thanks.

  • Seeing the WBS elelemnt exclusively in CN43N (without hierarchy)

    Hi all, Pls help me with my requirement which is to see the report of multiple WBS elements on one screen . These are at different levels within different projects or same project e.g. in CN43n or any other report which can be sent by mail to any per

  • How to embed word docs

    I have created an application using coldfusion that takes a bunch of inputs to produce an HTML page which gets emailed to the user.  In this app the user can upload files to be attached to the html page.  The problem I am having is the users don't ha

  • SAP ERP 2005 installation in Cluster mode on Solaris Platform using LDoms

    Hello Gurus, We want to install SAP ERP 2005 (ECC 6.0 SR3) on Solaris 10, (Solaris cluster 3.2). Please let me know the procedure. What would be the basic steps or difference while performing installation. Also if anybody can give the mount point det