football shirtscheap manchester united football shirtscheap england football shirtscheap real madrid football shirtscheap northern ireland football shirtscheap borussia dortmund football shirtscheap ac milan football shirtscheap inter milan football shirtscheap brazil football shirtscheap manchester city football shirtscheap arsenal football shirtsEuropean Cup Football Shirtscheap football shirtscheap football kitscheap football topscheap soccer jerseyscheap football shirts replicacheap football shirts for kidscheap football shirts ukcheap football shirts thailandcheap football shirts onlinecheap football shirts chinaEuropean Cup Football Shirtscheap football shirtscheap football kitscheap football topscheap soccer jerseyscheap football shirts replicacheap football shirts for kidscheap football shirts ukcheap football shirts thailandcheap football shirts onlinecheap football shirts china
Author Archives: dpclark
QA Plugin: Solving for Attribute Chunk
Posted on by dpclark
Reply
The Issue
The @chunk="to-content" requirement for the QA plugin has always been a bit sticky. Honestly, I hadn’t thought much about it since we run the QA plugin through a self-service web server and that attribute is handled by a Python controller. However, thinking in terms of local builds, it became evident that setting the @chunk by hand would quickly become a tiresome routine.
Besides attribute handling, the web server also masks another consideration—the QA plugin may not be running in isolation from other plugins.
The First Iteration
The first iteration of to move this functionality to the plugin itself resulted in a new build target extending the chunk preprocess.
The new target used a regex replace to add the chunk attribute just before processing began in the temporary build directory. This solved the problem of manually setting the attribute, but also extended the chunk pre-processing to other sibling plugins as well.
The Solution
It’s possible to add an if-condition to a target to look for the presence of a command-line parameter, but I needed to look for a parameter with a specific value. A second iteration added a double-hop if-condition to the ant call.
So if you run the QA plugin alongside any others, you can leave off the switch to avoid unwanted chunk attributes.
QA Plugin XSLT: Locating Distinct Values for Duplicate IDs
Posted on by dpclark
2
As part of a new framework enhancement, I needed a method to ensure that certain DITA elements carried unique @id values. Our authoring tool does a good job identifying duplicate @id values within a topic, but does not indicate whether those values also exist in other topics referenced in the DITA map.
In this case, the best fit was to add a new check to the QA plugin.
The check should:
• Identify duplicate @id values on specific elements
• Return only distinct values (i.e. if 123 appears several times, then return 123 only once)
After some forum research, my first thought was to use a key match.
Even though it met my requirements, it’s still an outdated approach that didn’t leave me with a job-well-done sense of completion. I wanted a cleaner solution that fit somewhere closer to the 2.0 realm.
I decided to use grouping to identify each distinct @id value. Then I could wrap an if statement to test for any groups that contained a second (duplicate) item. The result:
Having trouble figuring out how to script the @xml:lang attribute?
For a DITA document that contains a single language, the highest level element (i.e. map, concept, task, etc.) that contains content should set the @xml:lang attribute to the language that applies to the document.
The question: How do I set the @xml:lang attribute using lxml? Everyone seems confused on the forums. Continue reading →
Recursive DITA parsing using Perl and XML Twig, Part I
Posted on by dpclark
7
If you’re doing any text parsing and manipulation, it’s hard to ignore the processing power of Perl—especially considering that it comes pre-installed on the basic OS X platform. There are several XML parsing modules out there and plenty of sites comparing the features and usability of each one.
Personally, I like Michael Rodriguez’s (mirod) Twig module. It’s available on CPAN here. Continue reading →
Automating useful tasks within a CMIS repository
Posted on by dpclark
6
I started a project a while back to curb some of the less-efficient tasks for my Alfresco-based CMS. My main target: eliminate the painfully slow file check-in process. My goal: create a per-user bulk check-in method.
If you’re curious about how far you can get with some fairly basic scripting gusto, a good place to start is with the Apache Chemistry project. Continue reading →