[NTG-context] Re: mag-0008

2004-12-16 Thread Bruce D'Arcus
On Dec 15, 2004, at 12:16 PM, Hans Hagen wrote:
that was from the time that i played with schema's, nowadays i prefer 
relax ng
Indeed!
It may be worth noting that the next generation versions of both 
DocBook and TEI:

	-	are developed in RELAX NG
	-	are namespaced
	-	are designed for customizability, including mixing-and-matching 
definitions across the schemas

Bruce
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Re: mag-0008

2004-12-15 Thread Hans Hagen
Adam Lindsay wrote:
h h extern said this at Fri, 10 Dec 2004 22:38:27 +0100:

Also, what's the status of contml? I like the idea of it as a simple,
structural, basic markup that ConTeXt handles with zero effort, but is
anyone actually using it?
we sometimes mix it into other xml docs; i have no problem with
extending it; 

actualy, (see mag-0008.pdf), i want to map most context directly onto xml so 
that we have a rather complete xml input syntax

Yes, indeed. I took a look at the magazine again last night, and it was
put in an entirely new light. I'm very curious to work with x-fx now...
see below
I've been working on a general-ish conversion script from a new Mac
application. I'd like to offer most of ContML as basic level constructs,
but it should be possible for a user to add their own tags. If they can
tap into fx:anything tags, it should make people (hi, Bruce!) fairly happy.
My first reaction/critique of the approach was: why not fix at least one
of the problems of TeX: that it's a mixture between typesetting and
programming features as you say? 
indeed, but, it al depends on the 'to be written' manuals then:
- code in xml and then
- use xslt to generate an (structured) instance that
- calls templates that implement typographical solutions
- using the xml interface to context
in practice it means trading in some context funtionality by xslt functionality
the interesting thing is that the whole machinery is still there
What I propose is clearly a debatable XML-design issue, but it seemed
strange that fx:definelayout and fx:p were put into the same namespace.
Why do the formatting definitions share the same (theoretical) schema as
markup? Your documents keep these categories separate, as one would
expect. Why not encourage people to put them in separate files, as with
normal ConTeXt workflows? The designer and author are more clearly
divorced when you don't assume an XSLT-centric flow, right?
(or, is this already planned with this tidbit from foxet: fs = setup)
sure, definitions should become 'styles' but that's hard to demo in a 
magazine -)
in principle it could also mean that one could predefine page masters and have 
multiple variants instead of the five-area-fo-thing

I'm curious about how the namespacing would work, though, because I want
to use (and enable the use of) these nice fs:setuphead -like
configurations with my hybrid ContML++ documents. Will:
context\high{fx}
 fs:setuphead label='section' /
correctly (in my mind) affect a ContML element like this?
 context:sectionsomething/context:section
indeed, or
context:head label='section'something/context:head
a matter of taste; i'm open to any suggestion (more a discussion for the foxet 
list)

Curious,
well, here 's an experimental/ version of x-fx. It demonstrates that it's 
relaively easy to map the context interface to xml; actually, if things get 
dirty i can provide a more low level context support which then makes the 
mapping clean -)

%D \module
%D   [  file=x-fx,
%Dversion=2004.11.12,
%D  title=\FOXET,
%D   subtitle=Style Processor,
%D author=Hans Hagen,
%D   date=\currentdate,
%D  copyright={PRAGMA ADE / Hans Hagen \ Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
\chardef\XMLtokensreduction = 2
\chardef\XMLcdatamethod = 2
\usemodule[mathml]
\setupcolors[state=start]
% these will be speed up by few step expansion
\def\foxarguments {\theXMLarguments{fox}}
\def\initializefox{\expanded{\getrawparameters[fox][\theXMLarguments{fox}]}}
\def\foxaction  #1{\expanded{#1[\theXMLarguments{fox}]}}
% layers
\defineXMLcommand
  [fx:definelayer] [fox] [label=default]
  {\initializefox
   \expanded{\definelayer[\foxlabel]}%
   \expanded{\setuplayer[\foxlabel][\foxarguments]}}
\defineXMLcommand
  [fx:setuplayer] [fox] [label=default]
  {\initializefox
   \expanded{\setuplayer[\foxlabel][\foxarguments]}}
\defineXMLenvironment
  [fx:setlayer] [fox] [label=default]
  {\initializefox
   \expanded{\setlayer[\foxlabel][\foxarguments]}\bgroup\ignorespaces}
  {\removeunwantedspaces\egroup}
\defineXMLcommand
  [fx:flushlayer] [fox] [label=default]
  {\initializefox
   \tightlayer[\foxlabel]}
% framed
\defineXMLenvironment
  [fx:framed] [fox] []
  {\initializefox
   \expanded{\framed[\foxarguments]}\bgroup\ignorespaces}
  {\removeunwantedspaces\egroup}
% layout
\defineXMLcommand
  [fx:definelayout] [fox] [label=default]
  {\initializefox
   \expanded{\definelayout[\foxlabel][\foxarguments]}}
\defineXMLcommand
  [fx:setuplayout] [fox] [label=default]
  {\initializefox
   \expanded{\setuplayout[\foxlabel][\foxarguments]}
   }% \expanded{\setuplayout[\foxlabel]}} % todo: only when no further arguments
\defineXMLcommand
  [fx:enablelayout] [fox] [label=default]
  {\initializefox
   \expanded{\setuplayout[\foxlabel]}}
% heads / we need a stupid, not list/ref variant
\defineXMLcommand
  [fx:definehead] [fox] 

[NTG-context] Re: mag-0008

2004-12-15 Thread Hans Hagen
Bruce D'Arcus wrote:
BTW, Hans, I've yet to see the ContML schema.  Care to post it somewhere?
that was from the time that i played with schema's, nowadays i prefer relax 
ng
the funny ?context-block ? things can be used by some modules (in the 
distribution) to filter definitions for documentation purposes;

?xml version=1.0?
xsd:schema xmlns:xsd=http://www.w3.org/2001/XMLSchema;
xsd:annotation
  xsd:documentation xml:lang=en
This schema describes a class of presentations. The structure is
(normally) reflected in the design.
author: Hans Hagen, copyright: PRAGMA-ADE / Hasselt NL
  /xsd:documentation
/xsd:annotation
?context-block begin definitions ?
  xsd:complexType name=filename.value
xsd:restriction base=xsd:string
  xsd:pattern value='[a-zA-Z0-9\-\:\.]*' /
/xsd:restriction
  /xsd:complexType
  xsd:complexType name=filetype.value
xsd:restriction base=xsd:string
  xsd:enumeration value=tex /
  xsd:enumeration value=xml /
  xsd:enumeration value=txt /
/xsd:restriction
  /xsd:complexType
  xsd:complexType name=confirmation.value
xsd:restriction base=xsd:string
  xsd:enumeration value=yes /
  xsd:enumeration value=no /
/xsd:restriction
  /xsd:complexType
  xsd:complexType name=conversion.value
xsd:restriction base=xsd:string
  xsd:pattern value='(a|A|n|g|G|r|R|1|2|3|4)' /
/xsd:restriction
  /xsd:complexType
  xsd:complexType name=reference.label.value
xsd:restriction base=xsd:string
  xsd:pattern value='([a-zA-Z0-9\-\:]*' /
/xsd:restriction
  /xsd:complexType
?context-block end definitions ?
?context-block begin text ?
  xsd:element name=presentation mixed=true /
?context-block end text ?
?context-block begin p ?
  xsd:element name=p mixed=true /
?context-block end p ?
?context-block begin hide ?
  xsd:element name=hide mixed=true /
?context-block end hide ?
?context-block begin em ?
  xsd:element name=em mixed=true /
?context-block end em ?
?context-block begin b ?
  xsd:element name=b mixed=true /
?context-block end b ?
?context-block begin quote ?
  xsd:element name=quote mixed=true /
  xsd:element name=quotation mixed=true /
?context-block end quote ?
?context-block begin include ?
  xsd:attributeGroup name=include.attributes
xsd:attribute name=file type=filename.value use=required /
xsd:attribute name=type type=filetype.value /
  /xsd:attributeGroup
  xsd:complexType type=include.type
xsd:attributeGroup ref=include.attributes /
  /xsd:complexType
  xsd:element name=include type=include.type /
?context-block end include ?
?context-block begin compound ?
  xsd:attributeGroup name=compound.attributes
xsd:attribute name=token type=xsd:string /
  /xsd:attributeGroup
  xsd:complexType type=compound.type
xsd:attributeGroup ref=compound.attributes /
  /xsd:complexType
  xsd:element name=compound type=compound.type /
?context-block end compound ?
?context-block begin references ?
  xsd:attributeGroup name=reference.attributes
xsd:attribute name=label type=reference.label.value /
  /xsd:attributeGroup
  xsd:complexType type=reference.type
xsd:attributeGroup ref=reference.attributes /
  /xsd:complexType
  xsd:element name=lineref type=reference.type /
  xsd:element name=pageref type=reference.type /
  xsd:element name=textref type=reference.type /
?context-block end references ?
?context-block begin unknown ?
  xsd:element name=unknown/
?context-block end unknown ?
?context-block begin verbatim ? !-- string or anyType --
  xsd:complexType name=verbatim.verbatim
xsd:sequence maxOccurs=unbounded 
  xsd:element name=line type=xsd:string /
/xsd:sequence
  /xsd:complexType
  xsd:element name=verbatim type=verbatim.verbatim /
  xsd:element name=typing   type=verbatim.verbatim /
  xsd:element name=verb type=xsd:string /
  xsd:element name=type type=xsd:string /
?context-block end verbatim ?
?context-block begin itemize ?
  xsd:attributeGroup name=itemize.attributes
xsd:attribute name=type   type=conversion.value /
xsd:attribute name=packed type=confirmation.value /
xsd:attribute name=label  type=reference.label.value /
  /xsd:attributeGroup
  xsd:attributeGroup name=item.attributes
xsd:attribute name=label type=reference.label.value /
  /xsd:attributeGroup
  xsd:complexType name=item.type mixed=true
xsd:attributeGroup ref=item.attributes /
  /xsd:complexType
  xsd:complexType name=itemize.type
xsd:sequence minOccurs=1 maxOccurs=unbounded
  xml:element name=item type=item.type /
/xsd:sequence
xsd:attributeGroup ref=itemize.attributes /
  /xsd:complexType
  xsd:element name=itemize type=itemize.type /
?context-block end itemize ?
?context-block begin fixed ?
  xsd:complexType name=fixed.type.value
xsd:restriction base=xsd:string
  xsd:enumeration value=figure /
  xsd:enumeration value=table /
/xsd:restriction
  /xsd:complexType
  xsd:complexType name=fixed.location.value
xsd:restriction base=xsd:string
  xsd:enumeration value=high /
  

[NTG-context] Re: mag-0008 (was: XML formulas)

2004-12-13 Thread Bruce D'Arcus
On Dec 13, 2004, at 1:02 PM, Adam Lindsay wrote:
What I propose is clearly a debatable XML-design issue, but it seemed
strange that fx:definelayout and fx:p were put into the same namespace.
Why do the formatting definitions share the same (theoretical) schema 
as
markup? Your documents keep these categories separate, as one would
expect. Why not encourage people to put them in separate files, as with
normal ConTeXt workflows? The designer and author are more clearly
divorced when you don't assume an XSLT-centric flow, right?
FWIW, I'm currently working on a comprehensive XSLT-based solution for 
bibliographic formatting (think bibtex for xml, only better).  In that, 
I'm working across multiple namespaces:

1)  document (docbook ng)
2)  bibliographic data (mods)
3)  a citation formatting language (homegrown; again, in its own 
namespace)
4)  output (xhtml, for example)

I agree with the notion that, in principle, semantic document markup 
should be in a separate namespace from the formatting language.

BTW, Hans, I've yet to see the ContML schema.  Care to post it 
somewhere?

Also, FYI, I and an engineer at Sun have some up with a small citation 
schema designed for embedding in other XML dialects.  It has been 
approved for OpenOffice.

http://www.users.muohio.edu/darcusb/files/citation-schema.tar.gz
It's more for GUI apps (it's rather verbose), but could still be useful 
in other contexts.

Bruce
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context