Creating XML document using titanium - ios

I am unable to find any examples or pre-defined XML methods to create XML document using titanium. Do any body have an example or methods to create XML document using Titanium [Appcelerator]. Any suggestions on this ?
Thanks
Ranjith

You might want to start your search with Titanium's documentation:
http://docs.appcelerator.com/titanium/latest/#!/guide/Working_with_XML_Data
Or with the whole namespace dedicated to manipulating XML, Titanium.XML:
http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.XML

Related

Creating Epub on the basis of Template

I have been working on creating Epub for my work. I have used Aspose to create the Epub. In this process numerous word document is merged together and single epub file is created. Now I am asked to create an EPub based on a template. I have been searching a way to do it but I am no where near to the solution. I haven't even found the template for Epub which will render smoothly over various devices IOS and android. Similarly I have no clue how I will achieve this task programmatically. If anyone out there have any idea please provide me an insight.
As you may know an ePub is a file that contains a lot of html pages. if you want to create a template based epub programmatically you should link this files to a css and modify the structure of the html as the template.
If I were you I would use a regex to edit the html files, get the contents and place this contents in a new html page. Once done that I would place the html page in the epub.
I suggest you please create the template document (DOTX) using MS Word. Import this template document into Aspose.Words' DOM, merge Word documents, do other document processing tasks, and save it to EPUB using Document.Save method. You may also create the template document programmatically using Aspose.Words. I work with Aspose as Developer evangelist.

How to read pdf and extract text from pdf in symfony1.1?

I am working on Symfony-1.1 in an existing project. How can I read pdf files and extract text from them?
It's not a Symfony 1.1 related question, actually. It's a PHP one. There several libraries to handle PDFs in PHP. Following are some suggestions.
https://github.com/smalot/pdfparser
http://pastebin.com/dvwySU1a
http://www.pdflib.com/
If you just need to parse pdf in anyway and then process the text in PHP, you can also consider using a java library like the following.
http://pdfbox.apache.org/ (Is there a PDF parser for PHP?)

Resources for learning to output xml from rails?

I would like to use rails to output xml on a request from a client (Android device). I have gleaned from web searches that .builder.xml files are the way to go for this, but I cannot find a single tutorial or guide to get me started that is newer that 2006.. does anyone know of a good resource for xml and rails?
It's probably best to look at the official XML Builder homepage and follow/try the examples there: http://builder.rubyforge.org/
You can use XML Builder in both your controller or in your views, the code is the same. However, inside an .builder view you already have access to a builder instance via the "xml" variable. See: http://danengle.us/2009/05/generating-custom-xml-for-your-rails-app/
Take a look at this article about XML Builder.
I also highly recommend you to use Nokogiri to generate XML.

Strategy in exporting to Excel with formatting from ASP.NET?

So this is another exporting to Excel question.
I have a page that has a table with formatting by stylesheet.
When I export the page by setting the ContentType to application/excel and Content-Disposition to attachment, I can export the table to Excel (not CSV). However, it loses all formatting. I think it's because Excel does not load CSS and I guess that's reasonable.
So, in a scenario where I have to show the table on the web and also export to Excel, both with similar (even if not exact) formatting, what would be the best approach without using something like NPOI?
I am trying to minimize the work and keep the single template if possible. Is it necessary for me to create two separate templates: one with stylesheet, the other with embedded style in the table itself for Excel?
Having a single template with conditional formatting inside would be very messy.
Any ideas?
If you not yet solve the problem I'll recommend you to use Open XML SDK 2.0 for Microsoft Office (see http://www.microsoft.com/downloads/details.aspx?FamilyID=c6e744e5-36e9-45f5-8d8c-331df206e0d0&displaylang=en). With this way you will be able create an XLSX file without installing Excel on the server. XLSX file is compressed (like ZIP file) collection of xml files. Open XML SDK 2.0 helps you create and change XLSX file as pure xml files. At the first time if you look at Open XML SDK a lot of things look like strange, but it's only at the beginning. There are so named "Open XML SDK 2.0 Productivity Tool" (a part of Open XML SDK 2.0) which can generate a lot of useful code for you. Moreover you can create a nice Excel document which you can use as a prototype (template) of the document which you will create. So you can solve the problem of complex formating without writing of a lot of code.
Look at http://msdn.microsoft.com/en-us/library/cc850837(v=office.14).aspx for some examples and on http://openxmldeveloper.org/default.aspx. See also Creating Excel document with OpenXml sdk 2.0 as a start example. You can find also a lot of good stuffs on http://www.codeplex.com about Open XML SDK
there are several aproach
you could instantiate a excel object on your server using VSTO, and then write the document on memory and write to response the native file, but this aproach could be a litle expensive if you create a excel object per request, so you could try to do a singleton object that wraps the excel object instance
You can create a report (rdlc file) with a similar look to the grid. Then, you can have an action where you instantiate a LocalReport, pass the data you want to it and call its Render method. You then return the byte array returned by the Render method.

XMl Data into String in blackberry

Read the contents of an local XML file in an application and get the whole contents of xml file into a string for blackberry application?
To create a string from a local file see this blackberry forum entry: Open txt file from mediacard
Assuming you want to use the data within the XML, I would recommend using a XML parser rather than string manipulation. The following links should get you going with XML parsers and explain some of the trade-offs:
Blackberry How To - Use the XML Parser
Parsing XML in J2ME
Add XML parsing to your J2ME applications
If, however, you have any say about the format used JSON might be a good alternative. JSON is easy for machines to parse (thus using fewer resources) and it's human readable.
I have found using a SAXParser and subclassing DefaultHandler has worked well. Allows to go element by element.

Resources