Skip to main content
3-Newcomer
December 9, 2014
Solved

Burst configuration file, location rule for graphic objects

  • December 9, 2014
  • 1 reply
  • 3398 views

I use an xpath expression in a locrule to store document objects in a variable folder path location. I want to store graphic objects in the same folder as the parent document. But I get an error that says you cannot use xpath when sourcetype=graphic. Is there a way to do this?

Best answer by JeffStevenson

Hi Mike,

I would try the first suggestion before the 2nd. It's much less hassle. I lifted the 1st suggestion from a working bcf we have and replaced your Xpath.

If your graphic element is "image" then I would try...

<locnrule elementname="image" expr="concat(substring(/task/@id,1,1),'/',substring(/task/@id,2,1),'/',substring(/task/@id,3,1),'/',substring(/task/@id,4,2),'/',substring(/task/@id,6,1),'/',substring(/task/@id,1,8))"/>

-Jeff

1 reply

1-Visitor
December 9, 2014

The BCF should just see everything as elements. I'm not sure why it would have a problem.

Can you post your bcf file?

krussell3-NewcomerAuthor
3-Newcomer
December 10, 2014

Hi Jeff,

This is Mike Moore. I used my colleague Keith Russell's login before I set up my own account.

Attached are the BCF file and a screen shot of the error caused by the last three locrule elements. The xpath expressions in the first three locrule elements work fine. For example, if the id for the root element in a concept topic (DITA) is "INOTWD01-04", the first locrule element puts the document object in folder INOTWD01 in the following folder path:

I

N

O

TW

D

INOTWD01

In the last three locrule elements, I'm attempting to put any graphics that are usedin the topic in the same folder as the document object. I believe I must use the sourcetype attribute with a value of "graphic", not the elementname attribute to burst graphic objects.

Thanks,

Mike

1-Visitor
December 10, 2014

Hi,

Thanks for sharing your bcf.

I've handled graphics a bit differently in the past. Is there a reason that you are specifying @sourcetype? You could treat graphics like regular elements and that may get around the error.

Example:

<locnrule elementname="graphic" expr="concat(substring(/task/@id,1,1),'/',substring(/task/@id,2,1),'/',substring(/task/@id,3,1),'/',substring(/task/@id,4,2),'/',substring(/task/@id,6,1),'/',substring(/task/@id,1,8))"/>

When you use @sourcetype="graphic", Arbortext is calling the dcf file to see what defines as a graphic. I don't think it is inspecting the surrounding XML at all. It's working at an application/rules level. It makes sense that you cannot use @sourcetype and @expr together.

Alternatively, I've used ACL to get the correct location when using @sourcetype.

Example:

<locnhook sourcetype="graphic" type="acl">

<![CDATA[ dms::set_burst_hook_value(burst_hooks::generate_graphic_path());

]]>

</locnhook>

In this example, generate_graphic_path() is an ACL function that gets the locatin based on the XML. It's a bit more work, but it allows you to use @sourcetype and base the location off of the XML context.

Hope that helps!

-Jeff