×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    128

    Question XML Builder problem

    Hi,

    am converting int to string,
    then am giving the string to the builder, but after building the string becomes NULL string,

    int iMethodIndex = 0;

    /// a Temp variable to convert int to string
    TBuf<64> bufMethodId;
    bufMethodId.AppendNum(iMethodIndex);

    /// converting TBuf to TPtrC8 to set the method index
    TPtrC8 pcMethodName((TUint8*)bufMethodId.Ptr(), bufMethodId.Size());

    /// setting the method attribute -> index and value
    XmlMethodNode->AsElement()->AddAttrL(KName,pcMethodName);

    the resultant xml is,

    <method index=""></method>

    please help me in this issue.

    Regards,
    AMD

  2. #2
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,348

    Re: XML Builder problem

    Try to replace:
    Code:
    /// a Temp variable to convert int to string
    TBuf<64> bufMethodId;
    bufMethodId.AppendNum(iMethodIndex);
    
    /// converting TBuf to TPtrC8 to set the method index
    TPtrC8 pcMethodName((TUint8*)bufMethodId.Ptr(), bufMethodId.Size());
    
    /// setting the method attribute -> index and value
    XmlMethodNode->AsElement()->AddAttrL(KName,pcMethodName);
    with
    Code:
    /// a Temp variable to convert int to string
    TBuf8<64> bufMethodId;
    bufMethodId.AppendNum(iMethodIndex);
    
    /// setting the method attribute -> index and value
    XmlMethodNode->AsElement()->AddAttrL(KName,bufMethodId);

  3. #3
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    128

    Re: XML Builder problem

    Quote Originally Posted by A.A.M. View Post
    Try to replace:
    Code:
    /// a Temp variable to convert int to string
    TBuf<64> bufMethodId;
    bufMethodId.AppendNum(iMethodIndex);
    
    /// converting TBuf to TPtrC8 to set the method index
    TPtrC8 pcMethodName((TUint8*)bufMethodId.Ptr(), bufMethodId.Size());
    
    /// setting the method attribute -> index and value
    XmlMethodNode->AsElement()->AddAttrL(KName,pcMethodName);
    with
    Code:
    /// a Temp variable to convert int to string
    TBuf8<64> bufMethodId;
    bufMethodId.AppendNum(iMethodIndex);
    
    /// setting the method attribute -> index and value
    XmlMethodNode->AsElement()->AddAttrL(KName,bufMethodId);
    Hi A.A.M,

    Thanks for the solution.
    will try...

    Regards,
    AMD

Similar Threads

  1. SyncML link problem
    By samuel_ in forum Symbian
    Replies: 4
    Last Post: 2009-03-27, 08:02
  2. problem with JSR 172 XML parser sax
    By madsum in forum Mobile Java General
    Replies: 1
    Last Post: 2009-01-07, 12:00
  3. Problem with Borland C++ Builder SDK 1.2
    By wizking in forum Symbian Tools & SDKs
    Replies: 3
    Last Post: 2006-03-03, 00:15
  4. About 6230 Bt Problem
    By eerkek in forum Bluetooth Technology
    Replies: 17
    Last Post: 2005-02-08, 12:33
  5. 7210 Silent Problem
    By MarkMckim in forum Mobile Java General
    Replies: 1
    Last Post: 2003-03-18, 12:36

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×