[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Adding more profiling attributes
Hi Dean,
Since you are using a DTD, you can customize right in your files if you
like. The DocBook DTD has a bunch of empty parameter entities that let you
add attributes and elements to the DTD. In this case, the parameter entity
is named 'local.effectivity.attrib', and it can be customized in the
internal subset of the DTD like this:
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"../docbook44/docbookx.dtd" [
<!ENTITY % local.effectivity.attrib "model CDATA #IMPLIED
type CDATA #IMPLIED">
]>
This adds 'model' and 'type' attribute declarations to the collection of
common attributes that can be used on almost all elements.
In order for these to be recognized by the profiling stylesheet, you'll
need to copy and customize the template with match="*" and mode="profile"
from profiling/profile-mode.xsl. You need to duplicate one of the
existing variable declarations like:
<xsl:variable name="arch.content">
<xsl:if test="@arch">
<xsl:call-template name="cross.compare">
<xsl:with-param name="a" select="$profile.arch"/>
<xsl:with-param name="b" select="@arch"/>
</xsl:call-template>
</xsl:if>
</xsl:variable>
<xsl:variable name="arch.ok" select="not(@arch) or not($profile.arch) or
$arch.content != '' or @arch = ''"/>
and replace all instances of "arch" with "model" for one of your new
attributes. Repeat for other new attributes.
Then add your new *.ok variables to the final decision choice at the end of
the template:
<xsl:if test="$model.ok and $arch.ok and etc.
Your stylesheet customization also needs to declare the new profiling
parameters:
<xsl:param name="profile.model"/>
Then you should be able to set the profile.model parameter on the command
line when using a profiling stylesheet.
Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net
----- Original Message -----
From: "Nelson, Dean" <dean.nelson@eecradar.com>
To: "Scott Hudson" <scott.hudson@flatironssolutions.com>
Cc: <docbook-apps@lists.oasis-open.org>
Sent: Friday, January 05, 2007 9:06 PM
Subject: RE: [docbook-apps] Adding more profiling attributes
Thanks, Scott.
However, I am using Dockbook 4.4 XML and I don't know much about DB5. My
customization layer has the following snippet:
<xsl:param name="profile.attribute" select="'doc'"/>
<xsl:param name="profile.value" select="'FAT'"/>
How do I expand my list? Do I just add more to it? Like...
<xsl:param name="profile.attribute" select="'doc'"/>
<xsl:param name="profile.value" select="'FAT'"/>
<xsl:param name="profile.attribute" select="'type'"/>
<xsl:param name="profile.value" select="'ZDR'"/>
<xsl:param name="profile.attribute" select="'model'"/>
<xsl:param name="profile.value" select="'DWSR2500'"/>
I don't recognize your snippet of code. Is that the RNG schema?
Sorry if I'm a bit dense on this topic.
Regards,
Dean
________________________________
From: Scott Hudson [mailto:scott.hudson@flatironssolutions.com]
Sent: Fri 1/5/2007 6:46 PM
To: Nelson, Dean
Cc: docbook-apps@lists.oasis-open.org
Subject: Re: [docbook-apps] Adding more profiling attributes
Hi Dean,
Absolutely! I typically create custom profiling attributes for each of
my clients because of their specific needs. You just have to add them to
your customization layer, and redefine the db effectivity attributes to
call in your customization.
In DB5, it would look something like this:
my.effectivity =
attribute customprofile { text }
db.effectivity.attributes |=
db.audience.attribute?
& db.condition.attribute?
& db.conformance.attribute?
& db.revision.attribute?
& db.security.attribute?
& db.userlevel.attribute?
& my.effectivity?
You'll also need to adjust your stylesheet customization layer to
process the new attribute. See
http://www.sagehill.net/docbookxsl/CustomProfilingAttr.html
Best regards,
--Scott
Nelson, Dean wrote:
> Hello,
>
> I have used the "profile.attribute" because none of the standard Docbook
> attributes (os,lang,etc) really fit my scenario. To be able to maintain
> the docs through the years, the attributes needs to be something
> meaningful to fit our needs.
>
> How can I add more profile attributes to make my profiling fit my needs?
>
>
>
> Cheers,
>
> Dean Nelson
>
>
---------------------------------------------------------------------
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]