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)
Parsing DCR
Jens
Hi all,
after we migrated to TS 6.1, we have some problem on parsing DCRs via Perl and put the content into a DCT-Dropdown (inline-perl-cmd), if there are german characters in it.
In TS 5.5.2 it worked fine.
Any idea's ?
Ciao,
Jens
Find more posts tagged with
Comments
Dwayne
Is the problem realy with parsing the DCR, or is it with the output of your script being handled by the templating engine? My hunch is that it's the latter. You could test that by setting the environment variables that the templating engine sets, and then run your script from the command line, to see what's generated.
When you generate your XML, are you including a
<?xml version="1.0" encoding="UTF-8"?>
line to set the encoding? If not, try that and see if it makes a difference
--
Current project: TS 5.5.2/6.1 W2K
Jens
hi dwayne,
you are right, it isn't the parsing. i masked the character after parsing than it works.
Do the substitution doesn't work, but i don't want to mask all characters, so it there a configuration-file or something else.
Ciao,
Jens
Dwayne
What about the
<?xml version="1.0" encoding="UTF-8"?>
? Is your perl code generating this as the first line of the output? If not, it should. I've had problems with special characters in my
<inline>
code when I didn't use this.
--
Current project: TS 5.5.2/6.1 W2K
Jens
I use <?xml version="1.0" encoding="ISO-8859-1"?>, but i also tested the UTF-8 version without success.
Dwayne
Then the next step I would suggest would be to run your inline command from the command line, and send the output to a file, so that you can take a look at it. If everything looks OK, then pull the contents directly into the DCT, where you currently have the
<inline>
tag. (Don't forget to remove the
<substitution>
tags). See if the DCT works then.
--
Current project: TS 5.5.2/6.1 W2K
Jens
i tried this and it works
only the inline substitution i can't get work.
Dwayne
I'm afraid I'm out of ideas, then. Perhaps somebody else has a suggestion?
Or, you open a support case with Interwoven.
As a last ditch effort, you could try filtering your data - if it's a "high-order" character, then replace it with the
&#xxxx;
construct.
--
Current project: TS 5.5.2/6.1 W2K
Adam Stoller
Are you using a perl module to do character encoding/decoding? I seem to recall that there was a significant change to one of the perl modules used for this - but I don't recall the details off the top of my head. I believe you can find the information or reference to the information in the long-running TS6.x thread.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
gzevin
do you mean URI::Escape? however, I would not use it for escaping XML...
there was some internal methods in DCR::NOde, if I remember correct, and also some in XML:
OM..
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
tsrookie
If you are talking about encodeing xml reserved characters such as & for example then I handle this with Formapi
Regards
Colin
function init(){
// register some event handlers
IWEventRegistry.addItemHandler("/menuItem/itemText", "onItemChange", encodeAmpersands);
}
function encodeAmpersands(item){
var value = item.getValue();
//Look for ampersand
value = value.replace(/&[^amp]/g,'& ');
item.setValue( value );
return true;
}
init();
gzevin
well, firstly , it's not only ameprsands one has to take care of, and one does not need to reinvent the wheel to do that. secondly, I prefer and advise to use a presentation template to massage any DCR content.
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
Adam Stoller
I haven't spent too much time with javascript regex's but wouldn't:
value = value.replace(/&[^amp]/g,'& ');
mean that:
&foo; => &foo;
& => &
(so far okay, but)
&moo; => &moo; NOT &moo;
∥ => ∥ NOT &par;
I think it would be something more like:
value = value.replace(/&([^a][^m][^p])/g,'&$1 ');
(untested - it might still be wrong)
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com