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)
TeamSite::XMLnode
kellyrmilligan
I am using a perl script to take values out of a batch of DCR's and put them into a new format of dcr's. I have all the value's populated, and am setting the EA's properly to create the new dcr's. When I open the file up via the templating web interface, it looks fine. but when I physically open the file up, some of the reserved xml characters are still there. for example, for a content block, inside of the xml tags, might be something like this:
<p>this is a piece of content</p>
I grab that value, and put it into my new document.
the hex values should be something like this
<p>this is a piece of content</p>
but I get this:
<p>this is a piece of content</p>
This seems to only be doing part of the hex stuff. any ideas?
Here is the code previous to this to get the values:
$xml = "";
if (open(DCR, "<$dcrlocation"))
{ local $/;
$xml = <DCR>;
close(DCR);
}else
{
logthis "could not open $dcrlocation";
}
$rootnode = TeamSite::XMLnode->new($xml);
my $author = $rootnode->get_inner_xml('contributor.author');
my $contDate = $rootnode->get_inner_xml('contributor.contDate');
my $effDate = $rootnode->get_inner_xml('contributor.effDate');
my $revDate = $rootnode->get_inner_xml('contributor.revDate');
my $endDate = $rootnode->get_inner_xml('contributor.endDate');
my $State0 = $rootnode->get_inner_xml('contributor.State[0]');
my $State1 = $rootnode->get_inner_xml('contributor.State[1]');
my $State2 = $rootnode->get_inner_xml('contributor.State[2]');
my $keywords = $rootnode->get_inner_xml('policy_metadata.keywords');
This is including several different data fields. I was using DCRNode before this with the same get inner xml fucntion, and got the same results.
Find more posts tagged with
Comments
Adam Stoller
I believe it's doing the least it needs to do - i.e. as long as you convert the open-angle-bracket, you would have embedded tags, and XML parsers will be happy.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
kellyrmilligan
What should I use to convert the open bracket? Looking at the documentation, I thought maybe something to do with CDATA was in order, and I thought it was weird that the "<" was converted, but not the ">". weird.
thanks,
Kelly
Health Care Service Corp.
kellyrmilligan
is there a way for a parser(any parser) to not expand everything and just grab the value of the node? it seems like this should not be expanding anything at all. the only other thing I found was to use something called HTML::Entities that encodes things like this.
is there either:
a different translater, or
a different parser that I should be using?
rodigz
Hi,
In TS 5.5.2 I'm using the xml parser to parse my dcrs in order for me to do data deploy. But in TS 6.5 some of the dcrs are working fine but others don't special if the dcr contains euro characters.. I'm getting this error.
Could not create rootnode.
XML parse error :
no element found at line 1, column 0, byte -1 at
\iw-home\iw-perl\vendor\lib/XML/Parser.pm line 202
Please advise.
regards,
Process.jpg
Platform01.jpg
Runtime.jpg