Difference between revisions of "Ctx"

From Wiki
Jump to navigation Jump to search
 
(18 intermediate revisions by 13 users not shown)
Line 2: Line 2:
 
* [[manual:xmanipulate.pdf|Preprocessing source files, Manipulating graphics]]
 
* [[manual:xmanipulate.pdf|Preprocessing source files, Manipulating graphics]]
  
[URL=http://abc.obsq.info/]abc[/URL] online  <a href="http://abc.obsq.info/">abc</a> photo  http://abc.obsq.info/ abc video
+
= Processing XML files =
<a href="http://austrelia.obsq.info/">austrelia</a> online  [URL=http://austrelia.obsq.info/]austrelia[/URL] photo  http://austrelia.obsq.info/ austrelia news
+
 
[URL=http://adba.obsq.info/]adba[/URL] online  <a href="http://adba.obsq.info/">adba</a> doc  http://adba.obsq.info/ adba video
+
To process a file <code>xml.xml</code> with style definitions in <code>style.tex</code> you can make a file <code>xml.ctx</code> that says:
[URL=http://aaa.obsq.info/]aaa[/URL] photo  http://aaa.obsq.info/ aaa photo  <a href="http://aaa.obsq.info/">aaa</a> photo
+
 
[URL=http://airplanes.obsq.info/]airplanes[/URL] video  http://airplanes.obsq.info/ airplanes photo  <a href="http://airplanes.obsq.info/">airplanes</a> video
+
<xmlcode>
<a href="http://andros.obsq.info/">andros</a> read  [URL=http://andros.obsq.info/]andros[/URL] online  http://andros.obsq.info/ andros photo
+
<?xml version='1.0' standalone='yes'?>
[URL=http://alternate.obsq.info/]alternate[/URL] read  http://alternate.obsq.info/ alternate doc  <a href="http://alternate.obsq.info/">alternate</a> read
+
 
[URL=http://obsq.info/]information[/URL] video  <a href="http://obsq.info/">information</a> photo  http://obsq.info/ information read
+
<ctx:job>
http://asian.obsq.info/ asian photo  [URL=http://asian.obsq.info/]asian[/URL] doc  <a href="http://asian.obsq.info/">asian</a> online
+
  <ctx:message>whatever you like</ctx:message>
http://bad.obsq.info/ bad photo  <a href="http://bad.obsq.info/">bad</a> doc  [URL=http://bad.obsq.info/]bad[/URL] photo
+
  <ctx:preprocess/>
http://airs.obsq.info/ airs news  <a href="http://airs.obsq.info/">airs</a> online  [URL=http://airs.obsq.info/]airs[/URL] news
+
  <ctx:process>
 +
      <ctx:resources>
 +
          <ctx:environment>style.tex</ctx:environment>
 +
      </ctx:resources>
 +
  </ctx:process>
 +
  <ctx:postprocess/>
 +
</ctx:job>
 +
</xmlcode>
 +
 
 +
If you include a directive into the file <code>xml.xml</code>
 +
 
 +
<xmlcode>
 +
<?context-directive job ctxfile xml.ctx ?>
 +
</xmlcode>  
 +
 
 +
you can process your xml file directly with the command
 +
<code>context xml.xml</code>
 +
 
 +
[[Category:XML]]

Latest revision as of 18:13, 21 December 2022

See:

Processing XML files

To process a file xml.xml with style definitions in style.tex you can make a file xml.ctx that says:

<?xml version='1.0' standalone='yes'?>

<ctx:job>
   <ctx:message>whatever you like</ctx:message>
   <ctx:preprocess/>
   <ctx:process>
       <ctx:resources>
           <ctx:environment>style.tex</ctx:environment>
       </ctx:resources>
   </ctx:process>
   <ctx:postprocess/>
</ctx:job>

If you include a directive into the file xml.xml

<?context-directive job ctxfile xml.ctx ?>

you can process your xml file directly with the command context xml.xml