E
Ed Beroset
I have an XML file that I want to squeeze down as small as possible for
storage in an embedded device. I want it to still be a valid XML file
(and not something like a binary ASN.1 encoding of an XML file) but it
does not need to carry the long tags it currently has as long as I
create an XSLT which will put it back into the right form. What I had
in mind was something like this:
<original-xml-fragment>
<very-long-and-verbose-tag name="Long tag 1">
<more-information-is-stored-here name="stuff 1"/>
</very-long-and-verbose-tag>
<very-long-and-verbose-tag name="Long tag 2">
<more-information-is-stored-here name="stuff 2"/>
<valuable-additional-information name="foo"/>
</very-long-and-verbose-tag>
</original-xml-fragment>
I'm thinking of transforming it to this:
<o><v n="Long tag 1"><m n="stuff 1"/></v><v n="Long tag 2"><m n="stuff
2"/><v2 n="foo"/></v></o>
My question is, has someone already generated an XSLT that would
abbreviate tags in this kind of way AND generate the corresponding
"decoder" XSLT which would reconstitute the original. I have ideas
about how to do it using a procedural language, but I would like to do
it entirely with XSL transforms if I can.
The only part that I don't really know how to do is to automatically
generate short, unique abbreviations for each of the tags. I *could*
specify them all manually once, but I'd prefer an automatic solution to
simplify maintenance.
Ed
storage in an embedded device. I want it to still be a valid XML file
(and not something like a binary ASN.1 encoding of an XML file) but it
does not need to carry the long tags it currently has as long as I
create an XSLT which will put it back into the right form. What I had
in mind was something like this:
<original-xml-fragment>
<very-long-and-verbose-tag name="Long tag 1">
<more-information-is-stored-here name="stuff 1"/>
</very-long-and-verbose-tag>
<very-long-and-verbose-tag name="Long tag 2">
<more-information-is-stored-here name="stuff 2"/>
<valuable-additional-information name="foo"/>
</very-long-and-verbose-tag>
</original-xml-fragment>
I'm thinking of transforming it to this:
<o><v n="Long tag 1"><m n="stuff 1"/></v><v n="Long tag 2"><m n="stuff
2"/><v2 n="foo"/></v></o>
My question is, has someone already generated an XSLT that would
abbreviate tags in this kind of way AND generate the corresponding
"decoder" XSLT which would reconstitute the original. I have ideas
about how to do it using a procedural language, but I would like to do
it entirely with XSL transforms if I can.
The only part that I don't really know how to do is to automatically
generate short, unique abbreviations for each of the tags. I *could*
specify them all manually once, but I'd prefer an automatic solution to
simplify maintenance.
Ed