cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Styler date output format

BrianJ
3-Visitor

Styler date output format


We have an attribute of type xs:date (ie. is stored in YYYY-MM-DD format) and need to use the value of that attribute to output the month and year in long format, like "February 2009". We are using Styler. I didn't see anything in Styler help about being able to use ACL from a stylersheet. Does anyone have any idea how we can do this?

Thanks in advance,
--

Brian Jensen
bjensen@bluelid.com
3 REPLIES 3

There is no direct support. But try gentexting your attribute value wrapped by a UFE. Then do an edit source on the UFE and you can change the FOSI fragment to call ACL.

John Dreystadt
Software Development Director
Arbortext - PTC
734-352-2835
-

BrianJ
3-Visitor
(To:BrianJ)

Thank you very much, I was able to call out to ACL as I wanted. I have a
further problem now. This date value is in a document structure like the
following:

<cr pubdate="2008-09-10">
<crchapter pubdate="2006-05-09"></crchapter>
<crchapter pubdate="2026-12-03"></crchapter>

</cr>

We need to open and publish individual chapters as well as the entire
document containing all chapters. The pubDate attribute value is being
used to output a long date format (like "May 2006" for the first
chapter) in the header area of every page it is found on. Using John's
suggestion I was able to get this to work when opening individual
chapter files. I can't figure out how to get this to work when I open
the entire document. In this case I need the <cr> element's pubDate for
the headers in the front matter, but when each chapter's content begins
I need that chapter's pubDate converted and put in the header for the
pages it takes up.

The ACL to convert the date format uses xpath to get the pubDate
attribute value, but I can't figure out how to get it to look at the
<cr> element when in the front matter and the corresponding chapter's
crChapter element when outputting a page in that chapter. Any ideas how
I can do this?

Thanks in advance!

Brian Jensen


Dreystadt, John wrote:
> There is no direct support. But try gentexting your attribute value wrapped by a UFE. Then do an edit source on the UFE and you can change the FOSI fragment to call ACL.
>
> John Dreystadt?
> Software Development Director
> Arbortext - PTC
> 734-352-2835
> -
>
>
BrianJ
3-Visitor
(To:BrianJ)

Gareth responded with a better wording or description of my problem but
wasn't able to reply-all to include the list. I've received permission
from him to forward his response on to the list. My problem is still
unresolved, so anyone with any hints or solutions your comments would be
very much appreciated!

Thanks,
Brian

Forwarded content follows:

Gareth,

You've pretty much summed up my dilemma by saying "However I don't know
how you discover the context OID during composition". If I could figure
that out I'd (at least in theory) be golden. That was what I was trying
to say in my post, but I think you said it better. Do you mind if I
forward your mail to the list so my question is easier to understand?

Thanks,

Brian Jensen


lists@garethandbek.com wrote:
> Hi Brian,
>
> I'm at the limit of my FOSI+ACL knowledge here... essentially the
> problem is as follows:
>
> 1. During print composition, you want to pickup an attribute value
> using ACL. However, the attribute value must be relative to the XML
> context at the start (or end) of the current page.
>
> 2. Your ACL will be running from FOSI in the header of each page.
>
> So, using Styler's own header editor you can find a method for getting
> attribute values from the start/end of the current page. This doesn't
> help for ACL, but does show that this functionality exists. However,
> if you look at the .style file you won't find anything but a magic
> Styler GenText Element in the header definition (eg.
> <_gte:AttributeContentPage attr="pubDate" elem="crChapter"
> occur="pagefirst"/>).
>
> Looking in the online help you will discover the oid_xpath_string(oid,
> expr) function which allows your Xpath to work relative to a context
> OID. To access the correct attribute value relative to the context
> OID, you can use an Xpath expression such as the below:
>
> ancestor::*[@pubDate != "][1]/@pubDate
>
> (Look up the ancestor axis from the context OID, find the first
> element with a non-empty pubDate attribute, return the attribute value
> from that element).
>
> However I don't know how you discover the context OID during
> composition. (The OID passed into the userule would be for the header
> document, not the main document)
>
> There should be some sort of function that can find the relevant OID
> at the start/end of the current page. If you can achieve this, you can
> simply feed that context OID as the first parameter of
> oid_xpath_string().
>
> So close but not quite there! Perhaps I'm barking up the wrong tree -
> I'm sure someone on this list will show how this can be achieved.
>
> Cheers,
> Gareth
>
> Quoting Brian Jensen <bjensen@bluelid.com>:
>
>> Thank you very much, I was able to call out to ACL as I wanted. I have a
>> further problem now. This date value is in a document structure like the
>> following:
>>
>> <cr pubdate="2008-09-10">
>> <crchapter pubdate="2006-05-09"></crchapter>
>> <crchapter pubdate="2026-12-03"></crchapter>
>>
>> </cr>
>>
>> We need to open and publish individual chapters as well as the entire
>> document containing all chapters. The pubDate attribute value is being
>> used to output a long date format (like "May 2006" for the first
>> chapter) in the header area of every page it is found on. Using John's
>> suggestion I was able to get this to work when opening individual
>> chapter files. I can't figure out how to get this to work when I open
>> the entire document. In this case I need the <cr> element's pubDate for
>> the headers in the front matter, but when each chapter's content begins
>> I need that chapter's pubDate converted and put in the header for the
>> pages it takes up.
>>
>> The ACL to convert the date format uses xpath to get the pubDate
>> attribute value, but I can't figure out how to get it to look at the
>> <cr> element when in the front matter and the corresponding chapter's
>> crChapter element when outputting a page in that chapter. Any ideas how
>> I can do this?
>>
>> Thanks in advance!
>>
>> Brian Jensen
>>
>>
>> Dreystadt, John wrote:
>>> There is no direct support. But try gentexting your attribute value
>>> wrapped by a UFE. Then do an edit source on the UFE and you can
>>> change the FOSI fragment to call ACL.
>>>
>>> John Dreystadt?
>>> Software Development Director
>>> Arbortext - PTC
>>> 734-352-2835
>>> -
>>>
>>>
>>> From: Brian Jensen [
>>> Styler.? I didn't see anything in Styler help about being able to
>>> use ACL from a stylersheet.?? Does anyone have any idea how we can
>>> do this?
>>>
>>> Thanks in advance,
>>>
>>
>> --
>>
>>
>>
>>
>> Brian Jensen
>> bjensen@bluelid.com
>>
>
Top Tags