FAQ  •  Register  •  Login

why does copy-paste change: eg "<" to "&lt;"

Moderator: MiRai

<<

morwic

Posts: 66

Joined: Fri Mar 07, 2014 10:50 pm

Post Wed Jan 20, 2016 11:23 am

why does copy-paste change: eg "<" to "&lt;"

When I use the "copy to clipboard" option on some element of my profile and paste into an editor, it changes some characters to another encoding which makes it more difficult to read. As compared to simply loading the profile into the editor, which shows the < and > symbols unchanged.

What makes it particularly puzzling is that some of the "<" and ">" characters at the top of the paste are unchanged, they look normal.

If those work in their single character version, why do the others have to change?

I assume this is related to your warning not to simply copy-paste from an editor window in sharing profiles, but I don't understand why.

This isn't really an ISBoxer question, but can someone educate me?
<<

lax

User avatar

Site Admin

Posts: 7303

Joined: Tue Nov 17, 2009 9:32 pm

Post Wed Jan 20, 2016 11:38 am

Re: why does copy-paste change: eg "<" to "&lt;"

The encoding is XML. &lt; is an XML "entity" which an XML parser replaces with <, where using an actual < would otherwise begin a new XML Tag. The same concept is used to produce quotes within quotes, such as "This will contain a double quote: &quot;", etc.

When you Copy individual elements from within ISBoxer Toolkit, it has to keep it in a usable format. In order to properly manage what sort of object you're copying and pasting, ISBoxer places it in a "Box". Inside the Box is the actual XML, plus information on what actual type of object is inside. When the Box is then stored as XML (as in your Copy/Pasted view of it), the inner XML has to be converted in such a way as to not breaks the outer XML. That is, the XML of your Mapped Key for example, must not break the XML of the Box it is inside.

If you're intent on reading and manipulating the XML directly, just use the stored XML instead of Boxed objects -- you would typically want to Unbox it before working with it.

We don't usually suggest people to share their toolkit profile XML directly for a couple simple reasons: some information contained in the profile may be considered private and ISBoxer provides a user interface that can censor some of it; and XML is not something most people want to look at in the first place (that's what the Toolkit is for, right?); besides that, XML is harder to manually edit, even if you're already familiar with XML Entities and other details of the format.

As far as a "warning" though, unless your profile contains info you consider private it doesn't matter.
<<

morwic

Posts: 66

Joined: Fri Mar 07, 2014 10:50 pm

Post Wed Jan 20, 2016 8:25 pm

Re: why does copy-paste change: eg "<" to "&lt;"

Thank you very much. Your explanation makes sense, though it would take me some time to appreciate the details and ramifications.

I don't really expect to manually edit your XML files ... I was just wanting to know a bit more about how things work.

Thanks again.

Return to General

Who is online

Users browsing this forum: No registered users and 2 guests