Discussion Board

Results 1 to 9 of 9
  1. #1
    Nokia Developer Champion somnathbanik's Avatar
    Join Date
    Dec 2008
    Posts
    2,271
    Hi,

    I got this open source lib to display the UI components on the screen using html tags.

    http://code.google.com/p/htmlcontrol-for-symbian/

    I used the Form example and was able to see the UI on the screen. Even I could change the html tags and modify the UI components. But is there any other open source lib that can generate UI using the xml tags as it is doing here, or is there any way I could change the xml tags to html tags, so that I could use this .

    Please suggest me.

  2. #2
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    There were rumors about a forthcoming XML-based UI for Symbian/S60, but the project is likely dumped in favour of Qt.
    Anyway, note that HTML is a far less strict format than XML, so depending on your XML format, renaming the tags may already turn out to be enough.

  3. #3
    Nokia Developer Champion somnathbanik's Avatar
    Join Date
    Dec 2008
    Posts
    2,271
    Is there any way I could replace the xml string to html string.
    eg. <tablerow> ---> <tr>

    kind of file read/write program.

  4. #4
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    I would do that using descriptors.

  5. #5
    Nokia Developer Champion somnathbanik's Avatar
    Join Date
    Dec 2008
    Posts
    2,271
    descriptors? How, using HBufC/ TBuf.

    Please suggest me with some code.

  6. #6
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    Yes, that is exceptionally hard.
    Code:
    _LIT(KSomething,"blablabla<tablerow>blablabal</tablerow><tablerow>blablabla</tablerow><tablerow/>");
    TBuf<200> buf;
    buf=KSomething;
    
    _LIT(KFind1,"<tablerow");
    _LIT(KReplace1,"<tr");
    
    TInt pos=buf.Find(KFind1);
    while(pos>KErrNotFound)
    {
        buf.Replace(pos,KFind1().Length(),KReplace1);
        pos=buf.Find(KFind1);
    }
    
    _LIT(KFind2,"</tablerow");
    _LIT(KReplace2,"</tr");
    
    pos=buf.Find(KFind2);
    while(pos>KErrNotFound)
    {
        buf.Replace(pos,KFind2().Length(),KReplace2);
        pos=buf.Find(KFind2);
    }
    Of course I am cheating, because 'tr' is shorter than 'tablerow'. Replacing something with a longer text would require dynamic memory allocation, like HBufC-s or CBufFlat-s.

  7. #7
    Nokia Developer Champion somnathbanik's Avatar
    Join Date
    Dec 2008
    Posts
    2,271
    After replacing the string from KSomething, where the replaced string will be stored. in buf?

    I am trying to display the replaced sting but getting an error message Panic KERN-EXEC 3

    here is my code
    HTML Code:
    case EHelp:
    			{
    
    			_LIT(KSomething,"blablabla<tablerow>blablabal</tablerow><tablerow>blablabla</tablerow><tablerow/>");
    			TBuf<200> buf;
    			buf=KSomething;
    
    			_LIT(KFind1,"<tablerow");
    			_LIT(KReplace1,"<tr");
    
    			TInt pos=buf.Find(KFind1);
    			while(pos>KErrNotFound)
    			{
    			    buf.Replace(pos,KFind1().Length(),KReplace1);
    			    pos=buf.Find(KFind1);
    			}
    
    			_LIT(KFind2,"</tablerow");
    			_LIT(KReplace2,"</tr");
    
    			pos=buf.Find(KFind2);
    			while(pos>KErrNotFound)
    			{
    			    buf.Replace(pos,KFind2().Length(),KReplace2);
    			    pos=buf.Find(KFind2);
    			}
    			  _LIT(KMenuItem,"%S");
    			  TBuf<201> buf1;
    			  buf1.Format(KMenuItem(), buf);       
    			  CAknInformationNote* info = new (ELeave) CAknInformationNote;
    			  info->ExecuteLD(buf1);
    			        	        	        
    			}
    			break;
    please sugges me.

  8. #8
    Nokia Developer Champion somnathbanik's Avatar
    Join Date
    Dec 2008
    Posts
    2,271
    Yes I have solved it.

    here is the code

    HTML Code:
    	case EHelp:
    			{
    
    			_LIT(KSomething,"blablabla<tablerow>blablabal</tablerow><tablerow>blablabla</tablerow><tablerow/>");
    			TBuf<200> buf;
    			buf=KSomething;
    
    			_LIT(KFind1,"<tablerow");
    			_LIT(KReplace1,"<tr");
    
    			TInt pos=buf.Find(KFind1);
    			while(pos>KErrNotFound)
    			{
    			    buf.Replace(pos,KFind1().Length(),KReplace1);
    			    pos=buf.Find(KFind1);
    			}
    
    			_LIT(KFind2,"</tablerow");
    			_LIT(KReplace2,"</tr");
    
    			pos=buf.Find(KFind2);
    			while(pos>KErrNotFound)
    			{
    			    buf.Replace(pos,KFind2().Length(),KReplace2);
    			    pos=buf.Find(KFind2);
    			}
    			
    			     
    			  CAknInformationNote* info = new (ELeave) CAknInformationNote;
    			  info->ExecuteLD(buf);
    			  
    			        	        	        
    			}
    			break;

  9. #9
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    Just for future reference: %S expects the address of a descriptor, not the descriptor itself:
    Code:
    _LIT(KMenuItem,"%S");
    TBuf<201> buf1;
    buf1.Format(KMenuItem(), &buf);

Similar Threads

  1. converting html to xml
    By rati2010 in forum Symbian C++
    Replies: 5
    Last Post: 2008-07-09, 16:40
  2. Remove HTML tags from XML parsed text
    By sandro1972 in forum Mobile Java General
    Replies: 1
    Last Post: 2007-12-14, 10:13
  3. translate xml to html
    By yanhua in forum Python
    Replies: 0
    Last Post: 2007-10-21, 21:59
  4. convert from HTML / XML to WML
    By Nokia_Archive in forum Browsing and Mark-ups
    Replies: 1
    Last Post: 2002-05-16, 14:47
  5. building a HTML to WML converter
    By Nokia_Archived in forum Browsing and Mark-ups
    Replies: 1
    Last Post: 2002-05-15, 21:32

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved