Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
How touse a value of a DCR field in external ipl
masu
Hi,
I need to use a value of a DCR field in an external ipl.
How can I get the value?
In the ipl I can get the name and the entire path of the DCR.
Find more posts tagged with
Comments
Jeremy
Hi,
One way would be to parse the DCR using Perl and exctract the value you are looking for. There might be other ways but I would expect this to be the most obvious.
HTH
Jeremy
masu
Ok.
May I use the TeamSite:
CRparser -( library for parsing DCRs and arbitrary XML) or something else would be better?
Thank you
Migrateduser
I think it's better to learn XML::XPath than something Interwoven-specific, but the Interwoven one is easier because XPath statements against data in DCR structure are ugly.
masu
Actually I need something very simple, cause I need only to get a single value from a DCR.
I'll try to use the DCRParser.
Thanks
gzevin
well, this is not wise, as with iwov's DCR XML it's much easier to stick to Jon ****'s API
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
Piers
I use the standard PERL module
use XML:
imple
my $ref = XML:
imple::XMLin("$path$file", SuppressEmpty => 1);
my $publisharea = $ref->{'item'}->{'Publish to'}->{'value'};
my $fileupload = $ref->{'item'}->{'File Name'}->{'value'};
$ref will hold the entire contents of the XML tree, then it's esay to extract what you want - in my example, the contents of those two nodes.
Migrateduser
I still think XML::XPath is best and avoids learning anything Interwoven specific. Sure, DCRparser or whatever is easier, but those modules have bugs and they use nonstandard notation (like . instead of /, no leading /, etc.). It's pretty easy to write something that composes an XPath expression from a DCR expression, so you can still use it like DCRnode or whatever. And going through that excercise teaches you about DCR structure.
stingray
There is no "standard PERL Module" for working with XML.
XML:
imple is fantastic, but only if your xml doc doesn't do anything tricky/interesting like mix chardata and elements, use namespaces, or external references and you don't want to write it back out to disk. If you can guarantee those things, then use it. Otherwise, use XML::XPath or something similar.
Migrateduser
Actually if you want to write the DCR back, I would probably use TeamSite:
CRnode or something; I don't think XML::XPath does that.
gzevin
this is exactly what I meant - only DCRNode returns iwov-style XML like breeze
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
JonathonG
For doing major modifications to XML and write it back out, I like XML::Twig. It supports XPath addressing of nodes (the doco says its a limited XPath, but I haven't found anything I wanted to do that wasn't supported), and allows you to insert and replace entire sections of the XML tree.
Jonathon
Independent Interwoven Contractor
Migrateduser
For your use, I will put my 2cents on DCRNode. For iwov type dcrs it is very easy. I have used all of them before XMLSimple, XPath etc. I like DCRNode for iwov dcrs. There is good amount of documentation avl for this module.
-koti
Sr. Technical Consultant
TechAspect Solutions
Fremont, CA
Edited by brain_wave on 02/27/04 08:36 AM (server time).
Migrateduser
Thing that bugs me about DCRnode is that if you use XPath a lot you start defaulting to / as a delim, which causes issues when you use the non-XML modules (kind of like when I use + for concat in Perl instead of ., or . in JavaScript, another serious peeve).