Content is not allowed in the Trailing Section
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 16
- Joined: Tue Dec 06, 2022 11:21 am
Content is not allowed in the Trailing Section
Post by koushik9020 »
Hi Oxygen Support Team,
We are using CLOB_CONTENT column (from Oracle XML DB) to download the XML, DITA, DITAMAP files for one of our use cases as per the requirement with the below block of code.
Which is actually downloading the file to local storage without any issues, but as part of the same requirement we had to open the bookmap file in Oxygen automatically once it's downloading. While opening this file in Oxygen once download is completed seeing this below error in Oxygen:
Screenshot 2024-06-12 at 4.34.44 PM
When I click yes from above dialog , this is shown:
Screenshot 2024-06-12 at 4.34.55 PM
Clicking ok will take you to opening of the file in Text Mode instead of Author mode with some validation errors.
Screenshot 2024-06-12 at 5.32.44 PM
We are not seeing the same problem if we use XML_Content to use for the file downloading.
please suggest what's this error regarding and why does this occur, so that we can see the ways of fixing this. As our main requirement here is to focus on using CLOB_CONTENT for download instead of XML_CONTENT.
We are using CLOB_CONTENT column (from Oracle XML DB) to download the XML, DITA, DITAMAP files for one of our use cases as per the requirement with the below block of code.
Code: Select all
Clob clobObject = baselineObject.getClobContent();
Reader clobReader = clobObject.getCharacterStream();
StringBuilder sb = new StringBuilder();
char[] buf = new char[1024*8];
int n;
while( (n = clobReader.read(buf)) >= 0 ) {
sb.append(buf);
}
ByteArrayInputStream returnInputStreamofFile = new ByteArrayInputStream(sb.toString().getBytes(StandardCharsets.UTF_8));
remoteFile = returnInputStreamofFile;
updateLocalFileContent(targetFile, remoteFile);
Screenshot 2024-06-12 at 4.34.44 PM
- Screenshot 2024-06-12 at 4.34.44 PM.png (496.47 KiB) Viewed 749 times
Screenshot 2024-06-12 at 4.34.55 PM
Clicking ok will take you to opening of the file in Text Mode instead of Author mode with some validation errors.
Screenshot 2024-06-12 at 5.32.44 PM
- Screenshot 2024-06-12 at 4.34.55 PM.png (566.82 KiB) Viewed 749 times
We are not seeing the same problem if we use XML_Content to use for the file downloading.
please suggest what's this error regarding and why does this occur, so that we can see the ways of fixing this. As our main requirement here is to focus on using CLOB_CONTENT for download instead of XML_CONTENT.
Re: Content is not allowed in the Trailing Section
Hi,
In my opinion when you read from the reader:
that "n" variable holds the useful length from the "buf" which has been filled by the reader.
So I would assume something like this might fix the problem:
Of course you can add some logging to list the content you are adding to the string builder and double check if this is indeed the problem.
Regards,
Radu
In my opinion when you read from the reader:
Code: Select all
n = clobReader.read(buf)) >= 0
So I would assume something like this might fix the problem:
Code: Select all
sb.append(buf, 0, n);
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 16
- Joined: Tue Dec 06, 2022 11:21 am
Re: Content is not allowed in the Trailing Section
Post by koushik9020 »
Thank you Radu!
We were able to fix this.
We were able to fix this.
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service