docbook: Variables in an SGML or XML document


Previous by date: 15 Nov 2003 22:33:11 -0000 Re: Variables in an SGML or XML document, Martin A. Brown
Next by date: 15 Nov 2003 22:33:11 -0000 Jade errors from "ldp.dsl", Derek Tattersall
Previous in thread: 15 Nov 2003 22:33:11 -0000 Re: Variables in an SGML or XML document, Martin A. Brown
Next in thread: 15 Nov 2003 22:33:11 -0000 Re: Variables in an SGML or XML document, Rodolfo J. Paiz

Subject: Re: Variables in an SGML or XML document
From: Emma Jane Hogbin ####@####.####
Date: 15 Nov 2003 22:33:11 -0000
Message-Id: <20031115223203.GA3160@debian>

On Sat, Nov 15, 2003 at 03:57:32PM -0600, Rodolfo J. Paiz wrote:
> Can I define a variable in an SGML or XML document, like $TITLE for 
> instance?

Yes. In SGML/XML land they're called "entities." You create them at the
very beginning of your document in the document type declaration. Here are
some of the entities that are used in the Author Guide:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [

<!-- Chapter One: About this guide -->
<!ENTITY ag-about SYSTEM "ag-about.xml">
<!ENTITY tldp SYSTEM "tldp.xml">

<!-- Text Macros -->
<!ENTITY conectivasa '<ulink url="http://www.conectiva.com">Conectiva S.A.</ulink>'>
]>


You add the entities inside the DOCTYPE tag with square brackets. You can 
point to other file:
	<!ENTITY shortcut SYSTEM "filename"> 
or you can put the value right in the entity definition:
	<!ENTITY shortcut "Replace 'shortcut' with this text.">

To use them you would call them up with &entityname;. The three entities
above would be used in your document with:
	&ag-about;
	&tldp;
	&conectivasa;

I hope that helps!
emma

-- 
Emma Jane Hogbin
[[ 416 417 2868 ][ www.xtrinsic.com ]]

Previous by date: 15 Nov 2003 22:33:11 -0000 Re: Variables in an SGML or XML document, Martin A. Brown
Next by date: 15 Nov 2003 22:33:11 -0000 Jade errors from "ldp.dsl", Derek Tattersall
Previous in thread: 15 Nov 2003 22:33:11 -0000 Re: Variables in an SGML or XML document, Martin A. Brown
Next in thread: 15 Nov 2003 22:33:11 -0000 Re: Variables in an SGML or XML document, Rodolfo J. Paiz


  ©The Linux Documentation Project, 2014. Listserver maintained by dr Serge Victor on ibiblio.org servers. See current spam statz.