Subject:Holding information in memory Author:Jon Gallegos Date:22 Jul 2008 04:39 PM
I have a file that has data in the middle of the file that i need at the beginning of the file I am creating. I actually need it in several places. Is there a way to load this information into memory.
Here is an example of what I am looking for;
The input file example
record1
record2
record3
record4
record5
record6
record7
record8
record9
and the output file would look like this
record9
record2
record3
record4
record5
record1
record9
record6
record7
record8
record2
Subject:Holding information in memory Author:Tony Lavinio Date:23 Jul 2008 08:51 AM
Either XSLT or XQuery will do that for you.
You'll probably have a better chance with XQuery if the files are
very large; it might be able to stream some of the components so as
not to require the entire document to be in memory at once.
Have you tried using the XQuery mapper? You can load each DTD in,
and draw lines connecting corresponding elements and to define
repeating sections.
Subject:Holding information in memory Author:Tony Lavinio Date:23 Jul 2008 04:44 PM
Your input wasn't well-formed, and didn't quite match the data in
your sample output. It makes it easier for us to get it right the
first time if your examples are clear.
Stop trying to think in conventional terms like 'in memory' and
'looping'. XSLT requires that you think backwards, almost as if
you were pushing the data through the program instead of the
program pulling the data from the file.
Subject:Holding information in memory Author:Jon Gallegos Date:24 Jul 2008 08:33 AM
I understand how frustrating it could be trying to help someone who can't give you enough information to help. But it is a security thing here and I am a consultant.
Having said all that, I figured that was the way xslt worked so I came up with my own solution while I waited for a reply. I am now almost complete with the map so i want to finish it and then, if i can get permission send it to you. Hopefully, and if you have the time, you can tell me where I went wrong and if the solution you sent me is the best way to go.
Subject:Holding information in memory Author:Tony Lavinio Date:24 Jul 2008 11:56 AM
Honestly, the best place to go for XSLT advice isn't here, but
on the XSLT community mailing list run by Mulberry Technologies.
Here we have the resources of the Stylus Studio team, but there
not only do we contribute, but the major part of the XSLT community
including others who designed the XSLT standard and who implement
other XSLT engines.
These support lists are primarily for dealing with problems specific
to Stylus Studio or the specific implementations of the standards
that we supply.
I believe you'll get more comprehensive answers asking there.