validation problem for CODE element in docbook 5?

Hi, I'm creating a docbook 5 document in the latest Oxygen, and got a strange validation error. Here is what I wrote: <para> <code> <meta content="Home Page for Dick Solomon." name="description" /> </code></para> Here is the error message I receive: SystemID: I:\My Documents\work-related\\quickguide.xml Engine name: Jing Severity: error Description: element "meta" not allowed anywhere; expected the element end-tag, text or element "alt", "anchor", "annotation", "biblioref", "classname", "exceptionname", "function", "indexterm", "initializer", "inlinemediaobject", "interfacename", "link", "methodname", "modifier", "olink", "ooclass", "ooexception", "oointerface", "parameter", "phrase", "remark", "replaceable", "returnvalue", "subscript", "superscript", "type", "varname" or "xref" Start location: 157:99 It seems that the validator is trying to process the contents of the code element when in fact the code element allows text inside it http://www.docbook.org/tdg5/en/html/code.html Or am I missing something obvious? -- Robert Nagle

Hi Robert, The error complains that the XML tag <meta> is not allowed in <code>. This is correct. If you actually want to enter some random HTML fragment inside the <code> the fragment needs to be escaped like: <para> <code> <meta content="Home Page for Dick Solomon." name="description" /> </code></para> or surrounded in CDATA like: <para> <code><![CDATA[ <meta content="Home Page for Dick Solomon." name="description" />]]> </code></para> so that it gets interpreted as plain text. Regards, Radu -- Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 4/1/2010 3:38 PM, Robert Nagle wrote:
Hi,
I'm creating a docbook 5 document in the latest Oxygen, and got a strange validation error.
Here is what I wrote:
<para> <code> <meta content="Home Page for Dick Solomon." name="description" /> </code></para>
Here is the error message I receive:
SystemID: I:\My Documents\work-related\\quickguide.xml Engine name: Jing Severity: error Description: element "meta" not allowed anywhere; expected the element end-tag, text or element "alt", "anchor", "annotation", "biblioref", "classname", "exceptionname", "function", "indexterm", "initializer", "inlinemediaobject", "interfacename", "link", "methodname", "modifier", "olink", "ooclass", "ooexception", "oointerface", "parameter", "phrase", "remark", "replaceable", "returnvalue", "subscript", "superscript", "type", "varname" or "xref" Start location: 157:99
It seems that the validator is trying to process the contents of the code element when in fact the code element allows text inside it http://www.docbook.org/tdg5/en/html/code.html
Or am I missing something obvious?

Radu, thanks. I knew that some solution like this existed, but I could not find it documented anywhere in the docbook documentation (or more precisely I did not know how to find it). Searching for CDATA, I found something in Docbook XSL's Chapter 27 http://www.sagehill.net/docbookxsl/ProgramListings.html Robert Nagle On Thu, Apr 1, 2010 at 8:02 AM, Radu Coravu <radu_coravu@sync.ro> wrote:
Hi Robert,
The error complains that the XML tag <meta> is not allowed in <code>. This is correct. If you actually want to enter some random HTML fragment inside the <code> the fragment needs to be escaped like:
<para> <code> <meta content="Home Page for Dick Solomon." name="description" /> </code></para>
or surrounded in CDATA like: <para> <code><![CDATA[ <meta content="Home Page for Dick Solomon." name="description" />]]> </code></para>
so that it gets interpreted as plain text.
Regards, Radu
-- Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
On 4/1/2010 3:38 PM, Robert Nagle wrote:
Hi,
I'm creating a docbook 5 document in the latest Oxygen, and got a strange validation error.
Here is what I wrote:
<para> <code> <meta content="Home Page for Dick Solomon." name="description" /> </code></para>
Here is the error message I receive:
SystemID: I:\My Documents\work-related\\quickguide.xml Engine name: Jing Severity: error Description: element "meta" not allowed anywhere; expected the element end-tag, text or element "alt", "anchor", "annotation", "biblioref", "classname", "exceptionname", "function", "indexterm", "initializer", "inlinemediaobject", "interfacename", "link", "methodname", "modifier", "olink", "ooclass", "ooexception", "oointerface", "parameter", "phrase", "remark", "replaceable", "returnvalue", "subscript", "superscript", "type", "varname" or "xref" Start location: 157:99
It seems that the validator is trying to process the contents of the code element when in fact the code element allows text inside it http://www.docbook.org/tdg5/en/html/code.html
Or am I missing something obvious?

I'm not that good at XML, but it looks like your <para> belongs to a root element. One of highest value thing-ies. Maybe I'm wrong. Shaun Patrick O. [Shaun] Young Principal Multi-Systems Engineer Rapid Content Development and Management Systems & Services Network Centric Systems Raytheon Company (business) +1.972.344.1764 (cell) +1.214.354.5096 young1@raytheon.com www.raytheon.com This message contains information that may be confidential and privileged. Unless you are the addressee (or authorized to receive mail for the addressee), you should not use, copy or disclose to anyone this message or any information contained in this message. If you have received this message in error, please so advise the sender by reply e-mail and delete this message. Thank you for your cooperation. From: Robert Nagle <idiotprogrammer@gmail.com> To: oxygen-user@oxygenxml.com Date: 04/01/2010 07:41 AM Subject: [oXygen-user] validation problem for CODE element in docbook 5? Sent by: oxygen-user-bounces@oxygenxml.com Hi, I'm creating a docbook 5 document in the latest Oxygen, and got a strange validation error. Here is what I wrote: <para> <code> <meta content="Home Page for Dick Solomon." name="description" /> </code></para> Here is the error message I receive: SystemID: I:\My Documents\work-related\\quickguide.xml Engine name: Jing Severity: error Description: element "meta" not allowed anywhere; expected the element end-tag, text or element "alt", "anchor", "annotation", "biblioref", "classname", "exceptionname", "function", "indexterm", "initializer", "inlinemediaobject", "interfacename", "link", "methodname", "modifier", "olink", "ooclass", "ooexception", "oointerface", "parameter", "phrase", "remark", "replaceable", "returnvalue", "subscript", "superscript", "type", "varname" or "xref" Start location: 157:99 It seems that the validator is trying to process the contents of the code element when in fact the code element allows text inside it http://www.docbook.org/tdg5/en/html/code.html Or am I missing something obvious? -- Robert Nagle _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
participants (3)
-
Patrick O Young
-
Radu Coravu
-
Robert Nagle