following problem: I need to save a lot of xml strings of variable length and structure. As it is with xml, a lot of substrings are the same (some elements, attribute and value combination). Often the whole document is the same, except for a few small parts.
Because I have a lot of these strings, I need to save the xml structures as size-efficient as possible.
One idea I thought about, is replacing often occuring string with variables. Let's say attribute=verylongvalueetcetc appears in a lot of xml structures, my idea would be replacing the string with place holder like #1# (that would save 26 chars), and then replace it when I need it again.
Can anybody think of better ways or methods?
//Edit: In the end, I want to save the strings in several rows in MongoDB