unicode characters in transformation
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 6
- Joined: Fri May 14, 2010 5:59 pm
unicode characters in transformation
I just used this forum to figure out how to preserve unicode encoding in hex of special characters in our XML, but I find that the leading zeros are removed. Is this something that can be fixed? I'd rather make as few changes as possible to the coding, so that it's easier for me to check my before and after files to make sure I didn't change anything I wasn't expecting to change.
Example:
Before transform:
“
After transform:
“
The zero before the 201c is gone.
Thanks for the advice. I'm trying to figure out encoding, but currently it's a weak spot for me!
Example:
Before transform:
“
After transform:
“
The zero before the 201c is gone.
Thanks for the advice. I'm trying to figure out encoding, but currently it's a weak spot for me!
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Re: unicode characters in transformation
Entities are not part of the data model so basically what happens is that they are converted to characters, processed by XSLT and then the result is serialized. If a character cannot be represented in the output encoding then the serializer will output that as a character entity.
So, basically there is no link between your input representation of character entities and the output - you can expect anything in the output as long as that is XML correct. To preserve the entities format you need either a post-processing step, or if it is easier both a pre-processing and a post-processing step, for instance in the pre-processing step you can replace & with & so “ will be “ and in the post-processing step apply the reverse, replace & with & getting from “ back to “.
Best Regards,
George
So, basically there is no link between your input representation of character entities and the output - you can expect anything in the output as long as that is XML correct. To preserve the entities format you need either a post-processing step, or if it is easier both a pre-processing and a post-processing step, for instance in the pre-processing step you can replace & with & so “ will be “ and in the post-processing step apply the reverse, replace & with & getting from “ back to “.
Best Regards,
George
George Cristian Bina
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