OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [docbook-apps] Semicolon in attribute value?

Hi Eric,
The revisionflag attribute is defined in the DocBook DTD using a list of enumerated values, and enumerated values must conform to the NMTOKEN character set, which excludes spaces and semicolons among others. If you want to use semicolons, you will have to convert the attribute to CDATA type:

<!ENTITY % revisionflag.attrib
	"revisionflag	CDATA	#IMPLIED">

Then you can put whatever you want. However, you also lose all value checking by the DTD, so typos will validate as well.

But if you don't mind further probing, it looks like you are using revisionflag for both change markup and conditional text (profiling in DocBook parlance). I would suggest separating those functions into two attributes, leaving revisionflag unchanged, and using another profiling attribute for pdf, html, etc. The profiling attributes support semicolons because they are defined as CDATA, and more importantly, the XSL stylesheet supports the semicolons for profiling with multiple selections, as described in this chapter:


Bob Stayton
Sagehill Enterprises

From: "Nordlund, Eric" <ericn@amazon.com>
Sent: Monday, September 16, 2013 10:49 AM
To: <docbook-apps@lists.oasis-open.org>
Subject: [docbook-apps] Semicolon in attribute value?


Does anyone know how to get a semicolon to validate in an attribute value? I have a ton of content that has elements tagged with the following revisionflag attributes:


I think our transforms look for these values to see which image to use in an output, and the transforms work fine. The problem is that I get a ton of validation errors in my editor for all of these entries and they create a lot of noise that could drown out a real error. Is there a way for me to make these semicolons work? For example, can I escape them in the DTD so that the validator thinks that they are allowable values?

Or, is there a way for me to tell the validator to ignore these errors (I think this might be more difficult).

Here is a snippet from my dbpoolx.mod file:

<!ENTITY % revisionflag.attrib
            "revisionflag    (changed
|kindle-epub-cond) #IMPLIED">

I tried adding the semicolon values, but that breaks the DTD. I tried using single and double quotes around them and that also broke the DTD. I cannot change the way that the attribute values are displayed in the book XML (although that would obviously be the easiest way to do this) because I am in a multi-author environment. I need this to be a change I can make to the DTD so that it will work with all of our existing content and just get rid of my validation errors.


Eric N.

To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]