* Processing XML file inside a zip file
@ 2019-01-11 3:42 Aditya Mahajan
2019-01-11 3:57 ` Henri Menke
0 siblings, 1 reply; 3+ messages in thread
From: Aditya Mahajan @ 2019-01-11 3:42 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hi,
Is it possible to process an XML file inside a zip file without unzipping?
In particular, I have a program that generates zip files which look like
this:
The file `filename.zip` contains:
- filename.xml
- file_hash1.png
- file_hash2.png
etc.
Where `filename.xml` (the name matches the basename of the zip file) is
the main xml file and the `file_hash1.png` etc are png files that are
referred to inside the xml file.
If I unzip the file and add
\setupexternalfigures[directory={path-to-unzipped-folder]
then, I have an \startxmlsetups .. \stopxmlsetups environment that
correctly typesets the xml file. I believe that I have seen Hans post
snippets of code that suggest that context can directly read from a zip
file. So, I am wondering if there is a way that I can just call
context --magic-flags filename.zip
and obtain the correct output.
Thanks,
Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Processing XML file inside a zip file
2019-01-11 3:42 Processing XML file inside a zip file Aditya Mahajan
@ 2019-01-11 3:57 ` Henri Menke
2019-01-11 4:35 ` Aditya Mahajan
0 siblings, 1 reply; 3+ messages in thread
From: Henri Menke @ 2019-01-11 3:57 UTC (permalink / raw)
To: ntg-context
On 11/01/19 4:42 PM, Aditya Mahajan wrote:
> Hi,
>
> Is it possible to process an XML file inside a zip file without unzipping?
>
> In particular, I have a program that generates zip files which look like
> this:
>
> The file `filename.zip` contains:
> - filename.xml - file_hash1.png
> - file_hash2.png
> etc.
>
> Where `filename.xml` (the name matches the basename of the zip file) is
> the main xml file and the `file_hash1.png` etc are png files that are
> referred to inside the xml file.
>
> If I unzip the file and add
>
> \setupexternalfigures[directory={path-to-unzipped-folder]
>
> then, I have an \startxmlsetups .. \stopxmlsetups environment that
> correctly typesets the xml file. I believe that I have seen Hans post
> snippets of code that suggest that context can directly read from a zip
> file. So, I am wondering if there is a way that I can just call
>
> context --magic-flags filename.zip
You can directly typeset ePub files which is just zipped XML. There is
a script in mtxrun for it:
context --ctx=x-epub.ctx yourfile.epub
Documented in: http://www.pragma-ade.nl/general/manuals/hybrid.pdf
>
> and obtain the correct output.
>
> Thanks,
> Aditya
> ___________________________________________________________________________________
>
> If your question is of interest to others as well, please add an entry
> to the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage : http://www.pragma-ade.nl / http://context.aanhet.net
> archive : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___________________________________________________________________________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Processing XML file inside a zip file
2019-01-11 3:57 ` Henri Menke
@ 2019-01-11 4:35 ` Aditya Mahajan
0 siblings, 0 replies; 3+ messages in thread
From: Aditya Mahajan @ 2019-01-11 4:35 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Fri, 11 Jan 2019, Henri Menke wrote:
> On 11/01/19 4:42 PM, Aditya Mahajan wrote:
>> Hi,
>>
>> Is it possible to process an XML file inside a zip file without unzipping?
>>
>> In particular, I have a program that generates zip files which look like
>> this:
>>
>> The file `filename.zip` contains:
>> - filename.xml - file_hash1.png
>> - file_hash2.png
>> etc.
>>
>> Where `filename.xml` (the name matches the basename of the zip file) is
>> the main xml file and the `file_hash1.png` etc are png files that are
>> referred to inside the xml file.
>>
>> If I unzip the file and add
>>
>> \setupexternalfigures[directory={path-to-unzipped-folder]
>>
>> then, I have an \startxmlsetups .. \stopxmlsetups environment that
>> correctly typesets the xml file. I believe that I have seen Hans post
>> snippets of code that suggest that context can directly read from a zip
>> file. So, I am wondering if there is a way that I can just call
>>
>> context --magic-flags filename.zip
>
> You can directly typeset ePub files which is just zipped XML. There is
> a script in mtxrun for it:
>
> context --ctx=x-epub.ctx yourfile.epub
>
> Documented in: http://www.pragma-ade.nl/general/manuals/hybrid.pdf
Thanks. But I could not find `x-epub.ctx` file in the standalone
distribution.
Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-01-11 4:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-11 3:42 Processing XML file inside a zip file Aditya Mahajan
2019-01-11 3:57 ` Henri Menke
2019-01-11 4:35 ` Aditya Mahajan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).