Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
I am trying to bulk load Operations by using the LoadFromFile. The field LongDescription in most of the cases consists of multiline text. Below is the way the xml is currently being generated:
<csvBeginOperation handler="com.ptc.windchill.mpml.processplan.operation.LoadOperation.beginOperation">
<csvuser></csvuser>
<csvname>OP000001</csvname>
<csvnumber>OP000001</csvnumber>
<csvcategory>production</csvcategory>
<csvdescription>COIL LINE</csvdescription>
<csvlongDescription>REVIEW NEST OR CONTACT
NESTER FOR SHEAR LENGTH
INSTRUCTIONS.
UNIT IS SQFT
N-P</csvlongDescription>
<csvdefaultUnit>ea</csvdefaultUnit>
<csvfolder>/Default/Operations</csvfolder>
....
Unfortunately, the line break seems not to be recognized/detected.
I tried to replace the carriage return with " " (after reading a PTC document) but I had no luck
<csvlongDescription>REVIEW NEST OR CONTACT NESTER FOR SHEAR LENGTH INSTRUCTIONS. UNIT IS SQFT N-P</csvlongDescription>
I have tried also with " " and " " but they require to be declared in the xml and I am not sure this is the right way.
What am I missing?
Solved! Go to Solution.
ok, apparently the real solution to have the carriage returns rendered in the UI is to use CDATA together with <br></br> :
<![CDATA[some stuff<br>some other stuff</br>here's other<br>and this is the final stuff</br>]]>
will return:
"some stuff
some other stuff
here's other
and this is the final stuff"
The Character Data tag can be used for this …
<![CDATA[some stuff]]>
add it inside the description, then new lines can be written in the normal ways.
@rhart , thank you for your hint. Unfortunately this does not seem to resolve. Following is what I put in the xml:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE NmLoader SYSTEM "standard12_1.dtd">
<NmLoader>
<csvBeginOperation handler="com.ptc.windchill.mpml.processplan.operation.LoadOperation.beginOperation">
<csvuser></csvuser>
<csvname>LONGTEXT7</csvname>
<csvnumber>LONGTEXT7</csvnumber>
<csvcategory>production</csvcategory>
<csvdescription>COIL LINE</csvdescription>
<csvlongDescription><![CDATA[REVIEW NEST OR CONTACT
NESTER FOR SHEAR LENGTH
INSTRUCTIONS.
UNIT IS SQFT
N-P]]></csvlongDescription>
<csvdefaultUnit>ea</csvdefaultUnit>
<csvfolder>/Default/Operations</csvfolder>
...
and this what was created
ok, apparently the real solution to have the carriage returns rendered in the UI is to use CDATA together with <br></br> :
<![CDATA[some stuff<br>some other stuff</br>here's other<br>and this is the final stuff</br>]]>
will return:
"some stuff
some other stuff
here's other
and this is the final stuff"