ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Separate layout and content XML files?
@ 2010-11-12  4:30 Peter Davis
  2010-11-12  4:34 ` Aditya Mahajan
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Davis @ 2010-11-12  4:30 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 473 bytes --]

I want to process documents from two separate XML files.  One XML file
defines the layout of the page ... placement of text boxes, fonts to use ...
even placeholder text.  The other XML contains the actual content that gets
placed into that layout.

Is this possible?  Anyone have any examples of something like this?

I'm a LaTeX user who's new to ConTeXt.  I figured I can learn more quickly
by starting with a "recipe" and modifying it to fit my needs.

Thank you!

-pd

[-- Attachment #1.2: Type: text/html, Size: 607 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Separate layout and content XML files?
  2010-11-12  4:30 Separate layout and content XML files? Peter Davis
@ 2010-11-12  4:34 ` Aditya Mahajan
  2010-11-12 12:51   ` Peter Davis
  0 siblings, 1 reply; 7+ messages in thread
From: Aditya Mahajan @ 2010-11-12  4:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, 11 Nov 2010, Peter Davis wrote:

> I want to process documents from two separate XML files.  One XML file
> defines the layout of the page ... placement of text boxes, fonts to use ...
> even placeholder text.  The other XML contains the actual content that gets
> placed into that layout.

You can generate the \setup commands (i.e. the preable) from the first XML 
file, and the main body of the document from the second XML file.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Separate layout and content XML files?
  2010-11-12  4:34 ` Aditya Mahajan
@ 2010-11-12 12:51   ` Peter Davis
  2010-11-12 12:55     ` Martin Schröder
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Davis @ 2010-11-12 12:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1275 bytes --]

On Thu, Nov 11, 2010 at 11:34 PM, Aditya Mahajan <adityam@umich.edu> wrote:

> On Thu, 11 Nov 2010, Peter Davis wrote:
>
>  I want to process documents from two separate XML files.  One XML file
>> defines the layout of the page ... placement of text boxes, fonts to use
>> ...
>> even placeholder text.  The other XML contains the actual content that
>> gets
>> placed into that layout.
>>
>
> You can generate the \setup commands (i.e. the preable) from the first XML
> file, and the main body of the document from the second XML file.
>


 Thanks!

The layout XML would actually define a kind of boilerplate page, and then
various contents from the other XML would be inserted.  The final document
might have a thousand pages, all based on the same boilerplate, but with
different contents inserted.  So I'd need a mechanism for storing the
boilerplate so that for each element in the content XML, I could generate a
new page using the boilerplate plus the text from that element.

Is that clear?  It's kind of like mail merge in a word processor.  You might
get a few hundred or thousand copies of a letter, each for a different
recipient.  So in essence, one XML contains the letter, and the other
contains the list of recipients, their addresses, etc.

Thank you.

-pd

[-- Attachment #1.2: Type: text/html, Size: 1811 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Separate layout and content XML files?
  2010-11-12 12:51   ` Peter Davis
@ 2010-11-12 12:55     ` Martin Schröder
  2010-11-12 13:17       ` Peter Davis
  0 siblings, 1 reply; 7+ messages in thread
From: Martin Schröder @ 2010-11-12 12:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users

2010/11/12 Peter Davis <pfd@pfdstudio.com>:
> Is that clear?

It's called database publishing. :-)

Best
   Martin
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Separate layout and content XML files?
  2010-11-12 12:55     ` Martin Schröder
@ 2010-11-12 13:17       ` Peter Davis
  2010-11-12 13:39         ` Hans van der Meer
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Davis @ 2010-11-12 13:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 609 bytes --]

On Fri, Nov 12, 2010 at 7:55 AM, Martin Schröder <martin@oneiros.de> wrote:

> 2010/11/12 Peter Davis <pfd@pfdstudio.com>:
> > Is that clear?
>
> It's called database publishing. :-)
>

Exactly.  (Or sometimes variable data printing ... VDP.)

I guess the "layout" XML file would basically be used to construct a macro
that draws the page, and the "content" XML would basically invoke that macro
with different arguments for each recipient.

Does that seem like the most effective way to do this?  Any examples of
anything like this, or of using an XML to define a macro?

Thank you.

-pd

[-- Attachment #1.2: Type: text/html, Size: 1034 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Separate layout and content XML files?
  2010-11-12 13:17       ` Peter Davis
@ 2010-11-12 13:39         ` Hans van der Meer
  2010-11-12 13:47           ` Peter Davis
  0 siblings, 1 reply; 7+ messages in thread
From: Hans van der Meer @ 2010-11-12 13:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1917 bytes --]


On 12 nov 2010, at 14:17, Peter Davis wrote:

> 
> On Fri, Nov 12, 2010 at 7:55 AM, Martin Schröder <martin@oneiros.de> wrote:
> 2010/11/12 Peter Davis <pfd@pfdstudio.com>:
> > Is that clear?
> 
> It's called database publishing. :-)
> 
> Exactly.  (Or sometimes variable data printing ... VDP.)
> 
> I guess the "layout" XML file would basically be used to construct a macro that draws the page, and the "content" XML would basically invoke that macro with different arguments for each recipient.
> 
> Does that seem like the most effective way to do this?  Any examples of anything like this, or of using an XML to define a macro?
> 
> Thank you.
> 

On tlcontrib.metatex.or I placed a series of ConTeXt modules under title "hvdm".
Perhaps these are useful as a working example of how to separate various elements of xml-typesetting.
Hope this helps.

Hans van der Meer


One xml-definition file (hvdm-xml.tex) in the package is used for general constructs, another (hvdm-dvd.tex) for typesetting "database"-entries in xml. As an example of data input:

<!-- TEMPLATE FOR DVD-COVER DATA
     $Revision:: 43         $
     $Date:: 2010-10-29 19:#$
-->
<?xml version="1.0" encoding="UTF-8"?>
<dvd filenumber="_FILENUMBER_" genre="_GENRE_">
	<setup name="pdfcase" chaptername="off" left="" right=""/>
	<titles>
		<title>_TITLE_</title>
	</titles>
	<frontfigure commonsize="" maxwidth="" maxheight="" frame="">
		<img src="" width="" height="" frame="" option=""/>
	</frontfigure>
	<recording>
		<recorded>_DATE_</recorded>
		<burned>_DATE_</burned>
	</recording>
etc.

simply called by a minimal header:
\usemodule[hvdm-dvd]	% xml conversions
\DataLocation{/Volumes/Qrecordings/DVD/D026-D050/D050 Aux temps des croisades}
\starttext
\setupCase[DVD][state=draft]
\xmlprocessfile{dvd}{\DATALOCATION data.xml}{}	% start at the dvd root node
\stoptext
\endinput



[-- Attachment #1.2: Type: text/html, Size: 3845 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Separate layout and content XML files?
  2010-11-12 13:39         ` Hans van der Meer
@ 2010-11-12 13:47           ` Peter Davis
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Davis @ 2010-11-12 13:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 400 bytes --]

On Fri, Nov 12, 2010 at 8:39 AM, Hans van der Meer <H.vanderMeer@uva.nl>wrote:

>
> On tlcontrib.metatex.or I placed a series of ConTeXt modules under title
> "hvdm".
> Perhaps these are useful as a working example of how to separate various
> elements of xml-typesetting.
> Hope this helps.
>
> Hans van der Meer
>


Thank you, Hans.  I have downloaded this, and will take a closer look.

Best,
-pd

[-- Attachment #1.2: Type: text/html, Size: 865 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-11-12 13:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-12  4:30 Separate layout and content XML files? Peter Davis
2010-11-12  4:34 ` Aditya Mahajan
2010-11-12 12:51   ` Peter Davis
2010-11-12 12:55     ` Martin Schröder
2010-11-12 13:17       ` Peter Davis
2010-11-12 13:39         ` Hans van der Meer
2010-11-12 13:47           ` Peter Davis

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).