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
In arbortext editor 6.0,how to publish document to excel file ?
Solved! Go to Solution.
You can use a FOSI stylesheet to generate a comma-separated file from a structured markup document.
First, set the file extension for FOSI-exported files to ".csv" with the APTEXPORTEXT system variable.
Second, code e-i-cs that save the desired content, commas, and record ends to an appended string and write the result to an external ASCII file.
For example, assuming the content is in table cells, the following e-i-cs will generate a comma-separated file in the document directory when the document is formatted:
<e-i-c gi="entry" context="* table" occur="notlast">
<charlist inherit="1">
<savetext textid="csv.app" conrule="#CONTENT,\,\" append="1">
</charlist>
</e-i-c>
<e-i-c gi="entry" context="* table" occur="last">
<charlist inherit="1">
<savetext textid="csv.app" conrule="#CONTENT,\&#RE;\" append="1">
</charlist>
</e-i-c>
<e-i-c gi="generated">
<charlist inherit="1">
<usetext source="csv.app" userule="1"></usetext>
</charlist>
</e-i-c>
<e-i-c gi="table">
<charlist inherit="1">
<usetext source="<generated>,</generated>" placemnt="after"></usetext>
</charlist>
</e-i-c>
The resulting file will be named generated.csv. To change the file name, change the three instances of "generated" to the desired name.
I've attached a bare-bones FOSI with the above e-i-cs, which can be used as a template. If the desired content is not in table cells, then element names, contexts, and occurrences can be modified as needed.
For example, if the desired content is in markup such as this:
<partlist><part><partno>...</partno><partdesc>...</partdesc></part>...</partlist>
the following changes would be needed:
gi="entry" context="* table" occur="notlast" becomes gi="partno" context="part partlist" occur="all"
gi="entry" context="* table" occur="last" becomes gi="partdesc" context="part partlist" occur="all"
gi="table" becomes gi="partlist"
To generate the .csv file, put the cvs.fos file in the same directory as the document, then enter the following at the command line:
set fosi=csv; format
BTW: More than one e-i-c can write an external file.
Hope this heps! Please let me know any questions you may have.
Suzanne Napoleon
www.FOSIexpert.com
"WYSIWYG is last-century technology!"
Are you wanting to create a comma separated list?
What do you mean by publish? Are you meaning certain tags fill certain fields?
There is no option to publish to Excel. You can use File > Publish to Web, HTML, HTMLHelp, RTF, Printer, PDF
You may be able to use an XSL style sheet to transform a document to an Excel readable file.
You may also use ACL to write to a file, and as such create a comma separated list that is readable by Excel.
You can use a FOSI stylesheet to generate a comma-separated file from a structured markup document.
First, set the file extension for FOSI-exported files to ".csv" with the APTEXPORTEXT system variable.
Second, code e-i-cs that save the desired content, commas, and record ends to an appended string and write the result to an external ASCII file.
For example, assuming the content is in table cells, the following e-i-cs will generate a comma-separated file in the document directory when the document is formatted:
<e-i-c gi="entry" context="* table" occur="notlast">
<charlist inherit="1">
<savetext textid="csv.app" conrule="#CONTENT,\,\" append="1">
</charlist>
</e-i-c>
<e-i-c gi="entry" context="* table" occur="last">
<charlist inherit="1">
<savetext textid="csv.app" conrule="#CONTENT,\&#RE;\" append="1">
</charlist>
</e-i-c>
<e-i-c gi="generated">
<charlist inherit="1">
<usetext source="csv.app" userule="1"></usetext>
</charlist>
</e-i-c>
<e-i-c gi="table">
<charlist inherit="1">
<usetext source="<generated>,</generated>" placemnt="after"></usetext>
</charlist>
</e-i-c>
The resulting file will be named generated.csv. To change the file name, change the three instances of "generated" to the desired name.
I've attached a bare-bones FOSI with the above e-i-cs, which can be used as a template. If the desired content is not in table cells, then element names, contexts, and occurrences can be modified as needed.
For example, if the desired content is in markup such as this:
<partlist><part><partno>...</partno><partdesc>...</partdesc></part>...</partlist>
the following changes would be needed:
gi="entry" context="* table" occur="notlast" becomes gi="partno" context="part partlist" occur="all"
gi="entry" context="* table" occur="last" becomes gi="partdesc" context="part partlist" occur="all"
gi="table" becomes gi="partlist"
To generate the .csv file, put the cvs.fos file in the same directory as the document, then enter the following at the command line:
set fosi=csv; format
BTW: More than one e-i-c can write an external file.
Hope this heps! Please let me know any questions you may have.
Suzanne Napoleon
www.FOSIexpert.com
"WYSIWYG is last-century technology!"
Hi Li,
Did Suzanne's reply help you resolve the situation? Let us know if you need more assistance.
Otherwise, feel free to mark Suzanne's response as 'Correct'
Thanks!