Difference between revisions of "Ctx"

From Wiki
Jump to navigation Jump to search
m (Reverted edits by 164.58.221.239 (Talk); changed back to last version by Adityam)
Line 4: Line 4:
 
= Processing XML files =
 
= Processing XML files =
  
To process an <code>xml.xml</code> file with style definitions in <code>xml.ctex</code> you can make a <code>xml.ctx</code> file that says:
+
To process a file <code>xml.xml</code> with style definitions in <code>style.tex</code> you can make a <code>xml.ctx</code> file that says:
  
 
<xmlcode>
 
<xmlcode>
Line 14: Line 14:
 
   <ctx:process>
 
   <ctx:process>
 
       <ctx:resources>
 
       <ctx:resources>
           <ctx:environment>xml.ctex</ctx:environment>
+
           <ctx:environment>style.tex</ctx:environment>
 
       </ctx:resources>
 
       </ctx:resources>
 
   </ctx:process>
 
   </ctx:process>
Line 21: Line 21:
 
</xmlcode>
 
</xmlcode>
  
and directly run
+
Include a directive into the file <code>xml.xml</code>:
texexec xml.xml
+
 
 +
<xmlcode>
 +
<?context-directive job ctxfile xml.ctx ?>
 +
</xmlcode>
 +
 
 +
After doing this, you can process your xml file directly with the command
 +
<code>context xml.xml</code>
  
 
[[Category:XML]]
 
[[Category:XML]]

Revision as of 18:12, 21 December 2022

See:

Processing XML files

To process a file xml.xml with style definitions in style.tex you can make a xml.ctx file 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>

Include a directive into the file xml.xml:

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

After doing this, you can process your xml file directly with the command context xml.xml