Elsasoft Forums
Elsasoft Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SqlSpec
 Tips and Tricks
 Formats and links in XML comments
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

gurunty
Starting Member

2 Posts

Posted - May 19 2010 :  04:38:49 AM  Show Profile  Reply with Quote
Having embedded a few XML comments in our MSSQL2005 db, is there an (easy) way to include formatting in the text for these and include links etc?

Jesse
Forum Admin

732 Posts

Posted - May 19 2010 :  04:55:32 AM  Show Profile  Reply with Quote
what do you mean by formatting? do you mean HTML tags? If so, you can do that. It will only work if they are well-formed in the XML sense though. for example <br> is not allowed - it must be <br/>. You can also put links in via <a> tags, but again they must be well formed.

If you do put markup in the comments, make sure the "preserve html tags" checkbox is checked, on the "optional settings" page.
Go to Top of Page

gurunty
Starting Member

2 Posts

Posted - May 25 2010 :  01:39:48 AM  Show Profile  Reply with Quote
Okay thanks, I missed the setting.
Will give that a try soon, thanks again.
Go to Top of Page

kdwinton
Starting Member

1 Posts

Posted - Apr 02 2012 :  10:43:46 AM  Show Profile  Reply with Quote
I have added this to my comments
<table>
<tr><td>avg</td><td>1.5 A</td><td> </td><td> </td></tr>
<tr><td> </td><td>seq 1</td><td>seq 2</td><td>seq 3</td></tr>
<tr><td>seq</td><td> </td><td> </td><td> </td></tr>
<tr><td>len</td><td>1.5 A</td><td>2 A</td><td> </td></tr>
</table>

and checked "preserve html tags"

but in the generated doc, it just shows up as normal text, not as marked-up html. (Note: there are    in the empty table cells above, but the formum software removes them.)

Can't figure out what I'm doing wrong.

Edited by - kdwinton on Apr 02 2012 10:59:51 AM
Go to Top of Page

Jesse
Forum Admin

732 Posts

Posted - Apr 02 2012 :  10:51:41 AM  Show Profile  Reply with Quote
Hi kdwinton - what build of SqlSpec are you using? You can get it from the top of the logfile that it writes, eg:

---------------------------------------------------------------
Elsasoft SqlSpec 6.5.4442.38511
RETAIL - BETA - (SMO 2008 build)
build date: 2012-02-29 21:24:34
---------------------------------------------------------------

Also, where did you put this markup? Can you send me the SQL script to create the object, together with the XML comments?

send it to sqlspec at elsasoft dot org.

Jesse
Go to Top of Page

Jesse
Forum Admin

732 Posts

Posted - Apr 03 2012 :  04:32:13 AM  Show Profile  Reply with Quote
To get this to work, you need to replace all the &nbsp;  entity references in your comment with this: &#160;

why is this necessary? because &nbsp; is not understood by XML without a DTD (and DTDs are to be avoided, they are a pain)

&nbsp; is an HTML specific thing.

160 is the decimal character code for a non-breaking space, so &#160; *is* understood by XML.

More detail here: http://changelog.ca/log/2006/06/12/making_nbsp_work_with_xml_rss_and_atom

Note that when SqlSpec detects that a comment is not well-formed XML, it will let you know by printing an error message directly in the docs just above the comment. You should have seen something like this above your comment:

Comment below is not well-formed in the xml sense, so HTML tags could not be preserved. Error message follows: Reference to undeclared entity 'nbsp'. Line 11, position 49.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Elsasoft Forums © Elsasoft LLC Go To Top Of Page
Snitz Forums 2000