Escape forward slash in xml

LabKey Support Forum (Inactive)
Escape forward slash in xml trent  2012-08-22 19:34
Status: Closed
 
Any tricks?

In the case of a customView columns, the behaviour of forward slash is to link to data in another table. What about in the case of the column name actually containing a "/".

<customView xmlns="http://labkey.org/data/xml/queryCustomView">
    <columns>
        <column name="ParticipantId"></column>
        <column name="col (a/l)"></column>
    </columns>
</customView>
(fwiw - I tried html escaping it.)
I've gone against using this technique and instead just edited the the query xml file to hide out columns. Still, would be interested to know if the above can be achieved.
 
 
Ben Bimber responded:  2012-08-22 19:41
Hi Trent,

Would it work to rename your column (perhaps col_a_l), then set the columnLabel to "col (a/l)"? We should now support labels during import from an excel file (although i dont know how it will behave with slashes...), so in general the user shouldnt notice the difference.

There may be a way to work around it, but in general I would recommend avoiding slashes in column names.
 
trent responded:  2012-08-22 19:52
Hi Ben,

Yeah, been noticing a few issues here and there. Ah well, cheers for the info.
 
kevink responded:  2012-08-22 20:10
Can you try using the field key escape code for forward slash, "$S"? The column name would become:

<column name="col (a$Sl)"></column>
 
trent responded:  2012-08-22 20:13
Hi Kevin,

That works. Nice!