![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Function to convert character Topic Summary: Created On: 26-Jun-2007 20:22 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Either someone once told me or I have read somewhere that there is a DXL function that will convert a ">" into "& g t" (with no spaces between the "&" , "g" and "t"). Does this sound familiar to anyone?
As I am working on developing a script to export DOORS data into an XML sheet I am coming across cases where there are ">" and as a result, the file is unable to be parse correctly with some XML parsers. ------------------------- pete.kowalski(at)motorola.com Edited: 26-Jun-2007 at 20:44 by Pete Kowalski |
|
![]() |
|
![]() |
|
As you say, some characters are "special" in XML. Here is a list of the characters and how they should be escaped.
As you did, I have added an extra space after the & to stop it being converted by explorer. & -> "& amp;" < -> "& lt;" > -> "& gt;" You may also need to escape quotes and apostrophes. " -> "& quot;" ' -> "& apos;" My first XML exporter did this escaping manually by doing string replacement, but was inefficient and prone to error. This has now changed and I use MSXML instead. This takes care of all the escaping etc and allows you to concentrate on what is in the export rather than string processing. Works well for XML import too. ------------------------- Tony Goodman http://www.smartdxl.com Edited: 27-Jun-2007 at 15:50 by Tony Goodman |
|
![]() |
|
![]() |
|
Can I have a look at your XML exporter/importer?
Kindly send the DXL if available with you, to kiran.chaturvedula@ge.com |
|
![]() |
|
![]() |
|
Sorry, but I cannot give the source code away.
What I will say though is that my exporter uses MSXML, which means that special characters are escaped automatically and it copes with OLEs etc. Don't try to escape characters manually in your code - it will be slow and inefficient and sooner or later it will break when it comes across a character you hadn't thought of. Believe me, I know because this is how I wrote my first attempt! ------------------------- Tony Goodman Smart DXL limited www.smartdxl.com |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Function to convert character
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.