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

Checking for modified PCDATA content

JasonBuss
1-Newbie

Checking for modified PCDATA content

Hello all,

I was just trying to attach a function save callback to walk a document
tree, check for changed OIDs, and increment an attribute if the OID had
changed.

What I am finding out is that oid_modified() only seems to return 1 if
an attribute value has been changed, but not if the PCDATA within the
OID has changed.

I don't suppose anyone knows of an ACL solution for this before I have
to start digging into event handlers (didn't wanna go there if I didn't
have to)?

I have been pouring over the help, but nothing's jumping out at me (but
I've been staring at this a lot lately, so it's kind of a blur now.
Come on, weekend...)

Thanks,

-Jason A. Buss
8 REPLIES 8

Jason,

Off the top of my head, I'm not sure if there's a way to get ACL to tell you about the changed PCDATA, but what about turning on change tracking in your editing sessions and then resolving it all during your walk, essentially translating it into your attribute?

-Brandon 🙂

I had considered that. I have been talking to some of our authors about
it, but getting mixed reception. One other fear I have had about the
change tracking is there seems to be a handful of caveats in the online
help about certain customizations and circumstances where change
tracking can cause issues.

I might have to give it a try if nothing else pans out...

Thanks,

-Jason

In any case, I'm pretty sure you can't use oid_modified for this,
because when I tried to use eval oid_modified(oid_content(oid_caret()))
on the command line, Editor complained that that "Argument #1 to oid
modified() must be OID (object identifier)".


There is an undocumented parameter to some of the oid_xxxxx functions
that specifies the type of oid it works on. There should be an entry in
the adepter's archive from way back, something to do with walking the
oid tree and using that parameter to get the oid_xxxx functions to also
include things like the text content of an element, etc. Sorry, I don't
have the chance to look it up right now or I would give you more
specific info.

Hope that helps,
Brian


Benton, Ed L wrote:
> In any case, I'm pretty sure you can't use oid_modified for this,
> because when I tried to use eval oid_modified(oid_content(oid_caret()))
> on the command line, Editor complained that that "Argument #1 to oid
> modified() must be OID (object identifier)".
>

Hi Brian--

I did some searching and found something that sounds like what you're
referring to. I've pasted a copy below for convenience. I haven't tried
it, but a very useful tip assuming it works as advertised (or rather, as
NOT advertised). Thanks for remembering that obscure email thread from
2001!

--Clay

Good bit of sleuthing Clay 🙂

This seems a crucial bit of information for OID tree traversal! Hard
to believe it's not in the documentation... if only the documentation
was a wiki we could go and update 🙂

I had a quick peek at dms.acl, and I'm guessing these are the globals
that Paul was referring to (pasted here for reference):

main\dms.acl|168 col 9| global TRAV_NONE=0
main\dms.acl|171 col 9| global TRAV_TAG=0x4
main\dms.acl|172 col 9| global TRAV_PI=0x8
main\dms.acl|173 col 9| global TRAV_COMMENT=0x10
main\dms.acl|174 col 9| global TRAV_ATI=0x20
main\dms.acl|175 col 9| global TRAV_MS=0x40
main\dms.acl|176 col 9| global TRAV_ENTREF=0x80
main\dms.acl|177 col 9| global TRAV_TEXT=0x100
main\dms.acl|178 col 9| global TRAV_GENTEXT=0x200
main\dms.acl|179 col 9| global TRAV_ENDTAG=0x400
main\dms.acl|180 col 9| global TRAV_POID=0x2000
main\dms.acl|181 col 9| global TRAV_INCL_MS=0x4000
main\dms.acl|182 col 9| global TRAV_ESIS=0x61fc
main\dms.acl|183 col 9| global TRAV_ANY=0x67fc

Cheers,
Gareth

Quoting Clay Helberg <chelberg@terraxml.com>:

> Hi Brian--
>
> I did some searching and found something that sounds like what you're
> referring to. I've pasted a copy below for convenience. I haven't tried
> it, but a very useful tip assuming it works as advertised (or rather, as
> NOT advertised). Thanks for remembering that obscure email thread from
> 2001!
>
> --Clay
>

Wow, that appears to be exactly what I was needing. I'll give it a shot
and let you know what I find out.

Yeah, in this case, a little documentation would go a long way... 🙂

Thanks again, everybody!

-Jason

Thanks Clay and Gareth for doing the searching I didn't have time for on
Friday. I wanted to use the word "traversal" in my post because I knew
it was in the adepters post to look for, but I couldn't think of it.
All I could come up with was "walking the tree"...
Jason, I hope that will help you with what you were trying to do.

Brian


Buss, Jason A wrote:
> Wow, that appears to be exactly what I was needing. I'll give it a shot
> and let you know what I find out.
>
> Yeah, in this case, a little documentation would go a long way... 🙂
>
> Thanks again, everybody!
>
> -Jason
>
Announcements