Program to view SMS Messages? ( XML )

Soldato
Joined
18 Oct 2002
Posts
10,475
Location
Behind you... Naked!
I need a program to help me print out a copy of my SMS Messages from my Note 8

I have saved them, and they were saved in XML Format and everything i have tried, does not seem to display the text messages in a simple way.

I basically need it to be as simple as possible without it of course looking like I have simply typed it down.

Anyone?
 
No, thanks for the link, but even though it seems to format the file, all I get is a blank page? - Notepad shows its still got formatted text in it.

What it is,is simply that I am taking a guy to small claims court, and I need to provide a time-line of the sort of things he has been lying to me about and its all in the texts, but I want to print it out.

Now, one option, is to simply grab screenshots and sure, Im kind of half way through doing that, but there is months of back and forth and so there are absolutely hundreds of texts, and while some are irrelevant, I need to provide every one.
Screenshots are simply not a viable option with the number of texts that I need to get.

I might simply have a shot at writing my own program to do it as there does not seem to be anything that will do what I want... This was the sort of thing we had to do back in the day anway, but I have not programmed anything for years and the PC isa little bit different to an Atai or Commodore isnt it LOL
 
Assuming the content in the XML fields is in plain text, some Search-Replace in a decent text editor would strip out all the XML structural stuff. Notepad++ probably do it.
 
Ok, the APP I used is Wondershare MobileGo

As for writing a program to do it, working out what to do is not going to be a problem at all. The code is in text that is very similar to basic HTML, and so I see absolutely no issue at all in wqoring through what I need to do, to write the code.

The ONLY issue I do have... Is the actual writing of the program... Its been a very long time and a few years ago, I suffered a massive brain trauma and I have lost a massive chunk of my memory and so I lost the ability to program and write music and while I was never a briloliant programmer of musician, I was very competent, but I have tried to get my mojo back, I just seem to lack the ability.

I did write a small app a while back where I was tryign to sort out my Steam apps, and as you may know, there are files that have a number, and it opens these files up and lists the actual app that that file goes with... Took me days mind you, but I did it and it works perfectly well. I just re-run it every so often to renew my list. I needed that cos I have hundreds of steam games on Linux, Mac, and Windows and I needed to organise my stuff... Its the same I suppose with doing this with the SMS. All I need to do, is look for specific bits like the date and then the body of the SMS and everythign else can be ignored.

The code?
Well, ok, this is a chunk from the start of the XML file.

<?xml version="1.0" encoding="UTF-8"?>
<SmsDataSet xmlns="http://tempuri.org/SMS.xsd">
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:mstns="http://tempuri.org/SMS.xsd" id="SmsDataSet" targetNamespace="http://tempuri.org/SMS.xsd" attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:element name="SmsDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Sms">
<xs:complexType>
<xs:sequence>
<xs:element name="Id" msdata:AutoIncrement="true" type="xs:int" />
<xs:element name="Numbers" type="xs:string" minOccurs="0" />
<xs:element name="Subject" type="xs:string" minOccurs="0" />
<xs:element name="Body" type="xs:string" minOccurs="0" />
<xs:element name="SmsType" type="xs:int" />
<xs:element name="Time" type="xs:dateTime" minOccurs="0" />
<xs:element name="MMSData" type="xs:base64Binary" minOccurs="0" />

Obviously, it is XML Code

Here is a chunk of one of the messages obviously editted :-

<Sms>
<Id>1</Id>
<Numbers>THE PHONE NUMBER ITS GOING TO</Numbers>
<Body>THIS IS THE SMS MESSAGE TEXT - EDITTED OF COUSE</Body>
<SmsType>0</SmsType>
<Time>2017-12-07T15:15:12.249+00:00</Time>
<ContactId>0</ContactId>
<ThreadId>84</ThreadId>
<Status>3</Status>
<ChatType>0</ChatType>
</Sms>

Its fairly obvious to me, if I was to write the app myself that this is what I need to look for, and using the <Numbers></Numbers> and <Body></Body> tags to find the start and end of each bit I need... The idea is simple.

Ah I dont know.

And yes, a simple text editor will allow me to do it, but its needing to strip out everythign between certain tags...

I need to keep only what is between
<Numbers> here </Numbers>
and
<Body> here </Body>

Everything else can go, but I started to do it with notepad but after days of tedious editting, I realised that I have simply got far too much code to work through.

Hence an app to do it for me.

I thik I will make a start on the app actually.... Give me somethign to do.
 
Oh, well that was ridiculously simple.

I have written the program. Its tiny and its got disgustingly amateurish code, but I did it in just a few hours, and it works exactly as I need it to!

As I only actually need it to do one job and on one file, I have of course cut massive corners by assuming a lot of things, such as the particular XML that I am needing to format is between myself and the person who I am dealing with, and so, the only information that it takes out of the original file, is the body of the text, the timeline, and the person who sent the text. Those 3 bits of info are simply written to another file, and then it repeats that until there are not more texts.

I love it when things are this simple. makes me wish for the good old days when I could program. my code in this is effective sure, but is bloody rotten and embarassing to be honest.

But hey, it does what I want it to do, and so thats still a success.

Thanks all.
 
Too late, but you could have looked up xslt which does exactly what you want it to do:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
  <h2>Phone messages</h2>
  <table border="1">
    <tr bgcolor="#9acd32">
      <th style="text-align:left">Time</th>
      <th style="text-align:left">Number</th>
      <th style="text-align:left">Text</th>
    </tr>
    <xsl:for-each select="Sms">
    <tr>
      <td><xsl:value-of select="Time"/></td>
      <td><xsl:value-of select="Numbers"/></td>
      <td><xsl:value-of select="Body"/></td>
    </tr>
    </xsl:for-each>
  </table>
</body>

Try it out here. Paste the XML in the left pane, the code above in the right pane and click the button.
https://www.w3schools.com/xml/tryxslt.asp?xmlfile=cdcatalog&xsltfile=cdcatalog
 
Maybe... This is what I get :-

| Error in XSLT
|
| XML Parsing Error: no element found Location: https://www.w3schools.com/xml/tryxslt_result.asp Line Number 21, Column 8:

Its cool that it should have output the messages in a table, thats great, but that is also something that will be simple for me to add into my own program anyway, and indeed, it is something that I did consider... I did nothing about it, other than consider for two minutes, but I might have another plop at it... Might. The only reason is that it would be quick and easy to see who send what text when looking quickly through them, and the possibility of justifying left and right.

Ah, I will do it anyway.

Many thanks.
 
Depends on what your xml really looks like, but with this xml in the first box:
Code:
<messages>
<Sms>
<Id>1</Id>
<Numbers>THE PHONE NUMBER ITS GOING TO</Numbers>
<Body>THIS IS THE SMS MESSAGE TEXT - EDITTED OF COUSE</Body>
<SmsType>0</SmsType>
<Time>2017-12-07T15:15:12.249+00:00</Time>
<ContactId>0</ContactId>
<ThreadId>84</ThreadId>
<Status>3</Status>
<ChatType>0</ChatType>
</Sms>
<Sms>
<Id>2</Id>
<Numbers>002224558</Numbers>
<Body>message2</Body>
<SmsType>0</SmsType>
<Time>2017-12-09T21:15:12.249+00:00</Time>
<ContactId>0</ContactId>
<ThreadId>84</ThreadId>
<Status>3</Status>
<ChatType>0</ChatType>
</Sms>
</messages>
and this xslt in the second box:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/messages">
<html>
<body>
  <h2>Phone messages</h2>
  <table border="1">
    <tr bgcolor="#9acd32">
      <th style="text-align:left">Time</th>
      <th style="text-align:left">Number</th>
      <th style="text-align:left">Text</th>
    </tr>
    <xsl:for-each select="Sms">
    <tr>
      <td><xsl:value-of select="Time"/></td>
      <td><xsl:value-of select="Numbers"/></td>
      <td><xsl:value-of select="Body"/></td>
    </tr>
    </xsl:for-each>
  </table>
</body>
it produces a table (which I can't add here as I can't post an image at the moment but you get the idea):
Code:
Phone messages
Time Number Text
2017-12-07T15:15:12.249+00:00 THE PHONE NUMBER ITS GOING TO THIS IS THE SMS MESSAGE TEXT - EDITTED OF COUSE
2017-12-09T21:15:12.249+00:00 002224558 message2

Anyway, it's one of those silly things where if you are doing it one off and you have something that works, then you are good to go! :)
 
Back
Top Bottom