Hussein,
I found these two files on http://www.dlc-tei.net/ which seem to
indicate I can point to my schema file in the configuration file. And
also set up a custom css file for display of elements int editor?
attached
Is this the preferred way to handle a TEI document in XXE?
Scott
-------- Original Message --------
Subject: Re: [XXE] TEI
From: Hussein Shafie <[email protected]>
To: Scott Derrick <[email protected]>
Date: 12/11/2013 10:35 AM
On 12/11/2013 05:23 PM, Scott Derrick wrote:
I think I understand now.
At the top of all our documents is:
<?xml version="1.0" encoding="us-ascii"?>
<?xml-model href="../schemas/mbel.rnc"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0" xml:lang="en">
Associating the mbel.rnc schema with this file for validation. We
normally use the Oxygen editor which then uses this schema file to
provide validation as we type and context completion of tags. A feature
that is a must have for us.
Do I understand the XXE does not use the specified schema in an xml file
to provide validation tag hints, etc.. The user has to create an
additional configuration file that mirrors the schema file to enable
validation and contextual help?
Is that correct?
Not really. XMLmind XML Editor of course supports a schema specified at
the top of the XML file.
Something like:
<?xml-model href="../schemas/mbel.rnc"?>
is supported by XMLmind XML Editor. However, we consider that adding
<?xml-model href="../schemas/mbel.rnc"?>
at the top of all our documents is OK when prototyping, but not the best
approach for production use.
If so is there an xsl script that would read a schema file and generate
the appropriate configuration file?
Sorry but the answer is no.
A wizard would be better suited than an XSL script. We have considered
writing such wizard but we gave up the idea, because our customers not
writing DITA, DocBook or XHTML documents, seem to have no problem
creating a basic configuration file by hand.
Not familiar with the configuration
file maybe that is not possible with the information contained in the
schema file?
Writing a basic --three liner-- configuration file takes about 5
minutes. The problem is that, before being able to do it, you are forced
to read some very annoying documentation (written by me!):
http://www.xmlmind.com/xmleditor/_distrib/doc/configure/config_file.html
--
Talk sense to a fool and he calls you foolish.
Euripides
<?xml version="1.0" encoding="ISO-8859-1"?>
<configuration name="DLC-TEI"
xmlns="http://www.xmlmind.com/xmleditor/schema/configuration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:cfg="http://www.xmlmind.com/xmleditor/schema/configuration">
<detect>
<rootElementNamespace>http://www.tei-c.org/ns/1.0</rootElementNamespace>
</detect>
<relaxng compactSyntax="false" encoding="UTF-8" location="http://dlc-tei.net/p5/DLC-TEI.rng"/>
<css location="http://dlc-tei.net/p5/DLC-TEI.css" name="DLC Stylesheet"/>
<css location="http://dlc-tei.net/p5/DLC-TEI_lb.css" name="DLC Stylesheet (optimized for readability)" alternate="true"/>
<template location="http://dlc-tei.net/p5/Template.xml" name="DLC Template"/>
</configuration>
/* +++++++++++++++++++++++++++++++++++++++++++ */
/* root element */
/* +++++++++++++++++++++++++++++++++++++++++++ */
TEI {
display : block;
line-height : 1.2;
color : black;
padding-right : 2em;
/* background-color : rgb(230, 230, 230); */
}
/* +++++++++++++++++++++++++++++++++++++++++++ */
/* header elements */
/* +++++++++++++++++++++++++++++++++++++++++++ */
teiHeader,
text,
facsimile {
display : block;
padding-left : 1em;
color : black;
}
teiHeader:before,
text:before,
facsimile:before {
background-color : rgb(200, 240, 130);
content : element-label();
font-size: 110%;
width : 100%;
font-weight: bold;
padding : 0.5em;
border-radius : 10px 10px;
border : thin solid gray;
display : block;
}
teiHeader * {
display : block;
font-family : serif;
text-decoration : none;
margin-left : 2em;
collapsible : yes;
}
teiHeader *:before {
content : element-label() " " attr(type) attr(subtype) attr(xml|id) attr(ident) attr(gi) attr(n) attr(ref) attr(xml|lang) " < ";
font-weight : bold;
/* color : rgb(160, 100, 100);*/
color: gray;
font-size : smaller;
font-weight: bold;
font-family : sans-serif;
display : block; /* not good for ALL elements, check!*/
marker-offset : fill;
}
teiHeader *:after {
content : " > ";
font-weight : bold;
color : gray;
display : inline;
text-decoration : none;
collapsible : yes;
}
/* +++++++++++++++++++++++++++++++++++++++++++ */
/* text elements */
/* +++++++++++++++++++++++++++++++++++++++++++ */
text * {
display : block;
font-family : serif;
text-decoration : none;
collapsible : yes;
margin-left : 2em;
}
text *:before {
content : element-label() " " attr(type) attr(xml|id) attr(ident) attr(gi) attr(n) attr(ref) attr(xml|lang) " < ";
font-weight : bold;
color : gray;
font-size : smaller;
font-family : sans-serif;
display : block; /* not good for ALL elements, check!*/
marker-offset : fill;
}
text *:after {
content : " > ";
font-weight : bold;
color : gray;
display : inline;
text-decoration : none;
collapsible : yes;
}
form:before,
orth:before,
def:before {
content : " " element-label() " ";
display : inline;
}
figure:before {
content : collapser() " " element-label() " " attr(rend) " " attr(xml|id) " ";
font-weight : bold;
display : block;
}
/*seg:before {
content : element-label() " " insert-button() " " insert-after-button() " " text-field(attribute, part, columns, 4);
font-weight : bold;
display : block;
}
*/
ref:before,
ptr:before {
content : " " element-label() " " text-field(attribute, target, columns, 12) " ";
text-decoration : none;
font-weight : bold;
display : inline;
}
form,
rdg,
def {
display : inline;
}
expan,
g {
display : inline;
text-decoration : overline;
}
att:before,
eg:before,
val:before,
emph:before,
gi:before,
tag:before,
stringVal:before,
expan:before {
content : " " element-label() " < ";
text-decoration : none;
font-weight : bold;
display : inline;
}
g:before {
content : " " element-label() " ref: " text-field(attribute, ref, columns, 3) " *";
text-decoration : none;
font-weight : bold;
display : inline;
}
hi:before {
content : " " element-label() " rendition: " text-field(attribute, rendition, columns, 3) " *";
text-decoration : none;
font-weight : bold;
display : inline;
}
hi:after {
content : "* ";
text-decoration : none;
display : inline;
}
choice:before {
content : " " element-label() " {";
font-weight : bold;
display : inline;
}
choice:after {
content : "} ";
font-weight : bold;
display : inline;
}
rdg:before {
content : " " element-label() " " attr(wit) " «";
font-weight : bold;
display : inline;
}
q:before,
quote:before {
content : element-label() " «";
font-weight : bold;
display : inline;
text-decoration : none;
}
q:after,
quote:after,
rdg:after {
content : "» ";
font-weight : bold;
display : inline;
}
/* +++++++++++++++++++++++++++++++++++++++++++ */
/* general overrides */
/* +++++++++++++++++++++++++++++++++++++++++++ */
date:before {
content : element-label() " " attr(when) " < ";
font-weight : bold;
color : gray;
font-size : smaller;
font-family : sans-serif;
display : block; /* not good for ALL elements, check!*/
marker-offset : fill;
}
text * {
font-family : serif;
text-decoration : none;
}
text *:before {
content : element-label() " " attr(type) attr(when) attr(ident) attr(gi) attr(rendition) attr(n) attr(ref) attr(xml|lang) attr(reason) " < ";
font-weight : bold;
color : gray;
font-size : smaller;
font-family : sans-serif;
display : block; /* not good for ALL elements, check!*/
marker-offset : fill;
}
text *:after {
content : " > ";
color : gray;
font-weight : bold;
display : inline;
text-decoration : none;
}
/* +++++++++++++++++++++++++++++++++++++++++++ */
/* table, row, cell */
/* +++++++++++++++++++++++++++++++++++++++++++ */
table {
display : table;
margin-left : 2em;
padding : 0.5em;
border : thin dashed gray;
border-radius : 10px 10px;
background-color: rgb(240,240,240);
}
table:before,
row:before {
content : element-label() " ";
font-weight : bold;
display : table;
}
table:after{
background-color : white;
}
cell:before {
content : element-label() " ";
font-weight : bold;
display : inline;
}
row {
display : table-row;
background-color: rgb(240,240,240);
}
cell {
display : table-cell;
margin : 0;
white-space : nowrap;
}
/* +++++++++++++++++++++++++++++++++++++++++++ */
/* note and app elements */
/* +++++++++++++++++++++++++++++++++++++++++++ */
note,
app {
display : inline;
font-style : italic
}
note:before {
content : " [[ " element-label() " ";
font-style : normal;
font-weight : bold;
}
note:after {
content : " ]]";
font-weight : bold;
font-style : normal;
}
app:before {
content : " {{ " element-label() " ";
font-style : normal;
font-weight : bold;
}
app:after {
content : " }}";
font-weight : bold;
font-style : normal;
}
/* +++++++++++++++++++++++++++++++++++++++++++ */
/* page/column/line breaks and headers/footers */
/* +++++++++++++++++++++++++++++++++++++++++++ */
cb:before,
pb:before,
graphic:before,
milestone,
fw,
fw:before,
fw:after {
color : black;
width : 100%;
padding : 0.5em;
border-radius : 10px 10px;
border : thin solid gray;
}
cb:before,
pb:before,
milestone,
fw,
fw:before,
fw:after {
background-color: rgb(240,220,150);
}
graphic:before
{
background-color: rgb(150,220,240);
}
lb {
content : " \A";
display : inline;
font-weight : bold;
font-family : sans-serif;
}
lb[type = inWord] {
content : " || \A";
}
lb:before,
lb:after {
content : "";
display : inline;
}
cb:before {
content : element-label() " facs: " text-field(attribute, facs, columns, 16) " n: " text-field(attribute, n, columns, 6);
}
pb:before {
display: block;
content : element-label() " facs: " text-field(attribute, facs, columns, 16) " n: " text-field(attribute, n, columns, 6) " " check-box(attribute, subtype, checked-value, visible, remove-value, true) " view " command-button(icon, icon(external-link), menu, menu("External Viewer", "viewObject", "facs anyURI"));
}
graphic:before {
content : element-label() " URL: " text-field(attribute, url, columns, 16) " " check-box(attribute, rend, checked-value, visible, remove-value, true) " view " command-button(icon, icon(external-link), menu, menu("External Viewer", "viewObject", "url anyURI"));
}
pb[subtype = visible]:after {
display : block;
padding-left : 5em;
content : image-viewport(attribute, facs, data-type, anyURI, viewport-height, 320px, viewport-width, scale-to-fit, preserve-aspect-ratio, true, content-height, 300px, content-width, scale-to-fit, vertical-align, middle, horizontal-align, left);
}
pb:after {
display: none;
}
graphic[rend = visible]:after {
display : block;
padding-left : 5em;
content : image-viewport(attribute, url, data-type, anyURI, viewport-width, scale-to-fit, preserve-aspect-ratio, true, content-width, scale-to-fit, vertical-align, middle, horizontal-align, left);
}
milestone {
content : element-label() " " insert-button() " " insert-after-button() " rend: " text-field(attribute, rendition, columns, 20) " unit: " text-field(attribute, unit, columns, 6);
}
fw {
content : text-field(columns, 22);
}
fw:before {
content : element-label() " " insert-button() " " insert-after-button() " ";
font-weight : bold;
display : inline;
}
fw:after {
content : " place: " text-field(attribute, place, columns, 6) " type: " text-field(attribute, type, columns, 12);
font-weight : bold;
display : inline;
}
/* follow overrides */
/*inline elements*/
att,
val,
ref,
ptr,
emph,
eg,
gi,
choice,
q,
tag,
stringVal,
hi,
unclear{
display : inline;
text-decoration : underline;
}
change,
city,
date,
hom,
ident,
lem,
name,
persName,
postCode,
orgName,
rdGrp,
sense,
street,
resp,
label{
display : inline;
}
/*collapsible elements*/
teiHeader > *:before, text > *:before, facsimile > *:before {
content : collapser() " " element-label();
font-weight : bold;
display : block;
background-color : rgb(230, 230, 230);
width : 100%;
font-size: 110%;
color: black;
padding : 0.5em;
border-radius : 10px 10px;
border : thin solid gray;
}
div:before {
content : collapser() " " element-label();
font-weight : bold;
display : block;
background-color : rgb(230, 230, 230);
width : 100%;
font-size: 110%;
color: black;
padding : 0.5em;
border-radius : 10px 10px;
border : thin dashed gray;
}
div {
display : block;
background-color : white;
color : black;
width : 100%;
padding : 0.5em;
border-radius : 10px 10px;
border : thin dashed gray;
margin-bottom: 1em;
}
/*some elements have to be treated separately */
p:before,
rendition:before,
tagUsage:before,
title:before,
titlePart:before,
pubPlace:before,
publisher:before,
docDate:before,
figDesc:before,
bibl:before,
head:before,
cell:before,
l:before,
charProp:before,
mapping:before,
edition:before,
author:before,
item:before,
egXML:before{
display : marker; /* exceptions from above rule */
marker-offset : auto;
content : element-label() " < ";
}
front *, back *, body * {
margin-left: 4em;
}
fileDesc *, encodingDesc *, revisionDesc *, profileDesc * {
margin-left: 6em;
}
title,
titlePart,
head {
font-weight : bold;
}
p, pb {
margin-top : 0.5em;
margin-bottom : 0.5em;
}
pb, pb:before{
display:table-row;
width: 100%;
}
div {
margin-left: 0;
}
char:before {
content : element-label() " " attr(xml|id) " < ";
}
desc, value, localName, g {display: inline}
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support