none
load xml into a dataset doesnt work when xml has namespace RRS feed

  • Question

  •  

    I would like to load an xml file into a typed dataset with the readxml method but it the dataset is never filled because the xml contains a namespace

     

    this is the xml :

    <ns0:REMCHQ xmlns:ns0="http://BTS_REMISECHEQUE_SCHEMA.RemChq_Return_Schema">

    <ENCAISSEMENT>

    <ENCAISSEMENT_CODE>0861136568</ENCAISSEMENT_CODE>

    <ENCAISSEMENT_MNT>9525</ENCAISSEMENT_MNT>

    <TYPEEVTENC_ID>10</TYPEEVTENC_ID>

    <EVTENCAISSEMENT_DATE>20080530</EVTENCAISSEMENT_DATE>

      </ENCAISSEMENT>

    </ns0:REMCHQ>

     

    If i remove the namespace the dataset will be filled right but i dont want to

     

    this is the .net code where xmlstring contains all the xml

    StringReader v_StringReader = new StringReader(xmlstring);
    v_DstPointageEncaissement.DataSetName =
    "REMCHQ";
    v_DstPointageEncaissement.ReadXml(v_StringReader, XmlReadMode.InferSchema);

     

    I tried all the methods readxml with different parameters but nothing works

    WHo can help me to tell the framework my xml contains a namespace and to fill well ?

     

    Wednesday, May 28, 2008 12:54 PM

All replies

  •  totojobard wrote:

     

    I would like to load an xml file into a typed dataset with the readxml method but it the dataset is never filled because the xml contains a namespace

     

    this is the xml :

    <ns0:REMCHQ xmlns:ns0="http://BTS_REMISECHEQUE_SCHEMA.RemChq_Return_Schema">

    <ENCAISSEMENT>

    <ENCAISSEMENT_CODE>0861136568</ENCAISSEMENT_CODE>

    <ENCAISSEMENT_MNT>9525</ENCAISSEMENT_MNT>

    <TYPEEVTENC_ID>10</TYPEEVTENC_ID>

    <EVTENCAISSEMENT_DATE>20080530</EVTENCAISSEMENT_DATE>

      </ENCAISSEMENT>

    </ns0:REMCHQ>

     

    If i remove the namespace the dataset will be filled right but i dont want to

     

    this is the .net code where xmlstring contains all the xml

    StringReader v_StringReader = new StringReader(xmlstring);
    v_DstPointageEncaissement.DataSetName =
    "REMCHQ";
    v_DstPointageEncaissement.ReadXml(v_StringReader, XmlReadMode.InferSchema);

     

    I tried all the methods readxml with different parameters but nothing works

    WHo can help me to tell the framework my xml contains a namespace and to fill well ?

     

    Wednesday, May 28, 2008 12:55 PM